diff options
Diffstat (limited to 'src/plugins')
90 files changed, 613 insertions, 653 deletions
diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index e79689ede2..3737519e9e 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -263,12 +263,16 @@ void AndroidManifestEditorWidget::initializePage() << QLatin1String("android.permission.ACCESS_SURFACE_FLINGER") << QLatin1String("android.permission.ACCESS_WIFI_STATE") << QLatin1String("android.permission.ACCOUNT_MANAGER") + << QLatin1String("com.android.voicemail.permission.ADD_VOICEMAIL") << QLatin1String("android.permission.AUTHENTICATE_ACCOUNTS") << QLatin1String("android.permission.BATTERY_STATS") + << QLatin1String("android.permission.BIND_ACCESSIBILITY_SERVICE") << QLatin1String("android.permission.BIND_APPWIDGET") << QLatin1String("android.permission.BIND_DEVICE_ADMIN") << QLatin1String("android.permission.BIND_INPUT_METHOD") << QLatin1String("android.permission.BIND_REMOTEVIEWS") + << QLatin1String("android.permission.BIND_TEXT_SERVICE") + << QLatin1String("android.permission.BIND_VPN_SERVICE") << QLatin1String("android.permission.BIND_WALLPAPER") << QLatin1String("android.permission.BLUETOOTH") << QLatin1String("android.permission.BLUETOOTH_ADMIN") @@ -320,16 +324,20 @@ void AndroidManifestEditorWidget::initializePage() << QLatin1String("android.permission.PERSISTENT_ACTIVITY") << QLatin1String("android.permission.PROCESS_OUTGOING_CALLS") << QLatin1String("android.permission.READ_CALENDAR") + << QLatin1String("android.permission.READ_CALL_LOG") << QLatin1String("android.permission.READ_CONTACTS") + << QLatin1String("android.permission.READ_EXTERNAL_STORAGE") << QLatin1String("android.permission.READ_FRAME_BUFFER") << QLatin1String("com.android.browser.permission.READ_HISTORY_BOOKMARKS") << QLatin1String("android.permission.READ_INPUT_STATE") << QLatin1String("android.permission.READ_LOGS") - << QLatin1String("android.permission.READ_OWNER_DATA") << QLatin1String("android.permission.READ_PHONE_STATE") + << QLatin1String("android.permission.READ_PROFILE") << QLatin1String("android.permission.READ_SMS") + << QLatin1String("android.permission.READ_SOCIAL_STREAM") << QLatin1String("android.permission.READ_SYNC_SETTINGS") << QLatin1String("android.permission.READ_SYNC_STATS") + << QLatin1String("android.permission.READ_USER_DICTIONARY") << QLatin1String("android.permission.REBOOT") << QLatin1String("android.permission.RECEIVE_BOOT_COMPLETED") << QLatin1String("android.permission.RECEIVE_MMS") @@ -345,6 +353,7 @@ void AndroidManifestEditorWidget::initializePage() << QLatin1String("android.permission.SET_ANIMATION_SCALE") << QLatin1String("android.permission.SET_DEBUG_APP") << QLatin1String("android.permission.SET_ORIENTATION") + << QLatin1String("android.permission.SET_POINTER_SPEED") << QLatin1String("android.permission.SET_PREFERRED_APPLICATIONS") << QLatin1String("android.permission.SET_PROCESS_LIMIT") << QLatin1String("android.permission.SET_TIME") @@ -363,15 +372,18 @@ void AndroidManifestEditorWidget::initializePage() << QLatin1String("android.permission.WAKE_LOCK") << QLatin1String("android.permission.WRITE_APN_SETTINGS") << QLatin1String("android.permission.WRITE_CALENDAR") + << QLatin1String("android.permission.WRITE_CALL_LOG") << QLatin1String("android.permission.WRITE_CONTACTS") << QLatin1String("android.permission.WRITE_EXTERNAL_STORAGE") << QLatin1String("android.permission.WRITE_GSERVICES") << QLatin1String("com.android.browser.permission.WRITE_HISTORY_BOOKMARKS") - << QLatin1String("android.permission.WRITE_OWNER_DATA") + << QLatin1String("android.permission.WRITE_PROFILE") << QLatin1String("android.permission.WRITE_SECURE_SETTINGS") << QLatin1String("android.permission.WRITE_SETTINGS") << QLatin1String("android.permission.WRITE_SMS") + << QLatin1String("android.permission.WRITE_SOCIAL_STREAM") << QLatin1String("android.permission.WRITE_SYNC_SETTINGS") + << QLatin1String("android.permission.WRITE_USER_DICTIONARY") ); m_permissionsComboBox->setEditable(true); layout->addWidget(m_permissionsComboBox, 4, 0); diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp index b9f69f887f..0c1b52993f 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp @@ -79,9 +79,7 @@ AutotoolsProject::AutotoolsProject(AutotoolsManager *manager, const QString &fil m_makefileParserThread(0) { setProjectContext(Core::Context(Constants::PROJECT_CONTEXT)); - Core::Context pl(ProjectExplorer::Constants::LANG_CXX); - pl.add(ProjectExplorer::Constants::LANG_QMLJS); - setProjectLanguages(pl); + setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX)); const QFileInfo fileInfo(m_fileName); m_projectName = fileInfo.absoluteDir().dirName(); diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.pro b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.pro index 4feae8c564..bd83e36889 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.pro +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.pro @@ -32,3 +32,5 @@ SOURCES = autotoolsprojectplugin.cpp\ makefileparserthread.cpp\ makefileparser.cpp RESOURCES += autotoolsproject.qrc + +OTHER_FILES += AutotoolsProject.mimetypes.xml diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs index 4bfba21bbf..94e0f9ad18 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs @@ -12,6 +12,7 @@ QtcPlugin { Depends { name: "CppTools" } files: [ + "AutotoolsProject.mimetypes.xml", "autogenstep.cpp", "autogenstep.h", "autoreconfstep.cpp", diff --git a/src/plugins/bazaar/bazaar.qbs b/src/plugins/bazaar/bazaar.qbs index b43ff69dd0..c885f49be1 100644 --- a/src/plugins/bazaar/bazaar.qbs +++ b/src/plugins/bazaar/bazaar.qbs @@ -12,7 +12,6 @@ QtcPlugin { Depends { name: "VcsBase" } Depends { name: "Locator" } - Depends { name: "cpp" } files: [ "annotationhighlighter.cpp", diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index f4a3ebd0b7..ebf104bc97 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -606,7 +606,7 @@ void BazaarPlugin::testDiffFileResolving_data() void BazaarPlugin::testDiffFileResolving() { - BazaarEditor editor(editorParameters + 3, 0); + BazaarEditor editor(editorParameters + 2, 0); editor.testDiffFileResolving(); } @@ -630,7 +630,7 @@ void BazaarPlugin::testLogResolving() " (gz) Set approved revision and vote \"Approve\" when using lp-propose\n" " --approve (Jonathan Lange)\n" ); - BazaarEditor editor(editorParameters + 1, 0); + BazaarEditor editor(editorParameters, 0); editor.testLogResolving(data, "6572", "6571"); } #endif diff --git a/src/plugins/classview/classview.qbs b/src/plugins/classview/classview.qbs index 338cec83eb..be6ab5b42f 100644 --- a/src/plugins/classview/classview.qbs +++ b/src/plugins/classview/classview.qbs @@ -12,7 +12,6 @@ QtcPlugin { Depends { name: "ProjectExplorer" } Depends { name: "TextEditor" } - Depends { name: "cpp" } files: [ "classview.qrc", diff --git a/src/plugins/clearcase/clearcase.pro b/src/plugins/clearcase/clearcase.pro index d4fa42c38b..a5ba5b3a32 100644 --- a/src/plugins/clearcase/clearcase.pro +++ b/src/plugins/clearcase/clearcase.pro @@ -35,3 +35,5 @@ FORMS += checkoutdialog.ui \ versionselector.ui RESOURCES += clearcase.qrc + +OTHER_FILES += ClearCase.mimetypes.xml diff --git a/src/plugins/clearcase/clearcase.qbs b/src/plugins/clearcase/clearcase.qbs index 2264d7d47c..de3aa40ae9 100644 --- a/src/plugins/clearcase/clearcase.qbs +++ b/src/plugins/clearcase/clearcase.qbs @@ -17,6 +17,7 @@ QtcPlugin { Depends { name: "Locator" } files: [ + "ClearCase.mimetypes.xml", "activityselector.cpp", "activityselector.h", "annotationhighlighter.cpp", diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp index a31f6e26dc..d7614bf67e 100644 --- a/src/plugins/clearcase/clearcaseplugin.cpp +++ b/src/plugins/clearcase/clearcaseplugin.cpp @@ -2094,7 +2094,7 @@ void ClearCasePlugin::testDiffFileResolving_data() void ClearCasePlugin::testDiffFileResolving() { - ClearCaseEditor editor(editorParameters + 3, 0); + ClearCaseEditor editor(editorParameters + 2, 0); editor.testDiffFileResolving(); } @@ -2104,7 +2104,7 @@ void ClearCasePlugin::testLogResolving() "13-Sep.17:41 user1 create version \"src/plugins/clearcase/clearcaseeditor.h@@/main/branch1/branch2/9\" (baseline1, baseline2, ...)\n" "22-Aug.14:13 user2 create version \"src/plugins/clearcase/clearcaseeditor.h@@/main/branch1/branch2/8\" (baseline3, baseline4, ...)\n" ); - ClearCaseEditor editor(editorParameters + 1, 0); + ClearCaseEditor editor(editorParameters, 0); editor.testLogResolving(data, "src/plugins/clearcase/clearcaseeditor.h@@/main/branch1/branch2/9", "src/plugins/clearcase/clearcaseeditor.h@@/main/branch1/branch2/8"); diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 87efca9c1c..d69441c434 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -109,10 +109,7 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName) m_lastEditor(0) { setProjectContext(Core::Context(CMakeProjectManager::Constants::PROJECTCONTEXT)); - Core::Context pl(ProjectExplorer::Constants::LANG_CXX); - pl.add(ProjectExplorer::Constants::LANG_QMLJS); - setProjectLanguages(pl); - + setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX)); m_file = new CMakeFile(this, fileName); diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index d48f09016e..11f50003d0 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -255,7 +255,6 @@ QtcPlugin { } Export { - Depends { name: "cpp" } Depends { name: "Aggregation" } Depends { name: "Utils" } } diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index b9c586643e..88762f1f29 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1028,6 +1028,11 @@ bool EditorManager::closeEditors(const QList<IEditor*> &editorsToClose, bool ask if (EditorView *view = viewForEditor(editor)) { if (editor == view->currentEditor()) closedViews += view; + if (d->m_currentEditor == editor) { + // avoid having a current editor without view + setCurrentView(view); + setCurrentEditor(0); + } view->removeEditor(editor); } } @@ -1494,9 +1499,7 @@ IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QStri // back to the default editor: if (!editor) editor = createEditor(Id(), fn); - if (!editor) // Internal error - return 0; - + QTC_ASSERT(editor, return 0); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); QString errorString; if (!editor->open(&errorString, fn, realFn)) { diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 7110485e2f..e00901532e 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -29,8 +29,11 @@ #include "icore.h" +#include <app/app_version.h> #include <extensionsystem/pluginmanager.h> +#include <QSysInfo> + /*! \namespace Core \brief The Core namespace contains all classes that make up the Core plugin @@ -501,6 +504,41 @@ QString ICore::userResourcePath() return urp; } +static QString compilerString() +{ +#if defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too + QString isAppleString; +#if defined(__apple_build_version__) // Apple clang has other version numbers + isAppleString = QLatin1String(" (Apple)"); +#endif + return QLatin1String("Clang " ) + QString::number(__clang_major__) + QLatin1Char('.') + + QString::number(__clang_minor__) + isAppleString; +#elif defined(Q_CC_GNU) + return QLatin1String("GCC " ) + QLatin1String(__VERSION__); +#elif defined(Q_CC_MSVC) + if (_MSC_VER >= 1500) // 1500: MSVC 2008, 1600: MSVC 2010, ... + return QLatin1String("MSVC ") + QString::number(2008 + 2 * ((_MSC_VER / 100) - 15)); +#endif + return QLatin1String("<unknown compiler>"); +} + +QString ICore::versionString() +{ + QString ideVersionDescription; +#ifdef IDE_VERSION_DESCRIPTION + ideVersionDescription = tr(" (%1)").arg(QLatin1String(Constants::IDE_VERSION_DESCRIPTION_STR)); +#endif + return tr("Qt Creator %1%2").arg(QLatin1String(Constants::IDE_VERSION_LONG), + ideVersionDescription); +} + +QString ICore::buildCompatibilityString() +{ + return tr("Based on Qt %1 (%2, %3 bit)").arg(QLatin1String(qVersion()), + compilerString(), + QString::number(QSysInfo::WordSize)); +} + IContext *ICore::currentContextObject() { return m_mainwindow->currentContextObject(); diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index 82de766924..f8d8b261c2 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -113,6 +113,9 @@ public: static QString resourcePath(); static QString userResourcePath(); + static QString versionString(); + static QString buildCompatibilityString(); + static QWidget *mainWindow(); static Utils::AppMainWindow *appMainWindow(); static QStatusBar *statusBar(); diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.cpp b/src/plugins/coreplugin/progressmanager/progressmanager.cpp index 37c47799e1..b155834317 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.cpp +++ b/src/plugins/coreplugin/progressmanager/progressmanager.cpp @@ -494,16 +494,17 @@ void ProgressManagerPrivate::updateSummaryProgressBar() m_summaryProgressBar->setFinished(false); QMapIterator<QFutureWatcher<void> *, QString> it(m_runningTasks); - int range = 0; + static const int TASK_RANGE = 100; int value = 0; while (it.hasNext()) { it.next(); QFutureWatcher<void> *watcher = it.key(); int min = watcher->progressMinimum(); - range += watcher->progressMaximum() - min; - value += watcher->progressValue() - min; + int range = watcher->progressMaximum() - min; + if (range > 0) + value += TASK_RANGE * (watcher->progressValue() - min) / range; } - m_summaryProgressBar->setRange(0, range); + m_summaryProgressBar->setRange(0, TASK_RANGE * m_runningTasks.size()); m_summaryProgressBar->setValue(value); } diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp index 9ece9693f3..00aee2737b 100644 --- a/src/plugins/coreplugin/versiondialog.cpp +++ b/src/plugins/coreplugin/versiondialog.cpp @@ -31,10 +31,9 @@ #include <app/app_version.h> #include <coreplugin/coreconstants.h> +#include <coreplugin/icore.h> #include <utils/qtcassert.h> -#include <QSysInfo> - #include <QDialogButtonBox> #include <QGridLayout> #include <QLabel> @@ -55,13 +54,6 @@ VersionDialog::VersionDialog(QWidget *parent) QGridLayout *layout = new QGridLayout(this); layout->setSizeConstraint(QLayout::SetFixedSize); - QString version = QLatin1String(Constants::IDE_VERSION_LONG); - - QString ideVersionDescription; -#ifdef IDE_VERSION_DESCRIPTION - ideVersionDescription = tr("(%1)").arg(QLatin1String(Constants::IDE_VERSION_DESCRIPTION_STR)); -#endif - QString ideRev; #ifdef IDE_REVISION //: This gets conditionally inserted as argument %8 into the description string. @@ -69,23 +61,24 @@ VersionDialog::VersionDialog(QWidget *parent) #endif const QString description = tr( - "<h3>Qt Creator %1 %8</h3>" - "Based on Qt %2 (%3 bit)<br/>" + "<h3>%1</h3>" + "%2<br/>" "<br/>" - "Built on %4 at %5<br />" + "Built on %3 at %4<br />" "<br/>" - "%9" + "%5" "<br/>" "Copyright 2008-%6 %7. All rights reserved.<br/>" "<br/>" "The program is provided AS IS with NO WARRANTY OF ANY KIND, " "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " "PARTICULAR PURPOSE.<br/>") - .arg(version, - QLatin1String(qVersion()), QString::number(QSysInfo::WordSize), - QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(Constants::IDE_YEAR), - (QLatin1String(Constants::IDE_AUTHOR)), ideVersionDescription, - ideRev); + .arg(ICore::versionString(), + ICore::buildCompatibilityString(), + QLatin1String(__DATE__), QLatin1String(__TIME__), + ideRev, + QLatin1String(Constants::IDE_YEAR), + QLatin1String(Constants::IDE_AUTHOR)); QLabel *copyRightLabel = new QLabel(description); copyRightLabel->setWordWrap(true); diff --git a/src/plugins/cpaster/cpaster.qbs b/src/plugins/cpaster/cpaster.qbs index 14cf63b416..9bc42c490c 100644 --- a/src/plugins/cpaster/cpaster.qbs +++ b/src/plugins/cpaster/cpaster.qbs @@ -9,7 +9,6 @@ QtcPlugin { Depends { name: "Core" } Depends { name: "TextEditor" } - Depends { name: "cpp" } cpp.includePaths: base.concat("../../shared/cpaster") files: [ diff --git a/src/plugins/cpaster/frontend/frontend.qbs b/src/plugins/cpaster/frontend/frontend.qbs index 922fb3b7b3..87262aa3d6 100644 --- a/src/plugins/cpaster/frontend/frontend.qbs +++ b/src/plugins/cpaster/frontend/frontend.qbs @@ -4,7 +4,6 @@ import "../../../tools/QtcTool.qbs" as QtcTool QtcTool { name: "cpaster" - Depends { name: "cpp" } Depends { name: "Qt" submodules: ["gui", "network"] diff --git a/src/plugins/cppeditor/cppeditor.qbs b/src/plugins/cppeditor/cppeditor.qbs index d5698f7365..6dbbff538d 100644 --- a/src/plugins/cppeditor/cppeditor.qbs +++ b/src/plugins/cppeditor/cppeditor.qbs @@ -13,7 +13,6 @@ QtcPlugin { Depends { name: "CPlusPlus" } Depends { name: "TextEditor" } Depends { name: "ProjectExplorer" } - Depends { name: "cpp" } cpp.includePaths: base.concat("../../libs/3rdparty") diff --git a/src/plugins/cvs/CVS.mimetypes.xml b/src/plugins/cvs/CVS.mimetypes.xml index 237d8aa67c..f227093ecb 100644 --- a/src/plugins/cvs/CVS.mimetypes.xml +++ b/src/plugins/cvs/CVS.mimetypes.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> - <mime-type type="application/vnd.nokia.text.cvs.submit"> + <mime-type type="text/vnd.qtcreator.cvs.submit"> <comment>CVS submit template</comment> <sub-class-of type="text/plain"/> </mime-type> diff --git a/src/plugins/cvs/cvs.pro b/src/plugins/cvs/cvs.pro index 9ecb32b06e..9d32eabfda 100644 --- a/src/plugins/cvs/cvs.pro +++ b/src/plugins/cvs/cvs.pro @@ -26,3 +26,5 @@ SOURCES += annotationhighlighter.cpp \ FORMS += settingspage.ui RESOURCES += cvs.qrc + +OTHER_FILES += CVS.mimetypes.xml diff --git a/src/plugins/cvs/cvs.qbs b/src/plugins/cvs/cvs.qbs index d89725f59d..90b7f91523 100644 --- a/src/plugins/cvs/cvs.qbs +++ b/src/plugins/cvs/cvs.qbs @@ -13,6 +13,7 @@ QtcPlugin { Depends { name: "Locator" } files: [ + "CVS.mimetypes.xml", "annotationhighlighter.cpp", "annotationhighlighter.h", "checkoutwizard.cpp", diff --git a/src/plugins/debugger/cdb/cdb.pri b/src/plugins/debugger/cdb/cdb.pri index 8a62bd5e6d..f1928c0b3c 100644 --- a/src/plugins/debugger/cdb/cdb.pri +++ b/src/plugins/debugger/cdb/cdb.pri @@ -1,13 +1,11 @@ HEADERS += $$PWD/cdbengine.h \ cdb/bytearrayinputstream.h \ cdb/cdbparsehelpers.h \ - cdb/cdboptions.h \ cdb/cdboptionspage.h SOURCES += $$PWD/cdbengine.cpp \ cdb/bytearrayinputstream.cpp \ cdb/cdbparsehelpers.cpp \ - cdb/cdboptions.cpp \ cdb/cdboptionspage.cpp FORMS += cdb/cdboptionspagewidget.ui diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index bc2e9c0ba5..587400f5eb 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -195,9 +195,9 @@ Q_DECLARE_METATYPE(Debugger::Internal::ConditionalBreakPointCookie) namespace Debugger { namespace Internal { -static inline bool isCreatorConsole(const DebuggerStartParameters &sp, const CdbOptions &o) +static inline bool isCreatorConsole(const DebuggerStartParameters &sp) { - return !o.cdbConsole && sp.useTerminal + return !debuggerCore()->boolSetting(UseCdbConsole) && sp.useTerminal && (sp.startMode == StartInternal || sp.startMode == StartExternal); } @@ -316,35 +316,29 @@ static inline bool validMode(DebuggerStartMode sm) DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp, QString *errorMessage) { if (Utils::HostOsInfo::isWindowsHost()) { - CdbOptionsPage *op = CdbOptionsPage::instance(); - if (!op || !validMode(sp.startMode)) { - *errorMessage = QLatin1String("Internal error: Invalid start parameters passed for thee CDB engine."); - return 0; - } - return new CdbEngine(sp, op->options()); + if (validMode(sp.startMode)) + return new CdbEngine(sp); + *errorMessage = QLatin1String("Internal error: Invalid start parameters passed for thee CDB engine."); + } else { + *errorMessage = QString::fromLatin1("Unsupported debug mode"); } - *errorMessage = QString::fromLatin1("Unsupported debug mode"); return 0; } void addCdbOptionPages(QList<Core::IOptionsPage *> *opts) { - if (Utils::HostOsInfo::isWindowsHost()) + if (Utils::HostOsInfo::isWindowsHost()) { opts->push_back(new CdbOptionsPage); + opts->push_back(new CdbPathsPage); + } } #define QT_CREATOR_CDB_EXT "qtcreatorcdbext" -static inline Utils::SavedAction *theAssemblerAction() -{ - return debuggerCore()->action(OperateByInstruction); -} - -CdbEngine::CdbEngine(const DebuggerStartParameters &sp, const OptionsPtr &options) : +CdbEngine::CdbEngine(const DebuggerStartParameters &sp) : DebuggerEngine(sp), m_creatorExtPrefix("<qtcreatorcdbext>|"), m_tokenPrefix("<token>"), - m_options(options), m_effectiveStartMode(NoStartMode), m_accessible(false), m_specialStopMode(NoSpecialStop), @@ -363,7 +357,8 @@ CdbEngine::CdbEngine(const DebuggerStartParameters &sp, const OptionsPtr &option m_watchPointY(0), m_ignoreCdbOutput(false) { - connect(theAssemblerAction(), SIGNAL(triggered(bool)), this, SLOT(operateByInstructionTriggered(bool))); + connect(debuggerCore()->action(OperateByInstruction), SIGNAL(triggered(bool)), + this, SLOT(operateByInstructionTriggered(bool))); setObjectName(QLatin1String("CdbEngine")); connect(&m_process, SIGNAL(finished(int)), this, SLOT(processFinished())); @@ -380,7 +375,7 @@ void CdbEngine::init() m_specialStopMode = NoSpecialStop; m_nextCommandToken = 0; m_currentBuiltinCommandIndex = -1; - m_operateByInstructionPending = theAssemblerAction()->isChecked(); + m_operateByInstructionPending = debuggerCore()->action(OperateByInstruction)->isChecked(); m_operateByInstruction = true; // Default CDB setting m_notifyEngineShutdownOnTermination = false; m_hasDebuggee = false; @@ -583,9 +578,9 @@ void CdbEngine::setupEngine() if (debug) qDebug(">setupEngine"); // Nag to add symbol server and cache - if (CdbSymbolPathListEditor::promptToAddSymbolPaths(CdbOptions::settingsGroup(), - &(m_options->symbolPaths))) - m_options->toSettings(Core::ICore::settings()); + QStringList symbolPaths = debuggerCore()->stringListSetting(CdbSymbolPaths); + if (CdbSymbolPathListEditor::promptToAddSymbolPaths(&symbolPaths)) + debuggerCore()->action(CdbSymbolPaths)->setValue(symbolPaths); init(); if (!m_logTime.elapsed()) @@ -596,7 +591,7 @@ void CdbEngine::setupEngine() // console, too, but that immediately closes when the debuggee quits. // Use the Creator stub instead. const DebuggerStartParameters &sp = startParameters(); - const bool launchConsole = isCreatorConsole(sp, *m_options); + const bool launchConsole = isCreatorConsole(sp); m_effectiveStartMode = launchConsole ? AttachExternal : sp.startMode; const bool ok = launchConsole ? startConsole(startParameters(), &errorMessage) : @@ -668,14 +663,18 @@ bool CdbEngine::launchCDB(const DebuggerStartParameters &sp, QString *errorMessa << QLatin1String(".idle_cmd ") + QString::fromLatin1(m_extensionCommandPrefixBA) + QLatin1String("idle"); if (sp.useTerminal) // Separate console arguments << QLatin1String("-2"); - if (m_options->ignoreFirstChanceAccessViolation) + if (debuggerCore()->boolSetting(IgnoreFirstChanceAccessViolation)) arguments << QLatin1String("-x"); - if (!m_options->symbolPaths.isEmpty()) - arguments << QLatin1String("-y") << m_options->symbolPaths.join(QString(QLatin1Char(';'))); - if (!m_options->sourcePaths.isEmpty()) - arguments << QLatin1String("-srcpath") << m_options->sourcePaths.join(QString(QLatin1Char(';'))); + + const QStringList &symbolPaths = debuggerCore()->stringListSetting(CdbSymbolPaths); + if (!symbolPaths.isEmpty()) + arguments << QLatin1String("-y") << symbolPaths.join(QString(QLatin1Char(';'))); + const QStringList &sourcePaths = debuggerCore()->stringListSetting(CdbSourcePaths); + if (!sourcePaths.isEmpty()) + arguments << QLatin1String("-srcpath") << sourcePaths.join(QString(QLatin1Char(';'))); + // Compile argument string preserving quotes - QString nativeArguments = m_options->additionalArguments; + QString nativeArguments = debuggerCore()->stringSetting(CdbAdditionalArguments); switch (sp.startMode) { case StartInternal: case StartExternal: @@ -692,7 +691,7 @@ bool CdbEngine::launchCDB(const DebuggerStartParameters &sp, QString *errorMessa if (sp.startMode == AttachCrashedExternal) { arguments << QLatin1String("-e") << sp.crashParameter << QLatin1String("-g"); } else { - if (isCreatorConsole(startParameters(), *m_options)) + if (isCreatorConsole(startParameters())) arguments << QLatin1String("-pr") << QLatin1String("-pb"); } break; @@ -808,25 +807,21 @@ void CdbEngine::runEngine() { if (debug) qDebug("runEngine"); - foreach (const QString &breakEvent, m_options->breakEvents) - postCommand(QByteArray("sxe ") + breakEvent.toLatin1(), 0); + + const QStringList &breakEvents = + debuggerCore()->stringListSetting(CdbBreakEvents); + foreach (const QString &breakEvent, breakEvents) + postCommand(QByteArray("sxe ") + breakEvent.toLatin1(), 0); // Break functions: each function must be fully qualified, // else the debugger will slow down considerably. - foreach (const QString &breakFunctionS, m_options->breakFunctions) { - const QByteArray breakFunction = breakFunctionS.toLatin1(); - if (breakFunction == CdbOptions::crtDbgReport) { - // CrtDbgReport(): Add MSVC runtime (debug, release) - // and stop at Wide character version as well - const QByteArray module = msvcRunTime(startParameters().toolChainAbi.osFlavor()); - const QByteArray debugModule = module + 'D'; - const QByteArray wideFunc = breakFunction + 'W'; - postCommand(breakAtFunctionCommand(breakFunction, module), 0); - postCommand(breakAtFunctionCommand(wideFunc, module), 0); - postCommand(breakAtFunctionCommand(breakFunction, debugModule), 0); - postCommand(breakAtFunctionCommand(wideFunc, debugModule), 0); - } else { - postCommand(breakAtFunctionCommand(breakFunction), 0); - } + if (debuggerCore()->boolSetting(CdbBreakOnCrtDbgReport)) { + const QByteArray module = msvcRunTime(startParameters().toolChainAbi.osFlavor()); + const QByteArray debugModule = module + 'D'; + const QByteArray wideFunc = CdbOptionsPage::crtDbgReport + 'W'; + postCommand(breakAtFunctionCommand(CdbOptionsPage::crtDbgReport, module), 0); + postCommand(breakAtFunctionCommand(wideFunc, module), 0); + postCommand(breakAtFunctionCommand(CdbOptionsPage::crtDbgReport, debugModule), 0); + postCommand(breakAtFunctionCommand(wideFunc, debugModule), 0); } if (debuggerCore()->boolSetting(BreakOnWarning)) { postCommand("bm /( QtCored4!qWarning", 0); // 'bm': All overloads. @@ -2785,7 +2780,7 @@ void CdbEngine::attemptBreakpointSynchronization() switch (handler->state(id)) { case BreakpointInsertRequested: if (parameters.type == BreakpointByFileAndLine - && m_options->breakpointCorrection) { + && debuggerCore()->boolSetting(CdbBreakPointCorrection)) { if (lineCorrection.isNull()) lineCorrection.reset(new BreakpointCorrectionContext(debuggerCore()->cppCodeModelSnapshot(), CppTools::CppModelManagerInterface::instance()->workingCopy())); diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h index 1816d86923..4478af3c3b 100644 --- a/src/plugins/debugger/cdb/cdbengine.h +++ b/src/plugins/debugger/cdb/cdbengine.h @@ -47,7 +47,6 @@ namespace Internal { class DisassemblerAgent; struct CdbBuiltinCommand; struct CdbExtensionCommand; -struct CdbOptions; struct MemoryViewCookie; class ByteArrayInputStream; class GdbMi; @@ -57,8 +56,6 @@ class CdbEngine : public Debugger::DebuggerEngine Q_OBJECT public: - typedef QSharedPointer<CdbOptions> OptionsPtr; - enum CommandFlags { QuietCommand = 0x1 }; // Flag bits for a sequence of commands enum CommandSequenceFlags { @@ -74,7 +71,7 @@ public: typedef void (CdbEngine::*BuiltinCommandHandler)(const CdbBuiltinCommandPtr &); typedef void (CdbEngine::*ExtensionCommandHandler)(const CdbExtensionCommandPtr &); - CdbEngine(const DebuggerStartParameters &sp, const OptionsPtr &options); + CdbEngine(const DebuggerStartParameters &sp); ~CdbEngine(); // Factory function that returns 0 if the debug engine library cannot be found. @@ -247,7 +244,6 @@ private: const QByteArray m_creatorExtPrefix; const QByteArray m_tokenPrefix; - const OptionsPtr m_options; QProcess m_process; QScopedPointer<Utils::ConsoleProcess> m_consoleStub; diff --git a/src/plugins/debugger/cdb/cdboptions.cpp b/src/plugins/debugger/cdb/cdboptions.cpp deleted file mode 100644 index 99a5832e60..0000000000 --- a/src/plugins/debugger/cdb/cdboptions.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#include "cdboptions.h" - -#include <QSettings> - -static const char settingsGroupC[] = "CDB2"; -static const char symbolPathsKeyC[] = "SymbolPaths"; -static const char sourcePathsKeyC[] = "SourcePaths"; -static const char breakEventKeyC[] = "BreakEvent"; -static const char breakFunctionsKeyC[] = "BreakFunctions"; -static const char additionalArgumentsKeyC[] = "AdditionalArguments"; -static const char cdbConsoleKeyC[] = "CDB_Console"; -static const char breakpointCorrectionKeyC[] = "BreakpointCorrection"; -static const char ignoreFirstChanceAccessViolationKeyC[] = "IgnoreFirstChanceAccessViolation"; - -namespace Debugger { -namespace Internal { - -const char *CdbOptions::crtDbgReport = "CrtDbgReport"; - -CdbOptions::CdbOptions() - : cdbConsole(false) - , breakpointCorrection(true) - , ignoreFirstChanceAccessViolation(false) -{ -} - -QString CdbOptions::settingsGroup() -{ - return QLatin1String(settingsGroupC); -} - -void CdbOptions::clear() -{ - symbolPaths.clear(); - sourcePaths.clear(); - breakpointCorrection = true; - cdbConsole = ignoreFirstChanceAccessViolation = false; - breakEvents.clear(); - breakFunctions.clear(); -} - -QStringList CdbOptions::oldEngineSymbolPaths(const QSettings *s) -{ - return s->value(QLatin1String("CDB/SymbolPaths")).toStringList(); -} - -void CdbOptions::fromSettings(QSettings *s) -{ - clear(); - const QString keyRoot = QLatin1String(settingsGroupC) + QLatin1Char('/'); - additionalArguments = s->value(keyRoot + QLatin1String(additionalArgumentsKeyC), QString()).toString(); - symbolPaths = s->value(keyRoot + QLatin1String(symbolPathsKeyC), QStringList()).toStringList(); - sourcePaths = s->value(keyRoot + QLatin1String(sourcePathsKeyC), QStringList()).toStringList(); - breakEvents = s->value(keyRoot + QLatin1String(breakEventKeyC), QStringList()).toStringList(); - breakFunctions = s->value(keyRoot + QLatin1String(breakFunctionsKeyC), QStringList()).toStringList(); - cdbConsole = s->value(keyRoot + QLatin1String(cdbConsoleKeyC), QVariant(false)).toBool(); - breakpointCorrection = s->value(keyRoot + QLatin1String(breakpointCorrectionKeyC), QVariant(true)).toBool(); - ignoreFirstChanceAccessViolation = s->value(keyRoot + QLatin1String(ignoreFirstChanceAccessViolationKeyC), false).toBool(); -} - -void CdbOptions::toSettings(QSettings *s) const -{ - s->beginGroup(QLatin1String(settingsGroupC)); - s->setValue(QLatin1String(symbolPathsKeyC), symbolPaths); - s->setValue(QLatin1String(sourcePathsKeyC), sourcePaths); - s->setValue(QLatin1String(breakEventKeyC), breakEvents); - s->setValue(QLatin1String(breakFunctionsKeyC), breakFunctions); - s->setValue(QLatin1String(additionalArgumentsKeyC), additionalArguments); - s->setValue(QLatin1String(cdbConsoleKeyC), QVariant(cdbConsole)); - s->setValue(QLatin1String(breakpointCorrectionKeyC), QVariant(breakpointCorrection)); - s->setValue(QLatin1String(ignoreFirstChanceAccessViolationKeyC), QVariant(ignoreFirstChanceAccessViolation)); - s->endGroup(); -} - -bool CdbOptions::equals(const CdbOptions &rhs) const -{ - return cdbConsole == rhs.cdbConsole - && breakpointCorrection == rhs.breakpointCorrection - && ignoreFirstChanceAccessViolation == rhs.ignoreFirstChanceAccessViolation - && additionalArguments == rhs.additionalArguments - && symbolPaths == rhs.symbolPaths - && sourcePaths == rhs.sourcePaths - && breakEvents == rhs.breakEvents - && breakFunctions == rhs.breakFunctions; -} - -} // namespace Internal -} // namespace Debugger diff --git a/src/plugins/debugger/cdb/cdboptions.h b/src/plugins/debugger/cdb/cdboptions.h deleted file mode 100644 index 4fa3ca527a..0000000000 --- a/src/plugins/debugger/cdb/cdboptions.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - -#ifndef CDBOPTIONS_H -#define CDBOPTIONS_H - -#include <QStringList> - -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - -namespace Debugger { -namespace Internal { - -struct CdbOptions -{ -public: - CdbOptions(); - - void clear(); - - void fromSettings(QSettings *s); // Writes parameters on first-time autodetect - void toSettings(QSettings *s) const; - - bool equals(const CdbOptions &rhs) const; - - static QString settingsGroup(); - static QStringList oldEngineSymbolPaths(const QSettings *s); - - QString additionalArguments; - QStringList symbolPaths; - QStringList sourcePaths; - // Events to break on (Command 'sxe' with abbreviation and optional parameter) - QStringList breakEvents; - QStringList breakFunctions; - // Launch CDB's own console instead of Qt Creator's - bool cdbConsole; - // Perform code-model based correction of breakpoint location. - bool breakpointCorrection; - // Add -x to command line. - bool ignoreFirstChanceAccessViolation; - - static const char *crtDbgReport; -}; - -inline bool operator==(const CdbOptions &s1, const CdbOptions &s2) -{ return s1.equals(s2); } -inline bool operator!=(const CdbOptions &s1, const CdbOptions &s2) -{ return !s1.equals(s2); } - -} // namespace Internal -} // namespace Debugger - -#endif // CDBOPTIONS_H diff --git a/src/plugins/debugger/cdb/cdboptionspage.cpp b/src/plugins/debugger/cdb/cdboptionspage.cpp index d98040f3e8..2b25ede46b 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.cpp +++ b/src/plugins/debugger/cdb/cdboptionspage.cpp @@ -29,6 +29,8 @@ #include "cdboptionspage.h" #include "commonoptionspage.h" +#include "debuggeractions.h" +#include "debuggercore.h" #include "debuggerinternalconstants.h" #include "cdbengine.h" #include "cdbsymbolpathlisteditor.h" @@ -41,6 +43,8 @@ namespace Debugger { namespace Internal { +const char *CdbOptionsPage::crtDbgReport = "CrtDbgReport"; + struct EventsDescription { const char *abbreviation; bool hasParameter; @@ -157,8 +161,6 @@ QStringList CdbBreakEventWidget::breakEvents() const CdbOptionsPageWidget::CdbOptionsPageWidget(QWidget *parent) : QWidget(parent) , m_breakEventWidget(new CdbBreakEventWidget) - , m_symbolPathListEditor(new CdbSymbolPathListEditor) - , m_sourcePathListEditor(new Utils::PathListEditor) { m_ui.setupUi(this); // Squeeze the groupbox layouts vertically to @@ -175,40 +177,25 @@ CdbOptionsPageWidget::CdbOptionsPageWidget(QWidget *parent) eventLayout->addWidget(m_breakEventWidget); m_ui.eventGroupBox->setLayout(eventLayout); m_ui.breakCrtDbgReportCheckBox - ->setText(CommonOptionsPage::msgSetBreakpointAtFunction(CdbOptions::crtDbgReport)); + ->setText(CommonOptionsPage::msgSetBreakpointAtFunction(CdbOptionsPage::crtDbgReport)); const QString hint = tr("This is useful to catch runtime error messages, for example caused by assert()."); m_ui.breakCrtDbgReportCheckBox - ->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(CdbOptions::crtDbgReport, hint)); + ->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(CdbOptionsPage::crtDbgReport, hint)); - m_ui.symbolPathsGroupBox->layout()->addWidget(m_symbolPathListEditor); - m_ui.sourcePathsGroupBox->layout()->addWidget(m_sourcePathListEditor); -} + DebuggerCore *dc = debuggerCore(); + group.insert(dc->action(CdbAdditionalArguments), m_ui.additionalArgumentsLineEdit); + group.insert(dc->action(CdbBreakOnCrtDbgReport), m_ui.breakCrtDbgReportCheckBox); + group.insert(dc->action(UseCdbConsole), m_ui.consoleCheckBox); + group.insert(dc->action(CdbBreakPointCorrection), m_ui.breakpointCorrectionCheckBox); + group.insert(dc->action(IgnoreFirstChanceAccessViolation), + m_ui.ignoreFirstChanceAccessViolationCheckBox); -void CdbOptionsPageWidget::setOptions(CdbOptions &o) -{ - m_ui.additionalArgumentsLineEdit->setText(o.additionalArguments); - m_symbolPathListEditor->setPathList(o.symbolPaths); - m_sourcePathListEditor->setPathList(o.sourcePaths); - m_ui.ignoreFirstChanceAccessViolationCheckBox->setChecked(o.ignoreFirstChanceAccessViolation); - m_breakEventWidget->setBreakEvents(o.breakEvents); - m_ui.consoleCheckBox->setChecked(o.cdbConsole); - m_ui.breakpointCorrectionCheckBox->setChecked(o.breakpointCorrection); - m_ui.breakCrtDbgReportCheckBox->setChecked(o.breakFunctions.contains(QLatin1String(CdbOptions::crtDbgReport))); + m_breakEventWidget->setBreakEvents(dc->stringListSetting(CdbBreakEvents)); } -CdbOptions CdbOptionsPageWidget::options() const +QStringList CdbOptionsPageWidget::breakEvents() const { - CdbOptions rc; - rc.additionalArguments = m_ui.additionalArgumentsLineEdit->text().trimmed(); - rc.symbolPaths = m_symbolPathListEditor->pathList(); - rc.sourcePaths = m_sourcePathListEditor->pathList(); - rc.ignoreFirstChanceAccessViolation = m_ui.ignoreFirstChanceAccessViolationCheckBox->isChecked(); - rc.breakEvents = m_breakEventWidget->breakEvents(); - rc.cdbConsole = m_ui.consoleCheckBox->isChecked(); - rc.breakpointCorrection = m_ui.breakpointCorrectionCheckBox->isChecked(); - if (m_ui.breakCrtDbgReportCheckBox->isChecked()) - rc.breakFunctions.push_back(QLatin1String(CdbOptions::crtDbgReport)); - return rc; + return m_breakEventWidget->breakEvents(); } static QString stripColon(QString s) @@ -222,24 +209,15 @@ static QString stripColon(QString s) QString CdbOptionsPageWidget::searchKeywords() const { QString rc; - QTextStream(&rc) - << stripColon(m_ui.additionalArgumentsLabel->text()) << ' ' - << m_ui.symbolPathsGroupBox->title() << ' ' - << m_ui.sourcePathsGroupBox->title(); + QTextStream(&rc) << stripColon(m_ui.additionalArgumentsLabel->text()); rc.remove(QLatin1Char('&')); return rc; } // ---------- CdbOptionsPage -CdbOptionsPage *CdbOptionsPage::m_instance = 0; - -CdbOptionsPage::CdbOptionsPage() : - m_options(new CdbOptions) +CdbOptionsPage::CdbOptionsPage() { - CdbOptionsPage::m_instance = this; - m_options->fromSettings(Core::ICore::settings()); - setId("F.Cda"); setDisplayName(tr("CDB")); setCategory(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY); @@ -250,13 +228,11 @@ CdbOptionsPage::CdbOptionsPage() : CdbOptionsPage::~CdbOptionsPage() { - CdbOptionsPage::m_instance = 0; } QWidget *CdbOptionsPage::createPage(QWidget *parent) { m_widget = new CdbOptionsPageWidget(parent); - m_widget->setOptions(*m_options); if (m_searchKeywords.isEmpty()) m_searchKeywords = m_widget->searchKeywords(); return m_widget; @@ -266,15 +242,14 @@ void CdbOptionsPage::apply() { if (!m_widget) return; - const CdbOptions newOptions = m_widget->options(); - if (*m_options != newOptions) { - *m_options = newOptions; - m_options->toSettings(Core::ICore::settings()); - } + m_widget->group.apply(Core::ICore::settings()); + debuggerCore()->action(CdbBreakEvents)->setValue(m_widget->breakEvents()); } void CdbOptionsPage::finish() { + if (m_widget) + m_widget->group.finish(); } bool CdbOptionsPage::matches(const QString &s) const @@ -282,9 +257,91 @@ bool CdbOptionsPage::matches(const QString &s) const return m_searchKeywords.contains(s, Qt::CaseInsensitive); } -CdbOptionsPage *CdbOptionsPage::instance() +// ---------- CdbPathsPage + +class CdbPathsPageWidget : public QWidget +{ +public: + Utils::SavedActionSet group; + +// CdbPaths m_paths; + QString m_searchKeywords; + + CdbSymbolPathListEditor *m_symbolPathListEditor; + Utils::PathListEditor *m_sourcePathListEditor; + + CdbPathsPageWidget(QWidget *parent = 0); +}; + +CdbPathsPageWidget::CdbPathsPageWidget(QWidget *parent) : + QWidget(parent) +{ + QVBoxLayout *layout = new QVBoxLayout(this); + + QString title = tr("Symbol Paths"); + m_searchKeywords.append(title); + QGroupBox* gbSymbolPath = new QGroupBox(this); + gbSymbolPath->setTitle(title); + QVBoxLayout *gbSymbolPathLayout = new QVBoxLayout(gbSymbolPath); + m_symbolPathListEditor = new CdbSymbolPathListEditor(gbSymbolPath); + gbSymbolPathLayout->addWidget(m_symbolPathListEditor); + + title = tr("Source Paths"); + m_searchKeywords.append(title); + QGroupBox* gbSourcePath = new QGroupBox(this); + gbSourcePath->setTitle(title); + QVBoxLayout *gbSourcePathLayout = new QVBoxLayout(gbSourcePath); + m_sourcePathListEditor = new Utils::PathListEditor(gbSourcePath); + gbSourcePathLayout->addWidget(m_sourcePathListEditor); + + layout->addWidget(gbSymbolPath); + layout->addWidget(gbSourcePath); + + DebuggerCore *dc = debuggerCore(); + group.insert(dc->action(CdbSymbolPaths), m_symbolPathListEditor); + group.insert(dc->action(CdbSourcePaths), m_sourcePathListEditor); +} + +CdbPathsPage::CdbPathsPage() + : m_widget(0) +{ + setId("F.Cdb"); + setDisplayName(tr("CDB Paths")); + setCategory(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY); + setDisplayCategory(QCoreApplication::translate("Debugger", + Constants::DEBUGGER_SETTINGS_TR_CATEGORY)); + setCategoryIcon(QLatin1String(Constants::DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON)); +} + +CdbPathsPage::~CdbPathsPage() +{ +} + +QWidget *CdbPathsPage::createPage(QWidget *parent) +{ + if (!m_widget) + m_widget = new CdbPathsPageWidget(parent); + else + m_widget->setParent(parent); + return m_widget; +} + +void CdbPathsPage::apply() +{ + if (m_widget) + m_widget->group.apply(Core::ICore::settings()); +} + +void CdbPathsPage::finish() +{ + if (m_widget) + m_widget->group.finish(); +} + +bool CdbPathsPage::matches(const QString &searchKeyWord) const { - return m_instance; + return m_widget && + m_widget->m_searchKeywords.contains(searchKeyWord, Qt::CaseInsensitive); } } // namespace Internal diff --git a/src/plugins/debugger/cdb/cdboptionspage.h b/src/plugins/debugger/cdb/cdboptionspage.h index 0d3d0c7e9b..a84a703c73 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.h +++ b/src/plugins/debugger/cdb/cdboptionspage.h @@ -30,13 +30,13 @@ #ifndef CDBOPTIONSPAGE_H #define CDBOPTIONSPAGE_H -#include "cdboptions.h" - #include <coreplugin/dialogs/ioptionspage.h> +#include <utils/savedaction.h> #include "ui_cdboptionspagewidget.h" #include <QPointer> #include <QSharedPointer> +#include <QStringList> #include <QDialog> QT_BEGIN_NAMESPACE @@ -50,6 +50,7 @@ namespace Debugger { namespace Internal { class CdbSymbolPathListEditor; +class CdbPathsPageWidget; // Widget displaying a list of break events for the 'sxe' command // with a checkbox to enable 'break' and optionally a QLineEdit for @@ -78,15 +79,15 @@ class CdbOptionsPageWidget : public QWidget public: explicit CdbOptionsPageWidget(QWidget *parent); - - void setOptions(CdbOptions &o); - CdbOptions options() const; - + QStringList breakEvents() const; QString searchKeywords() const; + Utils::SavedActionSet group; + private: inline QString path() const; + Ui::CdbOptionsPageWidget m_ui; CdbBreakEventWidget *m_breakEventWidget; CdbSymbolPathListEditor *m_symbolPathListEditor; @@ -101,23 +102,40 @@ public: explicit CdbOptionsPage(); virtual ~CdbOptionsPage(); - static CdbOptionsPage *instance(); - // IOptionsPage QWidget *createPage(QWidget *parent); void apply(); void finish(); bool matches(const QString &) const; - QSharedPointer<CdbOptions> options() const { return m_options; } + static const char *crtDbgReport; private: - static CdbOptionsPage *m_instance; - const QSharedPointer<CdbOptions> m_options; + Utils::SavedActionSet group; QPointer<CdbOptionsPageWidget> m_widget; QString m_searchKeywords; }; +class CdbPathsPage : public Core::IOptionsPage +{ + Q_OBJECT + +public: + explicit CdbPathsPage(); + virtual ~CdbPathsPage(); + + static CdbPathsPage *instance(); + + // IOptionsPage + QWidget *createPage(QWidget *parent); + void apply(); + void finish(); + bool matches(const QString &searchKeyWord) const; + +private: + QPointer<CdbPathsPageWidget> m_widget; +}; + } // namespace Internal } // namespace Debugger diff --git a/src/plugins/debugger/cdb/cdboptionspagewidget.ui b/src/plugins/debugger/cdb/cdboptionspagewidget.ui index 6df830facc..7221f342e4 100644 --- a/src/plugins/debugger/cdb/cdboptionspagewidget.ui +++ b/src/plugins/debugger/cdb/cdboptionspagewidget.ui @@ -97,22 +97,6 @@ </layout> </item> <item> - <widget class="QGroupBox" name="symbolPathsGroupBox"> - <property name="title"> - <string>Symbol Paths</string> - </property> - <layout class="QGridLayout" name="gridLayout_3"/> - </widget> - </item> - <item> - <widget class="QGroupBox" name="sourcePathsGroupBox"> - <property name="title"> - <string>Source Paths</string> - </property> - <layout class="QGridLayout" name="gridLayout_4"/> - </widget> - </item> - <item> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 688805e214..d88065a8d7 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -17,7 +17,6 @@ QtcPlugin { Depends { name: "QmlDebug" } Depends { name: "QtcSsh" } - Depends { name: "cpp" } cpp.includePaths: base.concat([ "shared", "lldblib", @@ -149,8 +148,6 @@ QtcPlugin { "cdb/bytearrayinputstream.h", "cdb/cdbengine.cpp", "cdb/cdbengine.h", - "cdb/cdboptions.cpp", - "cdb/cdboptions.h", "cdb/cdboptionspage.cpp", "cdb/cdboptionspage.h", "cdb/cdboptionspagewidget.ui", diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 49e207bcb8..c84ca969a6 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -42,6 +42,7 @@ using namespace Utils; static const char debugModeSettingsGroupC[] = "DebugMode"; +static const char cdbSettingsGroupC[] = "CDB2"; static const char sourcePathMappingArrayNameC[] = "SourcePathMappings"; static const char sourcePathMappingSourceKeyC[] = "Source"; static const char sourcePathMappingTargetKeyC[] = "Target"; @@ -91,6 +92,7 @@ DebuggerSettings::DebuggerSettings(QSettings *settings) { m_settings = settings; const QString debugModeGroup = QLatin1String(debugModeSettingsGroupC); + const QString cdbSettingsGroup = QLatin1String(cdbSettingsGroupC); SavedAction *item = 0; @@ -225,6 +227,54 @@ DebuggerSettings::DebuggerSettings(QSettings *settings) insertItem(AutoDerefPointers, item); // + // Cdb Options + // + + item = new SavedAction(this); + item->setDefaultValue(QString()); + item->setSettingsKey(cdbSettingsGroup, QLatin1String("AdditionalArguments")); + insertItem(CdbAdditionalArguments, item); + + item = new SavedAction(this); + item->setDefaultValue(QStringList()); + item->setSettingsKey(cdbSettingsGroup, QLatin1String("SymbolPaths")); + insertItem(CdbSymbolPaths, item); + + item = new SavedAction(this); + item->setDefaultValue(QStringList()); + item->setSettingsKey(cdbSettingsGroup, QLatin1String("SourcePaths")); + insertItem(CdbSourcePaths, item); + + item = new SavedAction(this); + item->setDefaultValue(QStringList()); + item->setSettingsKey(cdbSettingsGroup, QLatin1String("BreakEvent")); + insertItem(CdbBreakEvents, item); + + item = new SavedAction(this); + item->setCheckable(true); + item->setDefaultValue(false); + item->setSettingsKey(cdbSettingsGroup, QLatin1String("BreakOnCrtDbgReport")); + insertItem(CdbBreakOnCrtDbgReport, item); + + item = new SavedAction(this); + item->setCheckable(true); + item->setDefaultValue(false); + item->setSettingsKey(cdbSettingsGroup, QLatin1String("CDB_Console")); + insertItem(UseCdbConsole, item); + + item = new SavedAction(this); + item->setCheckable(true); + item->setDefaultValue(true); + item->setSettingsKey(cdbSettingsGroup, QLatin1String("BreakpointCorrection")); + insertItem(CdbBreakPointCorrection, item); + + item = new SavedAction(this); + item->setCheckable(true); + item->setDefaultValue(false); + item->setSettingsKey(cdbSettingsGroup, QLatin1String("IgnoreFirstChanceAccessViolation")); + insertItem(IgnoreFirstChanceAccessViolation, item); + + // // Locals & Watchers // item = new SavedAction(this); diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index 4d654981c7..d98423a76c 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -115,6 +115,16 @@ enum DebuggerActionCode RegisterForPostMortem, + // Cdb + CdbAdditionalArguments, + CdbSymbolPaths, + CdbSourcePaths, + CdbBreakEvents, + CdbBreakOnCrtDbgReport, + UseCdbConsole, + CdbBreakPointCorrection, + IgnoreFirstChanceAccessViolation, + // Gdb LoadGdbInit, LoadGdbDumpers, diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp index 5a4a962fbb..c4c1ee0d70 100644 --- a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp +++ b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp @@ -314,10 +314,6 @@ void DebuggerRunConfigurationAspect::ctor() { connect(this, SIGNAL(debuggersChanged()), m_runConfiguration, SIGNAL(requestRunActionsUpdate())); - setUseCppDebugger(m_runConfiguration->target()->project()->projectLanguages().contains( - ProjectExplorer::Constants::LANG_CXX)); - setUseQmlDebugger(m_runConfiguration->target()->project()->projectLanguages().contains( - ProjectExplorer::Constants::LANG_QMLJS)); } } // namespace Debugger diff --git a/src/plugins/debugger/gdb/classicgdbengine.cpp b/src/plugins/debugger/gdb/classicgdbengine.cpp index 3e0b97cd71..baede63b58 100644 --- a/src/plugins/debugger/gdb/classicgdbengine.cpp +++ b/src/plugins/debugger/gdb/classicgdbengine.cpp @@ -415,6 +415,7 @@ static bool extractTemplate(const QByteArray &type, QByteArray *tmplate, QByteAr } *tmplate = tmplate->trimmed(); tmplate->replace("<>", ""); + tmplate->replace("'", ""); // Sometimes 'std::vector' is reported, with quotes. *inner = inner->trimmed(); // qDebug() << "EXTRACT TEMPLATE: " << *tmplate << *inner << " FROM " << type; return !inner->isEmpty(); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index b9ce9a083a..705fab28b4 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1813,15 +1813,28 @@ void GdbEngine::handleShowVersion(const GdbResponse &response) if (m_gdbVersion > 70300) m_hasBreakpointNotifications = true; - if (usesExecInterrupt()) - postCommand("set target-async on", ConsoleCommand); - else - postCommand("set target-async off", ConsoleCommand); + if (m_gdbVersion > 70100) + m_disassembleUsesComma = true; + + if (m_gdbVersion > 70100) { + if (usesExecInterrupt()) + postCommand("set target-async on", ConsoleCommand); + else + postCommand("set target-async off", ConsoleCommand); + } if (startParameters().multiProcess) postCommand("set detach-on-fork off", ConsoleCommand); - postCommand("set build-id-verbose 2", ConsoleCommand); + //postCommand("set build-id-verbose 2", ConsoleCommand); + + if (m_gdbVersion > 70100) { + // Quick check whether we have python. + showMessage(_("NOTE: CHECK FOR PYTHON SUPPRESSED, VERSION TOO LOW")); + postCommand("python print 43", ConsoleCommand, CB(handleHasPython)); + } else { + pythonDumpersFailed(); + } } } @@ -4641,11 +4654,6 @@ void GdbEngine::reloadDisassembly() updateLocals(); } -void GdbEngine::handleDisassemblerCheck(const GdbResponse &response) -{ - m_disassembleUsesComma = response.resultClass != GdbResultDone; -} - void GdbEngine::handleFetchDisassemblerByCliPointMixed(const GdbResponse &response) { DisassemblerAgentCookie ac = response.cookie.value<DisassemblerAgentCookie>(); @@ -4851,14 +4859,6 @@ void GdbEngine::startGdb(const QStringList &args) postCommand("set remotecache on", ConsoleCommand); //postCommand("set non-stop on", ConsoleCommand); - // Work around https://bugreports.qt-project.org/browse/QTCREATORBUG-2004 - postCommand("maintenance set internal-warning quit no", ConsoleCommand); - postCommand("maintenance set internal-error quit no", ConsoleCommand); - - showMessage(_("THE FOLLOWING COMMAND CHECKS AVAILABLE FEATURES. " - "AN ERROR IS EXPECTED.")); - postCommand("disassemble 0 0", ConsoleCommand, CB(handleDisassemblerCheck)); - typedef GlobalDebuggerOptions::SourcePathMap SourcePathMap; typedef SourcePathMap::const_iterator SourcePathMapIterator; @@ -4916,12 +4916,10 @@ void GdbEngine::startGdb(const QStringList &args) postCommand("set detach-on-fork off"); } - // Quick check whether we have python. - postCommand("python print 43", ConsoleCommand, CB(handleHasPython)); - // Dummy command to guarantee a roundtrip before the adapter proceed. // Make sure this stays the last command in startGdb(). - postCommand("pwd", ConsoleCommand, CB(reportEngineSetupOk)); + // Don't use ConsoleCommand, otherwise Mac won't markup the output. + postCommand("pwd", CB(reportEngineSetupOk)); } void GdbEngine::reportEngineSetupOk(const GdbResponse &response) diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 1a4d77c580..3b99657c44 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -514,7 +514,6 @@ private: ////////// View & Data Stuff ////////// //void handleFetchDisassemblerByMiPointPlain(const GdbResponse &response); //void handleFetchDisassemblerByMiRangeMixed(const GdbResponse &response); //void handleFetchDisassemblerByMiRangePlain(const GdbResponse &response); - void handleDisassemblerCheck(const GdbResponse &response); void handleBreakOnQFatal(const GdbResponse &response); DisassemblerLines parseDisassembler(const GdbResponse &response); DisassemblerLines parseCliDisassembler(const QByteArray &response); diff --git a/src/plugins/debugger/ptracepreload.qbs b/src/plugins/debugger/ptracepreload.qbs index 3e2de1517b..ee9835f19d 100644 --- a/src/plugins/debugger/ptracepreload.qbs +++ b/src/plugins/debugger/ptracepreload.qbs @@ -10,7 +10,6 @@ QtcLibrary { "c" ] - Depends { name: "cpp" } files: [ "ptracepreload.c", diff --git a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp index 5b9b5a5998..617a7c2994 100644 --- a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp +++ b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp @@ -208,8 +208,7 @@ int CdbSymbolPathListEditor::indexOfSymbolPath(const QStringList &paths, return -1; } -bool CdbSymbolPathListEditor::promptToAddSymbolPaths(const QString &settingsGroup, - QStringList *symbolPaths) +bool CdbSymbolPathListEditor::promptToAddSymbolPaths(QStringList *symbolPaths) { const int indexOfSymbolServer = CdbSymbolPathListEditor::indexOfSymbolPath(*symbolPaths, SymbolServerPath); @@ -220,7 +219,7 @@ bool CdbSymbolPathListEditor::promptToAddSymbolPaths(const QString &settingsGrou || (indexOfSymbolServer != -1 && indexOfSymbolCache != -1)) return false; - const QString nagSymbolServerKey = settingsGroup + QLatin1String("/NoPromptSymbolCache"); + const QString nagSymbolServerKey = QLatin1String("CDB2/NoPromptSymbolCache"); bool noFurtherNagging = Core::ICore::settings()->value(nagSymbolServerKey, false).toBool(); if (noFurtherNagging) return false; diff --git a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h index 949b8ef9e5..ae518c95a0 100644 --- a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h +++ b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h @@ -95,7 +95,7 @@ public: static int indexOfSymbolPath(const QStringList &paths, SymbolPathMode mode, QString *cacheDir = 0); // Nag user to add a symbol cache and server to the path list on debugger startup. - static bool promptToAddSymbolPaths(const QString &settingsGroup, QStringList *symbolPaths); + static bool promptToAddSymbolPaths(QStringList *symbolPaths); private: void addSymbolPath(SymbolPathMode mode); diff --git a/src/plugins/designer/designer.qbs b/src/plugins/designer/designer.qbs index f30940b731..18a9aa76ed 100644 --- a/src/plugins/designer/designer.qbs +++ b/src/plugins/designer/designer.qbs @@ -12,7 +12,6 @@ QtcPlugin { Depends { name: "TextEditor" } Depends { name: "ProjectExplorer" } - Depends { name: "cpp" } cpp.defines: base.concat(["CPP_ENABLED"]) cpp.includePaths: base.concat([ "../../libs/3rdparty", diff --git a/src/plugins/diffeditor/diffeditor.qbs b/src/plugins/diffeditor/diffeditor.qbs index 6d472cbc75..1b1d5fd974 100644 --- a/src/plugins/diffeditor/diffeditor.qbs +++ b/src/plugins/diffeditor/diffeditor.qbs @@ -10,7 +10,6 @@ QtcPlugin { Depends { name: "TextEditor" } Depends { name: "Find" } - Depends { name: "cpp" } files: [ "diffeditor_global.h", diff --git a/src/plugins/find/find.qbs b/src/plugins/find/find.qbs index 7b8287e5be..bcc177d707 100644 --- a/src/plugins/find/find.qbs +++ b/src/plugins/find/find.qbs @@ -7,7 +7,6 @@ QtcPlugin { Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "script"] } Depends { name: "Core" } - Depends { name: "cpp" } cpp.includePaths: base.concat([ "generichighlighter", diff --git a/src/plugins/genericprojectmanager/GenericProject.mimetypes.xml b/src/plugins/genericprojectmanager/GenericProject.mimetypes.xml index c45a828b20..76e0449a70 100644 --- a/src/plugins/genericprojectmanager/GenericProject.mimetypes.xml +++ b/src/plugins/genericprojectmanager/GenericProject.mimetypes.xml @@ -7,19 +7,19 @@ <glob pattern="*.creator"/> </mime-type> - <mime-type type="application/vnd.nokia.qt.generic.files"> + <mime-type type="application/vnd.qtcreator.generic.files"> <sub-class-of type="text/plain"/> <comment>Generic Project Files</comment> <glob pattern="*.files"/> </mime-type> - <mime-type type="application/vnd.nokia.qt.generic.includes"> + <mime-type type="application/vnd.qtcreator.generic.includes"> <sub-class-of type="text/plain"/> <comment>Generic Project Include Paths</comment> <glob pattern="*.includes"/> </mime-type> - <mime-type type="application/vnd.nokia.qt.generic.config"> + <mime-type type="application/vnd.qtcreator.generic.config"> <sub-class-of type="text/plain"/> <comment>Generic Project Configuration File</comment> <glob pattern="*.config"/> diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index bfffbfd17d..326e25c378 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -70,10 +70,7 @@ GenericProject::GenericProject(Manager *manager, const QString &fileName) m_fileName(fileName) { setProjectContext(Context(GenericProjectManager::Constants::PROJECTCONTEXT)); - Core::Context pl(ProjectExplorer::Constants::LANG_CXX); - pl.add(ProjectExplorer::Constants::LANG_QMLJS); - setProjectLanguages(pl); - + setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX)); QFileInfo fileInfo(m_fileName); QDir dir = fileInfo.dir(); diff --git a/src/plugins/genericprojectmanager/genericprojectmanager.pro b/src/plugins/genericprojectmanager/genericprojectmanager.pro index 008002bb0d..3458f52fb6 100644 --- a/src/plugins/genericprojectmanager/genericprojectmanager.pro +++ b/src/plugins/genericprojectmanager/genericprojectmanager.pro @@ -26,4 +26,4 @@ SOURCES = genericproject.cpp \ RESOURCES += genericproject.qrc FORMS += genericmakestep.ui - +OTHER_FILES += GenericProject.mimetypes.xml diff --git a/src/plugins/genericprojectmanager/genericprojectmanager.qbs b/src/plugins/genericprojectmanager/genericprojectmanager.qbs index 8a47a547cb..0a125ad02c 100644 --- a/src/plugins/genericprojectmanager/genericprojectmanager.qbs +++ b/src/plugins/genericprojectmanager/genericprojectmanager.qbs @@ -16,6 +16,7 @@ QtcPlugin { Depends { name: "QtSupport" } files: [ + "GenericProject.mimetypes.xml", "filesselectionwizardpage.cpp", "filesselectionwizardpage.h", "genericbuildconfiguration.cpp", diff --git a/src/plugins/git/gerrit/gerritdialog.cpp b/src/plugins/git/gerrit/gerritdialog.cpp index 78438801ae..2ec682dfa3 100644 --- a/src/plugins/git/gerrit/gerritdialog.cpp +++ b/src/plugins/git/gerrit/gerritdialog.cpp @@ -202,11 +202,11 @@ void GerritDialog::displayRepositoryPath() if (m_repositoryChooser->path().isEmpty()) m_repositoryChooser->setPath(m_parameters->repositoryPath); if (m_parameters->promptPath) { - m_displayButton->setText(tr("&Diff...")); + m_displayButton->setText(tr("&Show...")); m_cherryPickButton->setText(tr("Cherry &Pick...")); m_checkoutButton->setText(tr("&Checkout...")); } else { - m_displayButton->setText(tr("&Diff")); + m_displayButton->setText(tr("&Show")); m_cherryPickButton->setText(tr("Cherry &Pick")); m_checkoutButton->setText(tr("&Checkout")); } diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp index 511b92cdd8..71637952f0 100644 --- a/src/plugins/git/gerrit/gerritplugin.cpp +++ b/src/plugins/git/gerrit/gerritplugin.cpp @@ -183,6 +183,7 @@ void FetchContext::start() void FetchContext::processFinished(int exitCode, QProcess::ExitStatus es) { + Git::Internal::GitClient *client = Git::Internal::GitPlugin::instance()->gitClient(); if (es != QProcess::NormalExit) { handleError(tr("%1 crashed.").arg(m_git)); return; @@ -199,16 +200,22 @@ void FetchContext::processFinished(int exitCode, QProcess::ExitStatus es) m_progress.setProgressValue(m_progress.progressValue() + 1); switch (m_fetchMode) { case FetchDisplay: - m_state = WritePatchFileState; - startWritePatchFile(); + if (client->settings()->boolValue(Git::Internal::GitSettings::useDiffEditorKey)) { + client->show(m_repository, QLatin1String("FETCH_HEAD")); + m_progress.reportFinished(); + m_state = DoneState; + deleteLater(); + } else { + m_state = WritePatchFileState; + startWritePatchFile(); + } break; case FetchCherryPick: case FetchCheckout: if (m_fetchMode == FetchCherryPick) { cherryPick(); } else { - Git::Internal::GitPlugin::instance()->gitClient()->synchronousCheckout( - m_repository, QLatin1String("FETCH_HEAD")); + client->synchronousCheckout(m_repository, QLatin1String("FETCH_HEAD")); } m_progress.reportFinished(); m_state = DoneState; diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 26b4629216..15befd0406 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1274,7 +1274,7 @@ void GitClient::addFile(const QString &workingDirectory, const QString &fileName QStringList arguments; arguments << QLatin1String("add") << fileName; - executeGit(workingDirectory, arguments, 0, true); + executeGit(workingDirectory, arguments, 0); } bool GitClient::synchronousLog(const QString &workingDirectory, const QStringList &arguments, diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 4ce7508d3d..55dcce5364 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -106,7 +106,7 @@ static const VcsBase::VcsBaseEditorParameters editorParameters[] = { Git::Constants::GIT_DIFF_EDITOR_DISPLAY_NAME, Git::Constants::C_GIT_DIFF_EDITOR, "text/x-patch"}, -{ VcsBase::DiffOutput, +{ VcsBase::OtherContent, Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID, Git::Constants::GIT_COMMIT_TEXT_EDITOR_DISPLAY_NAME, Git::Constants::C_GIT_COMMIT_TEXT_EDITOR, diff --git a/src/plugins/help/help.qbs b/src/plugins/help/help.qbs index 90c215d1ec..dec5fb2011 100644 --- a/src/plugins/help/help.qbs +++ b/src/plugins/help/help.qbs @@ -20,7 +20,6 @@ QtcPlugin { Depends { name: "Locator" } Depends { name: "app_version_header" } - Depends { name: "cpp" } cpp.defines: { var list = base; diff --git a/src/plugins/locator/locator.qbs b/src/plugins/locator/locator.qbs index af809cfd84..c5c99a328a 100644 --- a/src/plugins/locator/locator.qbs +++ b/src/plugins/locator/locator.qbs @@ -7,7 +7,6 @@ QtcPlugin { Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "script"] } Depends { name: "Core" } - Depends { name: "cpp" } cpp.includePaths: base.concat([ "generichighlighter", diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index b651afe55d..e53009f4b4 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -707,7 +707,7 @@ void MercurialPlugin::testDiffFileResolving_data() void MercurialPlugin::testDiffFileResolving() { - MercurialEditor editor(editorParameters + 3, 0); + MercurialEditor editor(editorParameters + 2, 0); editor.testDiffFileResolving(); } @@ -728,7 +728,7 @@ void MercurialPlugin::testLogResolving() "date: Sat Jan 19 04:08:16 2013 +0100\n" "summary: test-rebase: add another test for rebase with multiple roots\n" ); - MercurialEditor editor(editorParameters + 1, 0); + MercurialEditor editor(editorParameters, 0); editor.testLogResolving(data, "18473:692cbda1eb50", "18472:37100f30590f"); } #endif diff --git a/src/plugins/perforce/Perforce.mimetypes.xml b/src/plugins/perforce/Perforce.mimetypes.xml index 3c2d332771..d65e3d017f 100644 --- a/src/plugins/perforce/Perforce.mimetypes.xml +++ b/src/plugins/perforce/Perforce.mimetypes.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> - <mime-type type="application/vnd.nokia.text.p4.submit"> + <mime-type type="text/vnd.qtcreator.p4.submit"> <comment>Perforce submit template</comment> <sub-class-of type="text/plain"/> <magic priority="50"> diff --git a/src/plugins/perforce/perforce.pro b/src/plugins/perforce/perforce.pro index 796a0c7a67..0ebffbe03e 100644 --- a/src/plugins/perforce/perforce.pro +++ b/src/plugins/perforce/perforce.pro @@ -32,3 +32,5 @@ FORMS += settingspage.ui \ submitpanel.ui RESOURCES += perforce.qrc + +OTHER_FILES += Perforce.mimetypes.xml diff --git a/src/plugins/perforce/perforce.qbs b/src/plugins/perforce/perforce.qbs index ee31c90959..c8d802cd32 100644 --- a/src/plugins/perforce/perforce.qbs +++ b/src/plugins/perforce/perforce.qbs @@ -13,6 +13,7 @@ QtcPlugin { Depends { name: "Locator" } files: [ + "Perforce.mimetypes.xml", "annotationhighlighter.cpp", "annotationhighlighter.h", "changenumberdialog.cpp", diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index d90c3ab0c5..70c573c883 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -1530,7 +1530,7 @@ void PerforcePlugin::testLogResolving() "\n" " Comment\n" ); - PerforceEditor editor(editorParameters + 1, 0); + PerforceEditor editor(editorParameters, 0); editor.testLogResolving(data, "12345", "12344"); } #endif diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 431b65f94e..30d44ce554 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -615,10 +615,17 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi bool MiniProjectTargetSelector::event(QEvent *event) { - if (event->type() != QEvent::LayoutRequest) - return QWidget::event(event); - doLayout(true); - return true; + if (event->type() == QEvent::LayoutRequest) { + doLayout(true); + return true; + } else if (event->type() == QEvent::ShortcutOverride) { + if (static_cast<QKeyEvent *>(event)->key() == Qt::Key_Escape) { + event->accept(); + return true; + } + } + return QWidget::event(event); + } class IndexSorter @@ -1319,9 +1326,12 @@ void MiniProjectTargetSelector::keyPressEvent(QKeyEvent *ke) { if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter - || ke->key() == Qt::Key_Space) + || ke->key() == Qt::Key_Space + || ke->key() == Qt::Key_Escape) { hide(); - QWidget::keyPressEvent(ke); + } else { + QWidget::keyPressEvent(ke); + } } void MiniProjectTargetSelector::keyReleaseEvent(QKeyEvent *ke) @@ -1337,7 +1347,8 @@ void MiniProjectTargetSelector::keyReleaseEvent(QKeyEvent *ke) } if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter - || ke->key() == Qt::Key_Space) + || ke->key() == Qt::Key_Space + || ke->key() == Qt::Key_Escape) return; QWidget::keyReleaseEvent(ke); } diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 3b9252f26d..d7519ee6ef 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -13,7 +13,6 @@ QtcPlugin { Depends { name: "TextEditor" } Depends { name: "QtcSsh" } - Depends { name: "cpp" } cpp.defines: base.concat("QTC_CPU=X86Architecture") cpp.includePaths: base.concat([ "customwizard", diff --git a/src/plugins/qbsprojectmanager/qbsnodes.cpp b/src/plugins/qbsprojectmanager/qbsnodes.cpp index 819ed96826..0fca740baa 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodes.cpp @@ -55,8 +55,13 @@ static QString displayNameFromPath(const QString &path, const QString &base) dir.append(QLatin1Char('/')); QString name = path; - if (name.startsWith(dir)) + if (name.startsWith(dir)) { name = name.mid(dir.count()); + } else { + QFileInfo fi = QFileInfo(path); + name = QCoreApplication::translate("Qbs::QbsProjectNode", "%1 in %2") + .arg(fi.fileName(), fi.absolutePath()); + } return name; } @@ -84,8 +89,8 @@ QIcon QbsGroupNode::m_groupIcon = generateIcon(); class FileTreeNode { public: - explicit FileTreeNode(const QString &n = QString(), FileTreeNode *p = 0) : - parent(p), name(n) + explicit FileTreeNode(const QString &n = QString(), FileTreeNode *p = 0, bool f = false) : + parent(p), name(n), m_isFile(f) { if (p) p->children.append(this); @@ -96,56 +101,24 @@ public: qDeleteAll(children); } - FileTreeNode *addPart(const QString &n) + FileTreeNode *addPart(const QString &n, bool isFile) { foreach (FileTreeNode *c, children) { if (c->name == n) return c; } - return new FileTreeNode(n, this); + return new FileTreeNode(n, this, isFile); } - bool isFile() { return children.isEmpty(); } - - // Moves the node pointing to basedir to the root of the tree and deletes any now empty nodes. - static void reorder(FileTreeNode *node, const QString &basedir, FileTreeNode *root) - { - if (node != root && node->path() == basedir) { - // move node to root: - FileTreeNode *parent = node->parent; - if (parent) - parent->children.removeOne(node); - root->children.append(node); - node->parent = root; - if (basedir.startsWith(QLatin1Char('/'))) - node->name = basedir.mid(1); - else - node->name = basedir; - - // clean up now-empty nodes: - while (parent) { - if (parent->children.count() == 0) { - FileTreeNode *current = parent; - parent = current->parent; - parent->children.removeOne(current); - current->parent = 0; - delete current; - } else { - break; - } - } - return; - } - foreach (FileTreeNode *n, node->children) - reorder(n, basedir, root); - } + bool isFile() { return m_isFile; } - static void moveChildrenUp(FileTreeNode *node) + static FileTreeNode *moveChildrenUp(FileTreeNode *node) { - if (!node || !node->parent) - return; + QTC_ASSERT(node, return 0); FileTreeNode *newParent = node->parent; + if (!newParent) + return 0; // disconnect node and parent: node->parent = 0; @@ -165,6 +138,44 @@ public: // Delete node node->children.clear(); delete node; + return newParent; + } + + // Moves the children of the node pointing to basedir to the root of the tree. + static void reorder(FileTreeNode *node, const QString &basedir) + { + QTC_CHECK(!basedir.isEmpty()); + QString prefix = basedir; + if (basedir.startsWith(QLatin1Char('/'))) + prefix = basedir.mid(1); + prefix.append(QLatin1Char('/')); + + if (node->path() == basedir) { + // Find root node: + FileTreeNode *root = node; + while (root->parent) + root = root->parent; + + foreach (FileTreeNode *c, node->children) { + // Update children names by prepending basedir + c->name = prefix + c->name; + // Update parent information: + c->parent = root; + + root->children.append(c); + } + + // Clean up node: + node->children.clear(); + node->parent->children.removeOne(node); + node->parent = 0; + delete node; + + return; + } + + foreach (FileTreeNode *n, node->children) + reorder(n, basedir); } static void simplify(FileTreeNode *node) @@ -175,23 +186,15 @@ public: if (!node->parent) return; - if (node->children.count() == 1 && !node->children.at(0)->isFile()) - moveChildrenUp(node->children.at(0)); - } - - static void moveBaseFolderContents(FileTreeNode *root, const QString &baseDir) - { - // Move files/folders found in the base folder up one level. The baseDir must be a child of - // the root of the FileNodeTree. - FileTreeNode *baseDirNode = 0; - foreach (FileTreeNode *c, root->children) { - if (c->path() == baseDir) { - baseDirNode = c; - break; - } + if (node->children.isEmpty() && !node->isFile()) { + // Clean up empty folder nodes: + node->parent->children.removeOne(node); + node->parent = 0; + delete node; + } else if (node->children.count() == 1 && !node->children.at(0)->isFile()) { + // Compact folder nodes with one child only: + moveChildrenUp(node); } - - moveChildrenUp(baseDirNode); } QString path() @@ -209,6 +212,7 @@ public: QList<FileTreeNode *> children; FileTreeNode *parent; QString name; + bool m_isFile; }; // ---------------------------------------------------------------------- @@ -363,13 +367,14 @@ void QbsGroupNode::setupFiles(QbsBaseProjectNode *root, const QStringList &files QStringList pathSegments = path.split(QLatin1Char('/'), QString::SkipEmptyParts); FileTreeNode *root = &tree; - while (!pathSegments.isEmpty()) - root = root->addPart(pathSegments.takeFirst()); + while (!pathSegments.isEmpty()) { + bool isFile = pathSegments.count() == 1; + root = root->addPart(pathSegments.takeFirst(), isFile); + } } - FileTreeNode::reorder(&tree, productPath, &tree); + FileTreeNode::reorder(&tree, productPath); FileTreeNode::simplify(&tree); - FileTreeNode::moveBaseFolderContents(&tree, productPath); setupFolder(root, &tree, productPath); } diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 217467f338..f01cdd4e52 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -106,10 +106,7 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) : m_currentBc(0) { setProjectContext(Core::Context(Constants::PROJECT_ID)); - Core::Context pl(ProjectExplorer::Constants::LANG_CXX); - pl.add(ProjectExplorer::Constants::LANG_QMLJS); - setProjectLanguages(pl); - + setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX)); connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), this, SLOT(changeActiveTarget(ProjectExplorer::Target*))); diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs index 6f603c26e7..ffb14bee5c 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs +++ b/src/plugins/qbsprojectmanager/qbsprojectmanager.qbs @@ -19,7 +19,6 @@ QtcPlugin { Depends { name: "QmlJS" } Depends { name: "QmlJSTools" } - Depends { name: "cpp" } cpp.includePaths: base.concat([ qbs_source_dir + "/src", diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h b/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h index 5c29eb5c25..6d7428f1ab 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h @@ -47,7 +47,8 @@ const char QBS_EVALUATE[] = "Qbs.QbsEvaluate"; // Actions: const char ACTION_REPARSE_QBS[] = "Qbs.Reparse"; const char ACTION_REPARSE_QBS_CONTEXT[] = "Qbs.ReparseCtx"; -const char ACTION_BUILD_FILE_QBS_CONTEXT[] = "Qbs.BuildFileCtx"; +const char ACTION_BUILD_FILE_CONTEXT[] = "Qbs.BuildFileCtx"; +const char ACTION_BUILD_FILE[] = "Qbs.BuildFile"; // Ids: const char QBS_BUILDSTEP_ID[] = "Qbs.BuildStep"; diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp index 4aa2579a8c..1453d18a00 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp @@ -34,6 +34,7 @@ #include "qbscleanstep.h" #include "qbsdeployconfigurationfactory.h" #include "qbsinstallstep.h" +#include "qbsnodes.h" #include "qbsproject.h" #include "qbsprojectmanager.h" #include "qbsprojectmanagerconstants.h" @@ -41,6 +42,9 @@ #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> +#include <coreplugin/coreconstants.h> +#include <coreplugin/editormanager/editormanager.h> +#include <coreplugin/editormanager/ieditor.h> #include <coreplugin/icore.h> #include <coreplugin/fileiconprovider.h> #include <coreplugin/mimedatabase.h> @@ -48,6 +52,7 @@ #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/session.h> #include <projectexplorer/target.h> #include <qtsupport/qtsupportconstants.h> #include <utils/qtcassert.h> @@ -119,11 +124,22 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString * connect(m_reparseQbsCtx, SIGNAL(triggered()), this, SLOT(reparseCurrentProject())); m_buildFileContextMenu = new QAction(tr("Build"), this); - command = Core::ActionManager::registerAction(m_buildFileContextMenu, Constants::ACTION_BUILD_FILE_QBS_CONTEXT, projectContext); + command = Core::ActionManager::registerAction(m_buildFileContextMenu, Constants::ACTION_BUILD_FILE_CONTEXT, projectContext); command->setAttribute(Core::Command::CA_Hide); mfile->addAction(command, ProjectExplorer::Constants::G_FILE_OTHER); connect(m_buildFileContextMenu, SIGNAL(triggered()), this, SLOT(buildFileContextMenu())); + const Core::Context globalcontext(Core::Constants::C_GLOBAL); + m_buildFile = new Utils::ParameterAction(tr("Build File"), tr("Build File \"%1\""), + Utils::ParameterAction::AlwaysEnabled, this); + command = Core::ActionManager::registerAction(m_buildFile, Constants::ACTION_BUILD_FILE, globalcontext); + command->setAttribute(Core::Command::CA_Hide); + command->setAttribute(Core::Command::CA_UpdateText); + command->setDescription(m_buildFile->text()); + command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B"))); + mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); + connect(m_buildFile, SIGNAL(triggered()), this, SLOT(buildFile())); + // Connect connect(m_projectExplorer, SIGNAL(currentNodeChanged(ProjectExplorer::Node*,ProjectExplorer::Project*)), this, SLOT(updateContextActions(ProjectExplorer::Node*,ProjectExplorer::Project*))); @@ -131,9 +147,13 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString * connect(m_projectExplorer->buildManager(), SIGNAL(buildStateChanged(ProjectExplorer::Project*)), this, SLOT(buildStateChanged(ProjectExplorer::Project*))); + connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), + this, SLOT(updateBuildFileAction())); + // Run initial setup routines updateContextActions(0, 0); updateReparseQbsAction(); + updateBuildFileAction(); return true; } @@ -180,6 +200,30 @@ void QbsProjectManagerPlugin::updateReparseQbsAction() && !m_currentProject->isParsing()); } +void QbsProjectManagerPlugin::updateBuildFileAction() +{ + bool visible = false; + bool enabled = false; + + QString file; + if (Core::IEditor *currentEditor = Core::EditorManager::currentEditor()) { + file = currentEditor->document()->fileName(); + ProjectExplorer::SessionManager *session = m_projectExplorer->session(); + ProjectExplorer::Node *node = session->nodeForFile(file); + ProjectExplorer::Project *project + = qobject_cast<QbsProject *>(session->projectForFile(file)); + + m_buildFile->setParameter(QFileInfo(file).fileName()); + visible = project && node && qobject_cast<QbsBaseProjectNode *>(node->projectNode()); + + enabled = !m_projectExplorer->buildManager()->isBuilding(project) + && m_currentProject && !m_currentProject->isParsing(); + } + + m_buildFile->setEnabled(enabled); + m_buildFile->setVisible(visible); +} + void QbsProjectManagerPlugin::activeTargetChanged() { if (m_currentTarget) @@ -200,6 +244,7 @@ void QbsProjectManagerPlugin::buildStateChanged(ProjectExplorer::Project *projec if (project == m_currentProject) { updateReparseQbsAction(); updateContextActions(m_currentNode, m_currentProject); + updateBuildFileAction(); } } @@ -213,13 +258,33 @@ void QbsProjectManagerPlugin::parsingStateChanged() void QbsProjectManagerPlugin::buildFileContextMenu() { - // <debug> - qDebug() << "Build file..."; - // </debug> QTC_ASSERT(m_currentNode, return); QTC_ASSERT(m_currentProject, return); - ProjectExplorer::Target *t = m_currentProject->activeTarget(); + buildFiles(m_currentProject, QStringList(m_currentNode->path())); +} + +void QbsProjectManagerPlugin::buildFile() +{ + QString file; + QbsProject *project = 0; + if (Core::IEditor *currentEditor = Core::EditorManager::currentEditor()) { + file = currentEditor->document()->fileName(); + project = qobject_cast<QbsProject *>(m_projectExplorer->session()->projectForFile(file)); + } + + if (!project || file.isEmpty()) + return; + + buildFiles(project, QStringList(file)); +} + +void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList &files) +{ + QTC_ASSERT(project, return); + QTC_ASSERT(!files.isEmpty(), return); + + ProjectExplorer::Target *t = project->activeTarget(); if (!t) return; QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration()); @@ -227,11 +292,10 @@ void QbsProjectManagerPlugin::buildFileContextMenu() return; ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance(); - if (!pe->saveModifiedFiles()) return; - bc->setChangedFiles(QStringList(m_currentNode->path())); + bc->setChangedFiles(files); const Core::Id buildStep = Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD); diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.h b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.h index 967826ec83..27317940a3 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.h +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.h @@ -31,6 +31,7 @@ #define QBSPROJECTMANAGERPLUGIN_H #include <extensionsystem/iplugin.h> +#include <utils/parameteraction.h> #include <QObject> @@ -67,20 +68,25 @@ public: private slots: void updateContextActions(ProjectExplorer::Node *node, ProjectExplorer::Project *project); void updateReparseQbsAction(); + void updateBuildFileAction(); void activeTargetChanged(); void buildStateChanged(ProjectExplorer::Project *project); void parsingStateChanged(); void buildFileContextMenu(); + void buildFile(); void reparseCurrentProject(); private: + void buildFiles(QbsProject *project, const QStringList &files); + QbsManager *m_manager; ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer; QAction *m_reparseQbs; QAction *m_reparseQbsCtx; QAction *m_buildFileContextMenu; + Utils::ParameterAction *m_buildFile; Internal::QbsProject *m_currentProject; ProjectExplorer::Target *m_currentTarget; diff --git a/src/plugins/qmldesigner/qmldesigner.qbs b/src/plugins/qmldesigner/qmldesigner.qbs index 21000dade9..f24e75bd3d 100644 --- a/src/plugins/qmldesigner/qmldesigner.qbs +++ b/src/plugins/qmldesigner/qmldesigner.qbs @@ -19,7 +19,6 @@ QtcPlugin { Depends { name: "LanguageUtils" } Depends { name: "QtSupport" } - Depends { name: "cpp" } cpp.defines: base.concat(["QWEAKPOINTER_ENABLE_ARROW"]) cpp.includePaths: base.concat([ "designercore", diff --git a/src/plugins/qmljseditor/qmljseditor.qbs b/src/plugins/qmljseditor/qmljseditor.qbs index 8ee2501206..32d3ef4d35 100644 --- a/src/plugins/qmljseditor/qmljseditor.qbs +++ b/src/plugins/qmljseditor/qmljseditor.qbs @@ -16,8 +16,6 @@ QtcPlugin { Depends { name: "QmlEditorWidgets" } Depends { name: "CPlusPlus" } - Depends { name: "cpp" } - files: [ "QmlJSEditor.mimetypes.xml", "jsfilewizard.cpp", diff --git a/src/plugins/qmljstools/qmljstools.qbs b/src/plugins/qmljstools/qmljstools.qbs index 3848531bd5..682dc34de1 100644 --- a/src/plugins/qmljstools/qmljstools.qbs +++ b/src/plugins/qmljstools/qmljstools.qbs @@ -17,7 +17,6 @@ QtcPlugin { Depends { name: "QmlDebug" } Depends { name: "QtSupport" } - Depends { name: "cpp" } cpp.includePaths: base.concat("../../libs/3rdparty") files: [ diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index 7567289cc7..cb136bf4d8 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.qbs +++ b/src/plugins/qmlprofiler/qmlprofiler.qbs @@ -20,7 +20,6 @@ QtcPlugin { Depends { name: "QmlJSTools" } Depends { name: "CPlusPlus" } - Depends { name: "cpp" } cpp.includePaths: base.concat("canvas") files: [ diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index 4dd936288b..123dbca22d 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -353,9 +353,7 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) : m_activeTarget(0) { setProjectContext(Core::Context(Qt4ProjectManager::Constants::PROJECT_ID)); - Core::Context pl(ProjectExplorer::Constants::LANG_CXX); - pl.add(ProjectExplorer::Constants::LANG_QMLJS); - setProjectLanguages(pl); + setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX)); m_asyncUpdateTimer.setSingleShot(true); m_asyncUpdateTimer.setInterval(3000); @@ -637,6 +635,15 @@ void Qt4Project::updateQmlJSCodeModel() } } + // If the project directory has a pro/pri file that includes a qml or quick or declarative + // library then chances of the project being a QML project is quite high. + // This assumption fails when there are no QDeclarativeEngine/QDeclarativeView (QtQuick 1) + // or QQmlEngine/QQuickView (QtQuick 2) instances. + Core::Context pl(ProjectExplorer::Constants::LANG_CXX); + if (hasQmlLib) + pl.add(ProjectExplorer::Constants::LANG_QMLJS); + setProjectLanguages(pl); + projectInfo.importPaths.removeDuplicates(); setProjectLanguage(ProjectExplorer::Constants::LANG_QMLJS, !projectInfo.sourceFiles.isEmpty()); diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.qbs b/src/plugins/qt4projectmanager/qt4projectmanager.qbs index 27431351ee..ccf3a654fb 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.qbs +++ b/src/plugins/qt4projectmanager/qt4projectmanager.qbs @@ -16,7 +16,6 @@ QtcPlugin { Depends { name: "TextEditor" } Depends { name: "QmlJSTools" } - Depends { name: "cpp" } cpp.includePaths: base.concat([ "customwidgetwizard", "../../shared", diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp index 213a2a546d..d0c4930761 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp @@ -421,8 +421,9 @@ void Qt4ProjectManagerPlugin::updateBuildFileAction() ProjectExplorer::SessionManager *session = m_projectExplorer->session(); ProjectExplorer::Node *node = session->nodeForFile(file); ProjectExplorer::Project *project = session->projectForFile(file); - m_buildFileAction->setParameter(file); + m_buildFileAction->setParameter(QFileInfo(file).fileName()); visible = qobject_cast<Qt4Project *>(project) + && node && qobject_cast<Qt4ProFileNode *>(node->projectNode()); enabled = !m_projectExplorer->buildManager()->isBuilding(project); diff --git a/src/plugins/qtsupport/qtsupport.qbs b/src/plugins/qtsupport/qtsupport.qbs index 841c171015..37637338cf 100644 --- a/src/plugins/qtsupport/qtsupport.qbs +++ b/src/plugins/qtsupport/qtsupport.qbs @@ -11,7 +11,6 @@ QtcPlugin { Depends { name: "TextEditor" } Depends { name: "QmlJS" } - Depends { name: "cpp" } cpp.includePaths: base.concat([ "../../shared", "../../shared/proparser" diff --git a/src/plugins/resourceeditor/ResourceEditor.mimetypes.xml b/src/plugins/resourceeditor/ResourceEditor.mimetypes.xml index 82a1797028..d22052251d 100644 --- a/src/plugins/resourceeditor/ResourceEditor.mimetypes.xml +++ b/src/plugins/resourceeditor/ResourceEditor.mimetypes.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> - <mime-type type="application/vnd.nokia.xml.qt.resource"> + <mime-type type="application/vnd.qt.xml.resource"> <sub-class-of type="text/xml"/> <comment>Qt Resource file</comment> <glob pattern="*.qrc"/> diff --git a/src/plugins/resourceeditor/resourceeditor.pro b/src/plugins/resourceeditor/resourceeditor.pro index d10ddc591b..ca745af184 100644 --- a/src/plugins/resourceeditor/resourceeditor.pro +++ b/src/plugins/resourceeditor/resourceeditor.pro @@ -15,3 +15,5 @@ resourcewizard.cpp \ resourceeditorw.cpp RESOURCES += resourceeditor.qrc + +OTHER_FILES += ResourceEditor.mimetypes.xml diff --git a/src/plugins/resourceeditor/resourceeditor.qbs b/src/plugins/resourceeditor/resourceeditor.qbs index 889bd951f2..eb049c70ad 100644 --- a/src/plugins/resourceeditor/resourceeditor.qbs +++ b/src/plugins/resourceeditor/resourceeditor.qbs @@ -7,7 +7,6 @@ QtcPlugin { Depends { name: "Core" } Depends { name: "Find" } - Depends { name: "cpp" } Depends { name: "Qt"; submodules: ["widgets", "xml"] } cpp.includePaths: base.concat("qrceditor") diff --git a/src/plugins/subversion/Subversion.mimetypes.xml b/src/plugins/subversion/Subversion.mimetypes.xml index 6aa0c3eda9..a337241364 100644 --- a/src/plugins/subversion/Subversion.mimetypes.xml +++ b/src/plugins/subversion/Subversion.mimetypes.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> - <mime-type type="application/vnd.nokia.text.subversion.submit"> + <mime-type type="text/vnd.qtcreator.svn.submit"> <comment>Subversion submit template</comment> <sub-class-of type="text/plain"/> </mime-type> diff --git a/src/plugins/subversion/subversion.pro b/src/plugins/subversion/subversion.pro index 6d2d9e21c0..1f7374e487 100644 --- a/src/plugins/subversion/subversion.pro +++ b/src/plugins/subversion/subversion.pro @@ -24,3 +24,5 @@ SOURCES += annotationhighlighter.cpp \ FORMS += settingspage.ui RESOURCES += subversion.qrc + +OTHER_FILES += Subversion.mimetypes.xml diff --git a/src/plugins/subversion/subversion.qbs b/src/plugins/subversion/subversion.qbs index ed5571e47c..14face460e 100644 --- a/src/plugins/subversion/subversion.qbs +++ b/src/plugins/subversion/subversion.qbs @@ -13,6 +13,7 @@ QtcPlugin { Depends { name: "Locator" } files: [ + "Subversion.mimetypes.xml", "annotationhighlighter.cpp", "annotationhighlighter.h", "checkoutwizard.cpp", diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 5a9a82b145..047210732b 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -1417,7 +1417,7 @@ void SubversionPlugin::testDiffFileResolving_data() void SubversionPlugin::testDiffFileResolving() { - SubversionEditor editor(editorParameters + 3, 0); + SubversionEditor editor(editorParameters + 2, 0); editor.testDiffFileResolving(); } @@ -1439,7 +1439,7 @@ void SubversionPlugin::testLogResolving() " expectations, remove XFail.\n" "\n" ); - SubversionEditor editor(editorParameters + 1, 0); + SubversionEditor editor(editorParameters, 0); editor.testLogResolving(data, "r1439551", "r1439540"); } #endif diff --git a/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.cpp b/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.cpp index 1680399597..f29daa6c84 100644 --- a/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.cpp +++ b/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.cpp @@ -39,53 +39,5 @@ const QLatin1String HighlightDefinitionMetaData::kMimeType("mimetype"); const QLatin1String HighlightDefinitionMetaData::kVersion("version"); const QLatin1String HighlightDefinitionMetaData::kUrl("url"); -HighlightDefinitionMetaData::HighlightDefinitionMetaData() : m_priority(0) +HighlightDefinitionMetaData::HighlightDefinitionMetaData() : priority(0) {} - -void HighlightDefinitionMetaData::setPriority(const int priority) -{ m_priority = priority; } - -int HighlightDefinitionMetaData::priority() const -{ return m_priority; } - -void HighlightDefinitionMetaData::setId(const QString &id) -{ m_id = id; } - -const QString &HighlightDefinitionMetaData::id() const -{ return m_id; } - -void HighlightDefinitionMetaData::setName(const QString &name) -{ m_name = name; } - -const QString &HighlightDefinitionMetaData::name() const -{ return m_name; } - -void HighlightDefinitionMetaData::setVersion(const QString &version) -{ m_version = version; } - -const QString &HighlightDefinitionMetaData::version() const -{ return m_version; } - -void HighlightDefinitionMetaData::setFileName(const QString &fileName) -{ m_fileName = fileName; } - -const QString &HighlightDefinitionMetaData::fileName() const -{ return m_fileName; } - -void HighlightDefinitionMetaData::setPatterns(const QStringList &patterns) -{ m_patterns = patterns; } - -const QStringList &HighlightDefinitionMetaData::patterns() const -{ return m_patterns; } - -void HighlightDefinitionMetaData::setMimeTypes(const QStringList &mimeTypes) -{ m_mimeTypes = mimeTypes; } - -const QStringList &HighlightDefinitionMetaData::mimeTypes() const -{ return m_mimeTypes; } - -void HighlightDefinitionMetaData::setUrl(const QUrl &url) -{ m_url = url; } - -const QUrl &HighlightDefinitionMetaData::url() const -{ return m_url; } diff --git a/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h b/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h index 9e334272fa..ed2309be21 100644 --- a/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h +++ b/src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h @@ -31,7 +31,6 @@ #define HIGHLIGHTDEFINITIONMETADATA_H #include <QString> -#include <QLatin1String> #include <QStringList> #include <QUrl> @@ -43,30 +42,6 @@ class HighlightDefinitionMetaData public: HighlightDefinitionMetaData(); - void setPriority(const int priority); - int priority() const; - - void setId(const QString &id); - const QString &id() const; - - void setName(const QString &name); - const QString &name() const; - - void setVersion(const QString &version); - const QString &version() const; - - void setFileName(const QString &fileName); - const QString &fileName() const; - - void setPatterns(const QStringList &patterns); - const QStringList &patterns() const; - - void setMimeTypes(const QStringList &mimeTypes); - const QStringList &mimeTypes() const; - - void setUrl(const QUrl &url); - const QUrl &url() const; - static const QLatin1String kPriority; static const QLatin1String kName; static const QLatin1String kExtensions; @@ -74,15 +49,15 @@ public: static const QLatin1String kVersion; static const QLatin1String kUrl; -private: - int m_priority; - QString m_id; - QString m_name; - QString m_version; - QString m_fileName; - QStringList m_patterns; - QStringList m_mimeTypes; - QUrl m_url; +public: + int priority; + QString id; + QString name; + QString version; + QString fileName; + QStringList patterns; + QStringList mimeTypes; + QUrl url; }; } // namespace Internal diff --git a/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp b/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp index 6c1f3454dd..f01fcf6621 100644 --- a/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp +++ b/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp @@ -74,23 +74,23 @@ void ManageDefinitionsDialog::populateDefinitionsWidget() // Look for this definition in the current path specified by the user, not the one // stored in the settings. So the manager should not be queried for this information. QString dirVersion; - QFileInfo fi(m_path + downloadData.fileName()); + QFileInfo fi(m_path + downloadData.fileName); QFile definitionFile(fi.absoluteFilePath()); if (definitionFile.open(QIODevice::ReadOnly | QIODevice::Text)) { const QSharedPointer<HighlightDefinitionMetaData> &data = Manager::parseMetadata(fi); if (!data.isNull()) - dirVersion = data->version(); + dirVersion = data->version; } for (int j = 0; j < 3; ++j) { QTableWidgetItem *item = new QTableWidgetItem; if (j == 0) - item->setText(downloadData.name()); + item->setText(downloadData.name); else if (j == 1) { item->setText(dirVersion); item->setTextAlignment(Qt::AlignCenter); } else if (j == 2) { - item->setText(downloadData.version()); + item->setText(downloadData.version); item->setTextAlignment(Qt::AlignCenter); } ui.definitionsTable->setItem(i, j, item); @@ -110,7 +110,7 @@ void ManageDefinitionsDialog::downloadDefinitions() QList<QUrl> urls; foreach (const QModelIndex &index, ui.definitionsTable->selectionModel()->selectedRows()) - urls.append(m_definitionsMetaData.at(index.row()).url()); + urls.append(m_definitionsMetaData.at(index.row()).url); Manager::instance()->downloadDefinitions(urls, m_path); accept(); } diff --git a/src/plugins/texteditor/generichighlighter/manager.cpp b/src/plugins/texteditor/generichighlighter/manager.cpp index d60cdf39b0..167256f1e7 100644 --- a/src/plugins/texteditor/generichighlighter/manager.cpp +++ b/src/plugins/texteditor/generichighlighter/manager.cpp @@ -166,16 +166,14 @@ public: QSet<QString> m_knownSuffixes; QHash<QString, Core::MimeType> m_userModified; static const int kMaxProgress; - - struct PriorityComp - { - bool operator()(const QSharedPointer<HighlightDefinitionMetaData> &a, - const QSharedPointer<HighlightDefinitionMetaData> &b) { - return a->priority() > b->priority(); - } - }; }; +bool priorityComp(const QSharedPointer<HighlightDefinitionMetaData> &a, + const QSharedPointer<HighlightDefinitionMetaData> &b) +{ + return a->priority > b->priority; +} + const int ManagerProcessor::kMaxProgress = 200; ManagerProcessor::ManagerProcessor() @@ -228,7 +226,7 @@ void ManagerProcessor::process(QFutureInterface<QPair<Manager::RegisterData, } // Consider definitions with higher priority first. - qSort(allMetaData.begin(), allMetaData.end(), PriorityComp()); + qSort(allMetaData.begin(), allMetaData.end(), &priorityComp); foreach (const QSharedPointer<HighlightDefinitionMetaData> &metaData, allMetaData) { if (future.isCanceled()) @@ -236,12 +234,12 @@ void ManagerProcessor::process(QFutureInterface<QPair<Manager::RegisterData, if (future.progressValue() < kMaxProgress - 1) future.setProgressValue(future.progressValue() + 1); - if (data.m_idByName.contains(metaData->name())) + if (data.m_idByName.contains(metaData->name)) // Name already exists... This is a fallback item, do not consider it. continue; - const QString &id = metaData->id(); - data.m_idByName.insert(metaData->name(), id); + const QString &id = metaData->id; + data.m_idByName.insert(metaData->name, id); data.m_definitionsMetaData.insert(id, metaData); static const QStringList textPlain(QLatin1String("text/plain")); @@ -249,7 +247,7 @@ void ManagerProcessor::process(QFutureInterface<QPair<Manager::RegisterData, // A definition can specify multiple MIME types and file extensions/patterns, // but all on a single string. So associate all patterns with all MIME types. QList<Core::MimeGlobPattern> globPatterns; - foreach (const QString &type, metaData->mimeTypes()) { + foreach (const QString &type, metaData->mimeTypes) { if (data.m_idByMimeType.contains(type)) continue; @@ -260,7 +258,7 @@ void ManagerProcessor::process(QFutureInterface<QPair<Manager::RegisterData, Core::MimeType mimeType; mimeType.setType(type); mimeType.setSubClassesOf(textPlain); - mimeType.setComment(metaData->name()); + mimeType.setComment(metaData->name); // If there's a user modification for this mime type, we want to use the // modified patterns and rule-based matchers. If not, just consider what @@ -269,7 +267,7 @@ void ManagerProcessor::process(QFutureInterface<QPair<Manager::RegisterData, m_userModified.find(mimeType.type()); if (it == m_userModified.end()) { if (globPatterns.isEmpty()) { - foreach (const QString &pattern, metaData->patterns()) { + foreach (const QString &pattern, metaData->patterns) { static const QLatin1String mark("*."); if (pattern.startsWith(mark)) { const QString &suffix = pattern.right(pattern.length() - 2); @@ -360,14 +358,14 @@ QSharedPointer<HighlightDefinitionMetaData> Manager::parseMetadata(const QFileIn if (reader.readNext() == QXmlStreamReader::StartElement && reader.name() == kLanguage) { const QXmlStreamAttributes &atts = reader.attributes(); - metaData->setFileName(fileInfo.fileName()); - metaData->setId(fileInfo.absoluteFilePath()); - metaData->setName(atts.value(HighlightDefinitionMetaData::kName).toString()); - metaData->setVersion(atts.value(HighlightDefinitionMetaData::kVersion).toString()); - metaData->setPriority(atts.value(HighlightDefinitionMetaData::kPriority).toString() - .toInt()); - metaData->setPatterns(atts.value(HighlightDefinitionMetaData::kExtensions) - .toString().split(kSemiColon, QString::SkipEmptyParts)); + metaData->fileName = fileInfo.fileName(); + metaData->id = fileInfo.absoluteFilePath(); + metaData->name = atts.value(HighlightDefinitionMetaData::kName).toString(); + metaData->version = atts.value(HighlightDefinitionMetaData::kVersion).toString(); + metaData->priority = atts.value(HighlightDefinitionMetaData::kPriority).toString() + .toInt(); + metaData->patterns = atts.value(HighlightDefinitionMetaData::kExtensions) + .toString().split(kSemiColon, QString::SkipEmptyParts); QStringList mimeTypes = atts.value(HighlightDefinitionMetaData::kMimeType). toString().split(kSemiColon, QString::SkipEmptyParts); @@ -375,10 +373,10 @@ QSharedPointer<HighlightDefinitionMetaData> Manager::parseMetadata(const QFileIn // There are definitions which do not specify a MIME type, but specify file // patterns. Creating an artificial MIME type is a workaround. QString artificialType(kArtificial); - artificialType.append(metaData->name().trimmed().replace(kSpace, kDash)); + artificialType.append(metaData->name.trimmed().replace(kSpace, kDash)); mimeTypes.append(artificialType); } - metaData->setMimeTypes(mimeTypes); + metaData->mimeTypes = mimeTypes; break; } @@ -402,13 +400,13 @@ QList<HighlightDefinitionMetaData> Manager::parseAvailableDefinitionsList(QIODev const QXmlStreamAttributes &atts = reader.attributes(); HighlightDefinitionMetaData metaData; - metaData.setName(atts.value(HighlightDefinitionMetaData::kName).toString()); - metaData.setVersion(atts.value(HighlightDefinitionMetaData::kVersion).toString()); + metaData.name = atts.value(HighlightDefinitionMetaData::kName).toString(); + metaData.version = atts.value(HighlightDefinitionMetaData::kVersion).toString(); QString url(atts.value(HighlightDefinitionMetaData::kUrl).toString()); - metaData.setUrl(QUrl(url)); + metaData.url = QUrl(url); const int slash = url.lastIndexOf(kSlash); if (slash != -1) - metaData.setFileName(url.right(url.length() - slash - 1)); + metaData.fileName = url.right(url.length() - slash - 1); metaDataList.append(metaData); } diff --git a/src/plugins/updateinfo/updateinfo.qbs b/src/plugins/updateinfo/updateinfo.qbs index 2d30541084..0063247ce5 100644 --- a/src/plugins/updateinfo/updateinfo.qbs +++ b/src/plugins/updateinfo/updateinfo.qbs @@ -5,7 +5,6 @@ import "../QtcPlugin.qbs" as QtcPlugin QtcPlugin { name: "UpdateInfo" - Depends { name: "cpp" } Depends { name: "Core" } Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] } diff --git a/src/plugins/vcsbase/vcsbase.pro b/src/plugins/vcsbase/vcsbase.pro index 0cfdef3b92..ee0dc3b030 100644 --- a/src/plugins/vcsbase/vcsbase.pro +++ b/src/plugins/vcsbase/vcsbase.pro @@ -71,3 +71,4 @@ FORMS += commonsettingspage.ui \ cleandialog.ui \ submiteditorwidget.ui +OTHER_FILES += VcsBase.mimetypes.xml diff --git a/src/plugins/vcsbase/vcsbase.qbs b/src/plugins/vcsbase/vcsbase.qbs index b5265d7b8c..97e6a11b64 100644 --- a/src/plugins/vcsbase/vcsbase.qbs +++ b/src/plugins/vcsbase/vcsbase.qbs @@ -9,7 +9,6 @@ QtcPlugin { Depends { name: "TextEditor" } Depends { name: "ProjectExplorer" } Depends { name: "Find" } - Depends { name: "cpp" } Depends { name: "Qt.widgets" } Depends { name: "CppTools" } Depends { name: "CPlusPlus" } diff --git a/src/plugins/welcome/welcome.qbs b/src/plugins/welcome/welcome.qbs index a99fe82ab9..39bc5b152b 100644 --- a/src/plugins/welcome/welcome.qbs +++ b/src/plugins/welcome/welcome.qbs @@ -9,7 +9,6 @@ QtcPlugin { Depends { name: "Core" } Depends { name: "ProjectExplorer" } - Depends { name: "cpp" } cpp.includePaths: base.concat("../../shared/scriptwrapper") files: [ |