diff options
author | Eike Ziller <eike.ziller@qt.io> | 2017-10-25 16:07:21 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2017-10-25 16:07:21 +0200 |
commit | 7f626b1182cae5407fa5495b264aa3d9170aa09d (patch) | |
tree | 9a87c924c34adf333a2bd33200a31afb29af511a /src | |
parent | 81f5c1c8ec19bb58fc4cfb607e2c2f8ebf5cc6d8 (diff) | |
parent | dd6092371374212b407ff248ba1fa5ba8fde795d (diff) | |
download | qt-creator-7f626b1182cae5407fa5495b264aa3d9170aa09d.tar.gz |
Merge remote-tracking branch 'origin/4.5'
Change-Id: Iceaa4ca40b5318744bde8a76c6d3ccca08df71bb
Diffstat (limited to 'src')
96 files changed, 787 insertions, 444 deletions
diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index fd554be585..0bbd5e780b 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -274,10 +274,11 @@ enum { debugLeaks = 0 }; using namespace Utils; -using namespace ExtensionSystem::Internal; namespace ExtensionSystem { +using namespace Internal; + static Internal::PluginManagerPrivate *d = 0; static PluginManager *m_instance = 0; @@ -442,7 +443,7 @@ QString PluginManager::systemInformation() const if (response.result == SynchronousProcessResponse::Finished) result += response.allOutput() + "\n"; result += "Plugin information:\n\n"; - auto longestSpec = std::max_element(plugins().cbegin(), plugins().cend(), + auto longestSpec = std::max_element(d->pluginSpecs.cbegin(), d->pluginSpecs.cend(), [](const PluginSpec *left, const PluginSpec *right) { return left->name().size() < right->name().size(); }); diff --git a/src/libs/extensionsystem/pluginview.cpp b/src/libs/extensionsystem/pluginview.cpp index 96052579ee..ec9dd7d722 100644 --- a/src/libs/extensionsystem/pluginview.cpp +++ b/src/libs/extensionsystem/pluginview.cpp @@ -421,8 +421,9 @@ void PluginView::updatePlugins() QList<CollectionItem *> collections; - auto end = PluginManager::pluginCollections().cend(); - for (auto it = PluginManager::pluginCollections().cbegin(); it != end; ++it) { + const QHash<QString, QList<PluginSpec *>> pluginCollections = PluginManager::pluginCollections(); + const auto end = pluginCollections.cend(); + for (auto it = pluginCollections.cbegin(); it != end; ++it) { const QString name = it.key().isEmpty() ? tr("Utilities") : it.key(); collections.append(new CollectionItem(name, it.value(), this)); } diff --git a/src/libs/modelinglib/qmt/controller/namecontroller.cpp b/src/libs/modelinglib/qmt/controller/namecontroller.cpp index c2c23c772a..25ebbc171f 100644 --- a/src/libs/modelinglib/qmt/controller/namecontroller.cpp +++ b/src/libs/modelinglib/qmt/controller/namecontroller.cpp @@ -136,10 +136,10 @@ QStringList NameController::buildElementsPath(const QString &filePath, bool igno QList<QString> relativeElements; QStringList split = filePath.split("/"); - QStringList::const_iterator splitEnd = split.end(); + QStringList::const_iterator splitEnd = split.constEnd(); if (ignoreLastFilePathPart || split.last().isEmpty()) splitEnd = --splitEnd; - for (auto it = split.cbegin(); it != splitEnd; ++it) { + for (auto it = split.constBegin(); it != splitEnd; ++it) { QString packageName = qmt::NameController::convertFileNameToElementName(*it); relativeElements.append(packageName); } diff --git a/src/libs/modelinglib/qtserialization/src/savingrefmap.cpp b/src/libs/modelinglib/qtserialization/src/savingrefmap.cpp index d3edaca11f..b6157d99dd 100644 --- a/src/libs/modelinglib/qtserialization/src/savingrefmap.cpp +++ b/src/libs/modelinglib/qtserialization/src/savingrefmap.cpp @@ -40,13 +40,13 @@ int SavingRefMap::countDanglingReferences() bool SavingRefMap::hasRef(const void *address, const char *typeName) { - return m_references.find(KeyType(address, typeName)) != m_references.end(); + return m_references.constFind(KeyType(address, typeName)) != m_references.constEnd(); } bool SavingRefMap::hasDefinedRef(const void *address, const char *typeName) { - MapType::const_iterator it = m_references.find(KeyType(address, typeName)); - if (it == m_references.end()) + const MapType::const_iterator it = m_references.constFind(KeyType(address, typeName)); + if (it == m_references.constEnd()) return false; return it.value().second; } diff --git a/src/libs/utils/fileinprojectfinder.cpp b/src/libs/utils/fileinprojectfinder.cpp index 5729b03b8e..80024b4fb1 100644 --- a/src/libs/utils/fileinprojectfinder.cpp +++ b/src/libs/utils/fileinprojectfinder.cpp @@ -232,7 +232,8 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const // check if absolute path is found in sysroot if (!m_sysroot.isEmpty()) { const QString sysrootPath = m_sysroot + originalPath; - if (QFileInfo(sysrootPath).exists() && QFileInfo(sysrootPath).isFile()) { + QFileInfo sysrootInfo(sysrootPath); + if (sysrootInfo.exists() && sysrootInfo.isFile()) { if (success) *success = true; m_cache.insert(originalPath, sysrootPath); diff --git a/src/libs/utils/json.cpp b/src/libs/utils/json.cpp index ae97e1fd52..6eb46b60dc 100644 --- a/src/libs/utils/json.cpp +++ b/src/libs/utils/json.cpp @@ -258,13 +258,14 @@ void JsonSchema::enterNestedTypeSchema() QStringList JsonSchema::properties(JsonObjectValue *v) const { - typedef QHash<QString, JsonValue *>::ConstIterator MemberConstIterator; + using Members = QHash<QString, JsonValue *>; QStringList all; if (JsonObjectValue *ov = getObjectValue(kProperties(), v)) { - const MemberConstIterator cend = ov->members().constEnd(); - for (MemberConstIterator it = ov->members().constBegin(); it != cend; ++it) + const Members members = ov->members(); + const Members::ConstIterator cend = members.constEnd(); + for (Members::ConstIterator it = members.constBegin(); it != cend; ++it) if (hasPropertySchema(it.key())) all.append(it.key()); } diff --git a/src/libs/utils/savefile.h b/src/libs/utils/savefile.h index 0be71967fd..3313574a39 100644 --- a/src/libs/utils/savefile.h +++ b/src/libs/utils/savefile.h @@ -33,6 +33,8 @@ namespace Utils { class QTCREATOR_UTILS_EXPORT SaveFile : public QTemporaryFile { + Q_OBJECT + public: explicit SaveFile(const QString &filename); virtual ~SaveFile(); diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index e3dab7ad7b..a8b88e4627 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -67,7 +67,10 @@ const char BuildTargetSdkKey[] = "BuildTargetSdk"; const char VerboseOutputKey[] = "VerboseOutput"; const char UseMinistroKey[] = "UseMinistro"; -class PasswordInputDialog : public QDialog { +class PasswordInputDialog : public QDialog +{ + Q_OBJECT + public: enum Context{ KeystorePassword = 1, @@ -433,3 +436,5 @@ QString PasswordInputDialog::getPassword(Context context, std::function<bool (co } } // namespace Android + +#include "androidbuildapkstep.moc" diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index 65e767b8d5..f866668856 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -107,6 +107,7 @@ IDevice::Ptr AndroidDevice::clone() const QUrl AndroidDevice::toolControlChannel(const ControlChannelHint &) const { QUrl url; + url.setScheme(urlTcpScheme()); url.setHost("localhost"); return url; } diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp index dd3895f507..f71e22d5cb 100644 --- a/src/plugins/android/androidsdkmanager.cpp +++ b/src/plugins/android/androidsdkmanager.cpp @@ -180,8 +180,8 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar output.success = false; output.stdOutput = response.stdOut(); output.stdError = QCoreApplication::translate("Android::Internal::AndroidSdkManager", - "Operation requires user interaction." - "Please use \"sdkmanager\" commandline tool"); + "The operation requires user interaction. " + "Use the \"sdkmanager\" command-line tool."); } else { output.success = response.result == SynchronousProcessResponse::Finished; } diff --git a/src/plugins/android/androidsdkmanagerwidget.cpp b/src/plugins/android/androidsdkmanagerwidget.cpp index 11877efdfe..665d7dfdd2 100644 --- a/src/plugins/android/androidsdkmanagerwidget.cpp +++ b/src/plugins/android/androidsdkmanagerwidget.cpp @@ -52,21 +52,6 @@ namespace Internal { using namespace std::placeholders; -class OptionsDialog : public QDialog -{ -public: - OptionsDialog(AndroidSdkManager *sdkManager, const QStringList &args, - QWidget *parent = nullptr); - ~OptionsDialog(); - - QStringList sdkManagerArguments() const; - -private: - QPlainTextEdit *argumentDetailsEdit; - QLineEdit *argumentsEdit; - QFuture<QString> m_optionsFuture; -}; - class PackageFilterModel : public QSortFilterProxyModel { public: @@ -269,7 +254,7 @@ void AndroidSdkManagerWidget::onNativeSdkManager() QProcess::startDetached(m_androidConfig.androidToolPath().toString()); } else { QMessageBox::warning(this, tr("Native SDK Manager Not Available"), - tr("SDK manager UI tool is not available in the installed SDK tools" + tr("SDK manager UI tool is not available in the installed SDK tools " "(version %1). Use the command line tool \"sdkmanager\" for " "advanced SDK management.") .arg(m_androidConfig.sdkToolsVersion().toString())); diff --git a/src/plugins/android/androidsdkmanagerwidget.h b/src/plugins/android/androidsdkmanagerwidget.h index 29b2ec064e..0d6a930ac1 100644 --- a/src/plugins/android/androidsdkmanagerwidget.h +++ b/src/plugins/android/androidsdkmanagerwidget.h @@ -27,8 +27,14 @@ #include "androidconfigurations.h" #include "androidsdkmanager.h" -#include <QWidget> +#include <QDialog> #include <QFutureWatcher> +#include <QWidget> + +QT_BEGIN_NAMESPACE +class QLineEdit; +class QPlainTextEdit; +QT_END_NAMESPACE namespace Utils { class OutputFormatter; } @@ -42,6 +48,23 @@ namespace Ui { class AndroidSdkModel; +class OptionsDialog : public QDialog +{ + Q_OBJECT + +public: + OptionsDialog(AndroidSdkManager *sdkManager, const QStringList &args, + QWidget *parent = nullptr); + ~OptionsDialog(); + + QStringList sdkManagerArguments() const; + +private: + QPlainTextEdit *argumentDetailsEdit; + QLineEdit *argumentsEdit; + QFuture<QString> m_optionsFuture; +}; + class AndroidSdkManagerWidget : public QWidget { Q_OBJECT diff --git a/src/plugins/autotest/qtest/qttestsettingspage.ui b/src/plugins/autotest/qtest/qttestsettingspage.ui index 4991107a02..849bd2ae8b 100644 --- a/src/plugins/autotest/qtest/qttestsettingspage.ui +++ b/src/plugins/autotest/qtest/qttestsettingspage.ui @@ -34,9 +34,9 @@ <item> <widget class="QCheckBox" name="useXMLOutputCB"> <property name="toolTip"> - <string>XML output recommended as it avoids parsing issues, while plain text is more human readable. + <string>XML output is recommended, because it avoids parsing issues, while plain text is more human readable. -Warning: Plain text output is missing some information (e.g. duration)</string> +Warning: Plain text misses some information, such as duration.</string> </property> <property name="text"> <string>Use XML output</string> diff --git a/src/plugins/autotest/testresultdelegate.cpp b/src/plugins/autotest/testresultdelegate.cpp index c6401343b1..6840394831 100644 --- a/src/plugins/autotest/testresultdelegate.cpp +++ b/src/plugins/autotest/testresultdelegate.cpp @@ -33,6 +33,7 @@ #include <QAbstractItemView> #include <QPainter> #include <QTextLayout> +#include <QWindow> namespace Autotest { namespace Internal { @@ -57,20 +58,20 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op painter->save(); QFontMetrics fm(opt.font); + QBrush background; QColor foreground; const QAbstractItemView *view = qobject_cast<const QAbstractItemView *>(opt.widget); const bool selected = opt.state & QStyle::State_Selected; if (selected) { - painter->setBrush(opt.palette.highlight().color()); + background = opt.palette.highlight().color(); foreground = opt.palette.highlightedText().color(); } else { - painter->setBrush(opt.palette.window().color()); + background = opt.palette.window().color(); foreground = opt.palette.text().color(); } - painter->setPen(Qt::NoPen); - painter->drawRect(opt.rect); + painter->fillRect(opt.rect, background); painter->setPen(foreground); TestResultFilterModel *resultFilterModel = static_cast<TestResultFilterModel *>(view->model()); @@ -78,10 +79,13 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op const TestResult *testResult = resultFilterModel->testResult(index); QTC_ASSERT(testResult, painter->restore();return); + const QWidget *widget = dynamic_cast<const QWidget*>(painter->device()); + QWindow *window = widget ? widget->window()->windowHandle() : nullptr; + QIcon icon = index.data(Qt::DecorationRole).value<QIcon>(); if (!icon.isNull()) painter->drawPixmap(positions.left(), positions.top(), - icon.pixmap(positions.iconSize(), positions.iconSize())); + icon.pixmap(window, QSize(positions.iconSize(), positions.iconSize()))); QString typeStr = TestResult::resultToString(testResult->result()); if (selected) { @@ -130,9 +134,10 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op painter->drawText(positions.lineAreaLeft(), positions.top() + fm.ascent(), line); } - painter->setClipRect(opt.rect); + painter->setClipping(false); painter->setPen(opt.palette.mid().color()); - painter->drawLine(0, opt.rect.bottom(), opt.rect.right(), opt.rect.bottom()); + const QRectF adjustedRect(QRectF(opt.rect).adjusted(0.5, 0.5, -0.5, -0.5)); + painter->drawLine(adjustedRect.bottomLeft(), adjustedRect.bottomRight()); painter->restore(); } diff --git a/src/plugins/autotest/testtreemodel.cpp b/src/plugins/autotest/testtreemodel.cpp index cd27377b07..8e11a1b45c 100644 --- a/src/plugins/autotest/testtreemodel.cpp +++ b/src/plugins/autotest/testtreemodel.cpp @@ -278,8 +278,12 @@ void TestTreeModel::handleParseResult(const TestParseResult *result, TestTreeIte void TestTreeModel::removeAllTestItems() { - for (Utils::TreeItem *item : *rootItem()) + for (Utils::TreeItem *item : *rootItem()) { item->removeChildren(); + TestTreeItem *testTreeItem = static_cast<TestTreeItem *>(item); + if (testTreeItem->checked() == Qt::PartiallyChecked) + testTreeItem->setChecked(Qt::Checked); + } emit testTreeModelChanged(); } diff --git a/src/plugins/clangpchmanager/clangpchmanager.qbs b/src/plugins/clangpchmanager/clangpchmanager.qbs new file mode 100644 index 0000000000..b8ade5b6ce --- /dev/null +++ b/src/plugins/clangpchmanager/clangpchmanager.qbs @@ -0,0 +1,48 @@ +import qbs +import qbs.FileInfo + +QtcPlugin { + name: "ClangPchManager" + + Depends { name: "libclang"; required: false } + condition: libclang.present && libclang.toolingEnabled + + Depends { name: "ClangSupport" } + Depends { name: "Utils" } + + Depends { name: "Core" } + Depends { name: "CppTools" } + Depends { name: "ProjectExplorer" } + + cpp.defines: { + var defines = base; + defines.push("CLANGPCHMANAGER_LIB"); + + // The following defines are used to determine the clang include path for intrinsics. + defines.push('CLANG_VERSION="' + libclang.llvmVersion + '"'); + var resourceDir = FileInfo.joinPaths(libclang.llvmLibDir, "clang", libclang.llvmVersion, + "include"); + defines.push('CLANG_RESOURCE_DIR="' + resourceDir + '"'); + return defines; + } + + cpp.includePaths: ["."] + + files: [ + "clangpchmanagerplugin.cpp", + "clangpchmanagerplugin.h", + "clangpchmanager_global.h", + "pchmanagerclient.cpp", + "pchmanagerclient.h", + "pchmanagernotifierinterface.cpp", + "pchmanagernotifierinterface.h", + "pchmanagerconnectionclient.cpp", + "pchmanagerconnectionclient.h", + "pchmanagerprojectupdater.cpp", + "pchmanagerprojectupdater.h", + "projectupdater.cpp", + "projectupdater.h", + "qtcreatorprojectupdater.cpp", + "qtcreatorprojectupdater.h", + ] +} diff --git a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.h b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.h index a92c994f0d..c8558e5286 100644 --- a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.h +++ b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.h @@ -50,6 +50,8 @@ class SearchInterface; class ClangQueryProjectsFindFilter : public Core::IFindFilter { + Q_OBJECT + public: ClangQueryProjectsFindFilter(ClangBackEnd::RefactoringServerInterface &server, SearchInterface &searchInterface, diff --git a/src/plugins/clangrefactoring/clangrefactoring.qbs b/src/plugins/clangrefactoring/clangrefactoring.qbs new file mode 100644 index 0000000000..15c2ada59e --- /dev/null +++ b/src/plugins/clangrefactoring/clangrefactoring.qbs @@ -0,0 +1,80 @@ +import qbs +import qbs.FileInfo + +QtcPlugin { + name: "ClangRefactoring" + + Depends { name: "libclang"; required: false } + condition: libclang.present && libclang.toolingEnabled + + Depends { name: "ClangSupport" } + Depends { name: "Utils" } + + Depends { name: "ClangPchManager" } + Depends { name: "Core" } + Depends { name: "CppTools" } + Depends { name: "ProjectExplorer" } + Depends { name: "TextEditor" } + + cpp.defines: { + var defines = base; + defines.push("CLANGPCHMANAGER_LIB"); + + // The following defines are used to determine the clang include path for intrinsics. + defines.push('CLANG_VERSION="' + libclang.llvmVersion + '"'); + var resourceDir = FileInfo.joinPaths(libclang.llvmLibDir, "clang", libclang.llvmVersion, + "include"); + defines.push('CLANG_RESOURCE_DIR="' + resourceDir + '"'); + return defines; + } + + cpp.includePaths: ["."] + + files: [ + "baseclangquerytexteditorwidget.cpp", + "baseclangquerytexteditorwidget.h", + "clangqueryexamplehighlighter.cpp", + "clangqueryexamplehighlighter.h", + "clangqueryexamplehighlightmarker.h", + "clangqueryexampletexteditorwidget.cpp", + "clangqueryexampletexteditorwidget.h", + "clangqueryhighlighter.cpp", + "clangqueryhighlighter.h", + "clangqueryhighlightmarker.h", + "clangqueryhoverhandler.cpp", + "clangqueryhoverhandler.h", + "clangqueryprojectsfindfilter.cpp", + "clangqueryprojectsfindfilter.h", + "clangqueryprojectsfindfilter.ui", + "clangqueryprojectsfindfilterwidget.cpp", + "clangqueryprojectsfindfilterwidget.h", + "clangquerytexteditorwidget.cpp", + "clangquerytexteditorwidget.h", + "clangrefactoringplugin.cpp", + "clangrefactoringplugin.h", + "projectpartutilities.cpp", + "projectpartutilities.h", + "qtcreatorclangqueryfindfilter.cpp", + "qtcreatorclangqueryfindfilter.h", + "qtcreatorsearch.cpp", + "qtcreatorsearch.h", + "qtcreatorsearchhandle.cpp", + "qtcreatorsearchhandle.h", + "querysqlitestatementfactory.h", + "refactoringclient.cpp", + "refactoringclient.h", + "refactoringconnectionclient.cpp", + "refactoringconnectionclient.h", + "refactoringengine.cpp", + "refactoringengine.h", + "refactoringprojectupdater.cpp", + "refactoringprojectupdater.h", + "searchhandle.cpp", + "searchhandle.h", + "searchinterface.cpp", + "searchinterface.h", + "sourcelocations.h", + "symbolquery.cpp", + "symbolquery.h", + ] +} diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp b/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp index 1f5785f86b..35af013f2b 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp @@ -222,7 +222,7 @@ void ClangStaticAnalyzerTool::updateRunActions() bool canRun = target && project->projectLanguages().contains(cxx) && ToolChainKitInformation::toolChain(target->kit(), cxx); if (!canRun) - toolTip = tr("This is not C++ project"); + toolTip = tr("This is not a C++ project."); m_startAction->setToolTip(toolTip); m_startAction->setEnabled(canRun); diff --git a/src/plugins/classview/classviewmanager.cpp b/src/plugins/classview/classviewmanager.cpp index 5034deb477..2b3b839cda 100644 --- a/src/plugins/classview/classviewmanager.cpp +++ b/src/plugins/classview/classviewmanager.cpp @@ -457,13 +457,13 @@ void Manager::gotoLocations(const QList<QVariant> &list) int column; textEditor->convertPosition(textEditor->position(), &line, &column); SymbolLocation current(fileName, line, column); - QSet<SymbolLocation>::const_iterator it = locations.find(current); + QSet<SymbolLocation>::const_iterator it = locations.constFind(current); QSet<SymbolLocation>::const_iterator end = locations.constEnd(); if (it != end) { // we already are at the symbol, cycle to next location ++it; if (it == end) - it = locations.begin(); + it = locations.constBegin(); loc = *it; } } diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.cpp b/src/plugins/cmakeprojectmanager/builddirmanager.cpp index a8b5e0b56a..6af10c3553 100644 --- a/src/plugins/cmakeprojectmanager/builddirmanager.cpp +++ b/src/plugins/cmakeprojectmanager/builddirmanager.cpp @@ -66,6 +66,7 @@ Utils::FileName BuildDirManager::workDirectory(const BuildDirParameters ¶met const Utils::FileName bdir = parameters.buildDirectory; const CMakeTool *cmake = parameters.cmakeTool; if (bdir.exists()) { + m_buildDirToTempDir.erase(bdir); return bdir; } else { if (cmake && cmake->autoCreateBuildDirectory()) { @@ -74,14 +75,19 @@ Utils::FileName BuildDirManager::workDirectory(const BuildDirParameters ¶met return bdir; } } - if (!m_tempDir) { - m_tempDir.reset(new Utils::TemporaryDirectory("qtc-cmake-XXXXXXXX")); - if (!m_tempDir->isValid()) { + auto tmpDirIt = m_buildDirToTempDir.find(bdir); + if (tmpDirIt == m_buildDirToTempDir.end()) { + auto ret = m_buildDirToTempDir.emplace(std::make_pair(bdir, std::make_unique<Utils::TemporaryDirectory>("qtc-cmake-XXXXXXXX"))); + QTC_ASSERT(ret.second, return bdir); + tmpDirIt = ret.first; + + if (!tmpDirIt->second->isValid()) { emitErrorOccured(tr("Failed to create temporary directory \"%1\".") - .arg(QDir::toNativeSeparators(m_tempDir->path()))); + .arg(QDir::toNativeSeparators(tmpDirIt->second->path()))); + return bdir; } } - return Utils::FileName::fromString(m_tempDir->path()); + return Utils::FileName::fromString(tmpDirIt->second->path()); } void BuildDirManager::emitDataAvailable() @@ -198,14 +204,20 @@ void BuildDirManager::setParametersAndRequestParse(const BuildDirParameters &par BuildDirReader *old = m_reader.get(); m_parameters = parameters; - m_parameters.buildDirectory = workDirectory(parameters); + m_parameters.workDirectory = workDirectory(parameters); updateReaderType(m_parameters, [this, old, newReaderReparseOptions, existingReaderReparseOptions]() { - if (old != m_reader.get()) - emit requestReparse(newReaderReparseOptions); - else - emit requestReparse(existingReaderReparseOptions); + int options = REPARSE_DEFAULT; + if (old != m_reader.get()) { + options = newReaderReparseOptions; + } else { + if (!QFileInfo::exists(m_parameters.workDirectory.toString() + "/CMakeCache.txt")) + options = newReaderReparseOptions; + else + options = existingReaderReparseOptions; + } + emit requestReparse(options); }); } @@ -239,16 +251,17 @@ bool BuildDirManager::persistCMakeState() { QTC_ASSERT(m_parameters.isValid(), return false); - if (!m_tempDir) + if (m_parameters.workDirectory == m_parameters.buildDirectory) return false; const Utils::FileName buildDir = m_parameters.buildDirectory; QDir dir(buildDir.toString()); dir.mkpath(buildDir.toString()); - m_tempDir.reset(nullptr); - - emit requestReparse(REPARSE_URGENT | REPARSE_FORCE_CONFIGURATION | REPARSE_CHECK_CONFIGURATION); + BuildDirParameters newParameters = m_parameters; + newParameters.workDirectory.clear(); + setParametersAndRequestParse(newParameters, REPARSE_URGENT | REPARSE_FORCE_CONFIGURATION | REPARSE_CHECK_CONFIGURATION, + REPARSE_FAIL); return true; } @@ -291,8 +304,8 @@ void BuildDirManager::clearCache() QTC_ASSERT(m_parameters.isValid(), return); QTC_ASSERT(!m_isHandlingError, return); - auto cmakeCache = workDirectory(m_parameters).appendPath("CMakeCache.txt"); - auto cmakeFiles = workDirectory(m_parameters).appendPath("CMakeFiles"); + auto cmakeCache = m_parameters.workDirectory.appendPath("CMakeCache.txt"); + auto cmakeFiles = m_parameters.workDirectory.appendPath("CMakeFiles"); const bool mustCleanUp = cmakeCache.exists() || cmakeFiles.exists(); if (!mustCleanUp) @@ -367,7 +380,7 @@ bool BuildDirManager::checkConfiguration() { QTC_ASSERT(m_parameters.isValid(), return false); - if (m_tempDir) // always throw away changes in the tmpdir! + if (m_parameters.workDirectory != m_parameters.buildDirectory) // always throw away changes in the tmpdir! return false; const CMakeConfig cache = m_parameters.buildConfiguration->configurationFromCMake(); @@ -375,41 +388,40 @@ bool BuildDirManager::checkConfiguration() return false; // No cache file yet. CMakeConfig newConfig; - QSet<QString> changedKeys; - QSet<QString> removedKeys; - foreach (const CMakeConfigItem &iBc, m_parameters.configuration) { - const CMakeConfigItem &iCache - = Utils::findOrDefault(cache, [&iBc](const CMakeConfigItem &i) { return i.key == iBc.key; }); - if (iCache.isNull()) { - removedKeys << QString::fromUtf8(iBc.key); - } else if (QString::fromUtf8(iCache.value) != iBc.expandedValue(m_parameters.expander)) { - changedKeys << QString::fromUtf8(iBc.key); - newConfig.append(iCache); + QHash<QString, QPair<QString, QString>> changedKeys; + foreach (const CMakeConfigItem &projectItem, m_parameters.configuration) { + const QString projectKey = QString::fromUtf8(projectItem.key); + const QString projectValue = projectItem.expandedValue(m_parameters.expander); + const CMakeConfigItem &cmakeItem + = Utils::findOrDefault(cache, [&projectItem](const CMakeConfigItem &i) { return i.key == projectItem.key; }); + const QString iCacheValue = QString::fromUtf8(cmakeItem.value); + if (cmakeItem.isNull()) { + changedKeys.insert(projectKey, qMakePair(tr("<removed>"), projectValue)); + } else if (iCacheValue != projectValue) { + changedKeys.insert(projectKey, qMakePair(iCacheValue, projectValue)); + newConfig.append(cmakeItem); } else { - newConfig.append(iBc); + newConfig.append(projectItem); } } - if (!changedKeys.isEmpty() || !removedKeys.isEmpty()) { - QSet<QString> total = removedKeys + changedKeys; - QStringList keyList = total.toList(); + if (!changedKeys.isEmpty()) { + QStringList keyList = changedKeys.keys(); Utils::sort(keyList); - QString table = QLatin1String("<table>"); + QString table = QString::fromLatin1("<table><tr><th>%1</th><th>%2</th><th>%3</th></tr>") + .arg(tr("Key")).arg(tr("CMake")).arg(tr("Project")); foreach (const QString &k, keyList) { - QString change; - if (removedKeys.contains(k)) - change = tr("<removed>"); - else - change = QString::fromUtf8(CMakeConfigItem::valueOf(k.toUtf8(), cache)).trimmed(); - if (change.isEmpty()) - change = tr("<empty>"); - table += QString::fromLatin1("\n<tr><td>%1</td><td>%2</td></tr>").arg(k).arg(change.toHtmlEscaped()); + const QPair<QString, QString> data = changedKeys.value(k); + table += QString::fromLatin1("\n<tr><td>%1</td><td>%2</td><td>%3</td></tr>") + .arg(k) + .arg(data.first.toHtmlEscaped()) + .arg(data.second.toHtmlEscaped()); } table += QLatin1String("\n</table>"); QPointer<QMessageBox> box = new QMessageBox(Core::ICore::mainWindow()); box->setText(tr("CMake configuration has changed on disk.")); - box->setInformativeText(tr("The CMakeCache.txt file has changed: %1").arg(table)); + box->setInformativeText(table); auto *defaultButton = box->addButton(tr("Overwrite Changes in CMake"), QMessageBox::RejectRole); auto *applyButton = box->addButton(tr("Apply Changes to Project"), QMessageBox::ApplyRole); box->setDefaultButton(defaultButton); diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.h b/src/plugins/cmakeprojectmanager/builddirmanager.h index e1762fc461..d703aed5ad 100644 --- a/src/plugins/cmakeprojectmanager/builddirmanager.h +++ b/src/plugins/cmakeprojectmanager/builddirmanager.h @@ -40,6 +40,7 @@ #include <functional> #include <memory> +#include <unordered_map> namespace ProjectExplorer { class FileNode; } @@ -112,7 +113,7 @@ private: void becameDirty(); BuildDirParameters m_parameters; - mutable std::unique_ptr<Utils::TemporaryDirectory> m_tempDir = nullptr; + mutable std::unordered_map<Utils::FileName, std::unique_ptr<Utils::TemporaryDirectory>> m_buildDirToTempDir; mutable std::unique_ptr<BuildDirReader> m_reader; mutable bool m_isHandlingError = false; }; diff --git a/src/plugins/cmakeprojectmanager/builddirparameters.h b/src/plugins/cmakeprojectmanager/builddirparameters.h index 08056085ee..1c26b45ffe 100644 --- a/src/plugins/cmakeprojectmanager/builddirparameters.h +++ b/src/plugins/cmakeprojectmanager/builddirparameters.h @@ -52,6 +52,7 @@ public: Utils::FileName sourceDirectory; Utils::FileName buildDirectory; + Utils::FileName workDirectory; // either buildDirectory or a QTemporaryDirectory! Utils::Environment environment; CMakeTool *cmakeTool = nullptr; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index df488bca32..be257a21fb 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -97,7 +97,7 @@ private: bool isParsing() const; - enum ForceEnabledChanged : quint8 { False, True }; + enum ForceEnabledChanged { False, True }; void clearError(ForceEnabledChanged fec = ForceEnabledChanged::False); void setBuildTargets(const QList<CMakeBuildTarget> &targets); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp index 0abe72fd7d..8f93c26e66 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp @@ -177,7 +177,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) m_configView->setUniformRowHeights(true); m_configView->setSortingEnabled(true); m_configView->sortByColumn(0, Qt::AscendingOrder); - auto stretcher = new Utils::HeaderViewStretcher(m_configView->header(), 1); + auto stretcher = new Utils::HeaderViewStretcher(m_configView->header(), 0); m_configView->setSelectionMode(QAbstractItemView::SingleSelection); m_configView->setSelectionBehavior(QAbstractItemView::SelectItems); m_configView->setFrameShape(QFrame::NoFrame); @@ -286,7 +286,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) connect(m_resetButton, &QPushButton::clicked, m_configModel, &ConfigModel::resetAllChanges); connect(m_reconfigureButton, &QPushButton::clicked, this, [this]() { - m_buildConfiguration->setConfigurationForCMake(m_configModel->configurationChanges()); + m_buildConfiguration->setConfigurationForCMake(m_configModel->configurationForCMake()); }); connect(m_unsetButton, &QPushButton::clicked, this, [this]() { m_configModel->toggleUnsetFlag(mapToSource(m_configView, m_configView->currentIndex())); @@ -320,7 +320,12 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) connect(m_buildConfiguration->target(), &ProjectExplorer::Target::kitChanged, this, &CMakeBuildSettingsWidget::updateFromKit); connect(m_buildConfiguration, &CMakeBuildConfiguration::enabledChanged, - this, [this]() { setError(m_buildConfiguration->disabledReason()); }); + this, [this]() { + setError(m_buildConfiguration->disabledReason()); + setConfigurationForCMake(); + }); + connect(m_buildConfiguration, &CMakeBuildConfiguration::configurationForCMakeChanged, + this, [this]() { setConfigurationForCMake(); }); updateSelection(QModelIndex(), QModelIndex()); } @@ -381,7 +386,19 @@ void CMakeBuildSettingsWidget::updateFromKit() for (const CMakeConfigItem &i : config) configHash.insert(QString::fromUtf8(i.key), i.expandedValue(k)); - m_configModel->setKitConfiguration(configHash); + m_configModel->setConfigurationFromKit(configHash); +} + +void CMakeBuildSettingsWidget::setConfigurationForCMake() +{ + QHash<QString, QString> config; + const CMakeConfig configList = m_buildConfiguration->configurationForCMake(); + for (const CMakeConfigItem &i : configList) { + config.insert(QString::fromUtf8(i.key), + CMakeConfigItem::expandedValueOf(m_buildConfiguration->target()->kit(), + i.key, configList)); + } + m_configModel->setConfigurationForCMake(config); } void CMakeBuildSettingsWidget::updateSelection(const QModelIndex ¤t, const QModelIndex &previous) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.h b/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.h index 6d422dfe1e..b205d20f77 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.h @@ -65,6 +65,7 @@ private: void updateAdvancedCheckBox(); void updateFromKit(); + void setConfigurationForCMake(); void updateSelection(const QModelIndex ¤t, const QModelIndex &previous); QAction *createForceAction(int type, const QModelIndex &idx); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 616eb61e03..7b3ff357b5 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -300,7 +300,7 @@ void CMakeBuildStep::handleProjectWasParsed(QFutureInterface<bool> &fi, bool suc if (success) { runImpl(fi); } else { - AbstractProcessStep::stdError(tr("Project did not parse successfully, can not build.")); + AbstractProcessStep::stdError(tr("Project did not parse successfully, cannot build.")); reportRunResult(fi, false); } } diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 24f1ad9428..e733202608 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -160,11 +160,11 @@ CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEM return; // Build configuration has switched: - // * Error out if the reader updates, can not happen since all BCs share a target/kit. + // * Check configuration if reader changes due to it not existing yet:-) // * run cmake without configuration arguments if the reader stays m_buildDirManager.setParametersAndRequestParse( BuildDirParameters(bc), - BuildDirManager::REPARSE_FAIL, + BuildDirManager::REPARSE_CHECK_CONFIGURATION, BuildDirManager::REPARSE_CHECK_CONFIGURATION); }); diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h index a7eafb30cc..a747504740 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.h +++ b/src/plugins/cmakeprojectmanager/cmakeproject.h @@ -26,11 +26,11 @@ #pragma once #include "cmake_global.h" + #include "builddirmanager.h" #include "cmakebuildtarget.h" #include "cmakeprojectimporter.h" #include "treescanner.h" -#include "builddirmanager.h" #include <projectexplorer/extracompiler.h> #include <projectexplorer/projectmacro.h> diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp index ae7afdd393..1b94ffc7e9 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp @@ -49,7 +49,7 @@ QByteArray CMakeInputsNode::generateId(const Utils::FileName &inputFile) bool CMakeInputsNode::showInSimpleTree() const { - return false; + return true; } CMakeListsNode::CMakeListsNode(const Utils::FileName &cmakeListPath) : diff --git a/src/plugins/cmakeprojectmanager/configmodel.cpp b/src/plugins/cmakeprojectmanager/configmodel.cpp index c31e1edb11..dbd654a103 100644 --- a/src/plugins/cmakeprojectmanager/configmodel.cpp +++ b/src/plugins/cmakeprojectmanager/configmodel.cpp @@ -94,13 +94,30 @@ void ConfigModel::setConfiguration(const QList<DataItem> &config) setConfiguration(Utils::transform(config, [](const DataItem &di) { return InternalDataItem(di); })); } -void ConfigModel::setKitConfiguration(const QHash<QString, QString> &kitConfig) +void ConfigModel::setConfigurationFromKit(const QHash<QString, QString> &kitConfig) { m_kitConfiguration = kitConfig; for (InternalDataItem &i : m_configuration) { - if (m_kitConfiguration.contains(i.key)) { + if (m_kitConfiguration.contains(i.key)) i.kitValue = m_kitConfiguration.value(i.key); + } + setConfiguration(m_configuration); +} + +void ConfigModel::setConfigurationForCMake(const QHash<QString, QString> &config) +{ + for (InternalDataItem &i : m_configuration) { + if (!config.contains(i.key)) + continue; + + const QString v = config.value(i.key); + if (i.value == v) { + i.newValue.clear(); + i.isUserChanged = false; + } else { + i.newValue = v; + i.isUserChanged = true; } } setConfiguration(m_configuration); @@ -202,7 +219,7 @@ ConfigModel::DataItem ConfigModel::dataItemFromIndex(const QModelIndex &idx) return DataItem(); } -QList<ConfigModel::DataItem> ConfigModel::configurationChanges() const +QList<ConfigModel::DataItem> ConfigModel::configurationForCMake() const { const QList<InternalDataItem> tmp = Utils::filtered(m_configuration, [](const InternalDataItem &i) { @@ -362,7 +379,7 @@ QString ConfigModel::InternalDataItem::toolTip() const tooltip << QCoreApplication::translate("CMakeProjectManager", "Not in CMakeCache.txt").arg(value); } if (!kitValue.isEmpty()) - tooltip << QCoreApplication::translate("CMakeProjectManager::ConfigModel", "Current Kit: %1").arg(kitValue); + tooltip << QCoreApplication::translate("CMakeProjectManager::ConfigModel", "Current kit: %1").arg(kitValue); return tooltip.join("<br>"); } @@ -511,7 +528,7 @@ QString ConfigModelTreeItem::toolTip() const QTC_ASSERT(dataItem, return QString()); QStringList tooltip(dataItem->description); if (!dataItem->kitValue.isEmpty()) - tooltip << QCoreApplication::translate("CMakeProjectManager", "Value requested by Kit: %1").arg(dataItem->kitValue); + tooltip << QCoreApplication::translate("CMakeProjectManager", "Value requested by kit: %1").arg(dataItem->kitValue); if (dataItem->inCMakeCache) { if (dataItem->value != dataItem->newValue) tooltip << QCoreApplication::translate("CMakeProjectManager", "Current CMake: %1").arg(dataItem->value); diff --git a/src/plugins/cmakeprojectmanager/configmodel.h b/src/plugins/cmakeprojectmanager/configmodel.h index fbe9b1b090..26f64d10a8 100644 --- a/src/plugins/cmakeprojectmanager/configmodel.h +++ b/src/plugins/cmakeprojectmanager/configmodel.h @@ -70,7 +70,8 @@ public: const QStringList &values = QStringList()); void setConfiguration(const CMakeConfig &config); void setConfiguration(const QList<DataItem> &config); - void setKitConfiguration(const QHash<QString, QString> &kitConfig); + void setConfigurationFromKit(const QHash<QString, QString> &kitConfig); + void setConfigurationForCMake(const QHash<QString, QString> &config); void flush(); void resetAllChanges(); @@ -84,7 +85,7 @@ public: static DataItem dataItemFromIndex(const QModelIndex &idx); - QList<DataItem> configurationChanges() const; + QList<DataItem> configurationForCMake() const; private: diff --git a/src/plugins/cmakeprojectmanager/servermodereader.cpp b/src/plugins/cmakeprojectmanager/servermodereader.cpp index 74a9f43bd3..a35b5a01e9 100644 --- a/src/plugins/cmakeprojectmanager/servermodereader.cpp +++ b/src/plugins/cmakeprojectmanager/servermodereader.cpp @@ -104,7 +104,7 @@ void ServerModeReader::setParameters(const BuildDirParameters &p) BuildDirReader::setParameters(p); if (!m_cmakeServer) { m_cmakeServer.reset(new ServerMode(p.environment, - p.sourceDirectory, p.buildDirectory, + p.sourceDirectory, p.workDirectory, p.cmakeTool->cmakeExecutable(), p.generator, p.extraGenerator, p.platform, p.toolset, true, 1)); @@ -155,7 +155,7 @@ bool ServerModeReader::isCompatible(const BuildDirParameters &p) && p.platform == m_parameters.platform && p.toolset == m_parameters.toolset && p.sourceDirectory == m_parameters.sourceDirectory - && p.buildDirectory == m_parameters.buildDirectory; + && p.workDirectory == m_parameters.workDirectory; } void ServerModeReader::resetData() diff --git a/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp b/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp index 6f022a621b..2cce88ec24 100644 --- a/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp +++ b/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp @@ -184,7 +184,7 @@ QModelIndex ExternalToolModel::index(int row, int column, const QModelIndex &par if (row < items.count()) return createIndex(row, 0, items.at(row)); } - } else if (column == 0 && row < m_tools.keys().count()) { + } else if (column == 0 && row < m_tools.size()) { return createIndex(row, 0); } return QModelIndex(); @@ -208,7 +208,7 @@ QModelIndex ExternalToolModel::parent(const QModelIndex &child) const int ExternalToolModel::rowCount(const QModelIndex &parent) const { if (!parent.isValid()) - return m_tools.keys().count(); + return m_tools.size(); if (toolForIndex(parent)) return 0; bool found; diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index 43b6cb212f..8cc8b81246 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -534,7 +534,9 @@ QList<IDocument *> DocumentManager::modifiedDocuments() { QList<IDocument *> modified; - foreach (IDocument *document, d->m_documentsWithWatch.keys()) { + const auto docEnd = d->m_documentsWithWatch.keyEnd(); + for (auto docIt = d->m_documentsWithWatch.keyBegin(); docIt != docEnd; ++docIt) { + IDocument *document = *docIt; if (document->isModified()) modified << document; } diff --git a/src/plugins/coreplugin/find/findtoolwindow.cpp b/src/plugins/coreplugin/find/findtoolwindow.cpp index 05704437eb..4a2e2a2a89 100644 --- a/src/plugins/coreplugin/find/findtoolwindow.cpp +++ b/src/plugins/coreplugin/find/findtoolwindow.cpp @@ -47,7 +47,7 @@ static bool validateRegExp(Utils::FancyLineEdit *edit, QString *errorMessage) { if (edit->text().isEmpty()) { if (errorMessage) - *errorMessage = FindToolWindow::tr("Empty search term"); + *errorMessage = FindToolWindow::tr("Empty search term."); return false; } if (Find::hasFindFlag(FindRegularExpression)) { diff --git a/src/plugins/coreplugin/find/highlightscrollbar.cpp b/src/plugins/coreplugin/find/highlightscrollbar.cpp index 3c6f8b1204..03be40b693 100644 --- a/src/plugins/coreplugin/find/highlightscrollbar.cpp +++ b/src/plugins/coreplugin/find/highlightscrollbar.cpp @@ -293,10 +293,11 @@ void HighlightScrollBarOverlay::paintEvent(QPaintEvent *paintEvent) QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing, false); - foreach (Utils::Theme::Color themeColor, highlights.keys()) { - const QColor &color = creatorTheme()->color(themeColor); - for (int i = 0, total = highlights[themeColor].size(); i < total; ++i) { - const QRect rect = highlights[themeColor][i]; + const auto highlightEnd = highlights.cend(); + for (auto highlightIt = highlights.cbegin(); highlightIt != highlightEnd; ++highlightIt) { + const QColor &color = creatorTheme()->color(highlightIt.key()); + for (int i = 0, total = highlightIt.value().size(); i < total; ++i) { + const QRect rect = highlightIt.value().at(i); painter.fillRect(rect, color); } } diff --git a/src/plugins/coreplugin/locator/basefilefilter.cpp b/src/plugins/coreplugin/locator/basefilefilter.cpp index 26db4474cc..31b23a916f 100644 --- a/src/plugins/coreplugin/locator/basefilefilter.cpp +++ b/src/plugins/coreplugin/locator/basefilefilter.cpp @@ -100,7 +100,7 @@ QList<LocatorFilterEntry> BaseFileFilter::matchesFor(QFutureInterface<LocatorFil const QString entry = QDir::fromNativeSeparators(origEntry); const EditorManager::FilePathInfo fp = EditorManager::splitLineAndColumnNumber(entry); - const QRegularExpression regexp = createRegExp(entry); + const QRegularExpression regexp = createRegExp(fp.filePath); if (!regexp.isValid()) { d->m_current.clear(); // free memory return betterEntries; diff --git a/src/plugins/coreplugin/locator/opendocumentsfilter.cpp b/src/plugins/coreplugin/locator/opendocumentsfilter.cpp index 8a7c6718f8..aacf80e88a 100644 --- a/src/plugins/coreplugin/locator/opendocumentsfilter.cpp +++ b/src/plugins/coreplugin/locator/opendocumentsfilter.cpp @@ -61,7 +61,7 @@ QList<LocatorFilterEntry> OpenDocumentsFilter::matchesFor(QFutureInterface<Locat QList<LocatorFilterEntry> betterEntries; const EditorManager::FilePathInfo fp = EditorManager::splitLineAndColumnNumber(entry); - const QRegularExpression regexp = createRegExp(entry); + const QRegularExpression regexp = createRegExp(fp.filePath); if (!regexp.isValid()) return goodEntries; diff --git a/src/plugins/cpaster/authenticationdialog.h b/src/plugins/cpaster/authenticationdialog.h index f52dbaef24..abab5b515e 100644 --- a/src/plugins/cpaster/authenticationdialog.h +++ b/src/plugins/cpaster/authenticationdialog.h @@ -35,6 +35,8 @@ namespace CodePaster { class AuthenticationDialog : public QDialog { + Q_OBJECT + public: AuthenticationDialog(const QString &details, QWidget *parent = nullptr); diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index dd64cab848..38d5a759f3 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -880,7 +880,10 @@ void CdbEngine::doInterruptInferior(SpecialStopMode sm) showMessage(QString("Interrupting process %1...").arg(inferiorPid()), LogMisc); QTC_ASSERT(!m_signalOperation, notifyInferiorStopFailed(); return;); - m_signalOperation = runTool()->device()->signalOperation(); + if (DebuggerRunTool *rt = runTool()) { + if (IDevice::ConstPtr device = rt->device()) + m_signalOperation = device->signalOperation(); + } m_specialStopMode = sm; QTC_ASSERT(m_signalOperation, notifyInferiorStopFailed(); return;); connect(m_signalOperation.data(), &DeviceProcessSignalOperation::finished, diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index fc19bdd51b..2a5f56048f 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -220,13 +220,10 @@ public: m_stackHandler(engine), m_threadsHandler(engine), m_watchHandler(engine), - m_disassemblerAgent(engine), - m_isStateDebugging(false) + m_disassemblerAgent(engine) { connect(&m_locationTimer, &QTimer::timeout, this, &DebuggerEnginePrivate::resetLocation); - connect(action(IntelFlavor), &Utils::SavedAction::valueChanged, - this, &DebuggerEnginePrivate::reloadDisassembly); } void doSetupEngine(); @@ -234,11 +231,6 @@ public: void doShutdownEngine(); void doShutdownInferior(); - void reloadDisassembly() - { - m_disassemblerAgent.reload(); - } - void doFinishDebugger() { QTC_ASSERT(state() == EngineShutdownOk @@ -246,10 +238,18 @@ public: m_engine->setState(DebuggerFinished); resetLocation(); if (isMasterEngine()) { - m_engine->showMessage("NOTE: FINISH DEBUGGER"); - QTC_ASSERT(state() == DebuggerFinished, qDebug() << m_engine << state()); - if (isMasterEngine() && m_runTool) - m_runTool->debuggingFinished(); + if (m_runTool) { + m_progress.setProgressValue(1000); + m_progress.reportFinished(); + m_modulesHandler.removeAll(); + m_stackHandler.removeAll(); + m_threadsHandler.removeAll(); + m_watchHandler.cleanup(); + Internal::runControlFinished(m_runTool); + m_runTool->reportStopped(); + m_runTool->appendMessage(tr("Debugging has finished"), NormalMessageFormat); + m_runTool.clear(); + } } } @@ -302,8 +302,6 @@ public: QScopedPointer<LocationMark> m_locationMark; QTimer m_locationTimer; - bool m_isStateDebugging = false; - Utils::FileInProjectFinder m_fileFinder; QString m_qtNamespace; @@ -556,29 +554,6 @@ void DebuggerEngine::gotoLocation(const Location &loc) d->m_locationMark.reset(new LocationMark(this, file, line)); } -// Called from RunControl. -void DebuggerEngine::handleStartFailed() -{ - showMessage("HANDLE RUNCONTROL START FAILED"); - d->m_runTool.clear(); - d->m_progress.setProgressValue(900); - d->m_progress.reportCanceled(); - d->m_progress.reportFinished(); -} - -// Called from RunControl. -void DebuggerEngine::handleFinished() -{ - showMessage("HANDLE RUNCONTROL FINISHED"); - d->m_runTool.clear(); - d->m_progress.setProgressValue(1000); - d->m_progress.reportFinished(); - modulesHandler()->removeAll(); - stackHandler()->removeAll(); - threadsHandler()->removeAll(); - watchHandler()->cleanup(); -} - const DebuggerRunParameters &DebuggerEngine::runParameters() const { return runTool()->runParameters(); @@ -679,8 +654,14 @@ void DebuggerEngine::notifyEngineSetupFailed() showMessage("NOTE: ENGINE SETUP FAILED"); QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state()); setState(EngineSetupFailed); - if (isMasterEngine() && runTool()) - runTool()->startFailed(); + if (isMasterEngine() && runTool()) { + showMessage(tr("Debugging has failed"), NormalMessageFormat); + d->m_runTool.clear(); + d->m_progress.setProgressValue(900); + d->m_progress.reportCanceled(); + d->m_progress.reportFinished(); + } + setState(DebuggerFinished); } @@ -1052,8 +1033,6 @@ static inline QString msgStateChanged(DebuggerState oldState, DebuggerState newS void DebuggerEngine::setState(DebuggerState state, bool forced) { const QString msg = msgStateChanged(d->m_state, state, forced, isMasterEngine()); - if (isStateDebugging()) - qDebug("%s", qPrintable(msg)); DebuggerState oldState = d->m_state; d->m_state = state; @@ -1651,16 +1630,6 @@ void DebuggerEngine::openDisassemblerView(const Location &location) agent->setLocation(location); } -bool DebuggerEngine::isStateDebugging() const -{ - return d->m_isStateDebugging; -} - -void DebuggerEngine::setStateDebugging(bool on) -{ - d->m_isStateDebugging = on; -} - void DebuggerRunParameters::validateExecutable() { const bool warnOnRelease = boolSetting(WarnOnReleaseBuilds); diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 41bcd8a2fa..1dc3b9bfea 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -337,8 +337,6 @@ public: virtual QAbstractItemModel *sourceFilesModel() const; void progressPing(); - void handleFinished(); - void handleStartFailed(); bool debuggerActionsEnabled() const; static bool debuggerActionsEnabled(DebuggerState state); @@ -467,9 +465,6 @@ protected: bool showStoppedBySignalMessageBox(const QString meaning, QString name); void showStoppedByExceptionMessageBox(const QString &description); - bool isStateDebugging() const; - void setStateDebugging(bool on); - virtual void setupSlaveEngine(); virtual void runSlaveEngine(); virtual void shutdownSlaveEngine(); diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index c0b5d5e15c..766ae442c5 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -203,7 +203,7 @@ public: QPersistentModelIndex m_currentIndex; }; -template <class Predicate> +template <typename Predicate> void forAllDebuggers(const Predicate &pred) { d->m_model->forItemsAtLevel<2>([pred](DebuggerTreeItem *titem) { @@ -211,7 +211,7 @@ void forAllDebuggers(const Predicate &pred) }); } -template <class Predicate> +template <typename Predicate> const DebuggerItem *findDebugger(const Predicate &pred) { DebuggerTreeItem *titem = d->m_model->findItemAtLevel<2>([pred](DebuggerTreeItem *titem) { @@ -625,31 +625,6 @@ void DebuggerOptionsPage::finish() d->m_model->cancel(); } -} // namespace Internal - -// -------------------------------------------------------------------------- -// DebuggerItemManager -// -------------------------------------------------------------------------- - -DebuggerItemManager::DebuggerItemManager() -{ - new DebuggerItemManagerPrivate; - connect(ICore::instance(), &ICore::saveSettingsRequested, - this, [] { d->saveDebuggers(); }); -} - -DebuggerItemManager::~DebuggerItemManager() -{ - delete d; -} - -QList<DebuggerItem> DebuggerItemManager::debuggers() -{ - QList<DebuggerItem> result; - forAllDebuggers([&result](const DebuggerItem &item) { result.append(item); }); - return result; -} - void DebuggerItemManagerPrivate::autoDetectCdbDebuggers() { FileNameList cdbs; @@ -827,42 +802,6 @@ void DebuggerItemManagerPrivate::readLegacyDebuggers(const FileName &file) } } -const DebuggerItem *DebuggerItemManager::findByCommand(const FileName &command) -{ - return findDebugger([command](const DebuggerItem &item) { - return item.command() == command; - }); -} - -const DebuggerItem *DebuggerItemManager::findById(const QVariant &id) -{ - return findDebugger([id](const DebuggerItem &item) { - return item.id() == id; - }); -} - -const DebuggerItem *DebuggerItemManager::findByEngineType(DebuggerEngineType engineType) -{ - return findDebugger([engineType](const DebuggerItem &item) { - return item.engineType() == engineType; - }); -} - -QVariant DebuggerItemManager::registerDebugger(const DebuggerItem &item) -{ - return d->registerDebugger(item); -} - -void DebuggerItemManager::deregisterDebugger(const QVariant &id) -{ - d->m_model->forItemsAtLevel<2>([id](DebuggerTreeItem *titem) { - if (titem->m_item.id() == id) - d->m_model->destroyItem(titem); - }); -} - -namespace Internal { - static FileName userSettingsFileName() { QFileInfo settingsLocation(ICore::settings()->fileName()); @@ -1001,4 +940,62 @@ void DebuggerItemManagerPrivate::saveDebuggers() } } // namespace Internal + +// -------------------------------------------------------------------------- +// DebuggerItemManager +// -------------------------------------------------------------------------- + +DebuggerItemManager::DebuggerItemManager() +{ + new DebuggerItemManagerPrivate; + connect(ICore::instance(), &ICore::saveSettingsRequested, + this, [] { d->saveDebuggers(); }); +} + +DebuggerItemManager::~DebuggerItemManager() +{ + delete d; +} + +QList<DebuggerItem> DebuggerItemManager::debuggers() +{ + QList<DebuggerItem> result; + forAllDebuggers([&result](const DebuggerItem &item) { result.append(item); }); + return result; +} + +const DebuggerItem *DebuggerItemManager::findByCommand(const FileName &command) +{ + return findDebugger([command](const DebuggerItem &item) { + return item.command() == command; + }); +} + +const DebuggerItem *DebuggerItemManager::findById(const QVariant &id) +{ + return findDebugger([id](const DebuggerItem &item) { + return item.id() == id; + }); +} + +const DebuggerItem *DebuggerItemManager::findByEngineType(DebuggerEngineType engineType) +{ + return findDebugger([engineType](const DebuggerItem &item) { + return item.engineType() == engineType; + }); +} + +QVariant DebuggerItemManager::registerDebugger(const DebuggerItem &item) +{ + return d->registerDebugger(item); +} + +void DebuggerItemManager::deregisterDebugger(const QVariant &id) +{ + d->m_model->forItemsAtLevel<2>([id](DebuggerTreeItem *titem) { + if (titem->m_item.id() == id) + d->m_model->destroyItem(titem); + }); +} + } // namespace Debugger diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index e5b8d8fdbe..11d37635e2 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1987,15 +1987,11 @@ public: { IDevice::ConstPtr device = DeviceKitInformation::device(kit); setDisplayName("AttachToRunningProcess"); + setUsePortsGatherer(true, false); + portsGatherer()->setDevice(device); - portsGatherer = new GdbServerPortsGatherer(runControl); - portsGatherer->setUseGdbServer(true); - portsGatherer->setUseQmlServer(false); - portsGatherer->setDevice(device); - - auto gdbServer = new GdbServerRunner(runControl, portsGatherer); + auto gdbServer = new GdbServerRunner(runControl, portsGatherer()); gdbServer->setUseMulti(false); - gdbServer->addStartDependency(portsGatherer); gdbServer->setDevice(device); gdbServer->setAttachPid(ProcessHandle(pid)); @@ -2008,14 +2004,6 @@ public: setUseContinueInsteadOfRun(true); setContinueAfterAttach(false); } - - void start() final - { - setRemoteChannel(portsGatherer->gdbServerChannel()); - DebuggerRunTool::start(); - } - - GdbServerPortsGatherer *portsGatherer; }; void DebuggerPluginPrivate::attachToRunningApplication() @@ -2945,8 +2933,6 @@ void DebuggerPluginPrivate::runControlStarted(DebuggerRunTool *runTool) void DebuggerPluginPrivate::runControlFinished(DebuggerRunTool *runTool) { - if (runTool && runTool->engine()) - runTool->engine()->handleFinished(); showStatusMessage(tr("Debugger finished.")); m_snapshotHandler->removeSnapshot(runTool); if (m_snapshotHandler->size() == 0) { diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 4b93b87cf4..34e1cbd931 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -88,6 +88,8 @@ DebuggerEngine *createLldbEngine(); class LocalProcessRunner : public RunWorker { + Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::LocalProcessRunner) + public: LocalProcessRunner(RunControl *runControl, const StandardRunnable &runnable) : RunWorker(runControl), m_runnable(runnable) @@ -244,6 +246,8 @@ class DebuggerRunToolPrivate public: QPointer<TerminalRunner> terminalRunner; QPointer<CoreUnpacker> coreUnpacker; + QPointer<GdbServerPortsGatherer> portsGatherer; + bool addQmlServerInferiorCommandLineArgumentIfNeeded = false; }; } // namespace Internal @@ -470,14 +474,7 @@ void DebuggerRunTool::prependInferiorCommandLineArgument(const QString &arg) void DebuggerRunTool::addQmlServerInferiorCommandLineArgumentIfNeeded() { - if (isQmlDebugging() && isCppDebugging()) { - using namespace QmlDebug; - int qmlServerPort = m_runParameters.qmlServer.port(); - QTC_ASSERT(qmlServerPort > 0, reportFailure(); return); - QString mode = QString("port:%1").arg(qmlServerPort); - QString qmlServerArg = qmlDebugCommandLineArguments(QmlDebuggerServices, mode, true); - prependInferiorCommandLineArgument(qmlServerArg); - } + d->addQmlServerInferiorCommandLineArgumentIfNeeded = true; } void DebuggerRunTool::setCrashParameter(const QString &event) @@ -502,6 +499,21 @@ void DebuggerRunTool::start() TaskHub::clearTasks(Debugger::Constants::TASK_CATEGORY_DEBUGGER_DEBUGINFO); TaskHub::clearTasks(Debugger::Constants::TASK_CATEGORY_DEBUGGER_RUNTIME); + if (d->portsGatherer) { + setRemoteChannel(d->portsGatherer->gdbServerChannel()); + setQmlServer(d->portsGatherer->qmlServer()); + if (d->addQmlServerInferiorCommandLineArgumentIfNeeded + && m_runParameters.isQmlDebugging + && m_runParameters.isCppDebugging) { + using namespace QmlDebug; + int qmlServerPort = m_runParameters.qmlServer.port(); + QTC_ASSERT(qmlServerPort > 0, reportFailure(); return); + QString mode = QString("port:%1").arg(qmlServerPort); + QString qmlServerArg = qmlDebugCommandLineArguments(QmlDebuggerServices, mode, true); + prependInferiorCommandLineArgument(qmlServerArg); + } + } + // User canceled input dialog asking for executable when working on library project. if (m_runParameters.startMode == StartInternal && m_runParameters.inferior.executable.isEmpty() @@ -568,7 +580,7 @@ void DebuggerRunTool::start() } if (!m_engine) { - reportFailure(DebuggerPlugin::tr("Unable to create a debugging engine")); + reportFailure(DebuggerPlugin::tr("Unable to create a debugging engine.")); return; } @@ -604,12 +616,6 @@ void DebuggerRunTool::start() m_engine->start(); } -void DebuggerRunTool::startFailed() -{ - appendMessage(tr("Debugging has failed"), NormalMessageFormat); - m_engine->handleStartFailed(); -} - void DebuggerRunTool::stop() { m_isDying = true; @@ -617,13 +623,6 @@ void DebuggerRunTool::stop() m_engine->quitDebugger(); } -void DebuggerRunTool::debuggingFinished() -{ - appendMessage(tr("Debugging has finished"), NormalMessageFormat); - Internal::runControlFinished(this); - reportStopped(); -} - const DebuggerRunParameters &DebuggerRunTool::runParameters() const { return m_runParameters; @@ -644,6 +643,20 @@ int DebuggerRunTool::portsUsedByDebugger() const return isCppDebugging() + isQmlDebugging(); } +void DebuggerRunTool::setUsePortsGatherer(bool useCpp, bool useQml) +{ + QTC_ASSERT(!d->portsGatherer, reportFailure(); return); + d->portsGatherer = new GdbServerPortsGatherer(runControl()); + d->portsGatherer->setUseGdbServer(useCpp); + d->portsGatherer->setUseQmlServer(useQml); + addStartDependency(d->portsGatherer); +} + +GdbServerPortsGatherer *DebuggerRunTool::portsGatherer() const +{ + return d->portsGatherer; +} + void DebuggerRunTool::setSolibSearchPath(const QStringList &list) { m_runParameters.solibSearchPath = list; @@ -999,6 +1012,7 @@ GdbServerRunner::GdbServerRunner(RunControl *runControl, GdbServerPortsGatherer setDisplayName("GdbServerRunner"); if (runControl->runnable().is<StandardRunnable>()) m_runnable = runControl->runnable().as<StandardRunnable>(); + addStartDependency(m_portsGatherer); } GdbServerRunner::~GdbServerRunner() diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index 50d2ed4b98..422756fb48 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -39,6 +39,8 @@ class TerminalRunner; class DebuggerRunToolPrivate; } // Internal +class GdbServerPortsGatherer; + class DEBUGGER_EXPORT DebuggerRunTool : public ProjectExplorer::RunWorker { Q_OBJECT @@ -58,13 +60,10 @@ public: void start() override; void stop() override; - void startFailed(); - void notifyInferiorIll(); Q_SLOT void notifyInferiorExited(); // Called from Android. void quitDebugger(); void abortDebugger(); - void debuggingFinished(); const Internal::DebuggerRunParameters &runParameters() const; @@ -74,6 +73,9 @@ public: bool isQmlDebugging() const; int portsUsedByDebugger() const; + void setUsePortsGatherer(bool useCpp, bool useQml); + GdbServerPortsGatherer *portsGatherer() const; + void setSolibSearchPath(const QStringList &list); void addSolibSearchDir(const QString &str); diff --git a/src/plugins/debugger/disassembleragent.cpp b/src/plugins/debugger/disassembleragent.cpp index 6ed4255247..980eb949d5 100644 --- a/src/plugins/debugger/disassembleragent.cpp +++ b/src/plugins/debugger/disassembleragent.cpp @@ -44,6 +44,7 @@ #include <utils/mimetypes/mimedatabase.h> #include <utils/qtcassert.h> +#include <utils/savedaction.h> #include <QTextBlock> #include <QDir> @@ -174,7 +175,10 @@ int DisassemblerAgentPrivate::lineForAddress(quint64 address) const DisassemblerAgent::DisassemblerAgent(DebuggerEngine *engine) : d(new DisassemblerAgentPrivate(engine)) -{} +{ + connect(action(IntelFlavor), &Utils::SavedAction::valueChanged, + this, &DisassemblerAgent::reload); +} DisassemblerAgent::~DisassemblerAgent() { diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index ca46e3e217..1afc1aedd6 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4529,7 +4529,7 @@ void GdbEngine::interruptInferior2() interruptLocalInferior(runParameters().attachPID.pid()); - } else if (isRemoteEngine()) { + } else if (isRemoteEngine() || runParameters().startMode == AttachToRemoteProcess) { CHECK_STATE(InferiorStopRequested); if (usesTargetAsync()) { diff --git a/src/plugins/git/gerrit/gerritdialog.ui b/src/plugins/git/gerrit/gerritdialog.ui index 56938f0a01..597cfd8f03 100644 --- a/src/plugins/git/gerrit/gerritdialog.ui +++ b/src/plugins/git/gerrit/gerritdialog.ui @@ -88,7 +88,7 @@ <property name="minimumSize"> <size> <width>0</width> - <height>400</height> + <height>350</height> </size> </property> <property name="title"> @@ -188,7 +188,7 @@ <property name="minimumSize"> <size> <width>0</width> - <height>200</height> + <height>175</height> </size> </property> <property name="title"> diff --git a/src/plugins/git/remotedialog.cpp b/src/plugins/git/remotedialog.cpp index 6ab4d0449f..e02f62ad5f 100644 --- a/src/plugins/git/remotedialog.cpp +++ b/src/plugins/git/remotedialog.cpp @@ -74,7 +74,7 @@ public: if (m_remoteNames.contains(input)) { if (errorMessage) - *errorMessage = tr("A remote with the name \"%1\" already exists.").arg(input); + *errorMessage = RemoteDialog::tr("A remote with the name \"%1\" already exists.").arg(input); return false; } @@ -91,7 +91,7 @@ public: const GitRemote r(edit->text()); if (!r.isValid && errorMessage) - *errorMessage = tr("The URL may not be valid."); + *errorMessage = RemoteDialog::tr("The URL may not be valid."); return r.isValid; }); diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp index c6d28a3974..01f5917760 100644 --- a/src/plugins/nim/project/nimproject.cpp +++ b/src/plugins/nim/project/nimproject.cpp @@ -166,7 +166,7 @@ bool NimProject::supportsKit(Kit *k, QString *errorMessage) const } if (!tc->compilerCommand().exists()) { if (errorMessage) - *errorMessage = tr("Nim compiler does not exist"); + *errorMessage = tr("Nim compiler does not exist."); return false; } return true; diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs index 1b9bf695e1..4b15441e7e 100644 --- a/src/plugins/plugins.qbs +++ b/src/plugins/plugins.qbs @@ -13,6 +13,8 @@ Project { "bineditor/bineditor.qbs", "bookmarks/bookmarks.qbs", "clangcodemodel/clangcodemodel.qbs", + "clangpchmanager/clangpchmanager.qbs", + "clangrefactoring/clangrefactoring.qbs", "clangstaticanalyzer/clangstaticanalyzer.qbs", "classview/classview.qbs", "clearcase/clearcase.qbs", diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp index 1dcb209250..da29506325 100644 --- a/src/plugins/projectexplorer/applicationlauncher.cpp +++ b/src/plugins/projectexplorer/applicationlauncher.cpp @@ -57,9 +57,11 @@ */ using namespace Utils; -using namespace ProjectExplorer::Internal; namespace ProjectExplorer { + +using namespace Internal; + namespace Internal { enum State { Inactive, Run }; diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 875fdb29d8..074bbc5410 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -186,6 +186,7 @@ PortsGatheringMethod::Ptr DesktopDevice::portsGatheringMethod() const QUrl DesktopDevice::toolControlChannel(const ControlChannelHint &) const { QUrl url; + url.setScheme(urlTcpScheme()); url.setHost("localhost"); return url; } diff --git a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp index f7c85ce0c7..a859097738 100644 --- a/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp +++ b/src/plugins/projectexplorer/devicesupport/deviceusedportsgatherer.cpp @@ -177,6 +177,13 @@ PortsGatherer::PortsGatherer(RunControl *runControl) : RunWorker(runControl) { setDisplayName("PortGatherer"); + + connect(&m_portsGatherer, &DeviceUsedPortsGatherer::error, this, &PortsGatherer::reportFailure); + connect(&m_portsGatherer, &DeviceUsedPortsGatherer::portListReady, this, [this] { + m_portList = device()->freePorts(); + appendMessage(tr("Found %n free ports.", nullptr, m_portList.count()), NormalMessageFormat); + reportStarted(); + }); } PortsGatherer::~PortsGatherer() @@ -185,15 +192,7 @@ PortsGatherer::~PortsGatherer() void PortsGatherer::start() { - appendMessage(tr("Checking available ports...") + '\n', NormalMessageFormat); - connect(&m_portsGatherer, &DeviceUsedPortsGatherer::error, this, [this](const QString &msg) { - reportFailure(msg); - }); - connect(&m_portsGatherer, &DeviceUsedPortsGatherer::portListReady, this, [this] { - m_portList = device()->freePorts(); - appendMessage(tr("Found %n free ports.", nullptr, m_portList.count()) + '\n', NormalMessageFormat); - reportStarted(); - }); + appendMessage(tr("Checking available ports..."), NormalMessageFormat); m_portsGatherer.start(device()); } diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 4736e26e85..985a3d326e 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -414,6 +414,7 @@ void IDevice::setSshParameters(const QSsh::SshConnectionParameters &sshParameter QUrl IDevice::toolControlChannel(const ControlChannelHint &) const { QUrl url; + url.setScheme(urlTcpScheme()); url.setHost(d->sshParameters.host); return url; } diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 9e0150a58c..80e35ecbcd 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -246,7 +246,7 @@ void FolderNavigationWidget::setAutoSynchronization(bool sync) void FolderNavigationWidget::setCurrentEditor(Core::IEditor *editor) { - if (!editor) + if (!editor || editor->document()->filePath().isEmpty() || editor->document()->isTemporary()) return; const Utils::FileName filePath = editor->document()->filePath(); // switch to most fitting root @@ -303,15 +303,20 @@ void FolderNavigationWidget::openItem(const QModelIndex &index) Core::EditorManager::openEditor(path); } -void FolderNavigationWidget::openProjectsInDirectory(const QModelIndex &index) +QStringList FolderNavigationWidget::projectsInDirectory(const QModelIndex &index) const { - QTC_ASSERT(index.isValid() && m_fileSystemModel->isDir(index), return); + QTC_ASSERT(index.isValid() && m_fileSystemModel->isDir(index), return {}); const QFileInfo fi = m_fileSystemModel->fileInfo(index); if (!fi.isReadable() || !fi.isExecutable()) - return; + return {}; const QString path = m_fileSystemModel->filePath(index); // Try to find project files in directory and open those. - const QStringList projectFiles = FolderNavigationWidget::projectFilesInDirectory(path); + return FolderNavigationWidget::projectFilesInDirectory(path); +} + +void FolderNavigationWidget::openProjectsInDirectory(const QModelIndex &index) +{ + const QStringList projectFiles = projectsInDirectory(index); if (!projectFiles.isEmpty()) Core::ICore::instance()->openFiles(projectFiles); } @@ -332,6 +337,8 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev) const QString fileName = m_fileSystemModel->fileName(current); if (m_fileSystemModel->isDir(current)) { actionOpenProjects = menu.addAction(tr("Open Project in \"%1\"").arg(fileName)); + if (projectsInDirectory(current).isEmpty()) + actionOpenProjects->setEnabled(false); } else { actionOpenFile = menu.addAction(tr("Open \"%1\"").arg(fileName)); if (ProjectExplorerPlugin::isProjectFile(Utils::FileName::fromString(fileName))) diff --git a/src/plugins/projectexplorer/foldernavigationwidget.h b/src/plugins/projectexplorer/foldernavigationwidget.h index efb72828c3..2976d639cd 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.h +++ b/src/plugins/projectexplorer/foldernavigationwidget.h @@ -107,6 +107,7 @@ private: void setRootDirectory(const Utils::FileName &directory); int bestRootForFile(const Utils::FileName &filePath); void openItem(const QModelIndex &index); + QStringList projectsInDirectory(const QModelIndex &index) const; void openProjectsInDirectory(const QModelIndex &index); Utils::NavigationTreeView *m_listView = nullptr; diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 2ed1a397e2..36e46faed4 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -719,7 +719,10 @@ GccToolChain::GccToolChain(const GccToolChain &) = default; void GccToolChain::addToEnvironment(Environment &env) const { - Q_UNUSED(env); + // On Windows gcc invokes cc1plus which is in libexec directory. + // cc1plus depends on libwinpthread-1.dll which is in bin, so bin must be in the PATH. + if (HostOsInfo::isWindowsHost()) + addCommandPathToEnvironment(m_compilerCommand, env); } FileNameList GccToolChain::suggestedMkspecList() const diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 3cc3625dfa..a1557ef272 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -234,7 +234,6 @@ const char M_SESSION[] = "ProjectExplorer.Menu.Session"; const char RUNMENUCONTEXTMENU[] = "Project.RunMenu"; const char FOLDER_OPEN_LOCATIONS_CONTEXT_MENU[] = "Project.F.OpenLocation.CtxMenu"; const char PROJECT_OPEN_LOCATIONS_CONTEXT_MENU[] = "Project.P.OpenLocation.CtxMenu"; -const char SUBPROJECT_OPEN_LOCATIONS_CONTEXT_MENU[] = "Project.S.OpenLocation.CtxMenu"; } // namespace Constants @@ -693,11 +692,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er folderOpenLocationCtxMenu->menu()->setTitle(tr("Open...")); folderOpenLocationCtxMenu->setOnAllDisabledBehavior(ActionContainer::Show); - ActionContainer *subProjectOpenLocationCtxMenu = - ActionManager::createMenu(Constants::SUBPROJECT_OPEN_LOCATIONS_CONTEXT_MENU); - subProjectOpenLocationCtxMenu->menu()->setTitle(tr("Open...")); - subProjectOpenLocationCtxMenu->setOnAllDisabledBehavior(ActionContainer::Show); - ActionContainer *projectOpenLocationCtxMenu = ActionManager::createMenu(Constants::PROJECT_OPEN_LOCATIONS_CONTEXT_MENU); projectOpenLocationCtxMenu->menu()->setTitle(tr("Open...")); @@ -758,7 +752,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er msubProjectContextMenu->appendGroup(Constants::G_PROJECT_LAST); msubProjectContextMenu->appendGroup(Constants::G_PROJECT_TREE); - msubProjectContextMenu->addMenu(subProjectOpenLocationCtxMenu, Constants::G_FOLDER_LOCATIONS); connect(msubProjectContextMenu->menu(), &QMenu::aboutToShow, dd, &ProjectExplorerPluginPrivate::updateLocationSubMenus); diff --git a/src/plugins/projectexplorer/projecttree.cpp b/src/plugins/projectexplorer/projecttree.cpp index 606ad41f24..69bbeb8a07 100644 --- a/src/plugins/projectexplorer/projecttree.cpp +++ b/src/plugins/projectexplorer/projecttree.cpp @@ -71,13 +71,9 @@ ProjectTree::ProjectTree(QObject *parent) : QObject(parent) this, &ProjectTree::update); connect(SessionManager::instance(), &SessionManager::projectAdded, - this, &ProjectTree::sessionChanged); - connect(SessionManager::instance(), &SessionManager::projectAdded, - this, &ProjectTree::treeChanged); - connect(SessionManager::instance(), &SessionManager::projectRemoved, - this, &ProjectTree::sessionChanged); + this, &ProjectTree::sessionAndTreeChanged); connect(SessionManager::instance(), &SessionManager::projectRemoved, - this, &ProjectTree::treeChanged); + this, &ProjectTree::sessionAndTreeChanged); connect(SessionManager::instance(), &SessionManager::startupProjectChanged, this, &ProjectTree::sessionChanged); connect(this, &ProjectTree::subtreeChanged, this, &ProjectTree::treeChanged); @@ -262,6 +258,12 @@ void ProjectTree::emitSubtreeChanged(FolderNode *node) emit s_instance->subtreeChanged(node); } +void ProjectTree::sessionAndTreeChanged() +{ + sessionChanged(); + emit treeChanged(); +} + void ProjectTree::collapseAll() { if (m_focusForContextMenu) diff --git a/src/plugins/projectexplorer/projecttree.h b/src/plugins/projectexplorer/projecttree.h index 3d880d8355..684d4b731a 100644 --- a/src/plugins/projectexplorer/projecttree.h +++ b/src/plugins/projectexplorer/projecttree.h @@ -89,6 +89,7 @@ signals: void treeChanged(); private: + void sessionAndTreeChanged(); void sessionChanged(); void update(); void updateFromProjectTreeWidget(Internal::ProjectTreeWidget *widget); diff --git a/src/plugins/projectexplorer/projectwelcomepage.cpp b/src/plugins/projectexplorer/projectwelcomepage.cpp index 9518891ece..f1eb287048 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.cpp +++ b/src/plugins/projectexplorer/projectwelcomepage.cpp @@ -233,7 +233,10 @@ protected: class SessionDelegate : public BaseDelegate { protected: - QString entryType() override { return tr("session", "Appears in \"Open session <name>\""); } + QString entryType() override + { + return ProjectWelcomePage::tr("session", "Appears in \"Open session <name>\""); + } QRect toolTipArea(const QRect &itemRect, const QModelIndex &idx) const override { // in expanded state bottom contains 'Clone', 'Rename', etc links, where the tool tip @@ -413,7 +416,10 @@ private: class ProjectDelegate : public BaseDelegate { - QString entryType() override { return tr("project", "Appears in \"Open project <name>\""); } + QString entryType() override + { + return ProjectWelcomePage::tr("project", "Appears in \"Open project <name>\""); + } int shortcutRole() const override { return ProjectModel::ShortcutRole; } public: diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index b56f1d683e..bd7037c575 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -616,7 +616,10 @@ public: runnable = runConfiguration->runnable(); displayName = runConfiguration->displayName(); outputFormatter = runConfiguration->createOutputFormatter(); - device = DeviceKitInformation::device(runConfiguration->target()->kit()); + if (runnable.is<StandardRunnable>()) + device = runnable.as<StandardRunnable>().device; + if (!device) + device = DeviceKitInformation::device(runConfiguration->target()->kit()); project = runConfiguration->target()->project(); } else { outputFormatter = new OutputFormatter(); @@ -985,9 +988,9 @@ void RunControlPrivate::onWorkerStarted(RunWorker *worker) continueStart(); return; } - showError(tr("Unexpected run control state %1 when worker %2 started.") - .arg(stateName(state)) - .arg(worker->d->id)); + showError(RunControl::tr("Unexpected run control state %1 when worker %2 started.") + .arg(stateName(state)) + .arg(worker->d->id)); } void RunControlPrivate::onWorkerFailed(RunWorker *worker, const QString &msg) @@ -1573,14 +1576,14 @@ void RunWorkerPrivate::timerEvent(QTimerEvent *ev) if (startWatchdogCallback) startWatchdogCallback(); else - q->reportFailure(tr("Worker start timed out.")); + q->reportFailure(RunWorker::tr("Worker start timed out.")); return; } if (ev->timerId() == stopWatchdogTimerId) { if (stopWatchdogCallback) stopWatchdogCallback(); else - q->reportFailure(tr("Worker stop timed out.")); + q->reportFailure(RunWorker::tr("Worker stop timed out.")); return; } } diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index ebbf557d2a..7e73c5b0c0 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -517,6 +517,8 @@ private: class PROJECTEXPLORER_EXPORT SimpleTargetRunner : public RunWorker { + Q_OBJECT + public: explicit SimpleTargetRunner(RunControl *runControl); diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 42194c2067..0602f44e1d 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -1020,10 +1020,15 @@ bool SessionManager::loadSession(const QString &session) } // find a list of projects to close later - const QList<Project *> oldProjects = Utils::filtered(projects(), [&fileList](Project *p) { - return !fileList.contains(p->projectFilePath().toString()); + const QList<Project *> projectsToRemove = Utils::filtered(projects(), [&fileList](Project *p) { + return !fileList.contains(p->projectFilePath().toString()); + }); + const QList<Project *> openProjects = projects(); + const QStringList projectPathsToLoad = Utils::filtered(fileList, [&openProjects](const QString &path) { + return !Utils::contains(openProjects, [&path](Project *p) { + return p->projectFilePath().toString() == path; + }); }); - d->m_failedProjects.clear(); d->m_depMap.clear(); d->m_values.clear(); @@ -1055,19 +1060,19 @@ bool SessionManager::loadSession(const QString &session) if (c.isValid()) StyleHelper::setBaseColor(c); - d->m_future.setProgressRange(0, fileList.count() + 1/*initialization above*/ + 1/*editors*/); + d->m_future.setProgressRange(0, projectPathsToLoad.count() + 1/*initialization above*/ + 1/*editors*/); d->m_future.setProgressValue(1); // if one processEvents doesn't get the job done // just use two! QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); - d->restoreProjects(fileList); + d->restoreProjects(projectPathsToLoad); d->sessionLoadingProgress(); d->restoreDependencies(reader); d->restoreStartupProject(reader); - removeProjects(oldProjects); // only remove old projects now that the startup project is set! + removeProjects(projectsToRemove); // only remove old projects now that the startup project is set! d->restoreEditors(reader); @@ -1082,6 +1087,7 @@ bool SessionManager::loadSession(const QString &session) ModeManager::activateMode(modeId); ModeManager::setFocusToCurrentMode(); } else { + removeProjects(projects()); ModeManager::activateMode(Id(Core::Constants::MODE_EDIT)); ModeManager::setFocusToCurrentMode(); } diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index 2b11012b28..1b167d74f9 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -265,6 +265,8 @@ public: return m_qbsCleanStep->keepGoing(); } + bool forceProbeExecution() const { return m_qbsBuildStep && m_qbsBuildStep->forceProbes(); } + bool showCommandLines() const { return m_qbsBuildStep ? m_qbsBuildStep->showCommandLines() : false; } @@ -328,6 +330,8 @@ QString QbsBuildConfiguration::equivalentCommandLine(const BuildStep *buildStep) Utils::QtcProcess::addArg(&commandLine, QLatin1String("--dry-run")); if (stepProxy.keepGoing()) Utils::QtcProcess::addArg(&commandLine, QLatin1String("--keep-going")); + if (stepProxy.forceProbeExecution()) + Utils::QtcProcess::addArg(&commandLine, QLatin1String("--force-probe-execution")); if (stepProxy.showCommandLines()) Utils::QtcProcess::addArgs(&commandLine, QStringList({"--command-echo-mode", "command-line"})); diff --git a/src/plugins/qbsprojectmanager/qbskitinformation.h b/src/plugins/qbsprojectmanager/qbskitinformation.h index 1011ae2c3d..85febeaa2c 100644 --- a/src/plugins/qbsprojectmanager/qbskitinformation.h +++ b/src/plugins/qbsprojectmanager/qbskitinformation.h @@ -32,6 +32,8 @@ namespace Internal { class QbsKitInformation final : public ProjectExplorer::KitInformation { + Q_OBJECT + public: static QString displayName(); static QString representation(const ProjectExplorer::Kit *kit); diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanagerview.cpp b/src/plugins/qmldesigner/components/componentcore/designeractionmanagerview.cpp index bfa6b2b0d5..d11b6ca2da 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanagerview.cpp +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanagerview.cpp @@ -162,7 +162,8 @@ const DesignerActionManager &DesignerActionManagerView::designerActionManager() void DesignerActionManagerView::emitSelectionChanged() { - emit selectionChanged(!selectedModelNodes().isEmpty(), singleSelectedModelNode().isRootNode()); + if (model()) + emit selectionChanged(!selectedModelNodes().isEmpty(), singleSelectedModelNode().isRootNode()); } /* We should consider compressing this. */ diff --git a/src/plugins/qmldesigner/components/componentcore/theme.h b/src/plugins/qmldesigner/components/componentcore/theme.h index cd8cce5ffa..626f92fb9d 100644 --- a/src/plugins/qmldesigner/components/componentcore/theme.h +++ b/src/plugins/qmldesigner/components/componentcore/theme.h @@ -25,6 +25,8 @@ #pragma once +#include <qmldesignercorelib_global.h> + #include <utils/theme/theme.h> #include <QColor> @@ -36,7 +38,7 @@ QT_END_NAMESPACE namespace QmlDesigner { -class Theme : public Utils::Theme +class QMLDESIGNERCORE_EXPORT Theme : public Utils::Theme { Q_OBJECT public: diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreeview.h b/src/plugins/qmldesigner/components/navigator/navigatortreeview.h index f5d4caa5ed..1589d70248 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreeview.h +++ b/src/plugins/qmldesigner/components/navigator/navigatortreeview.h @@ -32,6 +32,8 @@ namespace QmlDesigner { class NavigatorTreeView : public QTreeView { + Q_OBJECT + public: NavigatorTreeView(QWidget *parent = 0); static void drawSelectionBackground(QPainter *painter, const QStyleOption &option); diff --git a/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp b/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp index 1062aa4a96..ad3c7c8db4 100644 --- a/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp +++ b/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp @@ -133,11 +133,9 @@ void TextEditorWidget::jumpTextCursorToSelectedModelNode() const int nodeOffset = rewriterView->nodeOffset(selectedNode); if (nodeOffset > 0) { - if (!rewriterView->nodeContainsCursor(selectedNode, m_textEditor->editorWidget()->textCursor().position())) { int line, column; m_textEditor->editorWidget()->convertPosition(nodeOffset, &line, &column); m_textEditor->editorWidget()->gotoLine(line, column); - } } } m_updateSelectionTimer.stop(); diff --git a/src/plugins/qmldesigner/designercore/include/qmltimelinemutator.h b/src/plugins/qmldesigner/designercore/include/qmltimelinemutator.h index b1baf7d7fd..345ad8402d 100644 --- a/src/plugins/qmldesigner/designercore/include/qmltimelinemutator.h +++ b/src/plugins/qmldesigner/designercore/include/qmltimelinemutator.h @@ -54,8 +54,8 @@ public: qreal currentFrame() const; qreal duration() const; - qreal minActualFrame() const; - qreal maxActualFrame() const; + qreal minActualFrame(const ModelNode &target) const; + qreal maxActualFrame(const ModelNode &target) const; QList<ModelNode> allTargets() const; QList<QmlTimelineFrames> framesForTarget(const ModelNode &target) const; diff --git a/src/plugins/qmldesigner/designercore/include/rewriterview.h b/src/plugins/qmldesigner/designercore/include/rewriterview.h index b99a9815bd..4d4cfee8e6 100644 --- a/src/plugins/qmldesigner/designercore/include/rewriterview.h +++ b/src/plugins/qmldesigner/designercore/include/rewriterview.h @@ -132,7 +132,6 @@ public: int firstDefinitionInsideLength(const ModelNode &node) const; bool modificationGroupActive(); ModelNode nodeAtTextCursorPosition(int cursorPosition) const; - bool nodeContainsCursor(const ModelNode &node, int cursorPosition) const; bool renameId(const QString& oldId, const QString& newId); diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp index 4bb7142a42..85b3a69874 100644 --- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp +++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp @@ -165,10 +165,10 @@ PuppetCreator::PuppetCreator(ProjectExplorer::Kit *kit, const Model *model) : m_kit(kit) - ,m_availablePuppetType(FallbackPuppet) - ,m_model(model) + , m_availablePuppetType(FallbackPuppet) + , m_model(model) #ifndef QMLDESIGNER_TEST - ,m_designerSettings(QmlDesignerPlugin::instance()->settings()) + , m_designerSettings(QmlDesignerPlugin::instance()->settings()) #endif , m_currentProject(project) { @@ -412,6 +412,12 @@ QProcessEnvironment PuppetCreator::processEnvironment() const Utils::Environment environment = Utils::Environment::systemEnvironment(); if (!useOnlyFallbackPuppet()) m_kit->addToEnvironment(environment); + const QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(m_kit); + if (QTC_GUARD(qt)) { // Kits without a Qt version should not have a puppet! + // Update PATH to include QT_HOST_BINS + const Utils::FileName qtBinPath = qt->binPath(); + environment.prependOrSetPath(qtBinPath.toString()); + } environment.set("QML_BAD_GUI_RENDER_LOOP", "true"); environment.set("QML_USE_MOCKUPS", "true"); environment.set("QML_PUPPET_MODE", "true"); diff --git a/src/plugins/qmldesigner/designercore/model/qmltimelinemutator.cpp b/src/plugins/qmldesigner/designercore/model/qmltimelinemutator.cpp index 201650020c..e9349c898b 100644 --- a/src/plugins/qmldesigner/designercore/model/qmltimelinemutator.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmltimelinemutator.cpp @@ -130,33 +130,27 @@ qreal QmlTimelineMutator::duration() const return endFrame() - startFrame(); } -qreal QmlTimelineMutator::minActualFrame() const +qreal QmlTimelineMutator::minActualFrame(const ModelNode &target) const { qreal min = std::numeric_limits<double>::max(); - for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) { - if (QmlTimelineFrames::isValidQmlTimelineFrames(childNode)) { - QmlTimelineFrames frames(childNode); - qreal value = frames.minActualFrame(); - if (value < min) - min = value; - } + for (const QmlTimelineFrames &frames : framesForTarget(target)) { + qreal value = frames.minActualFrame(); + if (value < min) + min = value; } return min; } -qreal QmlTimelineMutator::maxActualFrame() const +qreal QmlTimelineMutator::maxActualFrame(const ModelNode &target) const { qreal max = std::numeric_limits<double>::min(); - for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) { - if (QmlTimelineFrames::isValidQmlTimelineFrames(childNode)) { - QmlTimelineFrames frames(childNode); - qreal value = frames.maxActualFrame(); - if (value > max) - max = value; - } + for (const QmlTimelineFrames &frames : framesForTarget(target)) { + qreal value = frames.maxActualFrame(); + if (value > max) + max = value; } return max; diff --git a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp index d550e82fbd..dc1f03794d 100644 --- a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp +++ b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp @@ -612,17 +612,6 @@ ModelNode RewriterView::nodeAtTextCursorPosition(int cursorPosition) const return nodeAtTextCursorPositionRekursive(rootModelNode(), cursorPosition); } -bool RewriterView::nodeContainsCursor(const ModelNode &node, int cursorPosition) const -{ - const int nodeTextLength = nodeLength(node); - const int nodeTextOffset = nodeOffset(node); - - if (isInNodeDefinition(nodeTextOffset, nodeTextLength, cursorPosition)) - return true; - - return false; -} - bool RewriterView::renameId(const QString& oldId, const QString& newId) { if (textModifier()) { diff --git a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionviewwidget.cpp b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionviewwidget.cpp index 2ad6d34d3d..54b771bf0d 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionviewwidget.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/connectioneditor/connectionviewwidget.cpp @@ -231,18 +231,24 @@ void ConnectionViewWidget::handleTabChanged(int) void ConnectionViewWidget::removeButtonClicked() { if (currentTab() == ConnectionTab) { + if (ui->connectionView->selectionModel()->selectedRows().isEmpty()) + return; int currentRow = ui->connectionView->selectionModel()->selectedRows().first().row(); ConnectionModel *connectionModel = qobject_cast<ConnectionModel*>(ui->connectionView->model()); if (connectionModel) { connectionModel->deleteConnectionByRow(currentRow); } } else if (currentTab() == BindingTab) { + if (ui->bindingView->selectionModel()->selectedRows().isEmpty()) + return; int currentRow = ui->bindingView->selectionModel()->selectedRows().first().row(); BindingModel *bindingModel = qobject_cast<BindingModel*>(ui->bindingView->model()); if (bindingModel) { bindingModel->deleteBindindByRow(currentRow); } } else if (currentTab() == DynamicPropertiesTab) { + if (ui->dynamicPropertiesView->selectionModel()->selectedRows().isEmpty()) + return; int currentRow = ui->dynamicPropertiesView->selectionModel()->selectedRows().first().row(); DynamicPropertiesModel *dynamicPropertiesModel = qobject_cast<DynamicPropertiesModel*>(ui->dynamicPropertiesView->model()); if (dynamicPropertiesModel) diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index d4a55c2419..d68c091113 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -136,22 +136,17 @@ QnxDebugSupport::QnxDebugSupport(RunControl *runControl) setDisplayName("QnxDebugSupport"); appendMessage(tr("Preparing remote side..."), LogMessageFormat); - m_portsGatherer = new GdbServerPortsGatherer(runControl); - m_portsGatherer->setUseGdbServer(isCppDebugging()); - m_portsGatherer->setUseQmlServer(isQmlDebugging()); + setUsePortsGatherer(isCppDebugging(), isQmlDebugging()); - auto debuggeeRunner = new QnxDebuggeeRunner(runControl, m_portsGatherer); - debuggeeRunner->addStartDependency(m_portsGatherer); + auto debuggeeRunner = new QnxDebuggeeRunner(runControl, portsGatherer()); + debuggeeRunner->addStartDependency(portsGatherer()); auto slog2InfoRunner = new Slog2InfoRunner(runControl); debuggeeRunner->addStartDependency(slog2InfoRunner); addStartDependency(debuggeeRunner); -} -void QnxDebugSupport::start() -{ - auto runConfig = qobject_cast<QnxRunConfiguration *>(runControl()->runConfiguration()); + auto runConfig = qobject_cast<QnxRunConfiguration *>(runControl->runConfiguration()); QTC_ASSERT(runConfig, return); Target *target = runConfig->target(); Kit *k = target->kit(); @@ -159,14 +154,10 @@ void QnxDebugSupport::start() setStartMode(AttachToRemoteServer); setCloseMode(KillAtClose); setUseCtrlCStub(true); - setRemoteChannel(m_portsGatherer->gdbServerChannel()); - setQmlServer(m_portsGatherer->qmlServer()); setSolibSearchPath(searchPaths(k)); if (auto qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitInformation::qtVersion(k))) setSysRoot(qtVersion->qnxTarget()); setSymbolFile(runConfig->localExecutableFilePath()); - - DebuggerRunTool::start(); } @@ -213,6 +204,7 @@ public: : SimpleTargetRunner(runControl), m_portsGatherer(portsGatherer) { setDisplayName("PDebugRunner"); + addStartDependency(m_portsGatherer); } private: @@ -236,28 +228,14 @@ QnxAttachDebugSupport::QnxAttachDebugSupport(RunControl *runControl) { setDisplayName("QnxAttachDebugSupport"); - m_portsGatherer = new GdbServerPortsGatherer(runControl); - m_portsGatherer->setUseGdbServer(isCppDebugging()); - m_portsGatherer->setUseQmlServer(isQmlDebugging()); + setUsePortsGatherer(isCppDebugging(), isQmlDebugging()); if (isCppDebugging()) { - m_pdebugRunner = new PDebugRunner(runControl, m_portsGatherer); - m_pdebugRunner->addStartDependency(m_portsGatherer); - addStartDependency(m_pdebugRunner); - } else { - // No pdebug needed for Qml-only debugging. - addStartDependency(m_portsGatherer); + auto pdebugRunner = new PDebugRunner(runControl, portsGatherer()); + addStartDependency(pdebugRunner); } } -void QnxAttachDebugSupport::start() -{ - setRemoteChannel(m_portsGatherer->gdbServerChannel()); - setQmlServer(m_portsGatherer->qmlServer()); - - DebuggerRunTool::start(); -} - void QnxAttachDebugSupport::showProcessesDialog() { auto kitChooser = new KitChooser; diff --git a/src/plugins/qnx/qnxdebugsupport.h b/src/plugins/qnx/qnxdebugsupport.h index bfce06231f..ed38da8874 100644 --- a/src/plugins/qnx/qnxdebugsupport.h +++ b/src/plugins/qnx/qnxdebugsupport.h @@ -36,11 +36,6 @@ class QnxDebugSupport : public Debugger::DebuggerRunTool public: explicit QnxDebugSupport(ProjectExplorer::RunControl *runControl); - -private: - void start() override; - - Debugger::GdbServerPortsGatherer *m_portsGatherer; }; class QnxAttachDebugSupport : public Debugger::DebuggerRunTool @@ -51,12 +46,6 @@ public: explicit QnxAttachDebugSupport(ProjectExplorer::RunControl *runControl); static void showProcessesDialog(); - -private: - void start() final; - - Debugger::GdbServerPortsGatherer *m_portsGatherer; - ProjectExplorer::SimpleTargetRunner *m_pdebugRunner; }; } // namespace Internal diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index a5f4019475..23872cdf61 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp @@ -598,7 +598,7 @@ public: auto hbox = new QHBoxLayout; if (m_isExamples) { - m_searcher->setPlaceholderText(tr("Search in Examples...")); + m_searcher->setPlaceholderText(ExamplesWelcomePage::tr("Search in Examples...")); auto exampleSetSelector = new QComboBox(this); exampleSetSelector->setMinimumWidth(itemWidth); @@ -614,7 +614,7 @@ public: hbox->setSpacing(17); hbox->addWidget(exampleSetSelector); } else { - m_searcher->setPlaceholderText(tr("Search in Tutorials...")); + m_searcher->setPlaceholderText(ExamplesWelcomePage::tr("Search in Tutorials...")); } hbox->addWidget(searchBox); hbox->addSpacing(sideMargin); diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index 1687eb1808..67c19fb30a 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp @@ -39,12 +39,10 @@ LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(RunControl *runControl) { setDisplayName("LinuxDeviceDebugSupport"); - m_portsGatherer = new GdbServerPortsGatherer(runControl); - m_portsGatherer->setUseGdbServer(isCppDebugging()); - m_portsGatherer->setUseQmlServer(isQmlDebugging()); + setUsePortsGatherer(isCppDebugging(), isQmlDebugging()); + addQmlServerInferiorCommandLineArgumentIfNeeded(); - auto gdbServer = new GdbServerRunner(runControl, m_portsGatherer); - gdbServer->addStartDependency(m_portsGatherer); + auto gdbServer = new GdbServerRunner(runControl, portsGatherer()); addStartDependency(gdbServer); @@ -59,14 +57,5 @@ LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(RunControl *runControl) setSymbolFile(rlrc->localExecutableFilePath()); } -void LinuxDeviceDebugSupport::start() -{ - setRemoteChannel(m_portsGatherer->gdbServerChannel()); - setQmlServer(m_portsGatherer->qmlServer()); - addQmlServerInferiorCommandLineArgumentIfNeeded(); - - DebuggerRunTool::start(); -} - } // namespace Internal } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.h b/src/plugins/remotelinux/remotelinuxdebugsupport.h index 1b7a0ee3ac..34df20d2da 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.h +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.h @@ -34,11 +34,6 @@ class LinuxDeviceDebugSupport : public Debugger::DebuggerRunTool { public: LinuxDeviceDebugSupport(ProjectExplorer::RunControl *runControl); - -private: - void start() override; - - Debugger::GdbServerPortsGatherer *m_portsGatherer = nullptr; }; } // namespace Internal diff --git a/src/plugins/scxmleditor/plugin_interface/graphicsscene.cpp b/src/plugins/scxmleditor/plugin_interface/graphicsscene.cpp index b1347007be..ffbbd0d0ab 100644 --- a/src/plugins/scxmleditor/plugin_interface/graphicsscene.cpp +++ b/src/plugins/scxmleditor/plugin_interface/graphicsscene.cpp @@ -202,7 +202,7 @@ void GraphicsScene::removeSelectedItems() { QVector<ScxmlTag*> tags = SceneUtils::findRemovedTags(m_baseItems); if (tags.count() > 0) { - m_document->undoStack()->beginMacro(tr("Remove item(s)")); + m_document->undoStack()->beginMacro(tr("Remove items")); // Then remove found tags for (int i = tags.count(); i--;) { @@ -368,7 +368,7 @@ void GraphicsScene::init() void GraphicsScene::runLayoutToSelectedStates() { - m_document->undoStack()->beginMacro(tr("Relayout")); + m_document->undoStack()->beginMacro(tr("Re-layout")); QVector<BaseItem*> selectedItems; foreach (BaseItem *node, m_baseItems) { diff --git a/src/plugins/scxmleditor/plugin_interface/idwarningitem.cpp b/src/plugins/scxmleditor/plugin_interface/idwarningitem.cpp index 2e50ac5b64..7376192581 100644 --- a/src/plugins/scxmleditor/plugin_interface/idwarningitem.cpp +++ b/src/plugins/scxmleditor/plugin_interface/idwarningitem.cpp @@ -54,7 +54,7 @@ void IdWarningItem::setId(const QString &text) // Check new id if (m_id.isEmpty()) { - setReason(tr("Missing ID")); + setReason(tr("Missing ID.")); setWarningActive(true); } else checkDuplicates(m_id); @@ -78,7 +78,7 @@ void IdWarningItem::checkDuplicates(const QString &id) foundItems[0]->setWarningActive(false); } else { for (int i = 0; i < foundItems.count(); ++i) { - foundItems[i]->setReason(tr("Duplicate ID (%1)").arg(id)); + foundItems[i]->setReason(tr("Duplicate ID (%1).").arg(id)); foundItems[i]->setWarningActive(true); } } diff --git a/src/plugins/scxmleditor/plugin_interface/initialwarningitem.cpp b/src/plugins/scxmleditor/plugin_interface/initialwarningitem.cpp index 987113eca0..f92fe501b8 100644 --- a/src/plugins/scxmleditor/plugin_interface/initialwarningitem.cpp +++ b/src/plugins/scxmleditor/plugin_interface/initialwarningitem.cpp @@ -36,7 +36,7 @@ InitialWarningItem::InitialWarningItem(InitialStateItem *parent) setSeverity(OutputPane::Warning::ErrorType); setTypeName(tr("Initial")); setDescription(tr("One level can contain only one initial state.")); - setReason(tr("Too many initial states at the same level")); + setReason(tr("Too many initial states at the same level.")); } void InitialWarningItem::updatePos() diff --git a/src/plugins/scxmleditor/plugin_interface/statewarningitem.cpp b/src/plugins/scxmleditor/plugin_interface/statewarningitem.cpp index 8074c9c7ff..4f8e7d1124 100644 --- a/src/plugins/scxmleditor/plugin_interface/statewarningitem.cpp +++ b/src/plugins/scxmleditor/plugin_interface/statewarningitem.cpp @@ -38,7 +38,7 @@ StateWarningItem::StateWarningItem(StateItem *parent) setDescription(tr("Draw some transitions to state.")); setPixmap(Utils::Icons::WARNING.pixmap()); - setReason(tr("No input connection")); + setReason(tr("No input connection.")); } void StateWarningItem::setIdWarning(IdWarningItem *idwarning) @@ -56,15 +56,15 @@ void StateWarningItem::check() bool inputProblem = !m_parentItem->isInitial() && !m_parentItem->hasInputTransitions(m_parentItem, true); if (outputProblem && inputProblem) { - setReason(tr("No input or output connections (%1)").arg(m_parentItem->itemId())); + setReason(tr("No input or output connections (%1).").arg(m_parentItem->itemId())); setDescription(tr("Draw some transitions to or from state.")); setWarningActive(true); } else if (outputProblem) { - setReason(tr("No output connections (%1)").arg(m_parentItem->itemId())); + setReason(tr("No output connections (%1).").arg(m_parentItem->itemId())); setDescription(tr("Draw some transitions from state.")); setWarningActive(true); } else if (inputProblem) { - setReason(tr("No input connections (%1)").arg(m_parentItem->itemId())); + setReason(tr("No input connections (%1).").arg(m_parentItem->itemId())); setDescription(tr("Draw some transitions to state.")); setWarningActive(true); } else diff --git a/src/plugins/scxmleditor/plugin_interface/transitionwarningitem.cpp b/src/plugins/scxmleditor/plugin_interface/transitionwarningitem.cpp index b92cd8ef8d..8b85c401c5 100644 --- a/src/plugins/scxmleditor/plugin_interface/transitionwarningitem.cpp +++ b/src/plugins/scxmleditor/plugin_interface/transitionwarningitem.cpp @@ -45,7 +45,7 @@ void TransitionWarningItem::check() { if (m_parentItem) { if (m_parentItem->targetType() == TransitionItem::ExternalNoTarget) { - setReason(tr("Not Connected (%1)").arg(m_parentItem->tagValue("event"))); + setReason(tr("Not connected (%1).").arg(m_parentItem->tagValue("event"))); setWarningActive(true); } else setWarningActive(false); diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index dcb33b50ae..b176e6c46e 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -64,7 +64,7 @@ class InternalEngine : public TextEditor::SearchEngine public: InternalEngine() : m_widget(new QWidget) {} ~InternalEngine() override { delete m_widget;} - QString title() const override { return tr("Internal"); } + QString title() const override { return TextEditor::SearchEngine::tr("Internal"); } QString toolTip() const override { return QString(); } QWidget *widget() const override { return m_widget; } QVariant parameters() const override { return QVariant(); } diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 35dedb0954..718c493920 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -150,6 +150,9 @@ using namespace Core; using namespace Utils; namespace TextEditor { + +using namespace Internal; + namespace Internal { enum { NExtraSelectionKinds = 12 }; @@ -765,8 +768,6 @@ TextEditorWidgetPrivate::~TextEditorWidgetPrivate() } // namespace Internal -using namespace Internal; - /*! * Test if syntax highlighter is available (or unneeded) for \a widget. * If not found, show a warning with a link to the relevant settings page. @@ -3425,7 +3426,11 @@ bool TextEditorWidgetPrivate::processAnnotaionTooltipRequest(const QTextBlock &b QFrame* separator = new QFrame(); separator->setFrameShape(QFrame::HLine); layout->addWidget(separator, layout->rowCount(), 0, 1, -1); - layout->addWidget(new QLabel(tr("Other annotations:")), layout->rowCount(), 0, 1, -1); + layout->addWidget(new QLabel(TextEditorWidget::tr("Other annotations:")), + layout->rowCount(), + 0, + 1, + -1); Utils::sort(marks, [](const TextMark* mark1, const TextMark* mark2){ return mark1->priority() > mark2->priority(); diff --git a/src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp b/src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp index 6b628cdb13..6ece9c8b9d 100644 --- a/src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp +++ b/src/plugins/vcsbase/vcsbasediffeditorcontroller.cpp @@ -174,7 +174,7 @@ void VcsBaseDiffEditorControllerPrivate::processDiff(const QString &patch) m_processWatcher->setFuture(Utils::runAsync(&readPatch, patch)); ProgressManager::addTask(m_processWatcher->future(), - q->tr("Processing diff"), "DiffEditor"); + VcsBaseDiffEditorController::tr("Processing diff"), "DiffEditor"); } void VcsBaseDiffEditorControllerPrivate::cancelReload() diff --git a/src/shared/qbs b/src/shared/qbs -Subproject 07fa68a352864f70b7930c996c4b4a7c5d9cd4a +Subproject 19abf216fdd8a54c2b8ec101631f378ce6b5bc6 diff --git a/src/tools/clangpchmanagerbackend/clangpchmanagerbackend.qbs b/src/tools/clangpchmanagerbackend/clangpchmanagerbackend.qbs new file mode 100644 index 0000000000..adb7e0c62b --- /dev/null +++ b/src/tools/clangpchmanagerbackend/clangpchmanagerbackend.qbs @@ -0,0 +1,83 @@ +import qbs +import qbs.FileInfo + +QtcTool { + name: "clangpchmanagerbackend" + Depends { name: "libclang"; required: false } + condition: libclang.present + && libclang.toolingEnabled + && (!qbs.targetOS.contains("windows") || libclang.llvmBuildModeMatches) + + Depends { name: "ClangSupport" } + + Depends { name: "Qt.network" } + + cpp.cxxFlags: base.concat(libclang.llvmToolingCxxFlags) + cpp.defines: { + var list = base.concat(libclang.llvmToolingDefines); + list.push('CLANG_COMPILER_PATH="' + + FileInfo.joinPaths(FileInfo.path(libclang.llvmConfig), "clang") + '"'); + return list; + } + cpp.includePaths: base.concat(libclang.llvmIncludeDir).concat(libclang.llvmToolingIncludes) + .concat(["source", "../clangrefactoringbackend/source"]) + cpp.libraryPaths: base.concat(libclang.llvmLibDir) + cpp.dynamicLibraries: base.concat(libclang.llvmToolingLibs) + + Properties { + condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos") + cpp.rpaths: base.concat(libclang.llvmLibDir) + } + + files: [ + "clangpchmanagerbackendmain.cpp", + ] + + Group { + prefix: "source/" + files: [ + "changedfilepathcompressor.h", + "clangpathwatcherinterface.cpp", + "clangpathwatcherinterface.h", + "clangpathwatchernotifier.cpp", + "clangpathwatchernotifier.h", + "clangpathwatcher.cpp", + "clangpathwatcher.h", + "clangpchmanagerbackend_global.h", + "collectincludesaction.h", + "collectincludespreprocessorcallbacks.h", + "collectincludestoolaction.h", + "environment.h", + "idpaths.cpp", + "idpaths.h", + "includecollector.cpp", + "includecollector.h", + "pchcreatorinterface.cpp", + "pchcreatorinterface.h", + "pchcreator.cpp", + "pchcreator.h", + "pchgenerator.h", + "pchgeneratorinterface.cpp", + "pchgeneratorinterface.h", + "pchgeneratornotifierinterface.cpp", + "pchgeneratornotifierinterface.h", + "pchmanagerserver.cpp", + "pchmanagerserver.h", + "pchnotcreatederror.h", + "projectpartsinterface.cpp", + "projectpartsinterface.h", + "projectparts.cpp", + "projectparts.h", + ] + } + + Group { + name: "sources from clangrefactoring" + prefix: "../clangrefactoringbackend/source/" + files: [ + "clangtool.cpp", + "refactoringcompilationdatabase.cpp", + ] + } +} + diff --git a/src/tools/clangrefactoringbackend/clangrefactoringbackend.qbs b/src/tools/clangrefactoringbackend/clangrefactoringbackend.qbs new file mode 100644 index 0000000000..1381b5b3df --- /dev/null +++ b/src/tools/clangrefactoringbackend/clangrefactoringbackend.qbs @@ -0,0 +1,86 @@ +import qbs +import qbs.FileInfo + +QtcTool { + name: "clangrefactoringbackend" + Depends { name: "libclang"; required: false } + condition: libclang.present + && libclang.toolingEnabled + && (!qbs.targetOS.contains("windows") || libclang.llvmBuildModeMatches) + + Depends { name: "ClangSupport" } + + Depends { name: "Qt.network" } + + cpp.cxxFlags: base.concat(libclang.llvmToolingCxxFlags) + cpp.defines: base.concat(libclang.llvmToolingDefines) + cpp.includePaths: base.concat(libclang.llvmIncludeDir).concat(libclang.llvmToolingIncludes) + .concat(["source"]) + cpp.libraryPaths: base.concat(libclang.llvmLibDir) + cpp.dynamicLibraries: base.concat(libclang.llvmToolingLibs) + + Properties { + condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos") + cpp.rpaths: base.concat(libclang.llvmLibDir) + } + + files: [ + "clangrefactoringbackendmain.cpp", + ] + + Group { + prefix: "source/" + files: [ + "clangquery.cpp", + "clangquerygatherer.cpp", + "clangquerygatherer.h", + "clangquery.h", + "clangrefactoringbackend_global.h", + "clangtool.cpp", + "clangtool.h", + "collectmacrossourcefilecallbacks.cpp", + "collectmacrossourcefilecallbacks.h", + "collectsymbolsaction.cpp", + "collectsymbolsaction.h", + "collectsymbolsastvisitor.h", + "collectsymbolsconsumer.h", + "findcursorusr.h", + "findlocationsofusrs.h", + "findusrforcursoraction.cpp", + "findusrforcursoraction.h", + "locationsourcefilecallbacks.cpp", + "locationsourcefilecallbacks.h", + "macropreprocessorcallbacks.cpp", + "macropreprocessorcallbacks.h", + "refactoringcompilationdatabase.cpp", + "refactoringcompilationdatabase.h", + "refactoringserver.cpp", + "refactoringserver.h", + "sourcelocationentry.cpp", + "sourcelocationentry.h", + "sourcelocationsutils.h", + "sourcerangeextractor.cpp", + "sourcerangeextractor.h", + "sourcerangefilter.cpp", + "sourcerangefilter.h", + "storagesqlitestatementfactory.h", + "symbolentry.cpp", + "symbolentry.h", + "symbolfinder.cpp", + "symbolfinder.h", + "symbolindexer.cpp", + "symbolindexer.h", + "symbolindexing.cpp", + "symbolindexing.h", + "symbolindexinginterface.h", + "symbollocationfinderaction.cpp", + "symbollocationfinderaction.h", + "symbolscollector.cpp", + "symbolscollector.h", + "symbolscollectorinterface.h", + "symbolstorage.cpp", + "symbolstorage.h", + "symbolstorageinterface.h", + ] + } +} diff --git a/src/tools/tools.qbs b/src/tools/tools.qbs index d1b8e93fc8..b3f27424e6 100644 --- a/src/tools/tools.qbs +++ b/src/tools/tools.qbs @@ -5,6 +5,8 @@ Project { references: [ "buildoutputparser/buildoutputparser.qbs", "clangbackend/clangbackend.qbs", + "clangpchmanagerbackend/clangpchmanagerbackend.qbs", + "clangrefactoringbackend/clangrefactoringbackend.qbs", "cplusplustools.qbs", "qml2puppet/qml2puppet.qbs", "qtcdebugger/qtcdebugger.qbs", |