diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2016-04-12 10:43:10 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2016-04-12 11:34:46 +0200 |
commit | 5c874322603444ef02bd578ae302c03a9b1cd034 (patch) | |
tree | 6339db7c3a2683e18208e75895444f2d2d251ebe /src/plugins | |
parent | 04acb9d643060811dbba8f66d807b2a7574c3a6f (diff) | |
parent | 8dadafb9e0a2fbb49ab08b9eea0ff307088ba3f8 (diff) | |
download | qt-creator-5c874322603444ef02bd578ae302c03a9b1cd034.tar.gz |
Merge remote-tracking branch 'origin/4.0'
Conflicts:
src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
Diffstat (limited to 'src/plugins')
208 files changed, 883 insertions, 581 deletions
diff --git a/src/plugins/android/androidruncontrol.cpp b/src/plugins/android/androidruncontrol.cpp index 62d28a3f5f..244fcf25ab 100644 --- a/src/plugins/android/androidruncontrol.cpp +++ b/src/plugins/android/androidruncontrol.cpp @@ -29,8 +29,9 @@ #include "androidrunconfiguration.h" #include "androidrunner.h" +#include <coreplugin/coreicons.h> + #include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/projectexplorericons.h> using namespace ProjectExplorer; @@ -43,7 +44,7 @@ AndroidRunControl::AndroidRunControl(AndroidRunConfiguration *rc) , m_running(false) { setRunnable(m_runner->runnable()); - setIcon(Icons::RUN_SMALL); + setIcon(Core::Icons::RUN_SMALL); } AndroidRunControl::~AndroidRunControl() diff --git a/src/plugins/autotest/autotest.qrc b/src/plugins/autotest/autotest.qrc index 698a86950e..7c8539f4b2 100644 --- a/src/plugins/autotest/autotest.qrc +++ b/src/plugins/autotest/autotest.qrc @@ -1,8 +1,6 @@ <RCC> <qresource prefix="/"> <file>images/autotest.png</file> - <file>images/class.png</file> - <file>images/func.png</file> <file>images/expand.png</file> <file>images/expand@2x.png</file> <file>images/collapse.png</file> diff --git a/src/plugins/autotest/images/class.png b/src/plugins/autotest/images/class.png Binary files differdeleted file mode 100644 index 88432d2cb1..0000000000 --- a/src/plugins/autotest/images/class.png +++ /dev/null diff --git a/src/plugins/autotest/images/func.png b/src/plugins/autotest/images/func.png Binary files differdeleted file mode 100644 index 3f5f62a5f6..0000000000 --- a/src/plugins/autotest/images/func.png +++ /dev/null diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index 9559ce5be7..7209e1fdef 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -41,7 +41,6 @@ #include <coreplugin/icore.h> #include <projectexplorer/projectexplorer.h> -#include <projectexplorer/projectexplorericons.h> #include <texteditor/texteditor.h> @@ -159,13 +158,13 @@ void TestResultsPane::createToolButtons() }); m_runAll = new QToolButton(m_treeView); - m_runAll->setIcon(ProjectExplorer::Icons::RUN_SMALL.icon()); + m_runAll->setIcon(Core::Icons::RUN_SMALL.icon()); m_runAll->setToolTip(tr("Run All Tests")); m_runAll->setEnabled(false); connect(m_runAll, &QToolButton::clicked, this, &TestResultsPane::onRunAllTriggered); m_runSelected = new QToolButton(m_treeView); - Utils::Icon runSelectedIcon = ProjectExplorer::Icons::RUN_SMALL; + Utils::Icon runSelectedIcon = Core::Icons::RUN_SMALL; foreach (const Utils::IconMaskAndColor &maskAndColor, Icons::RUN_SELECTED_OVERLAY) runSelectedIcon.append(maskAndColor); m_runSelected->setIcon(runSelectedIcon.icon()); @@ -174,7 +173,7 @@ void TestResultsPane::createToolButtons() connect(m_runSelected, &QToolButton::clicked, this, &TestResultsPane::onRunSelectedTriggered); m_stopTestRun = new QToolButton(m_treeView); - m_stopTestRun->setIcon(ProjectExplorer::Icons::STOP_SMALL.icon()); + m_stopTestRun->setIcon(Core::Icons::STOP_SMALL.icon()); m_stopTestRun->setToolTip(tr("Stop Test Run")); m_stopTestRun->setEnabled(false); connect(m_stopTestRun, &QToolButton::clicked, TestRunner::instance(), &TestRunner::requestStopTestRun); diff --git a/src/plugins/autotest/testtreeitem.cpp b/src/plugins/autotest/testtreeitem.cpp index 50ca4c899f..7e50905b6d 100644 --- a/src/plugins/autotest/testtreeitem.cpp +++ b/src/plugins/autotest/testtreeitem.cpp @@ -33,6 +33,8 @@ #include <texteditor/texteditor.h> +#include <cplusplus/Icons.h> + namespace Autotest { namespace Internal { @@ -51,8 +53,8 @@ static QIcon testTreeIcon(TestTreeItem::Type type) { static QIcon icons[] = { QIcon(), - QIcon(QLatin1String(":/images/class.png")), - QIcon(QLatin1String(":/images/func.png")), + CPlusPlus::Icons::iconForType(CPlusPlus::Icons::ClassIconType), + CPlusPlus::Icons::iconForType(CPlusPlus::Icons::SlotPrivateIconType), QIcon(QLatin1String(":/images/data.png")) }; diff --git a/src/plugins/clangcodemodel/clangassistproposalitem.cpp b/src/plugins/clangcodemodel/clangassistproposalitem.cpp index 6d0307903f..8ec96a8098 100644 --- a/src/plugins/clangcodemodel/clangassistproposalitem.cpp +++ b/src/plugins/clangcodemodel/clangassistproposalitem.cpp @@ -219,7 +219,6 @@ QString ClangAssistProposalItem::text() const QIcon ClangAssistProposalItem::icon() const { using CPlusPlus::Icons; - static const CPlusPlus::Icons m_icons; static const char SNIPPET_ICON_PATH[] = ":/texteditor/images/snippet.png"; static const QIcon snippetIcon = QIcon(QLatin1String(SNIPPET_ICON_PATH)); @@ -227,11 +226,11 @@ QIcon ClangAssistProposalItem::icon() const case CodeCompletion::ClassCompletionKind: case CodeCompletion::TemplateClassCompletionKind: case CodeCompletion::TypeAliasCompletionKind: - return m_icons.iconForType(Icons::ClassIconType); + return Icons::iconForType(Icons::ClassIconType); case CodeCompletion::EnumerationCompletionKind: - return m_icons.iconForType(Icons::EnumIconType); + return Icons::iconForType(Icons::EnumIconType); case CodeCompletion::EnumeratorCompletionKind: - return m_icons.iconForType(Icons::EnumeratorIconType); + return Icons::iconForType(Icons::EnumeratorIconType); case CodeCompletion::ConstructorCompletionKind: case CodeCompletion::DestructorCompletionKind: case CodeCompletion::FunctionCompletionKind: @@ -240,39 +239,39 @@ QIcon ClangAssistProposalItem::icon() const switch (m_codeCompletion.availability()) { case CodeCompletion::Available: case CodeCompletion::Deprecated: - return m_icons.iconForType(Icons::FuncPublicIconType); + return Icons::iconForType(Icons::FuncPublicIconType); default: - return m_icons.iconForType(Icons::FuncPrivateIconType); + return Icons::iconForType(Icons::FuncPrivateIconType); } case CodeCompletion::SignalCompletionKind: - return m_icons.iconForType(Icons::SignalIconType); + return Icons::iconForType(Icons::SignalIconType); case CodeCompletion::SlotCompletionKind: switch (m_codeCompletion.availability()) { case CodeCompletion::Available: case CodeCompletion::Deprecated: - return m_icons.iconForType(Icons::SlotPublicIconType); + return Icons::iconForType(Icons::SlotPublicIconType); case CodeCompletion::NotAccessible: case CodeCompletion::NotAvailable: - return m_icons.iconForType(Icons::SlotPrivateIconType); + return Icons::iconForType(Icons::SlotPrivateIconType); } case CodeCompletion::NamespaceCompletionKind: - return m_icons.iconForType(Icons::NamespaceIconType); + return Icons::iconForType(Icons::NamespaceIconType); case CodeCompletion::PreProcessorCompletionKind: - return m_icons.iconForType(Icons::MacroIconType); + return Icons::iconForType(Icons::MacroIconType); case CodeCompletion::VariableCompletionKind: switch (m_codeCompletion.availability()) { case CodeCompletion::Available: case CodeCompletion::Deprecated: - return m_icons.iconForType(Icons::VarPublicIconType); + return Icons::iconForType(Icons::VarPublicIconType); default: - return m_icons.iconForType(Icons::VarPrivateIconType); + return Icons::iconForType(Icons::VarPrivateIconType); } case CodeCompletion::KeywordCompletionKind: - return m_icons.iconForType(Icons::KeywordIconType); + return Icons::iconForType(Icons::KeywordIconType); case CodeCompletion::ClangSnippetKind: return snippetIcon; case CodeCompletion::Other: - return m_icons.iconForType(Icons::UnknownIconType); + return Icons::iconForType(Icons::UnknownIconType); } return QIcon(); diff --git a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp index c0e8904d1b..d19c12035d 100644 --- a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp +++ b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp @@ -46,6 +46,7 @@ #include <cplusplus/BackwardsScanner.h> #include <cplusplus/ExpressionUnderCursor.h> +#include <cplusplus/Icons.h> #include <cplusplus/SimpleLexer.h> #include <clangbackendipc/filecontainer.h> @@ -454,7 +455,7 @@ void ClangCompletionAssistProcessor::completeIncludePath(const QString &realPath auto *item = new ClangPreprocessorAssistProposalItem; item->setText(text); item->setDetail(hint); - item->setIcon(m_icons.keywordIcon()); + item->setIcon(Icons::keywordIcon()); item->setCompletionOperator(m_completionOperator); m_completions.append(item); } @@ -465,11 +466,11 @@ bool ClangCompletionAssistProcessor::completePreprocessorDirectives() { foreach (const QString &preprocessorCompletion, m_preprocessorCompletions) addCompletionItem(preprocessorCompletion, - m_icons.iconForType(Icons::MacroIconType)); + Icons::iconForType(Icons::MacroIconType)); if (m_interface->objcEnabled()) addCompletionItem(QLatin1String("import"), - m_icons.iconForType(Icons::MacroIconType)); + Icons::iconForType(Icons::MacroIconType)); return !m_completions.isEmpty(); } @@ -477,7 +478,7 @@ bool ClangCompletionAssistProcessor::completePreprocessorDirectives() bool ClangCompletionAssistProcessor::completeDoxygenKeywords() { for (int i = 1; i < CppTools::T_DOXY_LAST_TAG; ++i) - addCompletionItem(QString::fromLatin1(CppTools::doxygenTagSpell(i)), m_icons.keywordIcon()); + addCompletionItem(QString::fromLatin1(CppTools::doxygenTagSpell(i)), Icons::keywordIcon()); return !m_completions.isEmpty(); } diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp index 4dbeaca1c1..39eeeb3187 100644 --- a/src/plugins/clangcodemodel/clangutils.cpp +++ b/src/plugins/clangcodemodel/clangutils.cpp @@ -88,6 +88,7 @@ public: LibClangOptionsBuilder optionsBuilder(*projectPart.data()); + optionsBuilder.addTargetTriple(); optionsBuilder.addLanguageOption(fileKind); optionsBuilder.addOptionsForLanguage(/*checkForBorlandExtensions*/ true); diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerplugin.cpp b/src/plugins/clangstaticanalyzer/clangstaticanalyzerplugin.cpp index 0ab5c15e00..7c40c91a0a 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerplugin.cpp +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerplugin.cpp @@ -118,7 +118,7 @@ bool ClangStaticAnalyzerPlugin::initialize(const QStringList &arguments, QString auto panelFactory = new ProjectExplorer::ProjectPanelFactory(); panelFactory->setPriority(100); - panelFactory->setDisplayName(tr("Clang Static Analyzer Settings")); + panelFactory->setDisplayName(tr("Clang Static Analyzer")); panelFactory->setSimpleCreateWidgetFunction<ProjectSettingsWidget>(QIcon()); ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory); diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp index 69ff061c83..0789ace0c8 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp @@ -71,7 +71,6 @@ ClangStaticAnalyzerRunControl::ClangStaticAnalyzerRunControl( const ProjectInfo &projectInfo) : AnalyzerRunControl(runConfiguration, runMode) , m_projectInfo(projectInfo) - , m_wordWidth(runConfiguration->abi().wordWidth()) , m_initialFilesToProcessSize(0) , m_filesAnalyzed(0) , m_filesNotAnalyzed(0) @@ -80,7 +79,13 @@ ClangStaticAnalyzerRunControl::ClangStaticAnalyzerRunControl( BuildConfiguration *buildConfiguration = target->activeBuildConfiguration(); QTC_ASSERT(buildConfiguration, return); m_environment = buildConfiguration->environment(); - m_targetTriple = ToolChainKitInformation::toolChain(target->kit())->originalTargetTriple(); + + ToolChain *toolChain = ToolChainKitInformation::toolChain(target->kit()); + QTC_ASSERT(toolChain, return); + Abi abi = runConfiguration->abi(); + m_extraToolChainInfo.wordWidth = abi.wordWidth(); + m_extraToolChainInfo.isMsvc2015 = abi.osFlavor() == Abi::WindowsMsvc2015Flavor; + m_extraToolChainInfo.targetTriple = toolChain->originalTargetTriple(); } static void prependWordWidthArgumentIfNotIncluded(QStringList *arguments, unsigned char wordWidth) @@ -113,13 +118,8 @@ static void prependTargetTripleIfNotIncludedAndNotEmpty(QStringList *arguments, } } -// Removes (1) filePath (2) -o <somePath>. -// Prepends -m64/-m32 argument if not already included. -// Prepends -target if not already included. -static QStringList tweakedArguments(const QString &filePath, - const QStringList &arguments, - unsigned char wordWidth, - const QString &targetTriple) +// Removes (1) inputFile (2) -o <somePath>. +QStringList inputAndOutputArgumentsRemoved(const QString &inputFile, const QStringList &arguments) { QStringList newArguments; @@ -131,7 +131,7 @@ static QStringList tweakedArguments(const QString &filePath, } else if (argument == QLatin1String("-o")) { skip = true; continue; - } else if (QDir::fromNativeSeparators(argument) == filePath) { + } else if (QDir::fromNativeSeparators(argument) == inputFile) { continue; // TODO: Let it in? } @@ -139,8 +139,74 @@ static QStringList tweakedArguments(const QString &filePath, } QTC_CHECK(skip == false); - prependWordWidthArgumentIfNotIncluded(&newArguments, wordWidth); - prependTargetTripleIfNotIncludedAndNotEmpty(&newArguments, targetTriple); + return newArguments; +} + +static void appendMsCompatibility2015OptionForMsvc2015(QStringList *arguments, bool isMsvc2015) +{ + QTC_ASSERT(arguments, return); + + if (isMsvc2015) + arguments->append(QLatin1String("-fms-compatibility-version=19")); +} + +static QStringList languageFeatureMacros() +{ + // Collected with: + // $ CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 + // $ D:\usr\llvm-3.8.0\bin\clang++.exe -fms-compatibility-version=19 -std=c++1y -dM -E D:\empty.cpp | grep __cpp_ + static QStringList macros { + QLatin1String("__cpp_aggregate_nsdmi"), + QLatin1String("__cpp_alias_templates"), + QLatin1String("__cpp_attributes"), + QLatin1String("__cpp_binary_literals"), + QLatin1String("__cpp_constexpr"), + QLatin1String("__cpp_decltype"), + QLatin1String("__cpp_decltype_auto"), + QLatin1String("__cpp_delegating_constructors"), + QLatin1String("__cpp_digit_separators"), + QLatin1String("__cpp_generic_lambdas"), + QLatin1String("__cpp_inheriting_constructors"), + QLatin1String("__cpp_init_captures"), + QLatin1String("__cpp_initializer_lists"), + QLatin1String("__cpp_lambdas"), + QLatin1String("__cpp_nsdmi"), + QLatin1String("__cpp_range_based_for"), + QLatin1String("__cpp_raw_strings"), + QLatin1String("__cpp_ref_qualifiers"), + QLatin1String("__cpp_return_type_deduction"), + QLatin1String("__cpp_rtti"), + QLatin1String("__cpp_rvalue_references"), + QLatin1String("__cpp_static_assert"), + QLatin1String("__cpp_unicode_characters"), + QLatin1String("__cpp_unicode_literals"), + QLatin1String("__cpp_user_defined_literals"), + QLatin1String("__cpp_variable_templates"), + QLatin1String("__cpp_variadic_templates"), + }; + + return macros; +} + +static void undefineCppLanguageFeatureMacrosForMsvc2015(QStringList *arguments, bool isMsvc2015) +{ + QTC_ASSERT(arguments, return); + + if (isMsvc2015) { + foreach (const QString ¯oName, languageFeatureMacros()) + arguments->append(QLatin1String("/U") + macroName); + } +} + +static QStringList tweakedArguments(const QString &filePath, + const QStringList &arguments, + const ExtraToolChainInfo &extraParams) +{ + QStringList newArguments = inputAndOutputArgumentsRemoved(filePath, arguments); + prependWordWidthArgumentIfNotIncluded(&newArguments, extraParams.wordWidth); + prependTargetTripleIfNotIncludedAndNotEmpty(&newArguments, extraParams.targetTriple); + appendMsCompatibility2015OptionForMsvc2015(&newArguments, extraParams.isMsvc2015); + undefineCppLanguageFeatureMacrosForMsvc2015(&newArguments, extraParams.isMsvc2015); return newArguments; } @@ -167,10 +233,11 @@ class ClangStaticAnalyzerOptionsBuilder : public CompilerOptionsBuilder public: static QStringList build(const CppTools::ProjectPart &projectPart, CppTools::ProjectFile::Kind fileKind, - unsigned char wordWidth, - const QString &targetTriple) + const ExtraToolChainInfo &extraParams) { ClangStaticAnalyzerOptionsBuilder optionsBuilder(projectPart); + + optionsBuilder.addTargetTriple(); optionsBuilder.addLanguageOption(fileKind); optionsBuilder.addOptionsForLanguage(false); @@ -192,8 +259,9 @@ public: optionsBuilder.add(QLatin1String("-fPIC")); // TODO: Remove? QStringList options = optionsBuilder.options(); - prependWordWidthArgumentIfNotIncluded(&options, wordWidth); - prependTargetTripleIfNotIncludedAndNotEmpty(&options, targetTriple); + prependWordWidthArgumentIfNotIncluded(&options, extraParams.wordWidth); + appendMsCompatibility2015OptionForMsvc2015(&options, extraParams.isMsvc2015); + undefineCppLanguageFeatureMacrosForMsvc2015(&options, extraParams.isMsvc2015); return options; } @@ -205,6 +273,15 @@ private: { } + void addTargetTriple() override + { + // For MSVC toolchains we use clang-cl.exe, so there is nothing to do here since + // 1) clang-cl.exe does not understand the "-triple" option + // 2) clang-cl.exe already hardcodes the right triple value (even if built with mingw) + if (m_projectPart.toolchainType != ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID) + CompilerOptionsBuilder::addTargetTriple(); + } + void addLanguageOption(ProjectFile::Kind fileKind) override { if (m_isMsvcToolchain) @@ -240,8 +317,7 @@ private: static AnalyzeUnits unitsToAnalyzeFromCompilerCallData( const ProjectInfo::CompilerCallData &compilerCallData, - unsigned char wordWidth, - const QString &targetTriple) + const ExtraToolChainInfo &extraParams) { qCDebug(LOG) << "Taking arguments for analyzing from CompilerCallData."; @@ -253,7 +329,7 @@ static AnalyzeUnits unitsToAnalyzeFromCompilerCallData( const QString file = it.key(); const QList<QStringList> compilerCalls = it.value(); foreach (const QStringList &options, compilerCalls) { - const QStringList arguments = tweakedArguments(file, options, wordWidth, targetTriple); + const QStringList arguments = tweakedArguments(file, options, extraParams); unitsToAnalyze << AnalyzeUnit(file, arguments); } } @@ -262,8 +338,7 @@ static AnalyzeUnits unitsToAnalyzeFromCompilerCallData( } static AnalyzeUnits unitsToAnalyzeFromProjectParts(const QList<ProjectPart::Ptr> projectParts, - unsigned char wordWidth, - const QString &targetTriple) + const ExtraToolChainInfo &extraParams) { qCDebug(LOG) << "Taking arguments for analyzing from ProjectParts."; @@ -281,8 +356,7 @@ static AnalyzeUnits unitsToAnalyzeFromProjectParts(const QList<ProjectPart::Ptr> const QStringList arguments = ClangStaticAnalyzerOptionsBuilder::build(*projectPart.data(), file.kind, - wordWidth, - targetTriple); + extraParams); unitsToAnalyze << AnalyzeUnit(file.path, arguments); } } @@ -297,15 +371,10 @@ AnalyzeUnits ClangStaticAnalyzerRunControl::sortedUnitsToAnalyze() AnalyzeUnits units; const ProjectInfo::CompilerCallData compilerCallData = m_projectInfo.compilerCallData(); - if (compilerCallData.isEmpty()) { - units = unitsToAnalyzeFromProjectParts(m_projectInfo.projectParts(), - m_wordWidth, - m_targetTriple); - } else { - units = unitsToAnalyzeFromCompilerCallData(compilerCallData, - m_wordWidth, - m_targetTriple); - } + if (compilerCallData.isEmpty()) + units = unitsToAnalyzeFromProjectParts(m_projectInfo.projectParts(), m_extraToolChainInfo); + else + units = unitsToAnalyzeFromCompilerCallData(compilerCallData, m_extraToolChainInfo); Utils::sort(units, [](const AnalyzeUnit &a1, const AnalyzeUnit &a2) -> bool { return a1.file < a2.file; diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h index f1e5e34c02..e4b875c1ad 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h @@ -47,6 +47,12 @@ struct AnalyzeUnit { }; typedef QList<AnalyzeUnit> AnalyzeUnits; +struct ExtraToolChainInfo { + unsigned char wordWidth = 0; + QString targetTriple; + bool isMsvc2015 = false; +}; + class ClangStaticAnalyzerRunControl : public Debugger::AnalyzerRunControl { Q_OBJECT @@ -81,8 +87,7 @@ private: private: const CppTools::ProjectInfo m_projectInfo; - const unsigned char m_wordWidth; - QString m_targetTriple; + ExtraToolChainInfo m_extraToolChainInfo; Utils::Environment m_environment; QString m_clangExecutable; diff --git a/src/plugins/classview/classview.pro b/src/plugins/classview/classview.pro index b5d89be118..6d709d18f5 100644 --- a/src/plugins/classview/classview.pro +++ b/src/plugins/classview/classview.pro @@ -24,6 +24,3 @@ SOURCES += \ classviewsymbollocation.cpp \ classviewtreeitemmodel.cpp \ classviewutils.cpp - -RESOURCES += \ - classview.qrc diff --git a/src/plugins/classview/classview.qbs b/src/plugins/classview/classview.qbs index d564800f11..bc22d5ce68 100644 --- a/src/plugins/classview/classview.qbs +++ b/src/plugins/classview/classview.qbs @@ -13,7 +13,6 @@ QtcPlugin { Depends { name: "TextEditor" } files: [ - "classview.qrc", "classviewconstants.h", "classviewmanager.cpp", "classviewmanager.h", "classviewnavigationwidget.cpp", "classviewnavigationwidget.h", diff --git a/src/plugins/classview/classview.qrc b/src/plugins/classview/classview.qrc deleted file mode 100644 index 189357bc0b..0000000000 --- a/src/plugins/classview/classview.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/classview"> - <file>images/hierarchicalmode.png</file> - </qresource> -</RCC> diff --git a/src/plugins/classview/classviewnavigationwidget.cpp b/src/plugins/classview/classviewnavigationwidget.cpp index 2499f968c2..bd8d72776a 100644 --- a/src/plugins/classview/classviewnavigationwidget.cpp +++ b/src/plugins/classview/classviewnavigationwidget.cpp @@ -31,6 +31,9 @@ #include "classviewconstants.h" #include <coreplugin/find/itemviewfind.h> + +#include <cplusplus/Icons.h> + #include <utils/navigationtreeview.h> #include <utils/qtcassert.h> @@ -170,7 +173,7 @@ QList<QToolButton *> NavigationWidget::createToolButtons() // create a button fullProjectsModeButton = new QToolButton(); fullProjectsModeButton->setIcon( - QIcon(QLatin1String(":/classview/images/hierarchicalmode.png"))); + CPlusPlus::Icons::iconForType(CPlusPlus::Icons::ClassIconType)); fullProjectsModeButton->setCheckable(true); fullProjectsModeButton->setToolTip(tr("Show Subprojects")); diff --git a/src/plugins/classview/classviewtreeitemmodel.cpp b/src/plugins/classview/classviewtreeitemmodel.cpp index 2ce88dc31b..b00f8e3020 100644 --- a/src/plugins/classview/classviewtreeitemmodel.cpp +++ b/src/plugins/classview/classviewtreeitemmodel.cpp @@ -34,21 +34,6 @@ namespace ClassView { namespace Internal { -///////////////////////////////// TreeItemModelPrivate ////////////////////////////////// - -/*! - \class TreeItemModelPrivate - \brief The TreeItemModelPrivate class contains private class data for - the TreeItemModel class. - \sa TreeItemModel - */ -class TreeItemModelPrivate -{ -public: - //! icon provider - CPlusPlus::Icons icons; -}; - ///////////////////////////////// TreeItemModel ////////////////////////////////// /*! @@ -57,14 +42,12 @@ public: */ TreeItemModel::TreeItemModel(QObject *parent) - : QStandardItemModel(parent), - d(new TreeItemModelPrivate()) + : QStandardItemModel(parent) { } TreeItemModel::~TreeItemModel() { - delete d; } QVariant TreeItemModel::data(const QModelIndex &index, int role) const @@ -79,7 +62,7 @@ QVariant TreeItemModel::data(const QModelIndex &index, int role) const bool ok = false; int type = iconType.toInt(&ok); if (ok && type >= 0) - return d->icons.iconForType(static_cast<CPlusPlus::Icons::IconType>(type)); + return CPlusPlus::Icons::iconForType(static_cast<CPlusPlus::Icons::IconType>(type)); } } break; diff --git a/src/plugins/classview/images/hierarchicalmode.png b/src/plugins/classview/images/hierarchicalmode.png Binary files differdeleted file mode 100644 index 88432d2cb1..0000000000 --- a/src/plugins/classview/images/hierarchicalmode.png +++ /dev/null diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 28c0005323..e8e5e925ab 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -172,8 +172,8 @@ bool CMakeBuildStep::init(QList<const BuildStep *> &earlierSteps) if (!tool || !tool->isValid()) { emit addTask(Task(Task::Error, QCoreApplication::translate("CMakeProjectManager::CMakeBuildStep", - "Qt Creator needs a cmake tool set up to build. " - "Configure a cmake tool in the kit options."), + "Qt Creator needs a CMake Tool set up to build. " + "Configure a CMake Tool in the kit options."), Utils::FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); canInit = false; diff --git a/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp b/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp index e83f71fcde..5810dc7b16 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitconfigwidget.cpp @@ -344,13 +344,20 @@ void CMakeConfigurationKitConfigWidget::editConfigurationChanges() "separated from the variable value by \"=\".<br>" "You may provide a type hint by adding \":TYPE\" before the \"=\".")); - QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Apply|QDialogButtonBox::Cancel); + auto buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Apply + |QDialogButtonBox::Reset|QDialogButtonBox::Cancel); layout->addWidget(m_editor); layout->addWidget(buttons); connect(buttons, &QDialogButtonBox::accepted, m_dialog, &QDialog::accept); connect(buttons, &QDialogButtonBox::rejected, m_dialog, &QDialog::reject); + connect(buttons, &QDialogButtonBox::clicked, m_dialog, [buttons, this](QAbstractButton *button) { + if (button != buttons->button(QDialogButtonBox::Reset)) + return; + CMakeConfigurationKitInformation::setConfiguration(kit(), + CMakeConfigurationKitInformation::defaultConfiguration(kit())); + }); connect(m_dialog, &QDialog::accepted, this, &CMakeConfigurationKitConfigWidget::acceptChangesDialog); connect(m_dialog, &QDialog::rejected, this, &CMakeConfigurationKitConfigWidget::closeChangesDialog); connect(buttons->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index d303c23287..9cb110d6f8 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -323,15 +323,22 @@ void CMakeConfigurationKitInformation::fromStringList(Kit *k, const QStringList setConfiguration(k, result); } -QVariant CMakeConfigurationKitInformation::defaultValue(const Kit *k) const +CMakeConfig CMakeConfigurationKitInformation::defaultConfiguration(const Kit *k) { Q_UNUSED(k); - - // FIXME: Convert preload scripts CMakeConfig config; config << CMakeConfigItem(CMAKE_QMAKE_KEY, "%{Qt:qmakeExecutable}"); config << CMakeConfigItem(CMAKE_TOOLCHAIN_KEY, "%{Compiler:Executable}"); + return config; +} + +QVariant CMakeConfigurationKitInformation::defaultValue(const Kit *k) const +{ + Q_UNUSED(k); + + // FIXME: Convert preload scripts + CMakeConfig config = defaultConfiguration(k); const QStringList tmp = Utils::transform(config, [](const CMakeConfigItem &i) { return i.toString(); }); return tmp; diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.h b/src/plugins/cmakeprojectmanager/cmakekitinformation.h index 591e915fe3..3ee550cf01 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.h +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.h @@ -86,6 +86,8 @@ public: static QStringList toStringList(const ProjectExplorer::Kit *k); static void fromStringList(ProjectExplorer::Kit *k, const QStringList &in); + static CMakeConfig defaultConfiguration(const ProjectExplorer::Kit *k); + // KitInformation interface QVariant defaultValue(const ProjectExplorer::Kit *k) const override; QList<ProjectExplorer::Task> validate(const ProjectExplorer::Kit *k) const override; diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 4ee11e6074..b7dcd0eaa6 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -204,8 +204,11 @@ void CMakeProject::parseCMakeOutput() { auto cmakeBc = qobject_cast<CMakeBuildConfiguration *>(sender()); QTC_ASSERT(cmakeBc, return); - if (!activeTarget() || activeTarget()->activeBuildConfiguration() != cmakeBc) + + Target *t = activeTarget(); + if (!t || t->activeBuildConfiguration() != cmakeBc) return; + Kit *k = t->kit(); BuildDirManager *bdm = cmakeBc->buildDirManager(); QTC_ASSERT(bdm, return); @@ -216,10 +219,11 @@ void CMakeProject::parseCMakeOutput() bdm->clearFiles(); // Some of the FileNodes in files() were deleted! updateApplicationAndDeploymentTargets(); + updateTargetRunConfigurations(t); createGeneratedCodeModelSupport(); - ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(cmakeBc->target()->kit()); + ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k); if (!tc) { emit fileListChanged(); return; @@ -230,7 +234,7 @@ void CMakeProject::parseCMakeOutput() CppTools::ProjectPartBuilder ppBuilder(pinfo); CppTools::ProjectPart::QtVersion activeQtVersion = CppTools::ProjectPart::NoQt; - if (QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(cmakeBc->target()->kit())) { + if (QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(k)) { if (qtVersion->qtVersion() < QtSupport::QtVersionNumber(5,0,0)) activeQtVersion = CppTools::ProjectPart::Qt4; else @@ -264,8 +268,6 @@ void CMakeProject::parseCMakeOutput() emit fileListChanged(); emit cmakeBc->emitBuildTypeChanged(); - - updateRunConfigurations(); } bool CMakeProject::needsConfiguration() const @@ -278,6 +280,11 @@ bool CMakeProject::requiresTargetPanel() const return !targets().isEmpty(); } +bool CMakeProject::knowsAllBuildExecutables() const +{ + return false; +} + bool CMakeProject::supportsKit(Kit *k, QString *errorMessage) const { if (!CMakeKitInformation::cmakeTool(k)) { @@ -546,46 +553,33 @@ QStringList CMakeProject::filesGeneratedFrom(const QString &sourceFile) const } } -void CMakeProject::updateRunConfigurations() -{ - foreach (Target *t, targets()) - updateTargetRunConfigurations(t); -} - -// TODO Compare with updateDefaultRunConfigurations(); void CMakeProject::updateTargetRunConfigurations(Target *t) { - // create new and remove obsolete RCs using the factories - t->updateDefaultRunConfigurations(); + // *Update* existing runconfigurations (no need to update new ones!): + QHash<QString, const CMakeBuildTarget *> buildTargetHash; + const QList<CMakeBuildTarget> buildTargetList = buildTargets(); + foreach (const CMakeBuildTarget &bt, buildTargetList) { + if (bt.targetType != ExecutableType || bt.executable.isEmpty()) + continue; - // *Update* runconfigurations: - QMultiMap<QString, CMakeRunConfiguration*> existingRunConfigurations; - foreach (ProjectExplorer::RunConfiguration *rc, t->runConfigurations()) { - if (CMakeRunConfiguration* cmakeRC = qobject_cast<CMakeRunConfiguration *>(rc)) - existingRunConfigurations.insert(cmakeRC->title(), cmakeRC); + buildTargetHash.insert(bt.title, &bt); } - foreach (const CMakeBuildTarget &ct, buildTargets()) { - if (ct.targetType != ExecutableType) - continue; - if (ct.executable.isEmpty()) + foreach (RunConfiguration *rc, t->runConfigurations()) { + auto cmakeRc = qobject_cast<CMakeRunConfiguration *>(rc); + if (!cmakeRc) continue; - QList<CMakeRunConfiguration *> list = existingRunConfigurations.values(ct.title); - if (!list.isEmpty()) { - // Already exists, so override the settings... - foreach (CMakeRunConfiguration *rc, list) { - rc->setExecutable(ct.executable); - rc->setBaseWorkingDirectory(ct.workingDirectory); - rc->setEnabled(true); - } + + auto btIt = buildTargetHash.constFind(cmakeRc->title()); + cmakeRc->setEnabled(btIt != buildTargetHash.constEnd()); + if (btIt != buildTargetHash.constEnd()) { + cmakeRc->setExecutable(btIt.value()->executable); + cmakeRc->setBaseWorkingDirectory(btIt.value()->workingDirectory); } } - if (t->runConfigurations().isEmpty()) { - // Oh no, no run configuration, - // create a custom executable run configuration - t->addRunConfiguration(new QtSupport::CustomExecutableRunConfiguration(t)); - } + // create new and remove obsolete RCs using the factories + t->updateDefaultRunConfigurations(); } void CMakeProject::updateApplicationAndDeploymentTargets() diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h index fabdc6da14..f6616ef9d8 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.h +++ b/src/plugins/cmakeprojectmanager/cmakeproject.h @@ -105,6 +105,7 @@ public: bool needsConfiguration() const override; bool requiresTargetPanel() const override; + bool knowsAllBuildExecutables() const override; bool supportsKit(ProjectExplorer::Kit *k, QString *errorMessage = 0) const override; @@ -124,8 +125,6 @@ private: void handleParsingStarted(); void parseCMakeOutput(); - void updateRunConfigurations(); - void buildTree(Internal::CMakeProjectNode *rootNode, QList<ProjectExplorer::FileNode *> list); void gatherFileNodes(ProjectExplorer::FolderNode *parent, QList<ProjectExplorer::FileNode *> &list) const; ProjectExplorer::FolderNode *findOrCreateFolder(Internal::CMakeProjectNode *rootNode, QString directory); diff --git a/src/plugins/coreplugin/core.qrc b/src/plugins/coreplugin/core.qrc index 291038d870..a4fa04d2c0 100644 --- a/src/plugins/coreplugin/core.qrc +++ b/src/plugins/coreplugin/core.qrc @@ -103,5 +103,13 @@ <file>images/Desktop.png</file> <file>images/zoom.png</file> <file>images/zoom@2x.png</file> + <file>images/interrupt_small.png</file> + <file>images/interrupt_small@2x.png</file> + <file>images/run_small.png</file> + <file>images/run_small@2x.png</file> + <file>images/stop_small.png</file> + <file>images/stop_small@2x.png</file> + <file>images/boundingrect.png</file> + <file>images/boundingrect@2x.png</file> </qresource> </RCC> diff --git a/src/plugins/coreplugin/coreicons.cpp b/src/plugins/coreplugin/coreicons.cpp index 827caa16a6..1980a7779a 100644 --- a/src/plugins/coreplugin/coreicons.cpp +++ b/src/plugins/coreplugin/coreicons.cpp @@ -135,9 +135,19 @@ const Icon INFO_TOOLBAR({ const Icon EXPAND({ {QLatin1String(":/find/images/expand.png"), Theme::IconsBaseColor}}); const Icon ZOOM({ + {QLatin1String(":/core/images/zoom.png"), Theme::PanelTextColorMid}}, Icon::Tint); +const Icon ZOOM_TOOLBAR({ {QLatin1String(":/core/images/zoom.png"), Theme::IconsBaseColor}}); const Icon TOOLBAR_EXTENSION({ {QLatin1String(":/core/images/extension.png"), Theme::IconsBaseColor}}); +const Utils::Icon RUN_SMALL({ + {QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunColor}}); +const Utils::Icon STOP_SMALL({ + {QLatin1String(":/core/images/stop_small.png"), Utils::Theme::IconsStopColor}}); +const Utils::Icon INTERRUPT_SMALL({ + {QLatin1String(":/core/images/interrupt_small.png"), Utils::Theme::IconsInterruptColor}}); +const Icon BOUNDING_RECT({ + {QLatin1String(":/core/images/boundingrect.png"), Theme::IconsBaseColor}}); const Icon MODE_EDIT_CLASSIC( QLatin1String(":/fancyactionbar/images/mode_Edit.png")); diff --git a/src/plugins/coreplugin/coreicons.h b/src/plugins/coreplugin/coreicons.h index 048c356f94..60784a2e5c 100644 --- a/src/plugins/coreplugin/coreicons.h +++ b/src/plugins/coreplugin/coreicons.h @@ -84,7 +84,12 @@ CORE_EXPORT extern const Utils::Icon INFO; CORE_EXPORT extern const Utils::Icon INFO_TOOLBAR; CORE_EXPORT extern const Utils::Icon EXPAND; CORE_EXPORT extern const Utils::Icon ZOOM; +CORE_EXPORT extern const Utils::Icon ZOOM_TOOLBAR; CORE_EXPORT extern const Utils::Icon TOOLBAR_EXTENSION; +CORE_EXPORT extern const Utils::Icon RUN_SMALL; +CORE_EXPORT extern const Utils::Icon STOP_SMALL; +CORE_EXPORT extern const Utils::Icon INTERRUPT_SMALL; +CORE_EXPORT extern const Utils::Icon BOUNDING_RECT; CORE_EXPORT extern const Utils::Icon MODE_EDIT_CLASSIC; CORE_EXPORT extern const Utils::Icon MODE_EDIT_FLAT; diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index a0695767c6..a2fcb520c4 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -268,7 +268,6 @@ QtcPlugin { "filesystemfilter.ui", "ilocatorfilter.cpp", "ilocatorfilter.h", - "locator.qrc", "locatorconstants.h", "locatorfiltersfilter.cpp", "locatorfiltersfilter.h", @@ -285,8 +284,6 @@ QtcPlugin { "locatorsettingspage.cpp", "locatorsettingspage.h", "locatorsettingspage.ui", - "images/locator.png", - "images/reload.png", ] } diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 862445b47b..470e623d45 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1540,6 +1540,10 @@ void EditorManagerPrivate::setupSaveActions(IDocument *document, QAction *saveAc revertToSavedAction->setText(document->isModified() ? tr("Revert %1 to Saved").arg(quotedName) : tr("Reload %1").arg(quotedName)); + } else { + saveAction->setText(EditorManager::tr("&Save")); + saveAsAction->setText(EditorManager::tr("Save &As...")); + revertToSavedAction->setText(EditorManager::tr("Revert to Saved")); } } diff --git a/src/plugins/coreplugin/fancytabwidget.cpp b/src/plugins/coreplugin/fancytabwidget.cpp index bd3fe6114b..c4b942e0c5 100644 --- a/src/plugins/coreplugin/fancytabwidget.cpp +++ b/src/plugins/coreplugin/fancytabwidget.cpp @@ -404,6 +404,20 @@ public: emit clicked(ev->button(), ev->modifiers()); } + void paintEvent(QPaintEvent *event) + { + QWidget::paintEvent(event); + + // Some Themes do not want highlights and shadows in the toolbars. + // But we definitely want a separator between FancyColorButton and FancyTabBar + if (!creatorTheme()->flag(Theme::DrawToolBarHighlights)) { + QPainter p(this); + p.setPen(StyleHelper::borderColor()); + const QRectF innerRect = QRectF(rect()).adjusted(0.5, 0.5, -0.5, -0.5); + p.drawLine(innerRect.bottomLeft(), innerRect.bottomRight()); + } + } + signals: void clicked(Qt::MouseButton button, Qt::KeyboardModifiers modifiers); }; diff --git a/src/plugins/qmldesigner/components/formeditor/boundingrect.png b/src/plugins/coreplugin/images/boundingrect.png Binary files differindex 0a91478d6d..0a91478d6d 100644 --- a/src/plugins/qmldesigner/components/formeditor/boundingrect.png +++ b/src/plugins/coreplugin/images/boundingrect.png diff --git a/src/plugins/qmldesigner/components/formeditor/boundingrect@2x.png b/src/plugins/coreplugin/images/boundingrect@2x.png Binary files differindex 43ea7993fb..43ea7993fb 100644 --- a/src/plugins/qmldesigner/components/formeditor/boundingrect@2x.png +++ b/src/plugins/coreplugin/images/boundingrect@2x.png diff --git a/src/plugins/projectexplorer/images/interrupt_small.png b/src/plugins/coreplugin/images/interrupt_small.png Binary files differindex 1be511a21f..1be511a21f 100644 --- a/src/plugins/projectexplorer/images/interrupt_small.png +++ b/src/plugins/coreplugin/images/interrupt_small.png diff --git a/src/plugins/projectexplorer/images/interrupt_small@2x.png b/src/plugins/coreplugin/images/interrupt_small@2x.png Binary files differindex dd5e213f2d..dd5e213f2d 100644 --- a/src/plugins/projectexplorer/images/interrupt_small@2x.png +++ b/src/plugins/coreplugin/images/interrupt_small@2x.png diff --git a/src/plugins/projectexplorer/images/run_small.png b/src/plugins/coreplugin/images/run_small.png Binary files differindex d1a9c205a5..d1a9c205a5 100644 --- a/src/plugins/projectexplorer/images/run_small.png +++ b/src/plugins/coreplugin/images/run_small.png diff --git a/src/plugins/projectexplorer/images/run_small@2x.png b/src/plugins/coreplugin/images/run_small@2x.png Binary files differindex 6672a17739..6672a17739 100644 --- a/src/plugins/projectexplorer/images/run_small@2x.png +++ b/src/plugins/coreplugin/images/run_small@2x.png diff --git a/src/plugins/projectexplorer/images/stop_small.png b/src/plugins/coreplugin/images/stop_small.png Binary files differindex 50571390da..50571390da 100644 --- a/src/plugins/projectexplorer/images/stop_small.png +++ b/src/plugins/coreplugin/images/stop_small.png diff --git a/src/plugins/projectexplorer/images/stop_small@2x.png b/src/plugins/coreplugin/images/stop_small@2x.png Binary files differindex 59b578d1c0..59b578d1c0 100644 --- a/src/plugins/projectexplorer/images/stop_small@2x.png +++ b/src/plugins/coreplugin/images/stop_small@2x.png diff --git a/src/plugins/coreplugin/locator/images/locator.png b/src/plugins/coreplugin/locator/images/locator.png Binary files differdeleted file mode 100644 index 000ee1c018..0000000000 --- a/src/plugins/coreplugin/locator/images/locator.png +++ /dev/null diff --git a/src/plugins/coreplugin/locator/images/reload.png b/src/plugins/coreplugin/locator/images/reload.png Binary files differdeleted file mode 100644 index b5afefb32b..0000000000 --- a/src/plugins/coreplugin/locator/images/reload.png +++ /dev/null diff --git a/src/plugins/coreplugin/locator/locator.pri b/src/plugins/coreplugin/locator/locator.pri index c697437d69..e80765bfc5 100644 --- a/src/plugins/coreplugin/locator/locator.pri +++ b/src/plugins/coreplugin/locator/locator.pri @@ -36,9 +36,6 @@ FORMS += \ $$PWD/directoryfilter.ui \ $$PWD/locatorsettingspage.ui -RESOURCES += \ - $$PWD/locator.qrc - equals(TEST, 1) { HEADERS += $$PWD/locatorfiltertest.h SOURCES += \ diff --git a/src/plugins/coreplugin/locator/locator.qrc b/src/plugins/coreplugin/locator/locator.qrc deleted file mode 100644 index 4cd5df4f13..0000000000 --- a/src/plugins/coreplugin/locator/locator.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/locator"> - <file>images/reload.png</file> - <file>images/locator.png</file> - </qresource> -</RCC> diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index 44917a54a4..1299d1133b 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -248,7 +248,7 @@ LocatorWidget::LocatorWidget(Locator *qop) : layout->setMargin(0); layout->addWidget(m_fileLineEdit); - setWindowIcon(QIcon(QLatin1String(":/locator/images/locator.png"))); + setWindowIcon(Icons::ZOOM.icon()); const QPixmap pixmap = Icons::MAGNIFIER.pixmap(); m_fileLineEdit->setFiltering(true); m_fileLineEdit->setButtonPixmap(Utils::FancyLineEdit::Left, pixmap); diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 374cb87da1..347bf72226 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -538,7 +538,7 @@ void MainWindow::registerDefaultActions() // Save Action icon = QIcon::fromTheme(QLatin1String("document-save"), Icons::SAVEFILE.icon()); - QAction *tmpaction = new QAction(icon, tr("&Save"), this); + QAction *tmpaction = new QAction(icon, EditorManager::tr("&Save"), this); tmpaction->setEnabled(false); cmd = ActionManager::registerAction(tmpaction, Constants::SAVE); cmd->setDefaultKeySequence(QKeySequence::Save); @@ -548,7 +548,7 @@ void MainWindow::registerDefaultActions() // Save As Action icon = QIcon::fromTheme(QLatin1String("document-save-as")); - tmpaction = new QAction(icon, tr("Save &As..."), this); + tmpaction = new QAction(icon, EditorManager::tr("Save &As..."), this); tmpaction->setEnabled(false); cmd = ActionManager::registerAction(tmpaction, Constants::SAVEAS); cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Ctrl+Shift+S") : QString())); diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 0c5cd6c39b..913ca572d3 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -917,7 +917,8 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti tool.rect = menuarea.adjusted(1, 1, -1, -1); if (mflags & (State_Sunken | State_On | State_Raised)) { painter->setPen(Qt::gray); - painter->drawLine(tool.rect.topLeft(), tool.rect.bottomLeft()); + const QRectF lineRect = QRectF(tool.rect).adjusted(-0.5, 2.5, 0, -2.5); + painter->drawLine(lineRect.topLeft(), lineRect.bottomLeft()); if (mflags & (State_Sunken)) { QColor shade(0, 0, 0, 50); painter->fillRect(tool.rect.adjusted(0, -1, 1, 1), shade); diff --git a/src/plugins/cppeditor/cppelementevaluator.cpp b/src/plugins/cppeditor/cppelementevaluator.cpp index 04a3a6096e..1800ddde7b 100644 --- a/src/plugins/cppeditor/cppelementevaluator.cpp +++ b/src/plugins/cppeditor/cppelementevaluator.cpp @@ -284,7 +284,7 @@ CppMacro::CppMacro(const Macro ¯o) CppDeclarableElement::CppDeclarableElement(Symbol *declaration) : CppElement() , declaration(declaration) - , icon(Icons().iconForSymbol(declaration)) + , icon(Icons::iconForSymbol(declaration)) { Overview overview; overview.showArgumentNames = true; diff --git a/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp b/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp index 1e14ad1294..b4886d9ea0 100644 --- a/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp +++ b/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp @@ -182,14 +182,13 @@ private: auto *item = new VirtualFunctionProposalItem(link, m_params.openInNextSplit); item->setText(text); - item->setIcon(m_icons.iconForSymbol(func)); + item->setIcon(Icons::iconForSymbol(func)); return item; } VirtualFunctionAssistProvider::Parameters m_params; Overview m_overview; - Icons m_icons; mutable SymbolFinder m_finder; }; diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index c484e2b185..b520babef1 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -61,6 +61,14 @@ void CompilerOptionsBuilder::addDefine(const QByteArray &defineLine) m_options.append(defineLineToDefineOption(defineLine)); } +void CompilerOptionsBuilder::addTargetTriple() +{ + if (!m_projectPart.targetTriple.isEmpty()) { + m_options.append(QLatin1String("-target")); + m_options.append(m_projectPart.targetTriple); + } +} + void CompilerOptionsBuilder::addHeaderPathOptions() { typedef ProjectPartHeaderPath HeaderPath; diff --git a/src/plugins/cpptools/compileroptionsbuilder.h b/src/plugins/cpptools/compileroptionsbuilder.h index e83d15f2c1..ebd2e789a8 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.h +++ b/src/plugins/cpptools/compileroptionsbuilder.h @@ -44,6 +44,7 @@ public: void addDefine(const QByteArray &defineLine); // Add options based on project part + virtual void addTargetTriple(); void addHeaderPathOptions(); void addToolchainAndProjectDefines(); virtual void addLanguageOption(ProjectFile::Kind fileKind); diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp index c801fd7100..1e87bbebf8 100644 --- a/src/plugins/cpptools/cppcompletionassist.cpp +++ b/src/plugins/cpptools/cppcompletionassist.cpp @@ -1010,7 +1010,7 @@ int InternalCppCompletionAssistProcessor::startCompletionHelper() if (m_model->m_completionOperator == T_DOXY_COMMENT) { for (int i = 1; i < T_DOXY_LAST_TAG; ++i) - addCompletionItem(QString::fromLatin1(doxygenTagSpell(i)), m_icons.keywordIcon()); + addCompletionItem(QString::fromLatin1(doxygenTagSpell(i)), Icons::keywordIcon()); return m_positionForProposal; } @@ -1193,7 +1193,7 @@ void InternalCppCompletionAssistProcessor::addCompletionItem(Symbol *symbol, int ConvertToCompletionItem toCompletionItem; AssistProposalItem *item = toCompletionItem(symbol); if (item) { - item->setIcon(m_icons.iconForSymbol(symbol)); + item->setIcon(Icons::iconForSymbol(symbol)); item->setOrder(order); m_completions.append(item); } @@ -1300,7 +1300,7 @@ void InternalCppCompletionAssistProcessor::completeInclude(const QString &realPa QString text = fileName.mid(realPath.length() + 1); if (fileInfo.isDir()) text += QLatin1Char('/'); - addCompletionItem(text, m_icons.keywordIcon()); + addCompletionItem(text, Icons::keywordIcon()); } } } @@ -1814,7 +1814,7 @@ bool InternalCppCompletionAssistProcessor::completeQtMethod(const QList<LookupIt break; signatures.insert(completionText); ci->setText(completionText); // fix the completion item. - ci->setIcon(m_icons.iconForSymbol(fun)); + ci->setIcon(Icons::iconForSymbol(fun)); if (wantQt5SignalOrSlot && fun->isSlot()) ci->setOrder(1); m_completions.append(ci); @@ -1841,7 +1841,7 @@ bool InternalCppCompletionAssistProcessor::completeQtMethodClassName( return false; const LookupContext &context = m_model->m_typeOfExpression->context(); - const QIcon classIcon = m_icons.iconForType(Icons::ClassIconType); + const QIcon classIcon = Icons::iconForType(Icons::ClassIconType); Overview overview; foreach (const LookupItem &lookupItem, results) { @@ -1866,16 +1866,16 @@ void InternalCppCompletionAssistProcessor::addKeywords() // keyword completion items. for (int i = T_FIRST_KEYWORD; i < keywordLimit; ++i) - addCompletionItem(QLatin1String(Token::name(i)), m_icons.keywordIcon(), KeywordsOrder); + addCompletionItem(QLatin1String(Token::name(i)), Icons::keywordIcon(), KeywordsOrder); // primitive type completion items. for (int i = T_FIRST_PRIMITIVE; i <= T_LAST_PRIMITIVE; ++i) - addCompletionItem(QLatin1String(Token::name(i)), m_icons.keywordIcon(), KeywordsOrder); + addCompletionItem(QLatin1String(Token::name(i)), Icons::keywordIcon(), KeywordsOrder); // "Identifiers with special meaning" if (m_interface->languageFeatures().cxx11Enabled) { - addCompletionItem(QLatin1String("override"), m_icons.keywordIcon(), KeywordsOrder); - addCompletionItem(QLatin1String("final"), m_icons.keywordIcon(), KeywordsOrder); + addCompletionItem(QLatin1String("override"), Icons::keywordIcon(), KeywordsOrder); + addCompletionItem(QLatin1String("final"), Icons::keywordIcon(), KeywordsOrder); } } @@ -1888,7 +1888,7 @@ void InternalCppCompletionAssistProcessor::addMacros(const QString &fileName, addMacros_helper(snapshot, fileName, &processed, &definedMacros); foreach (const QString ¯oName, definedMacros) - addCompletionItem(macroName, m_icons.macroIcon(), MacrosOrder); + addCompletionItem(macroName, Icons::macroIcon(), MacrosOrder); } void InternalCppCompletionAssistProcessor::addMacros_helper(const Snapshot &snapshot, diff --git a/src/plugins/cpptools/cppcompletionassistprocessor.h b/src/plugins/cpptools/cppcompletionassistprocessor.h index 6db68e1a1a..7ccc632e63 100644 --- a/src/plugins/cpptools/cppcompletionassistprocessor.h +++ b/src/plugins/cpptools/cppcompletionassistprocessor.h @@ -30,8 +30,6 @@ #include <texteditor/codeassist/iassistprocessor.h> #include <texteditor/snippets/snippetassistcollector.h> -#include <cplusplus/Icons.h> - #include <functional> QT_BEGIN_NAMESPACE @@ -66,7 +64,6 @@ protected: QList<TextEditor::AssistProposalItemInterface *> m_completions; QStringList m_preprocessorCompletions; TextEditor::IAssistProposal *m_hintProposal; - CPlusPlus::Icons m_icons; private: TextEditor::SnippetAssistCollector m_snippetCollector; diff --git a/src/plugins/cpptools/projectpart.h b/src/plugins/cpptools/projectpart.h index 8f1b5b2c1f..a4102c627f 100644 --- a/src/plugins/cpptools/projectpart.h +++ b/src/plugins/cpptools/projectpart.h @@ -103,6 +103,7 @@ public: // fields QByteArray projectDefines; QByteArray toolchainDefines; Core::Id toolchainType; + QString targetTriple; ProjectPartHeaderPaths headerPaths; QStringList precompiledHeaders; LanguageVersion languageVersion; diff --git a/src/plugins/cpptools/projectpartbuilder.cpp b/src/plugins/cpptools/projectpartbuilder.cpp index 50329aa7eb..2cc08c7bd5 100644 --- a/src/plugins/cpptools/projectpartbuilder.cpp +++ b/src/plugins/cpptools/projectpartbuilder.cpp @@ -262,6 +262,23 @@ ProjectPartHeaderPath toProjectPartHeaderPath(const ProjectExplorer::HeaderPath return ProjectPartHeaderPath(headerPath.path(), headerPathType); } +QString targetTriple(ProjectExplorer::Project *project, const Core::Id &toolchainId) +{ + using namespace ProjectExplorer; + + if (toolchainId == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID) + return QLatin1String("i686-pc-windows-msvc"); + + if (project) { + if (Target *target = project->activeTarget()) { + if (ToolChain *toolChain = ToolChainKitInformation::toolChain(target->kit())) + return toolChain->originalTargetTriple(); + } + } + + return QString(); +} + } /*! @@ -324,6 +341,7 @@ void ProjectPartBuilder::evaluateProjectPartToolchain( projectPart->toolchainDefines = toolChain->predefinedMacros(commandLineFlags); projectPart->toolchainType = toolChain->typeId(); + projectPart->targetTriple = targetTriple(projectPart->project, toolChain->typeId()); projectPart->updateLanguageFeatures(); } diff --git a/src/plugins/cpptools/searchsymbols.cpp b/src/plugins/cpptools/searchsymbols.cpp index 654e77a952..68988d099c 100644 --- a/src/plugins/cpptools/searchsymbols.cpp +++ b/src/plugins/cpptools/searchsymbols.cpp @@ -25,6 +25,7 @@ #include "searchsymbols.h" +#include <cplusplus/Icons.h> #include <cplusplus/LookupContext.h> #include <utils/qtcassert.h> #include <utils/scopedswap.h> @@ -292,7 +293,7 @@ IndexItem::Ptr SearchSymbols::addChildItem(const QString &symbolName, const QStr m_paths.insert(symbol->fileId(), path); } - const QIcon icon = icons.iconForSymbol(symbol); + const QIcon icon = Icons::iconForSymbol(symbol); IndexItem::Ptr newItem = IndexItem::create(findOrInsert(symbolName), findOrInsert(symbolType), findOrInsert(symbolScope), diff --git a/src/plugins/cpptools/searchsymbols.h b/src/plugins/cpptools/searchsymbols.h index cb4c7dea31..68580d6156 100644 --- a/src/plugins/cpptools/searchsymbols.h +++ b/src/plugins/cpptools/searchsymbols.h @@ -31,7 +31,6 @@ #include "stringtable.h" #include <cplusplus/CppDocument.h> -#include <cplusplus/Icons.h> #include <cplusplus/Overview.h> #include <QString> @@ -107,7 +106,6 @@ private: IndexItem::Ptr _parent; QString _scope; CPlusPlus::Overview overview; - CPlusPlus::Icons icons; SymbolTypes symbolsToSearchFor; QHash<const CPlusPlus::StringLiteral *, QString> m_paths; }; diff --git a/src/plugins/debugger/analyzer/analyzericons.h b/src/plugins/debugger/analyzer/analyzericons.h index c423b27f6d..ac09fe84ef 100644 --- a/src/plugins/debugger/analyzer/analyzericons.h +++ b/src/plugins/debugger/analyzer/analyzericons.h @@ -31,8 +31,8 @@ namespace Debugger { namespace Icons { const Utils::Icon ANALYZER_CONTROL_START({ - {QLatin1String(":/images/analyzer_overlay_small.png"), Utils::Theme::IconsBaseColor}, - {QLatin1String(":/core/images/run_overlay_small.png"), Utils::Theme::IconsRunColor}}); + {QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunColor}, + {QLatin1String(":/images/analyzer_overlay_small.png"), Utils::Theme::IconsBaseColor}}); const Utils::Icon MODE_ANALYZE_CLASSIC( QLatin1String(":/images/mode_analyze.png")); const Utils::Icon MODE_ANALYZE_FLAT({ diff --git a/src/plugins/debugger/analyzer/images/analyzer_overlay_small.png b/src/plugins/debugger/analyzer/images/analyzer_overlay_small.png Binary files differindex 138391ddd0..4e22d67ab0 100644 --- a/src/plugins/debugger/analyzer/images/analyzer_overlay_small.png +++ b/src/plugins/debugger/analyzer/images/analyzer_overlay_small.png diff --git a/src/plugins/debugger/analyzer/images/analyzer_overlay_small@2x.png b/src/plugins/debugger/analyzer/images/analyzer_overlay_small@2x.png Binary files differindex 7fb5ea48b7..f8da44ca48 100644 --- a/src/plugins/debugger/analyzer/images/analyzer_overlay_small@2x.png +++ b/src/plugins/debugger/analyzer/images/analyzer_overlay_small@2x.png diff --git a/src/plugins/debugger/debugger.qrc b/src/plugins/debugger/debugger.qrc index cea824430d..d7bd49643d 100644 --- a/src/plugins/debugger/debugger.qrc +++ b/src/plugins/debugger/debugger.qrc @@ -4,14 +4,10 @@ <file>images/debugger_breakpoints.png</file> <file>images/debugger_continue.png</file> <file>images/debugger_continue@2x.png</file> - <file>images/debugger_continue_mask.png</file> - <file>images/debugger_continue_mask@2x.png</file> - <file>images/stop_overlay_small.png</file> - <file>images/stop_overlay_small@2x.png</file> - <file>images/interrupt_overlay_small.png</file> - <file>images/interrupt_overlay_small@2x.png</file> - <file>images/continue_overlay_small.png</file> - <file>images/continue_overlay_small@2x.png</file> + <file>images/debugger_continue_1_mask.png</file> + <file>images/debugger_continue_1_mask@2x.png</file> + <file>images/debugger_continue_2_mask.png</file> + <file>images/debugger_continue_2_mask@2x.png</file> <file>images/debugger_empty_14.png</file> <file>images/debugger_interrupt.png</file> <file>images/debugger_interrupt@2x.png</file> @@ -50,6 +46,10 @@ <file>images/qml/apply-on-save.png</file> <file>images/debugger_restart_small.png</file> <file>images/debugger_restart_small@2x.png</file> + <file>images/recordfill.png</file> + <file>images/recordfill@2x.png</file> + <file>images/recordoutline.png</file> + <file>images/recordoutline@2x.png</file> <file>Debugger.mimetypes.xml</file> </qresource> </RCC> diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 9bcef1cf68..0f7f1ff0b8 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -168,12 +168,6 @@ enum RemoteSetupState { RemoteSetupNone, RemoteSetupRequested, RemoteSetupSucceeded, RemoteSetupFailed, RemoteSetupCancelled }; -struct TypeInfo -{ - TypeInfo(uint s = 0) : size(s) {} - uint size; -}; - class DebuggerEnginePrivate : public QObject { Q_OBJECT @@ -342,7 +336,6 @@ public: bool m_isStateDebugging; Utils::FileInProjectFinder m_fileFinder; - QHash<QByteArray, TypeInfo> m_typeInfoCache; QByteArray m_qtNamespace; }; @@ -1997,31 +1990,13 @@ void DebuggerEngine::updateLocalsView(const GdbMi &all) { WatchHandler *handler = watchHandler(); - const bool partial = all["partial"].toInt(); - const GdbMi typeInfo = all["typeinfo"]; - if (typeInfo.type() == GdbMi::List) { - foreach (const GdbMi &s, typeInfo.children()) { - const GdbMi name = s["name"]; - const GdbMi size = s["size"]; - if (name.isValid() && size.isValid()) - d->m_typeInfoCache.insert(QByteArray::fromHex(name.data()), - TypeInfo(size.data().toUInt())); - } - } + handler->recordTypeInfo(typeInfo); - GdbMi data = all["data"]; - foreach (const GdbMi &child, data.children()) { - WatchItem *item = new WatchItem; - item->parse(child); - const TypeInfo ti = d->m_typeInfoCache.value(item->type); - if (ti.size && !item->size) - item->size = ti.size; + const GdbMi data = all["data"]; + handler->insertItems(data); - handler->insertItem(item); - } - - GdbMi ns = all["qtnamespace"]; + const GdbMi ns = all["qtnamespace"]; if (ns.isValid()) { setQtNamespace(ns.data()); showMessage(_("FOUND NAMESPACED QT: " + ns.data())); @@ -2034,6 +2009,7 @@ void DebuggerEngine::updateLocalsView(const GdbMi &all) DebuggerToolTipManager::updateEngine(this); + const bool partial = all["partial"].toInt(); if (!partial) emit stackFrameCompleted(); } diff --git a/src/plugins/debugger/debuggericons.h b/src/plugins/debugger/debuggericons.h index fd2d1837c4..fe577c2c50 100644 --- a/src/plugins/debugger/debuggericons.h +++ b/src/plugins/debugger/debuggericons.h @@ -45,22 +45,24 @@ const Utils::Icon TRACEPOINT( const Utils::Icon CONTINUE( QLatin1String(":/debugger/images/debugger_continue.png")); const Utils::Icon CONTINUE_FLAT({ - {QLatin1String(":/projectexplorer/images/debugger_beetle_mask.png"), Utils::Theme::IconsDebugColor}, - {QLatin1String(":/debugger/images/debugger_continue_mask.png"), Utils::Theme::IconsRunColor}}); + {QLatin1String(":/debugger/images/debugger_continue_1_mask.png"), Utils::Theme::IconsInterruptColor}, + {QLatin1String(":/debugger/images/debugger_continue_2_mask.png"), Utils::Theme::IconsRunColor}, + {QLatin1String(":/projectexplorer/images/debugger_beetle_mask.png"), Utils::Theme::IconsDebugColor}}); const Utils::Icon DEBUG_CONTINUE_SMALL({ - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}, - {QLatin1String(":/debugger/images/continue_overlay_small.png"), Utils::Theme::IconsRunColor}}); + {QLatin1String(":/projectexplorer/images/continue_1_small.png"), Utils::Theme::IconsInterruptColor}, + {QLatin1String(":/projectexplorer/images/continue_2_small.png"), Utils::Theme::IconsRunColor}, + {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}}); const Utils::Icon INTERRUPT( QLatin1String(":/debugger/images/debugger_interrupt.png")); const Utils::Icon INTERRUPT_FLAT({ - {QLatin1String(":/projectexplorer/images/debugger_beetle_mask.png"), Utils::Theme::IconsDebugColor}, - {QLatin1String(":/debugger/images/debugger_interrupt_mask.png"), Utils::Theme::IconsInterruptColor}}); + {QLatin1String(":/debugger/images/debugger_interrupt_mask.png"), Utils::Theme::IconsInterruptColor}, + {QLatin1String(":/projectexplorer/images/debugger_beetle_mask.png"), Utils::Theme::IconsDebugColor}}); const Utils::Icon DEBUG_INTERRUPT_SMALL({ - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}, - {QLatin1String(":/debugger/images/interrupt_overlay_small.png"), Utils::Theme::IconsInterruptColor}}); + {QLatin1String(":/core/images/interrupt_small.png"), Utils::Theme::IconsInterruptColor}, + {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}}); const Utils::Icon DEBUG_EXIT_SMALL({ - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}, - {QLatin1String(":/debugger/images/stop_overlay_small.png"), Utils::Theme::IconsStopColor}}); + {QLatin1String(":/core/images/stop_small.png"), Utils::Theme::IconsStopColor}, + {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}}); const Utils::Icon LOCATION( QLatin1String(":/debugger/images/location_16.png")); const Utils::Icon SNAPSHOT( @@ -75,6 +77,12 @@ const Utils::Icon SELECT( QLatin1String(":/debugger/images/qml/select.png")); const Utils::Icon EMPTY( QLatin1String(":/debugger/images/debugger_empty_14.png")); +const Utils::Icon RECORD_ON({ + {QLatin1String(":/debugger/images/recordfill.png"), Utils::Theme::IconsStopColor}, + {QLatin1String(":/debugger/images/recordoutline.png"), Utils::Theme::IconsBaseColor}}, Utils::Icon::Tint | Utils::Icon::DropShadow); +const Utils::Icon RECORD_OFF({ + {QLatin1String(":/debugger/images/recordfill.png"), Utils::Theme::IconsDisabledColor}, + {QLatin1String(":/debugger/images/recordoutline.png"), Utils::Theme::IconsBaseColor}}, Utils::Icon::Tint | Utils::Icon::DropShadow); const Utils::Icon STEP_OVER({ {QLatin1String(":/debugger/images/debugger_stepover_small.png"), Utils::Theme::IconsBaseColor}}); diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index 726673b4d9..8d8749709f 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -79,22 +79,15 @@ DebuggerMainWindow::DebuggerMainWindow() DebuggerMainWindow::~DebuggerMainWindow() { - // We keep track of widgets for operations that haven't been activated, yet, and make sure we - // don't leak any. + // As we have to setParent(0) on dock widget that are not selected, + // we keep track of all and make sure we don't leak any foreach (const Perspective &perspective, m_perspectiveForPerspectiveId) { foreach (const Perspective::Operation &operation, perspective.operations()) { - if (operation.widget) { - // There are two possible states: Either addDockForWidget(widget) has - // been called on an operation.widget (e.g. when the perspective gets - // activated for the first time), or not. In the first case we don't - // have to explicitly delete it as we have called setParent(this) on - // it. In the second case, if the widget didn't have a parent before, - // we have to delete it. - if (!operation.widget->parentWidget()) { - // These are from perspectives that were never activated and didn't - // have a parent to begin with. - delete operation.widget; - } + if (operation.widget && !operation.widget->parentWidget()) { + // These are from inactive perspectives. We call setParent(0) when deactivating + // a perspective so that the widgets can't be accidentally enabled in the wrong + // perspectives. That's why we have to delete them manually here. + delete operation.widget; } } } @@ -266,9 +259,10 @@ void DebuggerMainWindow::loadPerspectiveHelper(const QByteArray &perspectiveId, foreach (QDockWidget *dockWidget, m_dockForDockId) { QTC_ASSERT(dockWidget, continue); dockWidget->setFloating(false); - dockWidget->setParent(this); removeDockWidget(dockWidget); dockWidget->hide(); + // Prevent saveState storing the data of the wrong children. + dockWidget->setParent(0); } ICore::removeAdditionalContext(Context(Id::fromName(m_currentPerspectiveId))); @@ -303,6 +297,8 @@ void DebuggerMainWindow::loadPerspectiveHelper(const QByteArray &perspectiveId, ActionManager::actionContainer(Core::Constants::M_WINDOW_VIEWS)->addAction(cmd); } + // Restore parent/child relation, so that the widget hierarchy is clear. + dock->setParent(this); if (operation.operationType == Perspective::Raise) { dock->raise(); continue; @@ -361,7 +357,6 @@ QDockWidget *DebuggerMainWindow::registerDockWidget(const QByteArray &dockId, QW { QTC_ASSERT(!widget->objectName().isEmpty(), return 0); QDockWidget *dockWidget = addDockForWidget(widget); - dockWidget->setParent(this); m_dockForDockId[dockId] = dockWidget; return dockWidget; } diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 0ef5a4adb7..f60c1cf517 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1173,6 +1173,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, } DebuggerRunParameters rp; rp.startMode = AttachCrashedExternal; + rp.languages = CppLanguage; rp.crashParameter = it->section(QLatin1Char(':'), 0, 0); rp.attachPID = it->section(QLatin1Char(':'), 1, 1).toULongLong(); rp.displayName = tr("Crashed process %1").arg(rp.attachPID); @@ -1688,7 +1689,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, auto qmlZoomDummyAction = new QAction(tr("Zoom"), this); qmlZoomDummyAction->setCheckable(true); - qmlZoomDummyAction->setIcon(Core::Icons::ZOOM.icon()); + qmlZoomDummyAction->setIcon(Core::Icons::ZOOM_TOOLBAR.icon()); qmlZoomDummyAction->setEnabled(false); cmd = ActionManager::registerAction(qmlZoomDummyAction, Constants::QML_ZOOMTOOL); debugMenu->addAction(cmd); @@ -3536,7 +3537,7 @@ QAction *createStartAction() QAction *createStopAction() { auto action = new QAction(DebuggerMainWindow::tr("Stop"), DebuggerPlugin::instance()); - action->setIcon(ProjectExplorer::Icons::STOP_SMALL.icon()); + action->setIcon(Core::Icons::STOP_SMALL.icon()); action->setEnabled(true); return action; } diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 13904ca120..8a14181fc3 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -487,11 +487,12 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const m_rp.masterEngineType = QmlEngineType; service = QmlDebug::QmlDebuggerServices; } - if (m_rp.startMode != AttachExternal) + if (m_rp.startMode != AttachExternal && m_rp.startMode != AttachCrashedExternal) { QtcProcess::addArg(&m_rp.inferior.commandLineArguments, (m_rp.languages & CppLanguage) && m_rp.nativeMixedEnabled ? QmlDebug::qmlDebugNativeArguments(service, false) : QmlDebug::qmlDebugTcpArguments(service, m_rp.qmlServerPort)); + } } } diff --git a/src/plugins/debugger/gdb/coregdbadapter.cpp b/src/plugins/debugger/gdb/coregdbadapter.cpp index 19868da077..d946efbe4a 100644 --- a/src/plugins/debugger/gdb/coregdbadapter.cpp +++ b/src/plugins/debugger/gdb/coregdbadapter.cpp @@ -88,14 +88,14 @@ void GdbCoreEngine::setupEngine() static QString findExecutableFromName(const QString &fileNameFromCore, const QString &coreFile) { - if (QFileInfo(fileNameFromCore).isFile()) - return fileNameFromCore; if (fileNameFromCore.isEmpty()) - return QString(); + return fileNameFromCore; + QFileInfo fi(fileNameFromCore); + if (fi.isFile()) + return fileNameFromCore; // turn the filename into an absolute path, using the location of the core as a hint QString absPath; - QFileInfo fi(fileNameFromCore); if (fi.isAbsolute()) { absPath = fileNameFromCore; } else { @@ -204,6 +204,7 @@ void GdbCoreEngine::writeCoreChunk() void GdbCoreEngine::setupInferior() { CHECK_STATE(InferiorSetupRequested); + setLinuxOsAbi(); // Do that first, otherwise no symbols are loaded. QFileInfo fi(m_executable); QByteArray path = fi.absoluteFilePath().toLocal8Bit(); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 328b10fb97..9ff2da841b 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1917,6 +1917,13 @@ void GdbEngine::handleGdbExit(const DebuggerResponse &response) } } +void GdbEngine::setLinuxOsAbi() +{ + // In case GDB has multiple supported targets, the default osabi can be Cygwin. + if (HostOsInfo::isWindowsHost() && runParameters().toolChainAbi.binaryFormat() == Abi::ElfFormat) + runCommand({"set osabi GNU/Linux"}); +} + void GdbEngine::detachDebugger() { CHECK_STATE(InferiorStopOk); @@ -2773,7 +2780,7 @@ void GdbEngine::insertBreakpoint(Breakpoint bp) QByteArray condition = bp.condition(); if (!condition.isEmpty()) - cmd.function += " -c \"" + condition + "\" "; + cmd.function += " -c \"" + condition.replace('"', "\\\"") + "\" "; cmd.function += breakpointLocation(bp.parameters()); cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakInsert1(r, bp); }; @@ -4002,7 +4009,7 @@ void GdbEngine::startGdb(const QStringList &args) showMessage(_("STARTING ") + m_gdb + _(" ") + gdbArgs.join(QLatin1Char(' '))); m_gdbProc.setCommand(m_gdb, QtcProcess::joinArgs(gdbArgs)); Environment env = Environment(m_gdbProc.systemEnvironment()); - env.set(QLatin1String("LANG"), QLatin1String("C")); + env.set(QLatin1String("LC_NUMERIC"), QLatin1String("C")); m_gdbProc.setEnvironment(env); m_gdbProc.start(); @@ -4596,7 +4603,6 @@ void GdbEngine::doUpdateLocals(const UpdateParameters ¶ms) cmd.arg("resultvarname", m_resultVarName); cmd.arg("partialvar", params.partialVariable); - cmd.arg("sortstructs", boolSetting(SortStructMembers)); cmd.callback = CB(handleFetchVariables); runCommand(cmd); diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index a336ccb272..2f67440fa1 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -93,6 +93,7 @@ protected: ////////// Gdb Process Management ////////// void startGdb(const QStringList &args = QStringList()); void handleInferiorShutdown(const DebuggerResponse &response); void handleGdbExit(const DebuggerResponse &response); + void setLinuxOsAbi(); void loadInitScript(); void setEnvironmentVariables(); diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp index bf92900bf9..ba2f0f47da 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp @@ -162,6 +162,7 @@ void GdbRemoteServerEngine::uploadProcFinished() void GdbRemoteServerEngine::setupInferior() { QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state()); + setLinuxOsAbi(); const DebuggerRunParameters &rp = runParameters(); QString executableFileName; if (!rp.inferior.executable.isEmpty()) { diff --git a/src/plugins/debugger/images/continue_overlay_small.png b/src/plugins/debugger/images/continue_overlay_small.png Binary files differdeleted file mode 100644 index 75df55d1f6..0000000000 --- a/src/plugins/debugger/images/continue_overlay_small.png +++ /dev/null diff --git a/src/plugins/debugger/images/continue_overlay_small@2x.png b/src/plugins/debugger/images/continue_overlay_small@2x.png Binary files differdeleted file mode 100644 index 5fc601ca17..0000000000 --- a/src/plugins/debugger/images/continue_overlay_small@2x.png +++ /dev/null diff --git a/src/plugins/debugger/images/debugger_continue_1_mask.png b/src/plugins/debugger/images/debugger_continue_1_mask.png Binary files differnew file mode 100644 index 0000000000..522e5f36cc --- /dev/null +++ b/src/plugins/debugger/images/debugger_continue_1_mask.png diff --git a/src/plugins/debugger/images/debugger_continue_1_mask@2x.png b/src/plugins/debugger/images/debugger_continue_1_mask@2x.png Binary files differnew file mode 100644 index 0000000000..217ddc826f --- /dev/null +++ b/src/plugins/debugger/images/debugger_continue_1_mask@2x.png diff --git a/src/plugins/debugger/images/debugger_continue_2_mask.png b/src/plugins/debugger/images/debugger_continue_2_mask.png Binary files differnew file mode 100644 index 0000000000..756ba959f0 --- /dev/null +++ b/src/plugins/debugger/images/debugger_continue_2_mask.png diff --git a/src/plugins/debugger/images/debugger_continue_2_mask@2x.png b/src/plugins/debugger/images/debugger_continue_2_mask@2x.png Binary files differnew file mode 100644 index 0000000000..a4801fa6ba --- /dev/null +++ b/src/plugins/debugger/images/debugger_continue_2_mask@2x.png diff --git a/src/plugins/debugger/images/debugger_continue_mask.png b/src/plugins/debugger/images/debugger_continue_mask.png Binary files differdeleted file mode 100644 index fb9b1cb916..0000000000 --- a/src/plugins/debugger/images/debugger_continue_mask.png +++ /dev/null diff --git a/src/plugins/debugger/images/debugger_continue_mask@2x.png b/src/plugins/debugger/images/debugger_continue_mask@2x.png Binary files differdeleted file mode 100644 index 18b5be7203..0000000000 --- a/src/plugins/debugger/images/debugger_continue_mask@2x.png +++ /dev/null diff --git a/src/plugins/debugger/images/debugger_interrupt_mask.png b/src/plugins/debugger/images/debugger_interrupt_mask.png Binary files differindex c2081ca136..87f195f5c0 100644 --- a/src/plugins/debugger/images/debugger_interrupt_mask.png +++ b/src/plugins/debugger/images/debugger_interrupt_mask.png diff --git a/src/plugins/debugger/images/debugger_interrupt_mask@2x.png b/src/plugins/debugger/images/debugger_interrupt_mask@2x.png Binary files differindex 43aec6f9cc..6c477085d7 100644 --- a/src/plugins/debugger/images/debugger_interrupt_mask@2x.png +++ b/src/plugins/debugger/images/debugger_interrupt_mask@2x.png diff --git a/src/plugins/debugger/images/interrupt_overlay_small.png b/src/plugins/debugger/images/interrupt_overlay_small.png Binary files differdeleted file mode 100644 index e61b75384a..0000000000 --- a/src/plugins/debugger/images/interrupt_overlay_small.png +++ /dev/null diff --git a/src/plugins/debugger/images/interrupt_overlay_small@2x.png b/src/plugins/debugger/images/interrupt_overlay_small@2x.png Binary files differdeleted file mode 100644 index 2d686964bf..0000000000 --- a/src/plugins/debugger/images/interrupt_overlay_small@2x.png +++ /dev/null diff --git a/src/plugins/debugger/images/recordfill.png b/src/plugins/debugger/images/recordfill.png Binary files differnew file mode 100644 index 0000000000..57dc3054c8 --- /dev/null +++ b/src/plugins/debugger/images/recordfill.png diff --git a/src/plugins/debugger/images/recordfill@2x.png b/src/plugins/debugger/images/recordfill@2x.png Binary files differnew file mode 100644 index 0000000000..d4062c909c --- /dev/null +++ b/src/plugins/debugger/images/recordfill@2x.png diff --git a/src/plugins/debugger/images/recordoutline.png b/src/plugins/debugger/images/recordoutline.png Binary files differnew file mode 100644 index 0000000000..1d82d1028d --- /dev/null +++ b/src/plugins/debugger/images/recordoutline.png diff --git a/src/plugins/debugger/images/recordoutline@2x.png b/src/plugins/debugger/images/recordoutline@2x.png Binary files differnew file mode 100644 index 0000000000..f4710c98f0 --- /dev/null +++ b/src/plugins/debugger/images/recordoutline@2x.png diff --git a/src/plugins/debugger/images/stop_overlay_small.png b/src/plugins/debugger/images/stop_overlay_small.png Binary files differdeleted file mode 100644 index 8350ba9eec..0000000000 --- a/src/plugins/debugger/images/stop_overlay_small.png +++ /dev/null diff --git a/src/plugins/debugger/images/stop_overlay_small@2x.png b/src/plugins/debugger/images/stop_overlay_small@2x.png Binary files differdeleted file mode 100644 index f0fb92f670..0000000000 --- a/src/plugins/debugger/images/stop_overlay_small@2x.png +++ /dev/null diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index f818c83e29..28bae13c45 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -638,10 +638,12 @@ void LldbEngine::updateBreakpointData(Breakpoint bp, const GdbMi &bkpt, bool add sub.lineNumber = location["line"].toInt(); bp.insertSubBreakpoint(sub); } + response.pending = false; } else if (numChild == 1) { const GdbMi location = locations.childAt(0); response.address = location["addr"].toAddress(); response.functionName = location["func"].toUtf8(); + response.pending = false; } else { // This can happen for pending breakpoints. showMessage(_("NO LOCATIONS (YET) FOR BP %1").arg(response.toString())); @@ -791,7 +793,6 @@ void LldbEngine::doUpdateLocals(const UpdateParameters ¶ms) cmd.arg("autoderef", boolSetting(AutoDerefPointers)); cmd.arg("dyntype", boolSetting(UseDynamicType)); cmd.arg("partialvar", params.partialVariable); - cmd.arg("sortstructs", boolSetting(SortStructMembers)); cmd.arg("qobjectnames", boolSetting(ShowQObjectNames)); StackFrame frame = stackHandler()->currentFrame(); diff --git a/src/plugins/debugger/pdb/pdbengine.cpp b/src/plugins/debugger/pdb/pdbengine.cpp index 1c6dc62e65..02cacdedf0 100644 --- a/src/plugins/debugger/pdb/pdbengine.cpp +++ b/src/plugins/debugger/pdb/pdbengine.cpp @@ -513,13 +513,7 @@ void PdbEngine::refreshLocals(const GdbMi &vars) { WatchHandler *handler = watchHandler(); handler->resetValueCache(); - - foreach (const GdbMi &child, vars.children()) { - WatchItem *item = new WatchItem; - item->parse(child); - handler->insertItem(item); - } - + handler->insertItems(vars); handler->notifyUpdateFinished(); DebuggerToolTipManager::updateEngine(this); diff --git a/src/plugins/debugger/watchdata.cpp b/src/plugins/debugger/watchdata.cpp index 2be4a083b3..98b32654db 100644 --- a/src/plugins/debugger/watchdata.cpp +++ b/src/plugins/debugger/watchdata.cpp @@ -118,6 +118,7 @@ WatchItem::WatchItem() : bitsize(0), elided(0), arrayIndex(-1), + sortGroup(0), wantsChildren(false), valueEnabled(true), valueEditable(true), @@ -380,7 +381,18 @@ static void decodeArrayData(WatchItem *item, const QByteArray &rawData, qDebug() << "ENCODING ERROR: " << encoding.toString(); } -void WatchItem::parseHelper(const GdbMi &input) +static bool sortByName(const Utils::TreeItem *a, const Utils::TreeItem *b) +{ + auto aa = static_cast<const WatchItem *>(a); + auto bb = static_cast<const WatchItem *>(b); + + if (aa->sortGroup != bb->sortGroup) + return aa->sortGroup > bb->sortGroup; + + return aa->name < bb->name; +} + +void WatchItem::parseHelper(const GdbMi &input, bool maySort) { setChildrenUnneeded(); @@ -437,6 +449,10 @@ void WatchItem::parseHelper(const GdbMi &input) if (mi.isValid()) exp = mi.data(); + mi = input["sortgroup"]; + if (mi.isValid()) + sortGroup = mi.toInt(); + mi = input["valueenabled"]; if (mi.data() == "true") valueEnabled = true; @@ -500,14 +516,17 @@ void WatchItem::parseHelper(const GdbMi &input) QByteArray key = subinput["key"].data(); if (!key.isEmpty()) child->name = decodeData(key, subinput["keyencoded"].data()); - child->parseHelper(subinput); + child->parseHelper(subinput, maySort); appendChild(child); } + + if (maySort && input["sortable"].toInt()) + sortChildren(&sortByName); } } } -void WatchItem::parse(const GdbMi &data) +void WatchItem::parse(const GdbMi &data, bool maySort) { iname = data["iname"].data(); @@ -517,7 +536,7 @@ void WatchItem::parse(const GdbMi &data) else name = QString::fromLatin1(data["name"].data()); - parseHelper(data); + parseHelper(data, maySort); if (wname.isValid()) exp = name.toUtf8(); diff --git a/src/plugins/debugger/watchdata.h b/src/plugins/debugger/watchdata.h index 575c628650..8374d60d95 100644 --- a/src/plugins/debugger/watchdata.h +++ b/src/plugins/debugger/watchdata.h @@ -44,7 +44,7 @@ class WatchItem : public Utils::TreeItem public: WatchItem(); - void parse(const GdbMi &input); + void parse(const GdbMi &input, bool maySort); bool isLocal() const; bool isWatcher() const; @@ -116,13 +116,14 @@ public: uint bitsize; // Size in case of bit fields int elided; // Full size if value was cut off, -1 if cut on unknown size, 0 otherwise int arrayIndex; // -1 if not an array member + uchar sortGroup; // 0 - ordinary member, 1 - vptr, 2 - base class bool wantsChildren; bool valueEnabled; // Value will be enabled or not bool valueEditable; // Value will be editable bool outdated; // \internal item is to be removed. private: - void parseHelper(const GdbMi &input); + void parseHelper(const GdbMi &input, bool maySort); Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::WatchHandler) }; diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index c58f6ec014..da2a0d60be 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -80,6 +80,12 @@ static int theUnprintableBase = -1; const char INameProperty[] = "INameProperty"; const char KeyProperty[] = "KeyProperty"; +struct TypeInfo +{ + TypeInfo(uint s = 0) : size(s) {} + uint size; +}; + static const WatchModel *watchModel(const WatchItem *item) { return reinterpret_cast<const WatchModel *>(item->model()); @@ -345,7 +351,6 @@ public: WatchItem *findItem(const QByteArray &iname) const; const WatchItem *watchItem(const QModelIndex &idx) const; - void insertItem(WatchItem *item); void reexpandItems(); void showEditValue(const WatchItem *item); @@ -373,6 +378,7 @@ public: QSet<QByteArray> m_expandedINames; QTimer m_requestUpdateTimer; + QHash<QByteArray, TypeInfo> m_reportedTypeInfo; QHash<QString, DisplayFormats> m_reportedTypeFormats; // Type name -> Dumper Formats QHash<QByteArray, QString> m_valueCache; }; @@ -1249,23 +1255,46 @@ void WatchHandler::cleanup() m_model->m_separatedView->hide(); } -void WatchHandler::insertItem(WatchItem *item) +static bool sortByName(const TreeItem *a, const TreeItem *b) +{ + auto aa = static_cast<const WatchItem *>(a); + auto bb = static_cast<const WatchItem *>(b); + return aa->name < bb->name; +} + +void WatchHandler::insertItems(const GdbMi &data) { - m_model->insertItem(item); + QSet<TreeItem *> itemsToSort; + + const bool sortStructMembers = boolSetting(SortStructMembers); + foreach (const GdbMi &child, data.children()) { + auto item = new WatchItem; + item->parse(child, sortStructMembers); + const TypeInfo ti = m_model->m_reportedTypeInfo.value(item->type); + if (ti.size && !item->size) + item->size = ti.size; + + const bool added = insertItem(item); + if (added && item->level() == 2) + itemsToSort.insert(item->parent()); + } + + foreach (TreeItem *toplevel, itemsToSort) + toplevel->sortChildren(&sortByName); } -void WatchModel::insertItem(WatchItem *item) +bool WatchHandler::insertItem(WatchItem *item) { - QTC_ASSERT(!item->iname.isEmpty(), return); + QTC_ASSERT(!item->iname.isEmpty(), return false); - WatchItem *parent = findItem(parentName(item->iname)); - QTC_ASSERT(parent, return); + WatchItem *parent = m_model->findItem(parentName(item->iname)); + QTC_ASSERT(parent, return false); bool found = false; const QVector<TreeItem *> siblings = parent->children(); for (int row = 0, n = siblings.size(); row < n; ++row) { if (static_cast<WatchItem *>(siblings.at(row))->iname == item->iname) { - delete takeItem(parent->children().at(row)); + delete m_model->takeItem(parent->children().at(row)); parent->insertChild(row, item); found = true; break; @@ -1276,7 +1305,9 @@ void WatchModel::insertItem(WatchItem *item) item->update(); - item->walkTree([this](TreeItem *sub) { showEditValue(static_cast<WatchItem *>(sub)); }); + item->walkTree([this](TreeItem *sub) { m_model->showEditValue(static_cast<WatchItem *>(sub)); }); + + return !found; } void WatchModel::reexpandItems() @@ -1403,7 +1434,7 @@ void WatchHandler::watchExpression(const QString &exp0, const QString &name) item->exp = exp; item->name = name.isEmpty() ? exp0 : name; item->iname = watcherName(exp); - m_model->insertItem(item); + insertItem(item); saveWatchers(); if (m_model->m_engine->state() == DebuggerNotReady) { @@ -1874,5 +1905,16 @@ QSet<QByteArray> WatchHandler::expandedINames() const return m_model->m_expandedINames; } +void WatchHandler::recordTypeInfo(const GdbMi &typeInfo) +{ + if (typeInfo.type() == GdbMi::List) { + foreach (const GdbMi &s, typeInfo.children()) { + QByteArray typeName = QByteArray::fromHex(s["name"].data()); + TypeInfo ti(s["size"].data().toUInt()); + m_model->m_reportedTypeInfo.insert(typeName, ti); + } + } +} + } // namespace Internal } // namespace Debugger diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 527c93bb45..6b5fc51b11 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -108,7 +108,9 @@ public: void setCurrentItem(const QByteArray &iname); void updateWatchersWindow(); - void insertItem(WatchItem *item); // Takes ownership. + bool insertItem(WatchItem *item); // Takes ownership, returns whether item was added, not overwritten. + void insertItems(const GdbMi &data); + void removeItemByIName(const QByteArray &iname); void removeAllData(bool includeInspectData = false); void resetValueCache(); @@ -118,6 +120,7 @@ public: void notifyUpdateFinished(); void reexpandItems(); + void recordTypeInfo(const GdbMi &typeInfo); private: WatchModel *m_model; // Owned. diff --git a/src/plugins/genericprojectmanager/genericprojectplugin.cpp b/src/plugins/genericprojectmanager/genericprojectplugin.cpp index beefbbdc31..c49ad6198c 100644 --- a/src/plugins/genericprojectmanager/genericprojectplugin.cpp +++ b/src/plugins/genericprojectmanager/genericprojectplugin.cpp @@ -86,7 +86,7 @@ void GenericProjectPlugin::editFiles() auto genericProject = qobject_cast<GenericProject *>(ProjectTree::currentProject()); if (!genericProject) return; - SelectableFilesDialogEditFiles sfd(genericProject->projectFilePath(), + SelectableFilesDialogEditFiles sfd(genericProject->projectDirectory(), Utils::transform(genericProject->files(), [](const QString &f) { return Utils::FileName::fromString(f); }), ICore::mainWindow()); if (sfd.exec() == QDialog::Accepted) diff --git a/src/plugins/glsleditor/glslcompletionassist.cpp b/src/plugins/glsleditor/glslcompletionassist.cpp index e75bfb97a2..9be913279e 100644 --- a/src/plugins/glsleditor/glslcompletionassist.cpp +++ b/src/plugins/glsleditor/glslcompletionassist.cpp @@ -41,7 +41,9 @@ #include <texteditor/codeassist/genericproposal.h> #include <texteditor/codeassist/functionhintproposal.h> #include <cplusplus/ExpressionUnderCursor.h> +#include <cplusplus/Icons.h> +#include <utils/icon.h> #include <utils/faketooltip.h> #include <QIcon> @@ -138,6 +140,57 @@ static bool checkStartOfIdentifier(const QString &word) return false; } +enum IconTypes { + IconTypeAttribute, + IconTypeUniform, + IconTypeKeyword, + IconTypeVarying, + IconTypeConst, + IconTypeVariable, + IconTypeType, + IconTypeFunction, + IconTypeOther +}; + +static QIcon glslIcon(IconTypes iconType) +{ + using namespace CPlusPlus; + using namespace Utils; + + const QString member = QLatin1String(":/codemodel/images/member.png"); + + switch (iconType) { + case IconTypeType: + return Icons::iconForType(Icons::ClassIconType); + case IconTypeConst: + return Icons::iconForType(Icons::EnumeratorIconType); + case IconTypeKeyword: + return Icons::iconForType(Icons::KeywordIconType); + case IconTypeFunction: + return Icons::iconForType(Icons::FuncPublicIconType); + case IconTypeVariable: + return Icons::iconForType(Icons::VarPublicIconType); + case IconTypeAttribute: { + static const QIcon icon = + Icon({{member, Theme::IconsCodeModelAttributeColor}}, Icon::Tint).icon(); + return icon; + } + case IconTypeUniform: { + static const QIcon icon = + Icon({{member, Theme::IconsCodeModelUniformColor}}, Icon::Tint).icon(); + return icon; + } + case IconTypeVarying: { + static const QIcon icon = + Icon({{member, Theme::IconsCodeModelVaryingColor}}, Icon::Tint).icon(); + return icon; + } + case IconTypeOther: + default: + return Icons::iconForType(Icons::NamespaceIconType); + } +} + // ---------------------------- // GlslCompletionAssistProvider // ---------------------------- @@ -223,15 +276,6 @@ int GlslFunctionHintProposalModel::activeArgument(const QString &prefix) const // ----------------------------- GlslCompletionAssistProcessor::GlslCompletionAssistProcessor() : m_startPosition(0) - , m_keywordIcon(QLatin1String(":/glsleditor/images/keyword.png")) - , m_varIcon(QLatin1String(":/glsleditor/images/var.png")) - , m_functionIcon(QLatin1String(":/glsleditor/images/func.png")) - , m_typeIcon(QLatin1String(":/glsleditor/images/type.png")) - , m_constIcon(QLatin1String(":/glsleditor/images/const.png")) - , m_attributeIcon(QLatin1String(":/glsleditor/images/attribute.png")) - , m_uniformIcon(QLatin1String(":/glsleditor/images/uniform.png")) - , m_varyingIcon(QLatin1String(":/glsleditor/images/varying.png")) - , m_otherIcon(QLatin1String(":/glsleditor/images/other.png")) {} GlslCompletionAssistProcessor::~GlslCompletionAssistProcessor() @@ -385,9 +429,9 @@ IAssistProposal *GlslCompletionAssistProcessor::perform(const AssistInterface *i 0 }; for (int index = 0; attributeNames[index]; ++index) - m_completions << createCompletionItem(QString::fromLatin1(attributeNames[index]), m_attributeIcon); + m_completions << createCompletionItem(QString::fromLatin1(attributeNames[index]), glslIcon(IconTypeAttribute)); for (int index = 0; uniformNames[index]; ++index) - m_completions << createCompletionItem(QString::fromLatin1(uniformNames[index]), m_uniformIcon); + m_completions << createCompletionItem(QString::fromLatin1(uniformNames[index]), glslIcon(IconTypeUniform)); } } @@ -395,7 +439,7 @@ IAssistProposal *GlslCompletionAssistProcessor::perform(const AssistInterface *i QStringList keywords = GLSL::Lexer::keywords(languageVariant(m_interface->mimeType())); // m_keywordCompletions.clear(); for (int index = 0; index < keywords.size(); ++index) - m_completions << createCompletionItem(keywords.at(index), m_keywordIcon); + m_completions << createCompletionItem(keywords.at(index), glslIcon(IconTypeKeyword)); // m_keywordVariant = languageVariant(m_interface->mimeType()); // } @@ -408,23 +452,23 @@ IAssistProposal *GlslCompletionAssistProcessor::perform(const AssistInterface *i if (var) { int storageType = var->qualifiers() & GLSL::QualifiedTypeAST::StorageMask; if (storageType == GLSL::QualifiedTypeAST::Attribute) - icon = m_attributeIcon; + icon = glslIcon(IconTypeAttribute); else if (storageType == GLSL::QualifiedTypeAST::Uniform) - icon = m_uniformIcon; + icon = glslIcon(IconTypeUniform); else if (storageType == GLSL::QualifiedTypeAST::Varying) - icon = m_varyingIcon; + icon = glslIcon(IconTypeVarying); else if (storageType == GLSL::QualifiedTypeAST::Const) - icon = m_constIcon; + icon = glslIcon(IconTypeConst); else - icon = m_varIcon; + icon = glslIcon(IconTypeVariable); } else if (s->asArgument()) { - icon = m_varIcon; + icon = glslIcon(IconTypeVariable); } else if (s->asFunction() || s->asOverloadSet()) { - icon = m_functionIcon; + icon = glslIcon(IconTypeFunction); } else if (s->asStruct()) { - icon = m_typeIcon; + icon = glslIcon(IconTypeType); } else { - icon = m_otherIcon; + icon = glslIcon(IconTypeOther); } if (specialMembers.contains(s->name())) m_completions << createCompletionItem(s->name(), icon, SpecialMemberOrder); diff --git a/src/plugins/glsleditor/glslcompletionassist.h b/src/plugins/glsleditor/glslcompletionassist.h index 3714c3e383..234b6331f0 100644 --- a/src/plugins/glsleditor/glslcompletionassist.h +++ b/src/plugins/glsleditor/glslcompletionassist.h @@ -33,7 +33,6 @@ #include <texteditor/codeassist/ifunctionhintproposalmodel.h> -#include <QIcon> #include <QScopedPointer> #include <QSharedPointer> @@ -106,16 +105,6 @@ private: int m_startPosition; QScopedPointer<const GlslCompletionAssistInterface> m_interface; - - QIcon m_keywordIcon; - QIcon m_varIcon; - QIcon m_functionIcon; - QIcon m_typeIcon; - QIcon m_constIcon; - QIcon m_attributeIcon; - QIcon m_uniformIcon; - QIcon m_varyingIcon; - QIcon m_otherIcon; }; class GlslCompletionAssistInterface : public TextEditor::AssistInterface diff --git a/src/plugins/glsleditor/glsleditor.qrc b/src/plugins/glsleditor/glsleditor.qrc index 3455048e00..cb1c737c9a 100644 --- a/src/plugins/glsleditor/glsleditor.qrc +++ b/src/plugins/glsleditor/glsleditor.qrc @@ -2,14 +2,5 @@ <qresource prefix="/glsleditor"> <file>GLSLEditor.mimetypes.xml</file> <file>images/glslfile.png</file> - <file>images/keyword.png</file> - <file>images/var.png</file> - <file>images/func.png</file> - <file>images/type.png</file> - <file>images/const.png</file> - <file>images/attribute.png</file> - <file>images/uniform.png</file> - <file>images/varying.png</file> - <file>images/other.png</file> </qresource> </RCC> diff --git a/src/plugins/glsleditor/images/attribute.png b/src/plugins/glsleditor/images/attribute.png Binary files differdeleted file mode 100644 index fe2bdc36fd..0000000000 --- a/src/plugins/glsleditor/images/attribute.png +++ /dev/null diff --git a/src/plugins/glsleditor/images/const.png b/src/plugins/glsleditor/images/const.png Binary files differdeleted file mode 100644 index 25fc49c659..0000000000 --- a/src/plugins/glsleditor/images/const.png +++ /dev/null diff --git a/src/plugins/glsleditor/images/func.png b/src/plugins/glsleditor/images/func.png Binary files differdeleted file mode 100644 index e515e76e61..0000000000 --- a/src/plugins/glsleditor/images/func.png +++ /dev/null diff --git a/src/plugins/glsleditor/images/keyword.png b/src/plugins/glsleditor/images/keyword.png Binary files differdeleted file mode 100644 index e5a51858d9..0000000000 --- a/src/plugins/glsleditor/images/keyword.png +++ /dev/null diff --git a/src/plugins/glsleditor/images/other.png b/src/plugins/glsleditor/images/other.png Binary files differdeleted file mode 100644 index 18d2941572..0000000000 --- a/src/plugins/glsleditor/images/other.png +++ /dev/null diff --git a/src/plugins/glsleditor/images/type.png b/src/plugins/glsleditor/images/type.png Binary files differdeleted file mode 100644 index 88432d2cb1..0000000000 --- a/src/plugins/glsleditor/images/type.png +++ /dev/null diff --git a/src/plugins/glsleditor/images/uniform.png b/src/plugins/glsleditor/images/uniform.png Binary files differdeleted file mode 100644 index 075e875dd2..0000000000 --- a/src/plugins/glsleditor/images/uniform.png +++ /dev/null diff --git a/src/plugins/glsleditor/images/var.png b/src/plugins/glsleditor/images/var.png Binary files differdeleted file mode 100644 index 089cfb45e5..0000000000 --- a/src/plugins/glsleditor/images/var.png +++ /dev/null diff --git a/src/plugins/glsleditor/images/varying.png b/src/plugins/glsleditor/images/varying.png Binary files differdeleted file mode 100644 index a6e3e12c6d..0000000000 --- a/src/plugins/glsleditor/images/varying.png +++ /dev/null diff --git a/src/plugins/imageviewer/images/outline.png b/src/plugins/imageviewer/images/outline.png Binary files differdeleted file mode 100644 index aaa9464535..0000000000 --- a/src/plugins/imageviewer/images/outline.png +++ /dev/null diff --git a/src/plugins/imageviewer/images/pause-small.png b/src/plugins/imageviewer/images/pause-small.png Binary files differdeleted file mode 100644 index 66d1f46d3d..0000000000 --- a/src/plugins/imageviewer/images/pause-small.png +++ /dev/null diff --git a/src/plugins/imageviewer/images/play-small.png b/src/plugins/imageviewer/images/play-small.png Binary files differdeleted file mode 100644 index 3a7a99fb24..0000000000 --- a/src/plugins/imageviewer/images/play-small.png +++ /dev/null diff --git a/src/plugins/imageviewer/imageviewer.cpp b/src/plugins/imageviewer/imageviewer.cpp index 44f86c44b9..5710174a1d 100644 --- a/src/plugins/imageviewer/imageviewer.cpp +++ b/src/plugins/imageviewer/imageviewer.cpp @@ -102,9 +102,10 @@ void ImageViewer::ctor() d->ui_toolbar.setupUi(d->toolbar); d->ui_toolbar.toolButtonExportImage->setIcon(QIcon::fromTheme(QLatin1String("document-save"), Core::Icons::SAVEFILE.icon())); + d->ui_toolbar.toolButtonOutline->setIcon(Core::Icons::BOUNDING_RECT.icon()); d->ui_toolbar.toolButtonZoomIn->setIcon(Core::Icons::PLUS.icon()); d->ui_toolbar.toolButtonZoomOut->setIcon(Core::Icons::MINUS.icon()); - d->ui_toolbar.toolButtonFitToScreen->setIcon(Core::Icons::ZOOM.icon()); + d->ui_toolbar.toolButtonFitToScreen->setIcon(Core::Icons::ZOOM_TOOLBAR.icon()); // icons update - try to use system theme updateButtonIconByTheme(d->ui_toolbar.toolButtonZoomIn, QLatin1String("zoom-in")); updateButtonIconByTheme(d->ui_toolbar.toolButtonZoomOut, QLatin1String("zoom-out")); @@ -253,10 +254,10 @@ void ImageViewer::updatePauseAction() if (isMovie) { if (d->file->isPaused()) { d->ui_toolbar.toolButtonPlayPause->setToolTipBase(tr("Play Animation")); - d->ui_toolbar.toolButtonPlayPause->setIcon(QPixmap(QLatin1String(":/imageviewer/images/play-small.png"))); + d->ui_toolbar.toolButtonPlayPause->setIcon(Core::Icons::RUN_SMALL.pixmap()); } else { d->ui_toolbar.toolButtonPlayPause->setToolTipBase(tr("Pause Animation")); - d->ui_toolbar.toolButtonPlayPause->setIcon(QPixmap(QLatin1String(":/imageviewer/images/pause-small.png"))); + d->ui_toolbar.toolButtonPlayPause->setIcon(Core::Icons::INTERRUPT_SMALL.pixmap()); } } } diff --git a/src/plugins/imageviewer/imageviewer.qrc b/src/plugins/imageviewer/imageviewer.qrc index e39039ade1..60678a9ced 100644 --- a/src/plugins/imageviewer/imageviewer.qrc +++ b/src/plugins/imageviewer/imageviewer.qrc @@ -1,10 +1,7 @@ <RCC> <qresource prefix="/imageviewer"> - <file>images/outline.png</file> <file>images/originalsize.png</file> <file>images/background.png</file> - <file>images/pause-small.png</file> - <file>images/play-small.png</file> <file>ImageViewer.mimetypes.xml</file> </qresource> </RCC> diff --git a/src/plugins/imageviewer/imageviewerplugin.cpp b/src/plugins/imageviewer/imageviewerplugin.cpp index 12d0f86524..2193c5c43c 100644 --- a/src/plugins/imageviewer/imageviewerplugin.cpp +++ b/src/plugins/imageviewer/imageviewerplugin.cpp @@ -86,7 +86,7 @@ void ImageViewerPlugin::extensionsInitialized() iv->resetToOriginalSize(); }); - a = registerNewAction(Constants::ACTION_FIT_TO_SCREEN, tr("Fit To Screen"), + a = registerNewAction(Constants::ACTION_FIT_TO_SCREEN, tr("Fit to Screen"), QKeySequence(tr("Ctrl+="))); connect(a, &QAction::triggered, this, [this]() { if (ImageViewer *iv = currentImageViewer()) diff --git a/src/plugins/imageviewer/imageviewertoolbar.ui b/src/plugins/imageviewer/imageviewertoolbar.ui index 0c86a3e585..4dec6dc66e 100644 --- a/src/plugins/imageviewer/imageviewertoolbar.ui +++ b/src/plugins/imageviewer/imageviewertoolbar.ui @@ -46,10 +46,6 @@ <property name="toolTipBase"> <string>Show Outline</string> </property> - <property name="icon"> - <iconset resource="imageviewer.qrc"> - <normaloff>:/imageviewer/images/outline.png</normaloff>:/imageviewer/images/outline.png</iconset> - </property> <property name="checkable"> <bool>true</bool> </property> diff --git a/src/plugins/ios/iosruncontrol.cpp b/src/plugins/ios/iosruncontrol.cpp index 47e019a6e6..237790fff3 100644 --- a/src/plugins/ios/iosruncontrol.cpp +++ b/src/plugins/ios/iosruncontrol.cpp @@ -28,8 +28,9 @@ #include "iosrunconfiguration.h" #include "iosrunner.h" +#include <coreplugin/coreicons.h> + #include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/projectexplorericons.h> using namespace ProjectExplorer; @@ -41,7 +42,7 @@ IosRunControl::IosRunControl(IosRunConfiguration *rc) , m_runner(new IosRunner(this, rc, false, QmlDebug::NoQmlDebugServices)) , m_running(false) { - setIcon(Icons::RUN_SMALL); + setIcon(Core::Icons::RUN_SMALL); } IosRunControl::~IosRunControl() diff --git a/src/plugins/modeleditor/extpropertiesmview.cpp b/src/plugins/modeleditor/extpropertiesmview.cpp index 05acb4435b..529f251dca 100644 --- a/src/plugins/modeleditor/extpropertiesmview.cpp +++ b/src/plugins/modeleditor/extpropertiesmview.cpp @@ -65,7 +65,7 @@ void ExtPropertiesMView::visitMPackage(const qmt::MPackage *package) return edit->text().isEmpty() || m_configPath->defaultValidationFunction()(edit, errorMessage); }); m_configPath->setInitialBrowsePathBackup(QFileInfo(project->fileName()).absolutePath()); - addRow(tr("Config Path:"), m_configPath, "configpath"); + addRow(tr("Config path:"), m_configPath, "configpath"); connect(m_configPath, &Utils::PathChooser::pathChanged, this, &ExtPropertiesMView::onConfigPathChanged); } diff --git a/src/plugins/modeleditor/modeldocument.cpp b/src/plugins/modeleditor/modeldocument.cpp index 019084eadc..e75ff0760e 100644 --- a/src/plugins/modeleditor/modeldocument.cpp +++ b/src/plugins/modeleditor/modeldocument.cpp @@ -93,7 +93,9 @@ bool ModelDocument::save(QString *errorString, const QString &name, bool autoSav return false; } - if (!autoSave) { + if (autoSave) { + d->documentController->projectController()->setModified(); + } else { setFilePath(Utils::FileName::fromString(d->documentController->projectController()->project()->fileName())); emit changed(); } @@ -101,6 +103,11 @@ bool ModelDocument::save(QString *errorString, const QString &name, bool autoSav return true; } +bool ModelDocument::shouldAutoSave() const +{ + return isModified(); +} + bool ModelDocument::isModified() const { return d->documentController ? d->documentController->projectController()->isModified() : false; diff --git a/src/plugins/modeleditor/modeldocument.h b/src/plugins/modeleditor/modeldocument.h index 5998065157..f83085866a 100644 --- a/src/plugins/modeleditor/modeldocument.h +++ b/src/plugins/modeleditor/modeldocument.h @@ -51,6 +51,7 @@ public: OpenResult open(QString *errorString, const QString &fileName, const QString &realFileName) override; bool save(QString *errorString, const QString &fileName, bool autoSave) override; + bool shouldAutoSave() const override; bool isModified() const override; bool isSaveAsAllowed() const override; bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override; diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 4084290281..8346697f6c 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -158,7 +158,7 @@ AppOutputPane::AppOutputPane() : setObjectName(QLatin1String("AppOutputPane")); // Used in valgrind engine // Rerun - m_reRunButton->setIcon(Icons::RUN_SMALL.icon()); + m_reRunButton->setIcon(Core::Icons::RUN_SMALL.icon()); m_reRunButton->setToolTip(tr("Re-run this run-configuration")); m_reRunButton->setAutoRaise(true); m_reRunButton->setEnabled(false); @@ -166,7 +166,7 @@ AppOutputPane::AppOutputPane() : this, &AppOutputPane::reRunRunControl); // Stop - m_stopAction->setIcon(Icons::STOP_SMALL.icon()); + m_stopAction->setIcon(Core::Icons::STOP_SMALL.icon()); m_stopAction->setToolTip(tr("Stop")); m_stopAction->setEnabled(false); @@ -644,7 +644,7 @@ void AppOutputPane::enableButtons(const RunControl *rc /* = 0 */, bool isRunning m_zoomOutButton->setEnabled(true); } else { m_reRunButton->setEnabled(false); - m_reRunButton->setIcon(Icons::RUN_SMALL.icon()); + m_reRunButton->setIcon(Core::Icons::RUN_SMALL.icon()); m_attachButton->setEnabled(false); m_attachButton->setToolTip(msgAttachDebuggerTooltip()); m_stopAction->setEnabled(false); diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 2a69b1563d..71ecf037d5 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -32,6 +32,8 @@ #include <projectexplorer/projectexplorerconstants.h> #include <ssh/sshconnection.h> + +#include <utils/environment.h> #include <utils/portlist.h> #include <QCoreApplication> @@ -116,6 +118,22 @@ DeviceProcessSignalOperation::Ptr DesktopDevice::signalOperation() const return DeviceProcessSignalOperation::Ptr(new DesktopProcessSignalOperation()); } +class DesktopDeviceEnvironmentFetcher : public DeviceEnvironmentFetcher +{ +public: + DesktopDeviceEnvironmentFetcher() {} + + void start() override + { + emit finished(Utils::Environment::systemEnvironment(), true); + } +}; + +DeviceEnvironmentFetcher::Ptr DesktopDevice::environmentFetcher() const +{ + return DeviceEnvironmentFetcher::Ptr(new DesktopDeviceEnvironmentFetcher()); +} + QString DesktopDevice::qmlProfilerHost() const { return QLatin1String("localhost"); diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.h b/src/plugins/projectexplorer/devicesupport/desktopdevice.h index da6c1fada9..b99d83457d 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.h @@ -51,6 +51,7 @@ public: bool canCreateProcess() const override { return true; } DeviceProcess *createProcess(QObject *parent) const override; DeviceProcessSignalOperation::Ptr signalOperation() const override; + DeviceEnvironmentFetcher::Ptr environmentFetcher() const override; QString qmlProfilerHost() const override; IDevice::Ptr clone() const override; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 2f7a19ec9b..b48a6b51ec 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -277,6 +277,11 @@ DeviceProcess *IDevice::createProcess(QObject * /* parent */) const return 0; } +DeviceEnvironmentFetcher::Ptr IDevice::environmentFetcher() const +{ + return DeviceEnvironmentFetcher::Ptr(); +} + IDevice::DeviceState IDevice::deviceState() const { return d->deviceState; @@ -457,4 +462,8 @@ DeviceProcessSignalOperation::DeviceProcessSignalOperation() { } +DeviceEnvironmentFetcher::DeviceEnvironmentFetcher() +{ +} + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index d1484e25ff..3ab1ff03cd 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -40,7 +40,11 @@ class QWidget; QT_END_NAMESPACE namespace QSsh { class SshConnectionParameters; } -namespace Utils { class PortList; } + +namespace Utils { +class Environment; +class PortList; +} // Utils namespace ProjectExplorer { class DeviceProcess; @@ -77,6 +81,21 @@ protected: QString m_errorMessage; }; +class PROJECTEXPLORER_EXPORT DeviceEnvironmentFetcher : public QObject +{ + Q_OBJECT +public: + typedef QSharedPointer<DeviceEnvironmentFetcher> Ptr; + + virtual void start() = 0; + +signals: + void finished(const Utils::Environment &env, bool success); + +protected: + explicit DeviceEnvironmentFetcher(); +}; + class PROJECTEXPLORER_EXPORT PortsGatheringMethod { public: @@ -138,6 +157,7 @@ public: virtual bool canCreateProcess() const { return false; } virtual DeviceProcess *createProcess(QObject *parent) const; virtual DeviceProcessSignalOperation::Ptr signalOperation() const = 0; + virtual DeviceEnvironmentFetcher::Ptr environmentFetcher() const; enum DeviceState { DeviceReadyToUse, DeviceConnected, DeviceDisconnected, DeviceStateUnknown }; DeviceState deviceState() const; diff --git a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp index c347dd79e4..686d4ce712 100644 --- a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp @@ -80,7 +80,11 @@ SshDeviceProcess::~SshDeviceProcess() void SshDeviceProcess::start(const Runnable &runnable) { QTC_ASSERT(d->state == SshDeviceProcessPrivate::Inactive, return); - QTC_ASSERT(runnable.is<StandardRunnable>(), return); + if (!runnable.is<StandardRunnable>()) { + d->errorMessage = tr("Internal error"); + error(QProcess::FailedToStart); + return; + } d->setState(SshDeviceProcessPrivate::Connecting); d->errorMessage.clear(); diff --git a/src/plugins/projectexplorer/environmentaspect.h b/src/plugins/projectexplorer/environmentaspect.h index 9fb946ef4b..20c59f84c1 100644 --- a/src/plugins/projectexplorer/environmentaspect.h +++ b/src/plugins/projectexplorer/environmentaspect.h @@ -53,8 +53,10 @@ public: QList<Utils::EnvironmentItem> userEnvironmentChanges() const { return m_changes; } void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff); + // The environment the user chose as base for his modifications. virtual Utils::Environment baseEnvironment() const = 0; - virtual Utils::Environment environment() const; + // The environment including the user's modifications. + Utils::Environment environment() const; signals: void baseEnvironmentChanged(); diff --git a/src/plugins/projectexplorer/extracompiler.cpp b/src/plugins/projectexplorer/extracompiler.cpp index 82c6a0b2f9..605e24252e 100644 --- a/src/plugins/projectexplorer/extracompiler.cpp +++ b/src/plugins/projectexplorer/extracompiler.cpp @@ -375,6 +375,14 @@ ProcessExtraCompiler::ProcessExtraCompiler(const Project *project, const Utils:: ExtraCompiler(project, source, targets, parent) { } +ProcessExtraCompiler::~ProcessExtraCompiler() +{ + if (!m_watcher) + return; + m_watcher->cancel(); + m_watcher->waitForFinished(); +} + void ProcessExtraCompiler::run(const QByteArray &sourceContents) { ContentProvider contents = [this, sourceContents]() { return sourceContents; }; @@ -429,17 +437,18 @@ void ProcessExtraCompiler::runImpl(const ContentProvider &provider) buildEnvironment())); } -FileNameToContentsHash ProcessExtraCompiler::runInThread( +void ProcessExtraCompiler::runInThread( + QFutureInterface<FileNameToContentsHash> &futureInterface, const Utils::FileName &cmd, const Utils::FileName &workDir, const QStringList &args, const ContentProvider &provider, const Utils::Environment &env) { if (cmd.isEmpty() || !cmd.toFileInfo().isExecutable()) - return FileNameToContentsHash(); + return; const QByteArray sourceContents = provider(); if (sourceContents.isNull() || !prepareToRun(sourceContents)) - return FileNameToContentsHash(); + return; QProcess process; @@ -449,25 +458,38 @@ FileNameToContentsHash ProcessExtraCompiler::runInThread( process.start(cmd.toString(), args, QIODevice::ReadWrite); if (!process.waitForStarted()) { handleProcessError(&process); - return FileNameToContentsHash(); + return; + } + bool isCanceled = futureInterface.isCanceled(); + if (!isCanceled) { + handleProcessStarted(&process, sourceContents); + forever { + bool done = process.waitForFinished(200); + isCanceled = futureInterface.isCanceled(); + if (done || isCanceled) + break; + } } - handleProcessStarted(&process, sourceContents); - process.waitForFinished(); - if (process.state() == QProcess::Running) { + isCanceled |= process.state() == QProcess::Running; + if (isCanceled) { process.kill(); process.waitForFinished(3000); + return; } - return handleProcessFinished(&process); + futureInterface.reportResult(handleProcessFinished(&process)); } void ProcessExtraCompiler::cleanUp() { QTC_ASSERT(m_watcher, return); - const FileNameToContentsHash data = m_watcher->future().result(); + auto future = m_watcher->future(); delete m_watcher; m_watcher = nullptr; + if (!future.resultCount()) + return; + const FileNameToContentsHash data = future.result(); if (data.isEmpty()) return; // There was some kind of error... diff --git a/src/plugins/projectexplorer/extracompiler.h b/src/plugins/projectexplorer/extracompiler.h index 024c9b8758..21efd6b29f 100644 --- a/src/plugins/projectexplorer/extracompiler.h +++ b/src/plugins/projectexplorer/extracompiler.h @@ -101,6 +101,7 @@ public: ProcessExtraCompiler(const Project *project, const Utils::FileName &source, const Utils::FileNameList &targets, QObject *parent = nullptr); + ~ProcessExtraCompiler(); protected: // This will run a process in a thread, if @@ -128,9 +129,10 @@ protected: private: using ContentProvider = std::function<QByteArray()>; void runImpl(const ContentProvider &sourceContents); - FileNameToContentsHash runInThread(const Utils::FileName &cmd, const Utils::FileName &workDir, - const QStringList &args, const ContentProvider &provider, - const Utils::Environment &env); + void runInThread(QFutureInterface<FileNameToContentsHash> &futureInterface, + const Utils::FileName &cmd, const Utils::FileName &workDir, + const QStringList &args, const ContentProvider &provider, + const Utils::Environment &env); void cleanUp(); QFutureWatcher<FileNameToContentsHash> *m_watcher = nullptr; diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 6853c9e41e..dff1c85ecb 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -326,6 +326,8 @@ Abi GccToolChain::targetAbi() const QString GccToolChain::originalTargetTriple() const { + if (m_originalTargetTriple.isEmpty()) + m_originalTargetTriple = detectSupportedAbis().originalTargetTriple; return m_originalTargetTriple; } diff --git a/src/plugins/projectexplorer/images/clean.png b/src/plugins/projectexplorer/images/clean.png Binary files differdeleted file mode 100644 index ab5e07ef79..0000000000 --- a/src/plugins/projectexplorer/images/clean.png +++ /dev/null diff --git a/src/plugins/projectexplorer/images/clean_small.png b/src/plugins/projectexplorer/images/clean_small.png Binary files differdeleted file mode 100644 index 6a6d16718c..0000000000 --- a/src/plugins/projectexplorer/images/clean_small.png +++ /dev/null diff --git a/src/plugins/projectexplorer/images/continue_1_small.png b/src/plugins/projectexplorer/images/continue_1_small.png Binary files differnew file mode 100644 index 0000000000..1240171792 --- /dev/null +++ b/src/plugins/projectexplorer/images/continue_1_small.png diff --git a/src/plugins/projectexplorer/images/continue_1_small@2x.png b/src/plugins/projectexplorer/images/continue_1_small@2x.png Binary files differnew file mode 100644 index 0000000000..f683251b92 --- /dev/null +++ b/src/plugins/projectexplorer/images/continue_1_small@2x.png diff --git a/src/plugins/projectexplorer/images/continue_2_small.png b/src/plugins/projectexplorer/images/continue_2_small.png Binary files differnew file mode 100644 index 0000000000..876cb829bf --- /dev/null +++ b/src/plugins/projectexplorer/images/continue_2_small.png diff --git a/src/plugins/projectexplorer/images/continue_2_small@2x.png b/src/plugins/projectexplorer/images/continue_2_small@2x.png Binary files differnew file mode 100644 index 0000000000..5794fa039e --- /dev/null +++ b/src/plugins/projectexplorer/images/continue_2_small@2x.png diff --git a/src/plugins/projectexplorer/images/debugger_beetle_mask.png b/src/plugins/projectexplorer/images/debugger_beetle_mask.png Binary files differindex 359b6cc425..b041005b3a 100644 --- a/src/plugins/projectexplorer/images/debugger_beetle_mask.png +++ b/src/plugins/projectexplorer/images/debugger_beetle_mask.png diff --git a/src/plugins/projectexplorer/images/debugger_beetle_mask@2x.png b/src/plugins/projectexplorer/images/debugger_beetle_mask@2x.png Binary files differindex 24a5f3b7bc..f4f7098ee3 100644 --- a/src/plugins/projectexplorer/images/debugger_beetle_mask@2x.png +++ b/src/plugins/projectexplorer/images/debugger_beetle_mask@2x.png diff --git a/src/plugins/projectexplorer/images/debugger_overlay_small.png b/src/plugins/projectexplorer/images/debugger_overlay_small.png Binary files differindex deb68239db..809bf34732 100644 --- a/src/plugins/projectexplorer/images/debugger_overlay_small.png +++ b/src/plugins/projectexplorer/images/debugger_overlay_small.png diff --git a/src/plugins/projectexplorer/images/debugger_overlay_small@2x.png b/src/plugins/projectexplorer/images/debugger_overlay_small@2x.png Binary files differindex fe9107f75f..c24c861cbb 100644 --- a/src/plugins/projectexplorer/images/debugger_overlay_small@2x.png +++ b/src/plugins/projectexplorer/images/debugger_overlay_small@2x.png diff --git a/src/plugins/projectexplorer/images/debugger_run_mask.png b/src/plugins/projectexplorer/images/debugger_run_mask.png Binary files differdeleted file mode 100644 index 0e3ab010d0..0000000000 --- a/src/plugins/projectexplorer/images/debugger_run_mask.png +++ /dev/null diff --git a/src/plugins/projectexplorer/images/debugger_run_mask@2x.png b/src/plugins/projectexplorer/images/debugger_run_mask@2x.png Binary files differdeleted file mode 100644 index 978d099a9c..0000000000 --- a/src/plugins/projectexplorer/images/debugger_run_mask@2x.png +++ /dev/null diff --git a/src/plugins/projectexplorer/images/rebuild.png b/src/plugins/projectexplorer/images/rebuild.png Binary files differdeleted file mode 100644 index 2888e90539..0000000000 --- a/src/plugins/projectexplorer/images/rebuild.png +++ /dev/null diff --git a/src/plugins/projectexplorer/images/rebuild_small.png b/src/plugins/projectexplorer/images/rebuild_small.png Binary files differdeleted file mode 100644 index 85d3bcd681..0000000000 --- a/src/plugins/projectexplorer/images/rebuild_small.png +++ /dev/null diff --git a/src/plugins/projectexplorer/images/rebuildhammerhandles.png b/src/plugins/projectexplorer/images/rebuildhammerhandles.png Binary files differnew file mode 100644 index 0000000000..d0c117da13 --- /dev/null +++ b/src/plugins/projectexplorer/images/rebuildhammerhandles.png diff --git a/src/plugins/projectexplorer/images/rebuildhammerhandles@2x.png b/src/plugins/projectexplorer/images/rebuildhammerhandles@2x.png Binary files differnew file mode 100644 index 0000000000..9ea2b3a871 --- /dev/null +++ b/src/plugins/projectexplorer/images/rebuildhammerhandles@2x.png diff --git a/src/plugins/projectexplorer/images/rebuildhammerheads.png b/src/plugins/projectexplorer/images/rebuildhammerheads.png Binary files differnew file mode 100644 index 0000000000..24de5314c9 --- /dev/null +++ b/src/plugins/projectexplorer/images/rebuildhammerheads.png diff --git a/src/plugins/projectexplorer/images/rebuildhammerheads@2x.png b/src/plugins/projectexplorer/images/rebuildhammerheads@2x.png Binary files differnew file mode 100644 index 0000000000..50f8757d19 --- /dev/null +++ b/src/plugins/projectexplorer/images/rebuildhammerheads@2x.png diff --git a/src/plugins/projectexplorer/images/run_overlay_small.png b/src/plugins/projectexplorer/images/run_overlay_small.png Binary files differdeleted file mode 100644 index db22edd2fb..0000000000 --- a/src/plugins/projectexplorer/images/run_overlay_small.png +++ /dev/null diff --git a/src/plugins/projectexplorer/images/run_overlay_small@2x.png b/src/plugins/projectexplorer/images/run_overlay_small@2x.png Binary files differdeleted file mode 100644 index a5ec8416b6..0000000000 --- a/src/plugins/projectexplorer/images/run_overlay_small@2x.png +++ /dev/null diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.cpp b/src/plugins/projectexplorer/localapplicationruncontrol.cpp index c0ea09d341..2e99c51b18 100644 --- a/src/plugins/projectexplorer/localapplicationruncontrol.cpp +++ b/src/plugins/projectexplorer/localapplicationruncontrol.cpp @@ -28,10 +28,11 @@ #include "environmentaspect.h" #include <projectexplorer/projectexplorerconstants.h> -#include <projectexplorer/projectexplorericons.h> #include <projectexplorer/kitinformation.h> #include <projectexplorer/target.h> +#include <coreplugin/coreicons.h> + #include <utils/qtcassert.h> #include <QDir> @@ -62,7 +63,7 @@ LocalApplicationRunControl::LocalApplicationRunControl(RunConfiguration *rc, Cor : RunControl(rc, mode) { setRunnable(rc->runnable()); - setIcon(Icons::RUN_SMALL); + setIcon(Core::Icons::RUN_SMALL); connect(&m_applicationLauncher, &ApplicationLauncher::appendMessage, this, static_cast<void(RunControl::*)(const QString &, Utils::OutputFormat)>(&RunControl::appendMessage)); connect(&m_applicationLauncher, &ApplicationLauncher::processStarted, @@ -119,7 +120,7 @@ void LocalApplicationRunControl::processExited(int exitCode, QProcess::ExitStatu QString msg; QString exe = runnable().as<StandardRunnable>().executable; if (status == QProcess::CrashExit) - msg = tr("%1 crashed").arg(QDir::toNativeSeparators(exe)); + msg = tr("%1 crashed.").arg(QDir::toNativeSeparators(exe)); else msg = tr("%1 exited with code %2").arg(QDir::toNativeSeparators(exe)).arg(exitCode); appendMessage(msg + QLatin1Char('\n'), Utils::NormalMessageFormat); diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 930060f47c..d20c324c39 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -684,6 +684,11 @@ bool Project::needsSpecialDeployment() const return false; } +bool Project::knowsAllBuildExecutables() const +{ + return true; +} + void Project::setup(QList<const BuildInfo *> infoList) { QList<Target *> toRegister; diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index aa28e8ed14..7fd785279f 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -139,6 +139,9 @@ public: void setPreferredKitMatcher(const KitMatcher &matcher); virtual bool needsSpecialDeployment() const; + // The build system is able to report all executables that can be built, independent + // of configuration. + virtual bool knowsAllBuildExecutables() const; void setup(QList<const BuildInfo *> infoList); Utils::MacroExpander *macroExpander() const; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 5f016e71d8..e68a06ed96 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -105,6 +105,7 @@ #include <coreplugin/idocumentfactory.h> #include <coreplugin/idocument.h> #include <coreplugin/coreconstants.h> +#include <coreplugin/coreicons.h> #include <coreplugin/documentmanager.h> #include <coreplugin/imode.h> #include <coreplugin/modemanager.h> @@ -700,7 +701,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er ActionContainer *runMenu = ActionManager::createMenu(Constants::RUNMENUCONTEXTMENU); runMenu->setOnAllDisabledBehavior(ActionContainer::Hide); QIcon runIcon = Utils::Icon::sideBarIcon(Icons::RUN, Icons::RUN_FLAT); - runIcon.addPixmap(Icons::RUN_SMALL.pixmap()); + runIcon.addPixmap(Core::Icons::RUN_SMALL.pixmap()); runMenu->menu()->setIcon(runIcon); runMenu->menu()->setTitle(tr("Run")); msubProjectContextMenu->addMenu(runMenu, ProjectExplorer::Constants::G_PROJECT_RUN); @@ -849,17 +850,13 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD); // rebuild session action - QIcon rebuildIcon = Icons::REBUILD.icon(); - rebuildIcon.addPixmap(Icons::REBUILD_SMALL.pixmap()); - dd->m_rebuildSessionAction = new QAction(rebuildIcon, tr("Rebuild All"), this); + dd->m_rebuildSessionAction = new QAction(Icons::REBUILD.icon(), tr("Rebuild All"), this); cmd = ActionManager::registerAction(dd->m_rebuildSessionAction, Constants::REBUILDSESSION); mbuild->addAction(cmd, Constants::G_BUILD_REBUILD); msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD); // clean session - QIcon cleanIcon = Icons::CLEAN.icon(); - cleanIcon.addPixmap(Icons::CLEAN_SMALL.pixmap()); - dd->m_cleanSessionAction = new QAction(cleanIcon, tr("Clean All"), this); + dd->m_cleanSessionAction = new QAction(Icons::CLEAN.icon(), tr("Clean All"), this); cmd = ActionManager::registerAction(dd->m_cleanSessionAction, Constants::CLEANSESSION); mbuild->addAction(cmd, Constants::G_BUILD_CLEAN); msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD); @@ -902,7 +899,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er mbuild->addAction(cmd, Constants::G_BUILD_CLEAN); // cancel build action - dd->m_cancelBuildAction = new QAction(Icons::STOP_SMALL.icon(), tr("Cancel Build"), this); + dd->m_cancelBuildAction = new QAction(Core::Icons::STOP_SMALL.icon(), tr("Cancel Build"), this); cmd = ActionManager::registerAction(dd->m_cancelBuildAction, Constants::CANCELBUILD); mbuild->addAction(cmd, Constants::G_BUILD_CANCEL); diff --git a/src/plugins/projectexplorer/projectexplorer.qrc b/src/plugins/projectexplorer/projectexplorer.qrc index e8d0044e3f..6d9310c46f 100644 --- a/src/plugins/projectexplorer/projectexplorer.qrc +++ b/src/plugins/projectexplorer/projectexplorer.qrc @@ -2,32 +2,26 @@ <qresource prefix="/projectexplorer"> <file>images/build_small.png</file> <file>images/category_buildrun.png</file> - <file>images/clean.png</file> - <file>images/clean_small.png</file> <file>images/closetab.png</file> <file>images/debugger_start.png</file> <file>images/debugger_start@2x.png</file> <file>images/debugger_beetle_mask.png</file> <file>images/debugger_beetle_mask@2x.png</file> - <file>images/debugger_run_mask.png</file> - <file>images/debugger_run_mask@2x.png</file> <file>images/mode_project.png</file> <file>images/mode_project@2x.png</file> <file>images/mode_project_mask.png</file> <file>images/mode_project_mask@2x.png</file> <file>images/projectexplorer.png</file> - <file>images/rebuild.png</file> - <file>images/rebuild_small.png</file> + <file>images/rebuildhammerhandles.png</file> + <file>images/rebuildhammerhandles@2x.png</file> + <file>images/rebuildhammerheads.png</file> + <file>images/rebuildhammerheads@2x.png</file> <file>images/run.png</file> <file>images/run@2x.png</file> <file>images/run_mask.png</file> <file>images/run_mask@2x.png</file> - <file>images/run_small.png</file> - <file>images/run_small@2x.png</file> <file>images/debugger_overlay_small.png</file> <file>images/debugger_overlay_small@2x.png</file> - <file>images/run_overlay_small.png</file> - <file>images/run_overlay_small@2x.png</file> <file>images/session.png</file> <file>images/targetrunselected.png</file> <file>images/targetrunselected@2x.png</file> @@ -54,10 +48,10 @@ <file>images/targetpanel_bottom.png</file> <file>images/targetpanel_gradient.png</file> <file>images/window.png</file> - <file>images/stop_small.png</file> - <file>images/stop_small@2x.png</file> - <file>images/interrupt_small.png</file> - <file>images/interrupt_small@2x.png</file> + <file>images/continue_1_small.png</file> + <file>images/continue_1_small@2x.png</file> + <file>images/continue_2_small.png</file> + <file>images/continue_2_small@2x.png</file> <file>images/buildstepdisable.png</file> <file>images/buildstepdisable@2x.png</file> <file>images/buildstepmovedown.png</file> diff --git a/src/plugins/projectexplorer/projectexplorericons.h b/src/plugins/projectexplorer/projectexplorericons.h index 05a2ce3c36..384be59100 100644 --- a/src/plugins/projectexplorer/projectexplorericons.h +++ b/src/plugins/projectexplorer/projectexplorericons.h @@ -37,14 +37,11 @@ const Utils::Icon BUILD_FLAT({ {QLatin1String(":/projectexplorer/images/build_hammerhead_mask.png"), Utils::Theme::IconsBuildHammerHeadColor}}); const Utils::Icon BUILD_SMALL( QLatin1String(":/projectexplorer/images/build_small.png")); -const Utils::Icon CLEAN( - QLatin1String(":/projectexplorer/images/clean.png")); -const Utils::Icon CLEAN_SMALL( - QLatin1String(":/projectexplorer/images/clean_small.png")); -const Utils::Icon REBUILD( - QLatin1String(":/projectexplorer/images/rebuild.png")); -const Utils::Icon REBUILD_SMALL( - QLatin1String(":/projectexplorer/images/rebuild_small.png")); +const Utils::Icon CLEAN({ + {QLatin1String(":/core/images/clean_pane_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint); +const Utils::Icon REBUILD({ + {QLatin1String(":/projectexplorer/images/rebuildhammerhandles.png"), Utils::Theme::IconsBuildHammerHandleColor}, + {QLatin1String(":/projectexplorer/images/rebuildhammerheads.png"), Utils::Theme::IconsBuildHammerHeadColor}}, Utils::Icon::Tint); const Utils::Icon RUN( QLatin1String(":/projectexplorer/images/run.png")); const Utils::Icon RUN_FLAT({ @@ -55,11 +52,11 @@ const Utils::Icon DEBUG_START( QLatin1String(":/projectexplorer/images/debugger_start.png")); const Utils::Icon DEBUG_START_FLAT({ - {QLatin1String(":/projectexplorer/images/debugger_beetle_mask.png"), Utils::Theme::IconsDebugColor}, - {QLatin1String(":/projectexplorer/images/debugger_run_mask.png"), Utils::Theme::IconsRunColor}}); + {QLatin1String(":/projectexplorer/images/run_mask.png"), Utils::Theme::IconsRunColor}, + {QLatin1String(":/projectexplorer/images/debugger_beetle_mask.png"), Utils::Theme::IconsDebugColor}}); const Utils::Icon DEBUG_START_SMALL({ - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}, - {QLatin1String(":/projectexplorer/images/run_overlay_small.png"), Utils::Theme::IconsRunColor}}); + {QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunColor}, + {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}}); const Utils::Icon BUILDSTEP_MOVEUP({ {QLatin1String(":/projectexplorer/images/buildstepmoveup.png"), Utils::Theme::PanelTextColorDark}}, Utils::Icon::Tint); @@ -75,18 +72,12 @@ const Utils::Icon DESKTOP_DEVICE({ const Utils::Icon DESKTOP_DEVICE_SMALL({ {QLatin1String(":/projectexplorer/images/desktopdevicesmall.png"), Utils::Theme::PanelTextColorDark}}, Utils::Icon::Tint); -const Utils::Icon RUN_SMALL({ - {QLatin1String(":/projectexplorer/images/run_small.png"), Utils::Theme::IconsRunColor}}); -const Utils::Icon STOP_SMALL({ - {QLatin1String(":/projectexplorer/images/stop_small.png"), Utils::Theme::IconsStopColor}}); const Utils::Icon MODE_PROJECT_CLASSIC( QLatin1String(":/projectexplorer/images/mode_project.png")); const Utils::Icon MODE_PROJECT_FLAT({ {QLatin1String(":/projectexplorer/images/mode_project_mask.png"), Utils::Theme::IconsBaseColor}}); const Utils::Icon MODE_PROJECT_FLAT_ACTIVE({ {QLatin1String(":/projectexplorer/images/mode_project_mask.png"), Utils::Theme::IconsModeProjetcsActiveColor}}); -const Utils::Icon INTERRUPT_SMALL({ - {QLatin1String(":/projectexplorer/images/interrupt_small.png"), Utils::Theme::IconsInterruptColor}}); } // namespace Icons } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/selectablefilesmodel.cpp b/src/plugins/projectexplorer/selectablefilesmodel.cpp index b88f2e72f0..e3f3abe7b5 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.cpp +++ b/src/plugins/projectexplorer/selectablefilesmodel.cpp @@ -58,15 +58,12 @@ SelectableFilesModel::SelectableFilesModel(QObject *parent) : QAbstractItemModel connect(this, &SelectableFilesModel::modelReset, this, [this] { emit checkedFilesChanged(); }); m_root = new Tree; - m_root->parent = 0; } void SelectableFilesModel::setInitialMarkedFiles(const Utils::FileNameList &files) { m_files = files.toSet(); - m_outOfBaseDirFiles - = Utils::filtered(m_files, [this](const Utils::FileName &fn) { return !fn.isChildOf(m_baseDir); }); - m_allFiles = false; + m_allFiles = files.isEmpty(); } void SelectableFilesModel::startParsing(const Utils::FileName &baseDir) @@ -78,7 +75,6 @@ void SelectableFilesModel::startParsing(const Utils::FileName &baseDir) // Build a tree in a future m_rootForFuture = new Tree; m_rootForFuture->name = baseDir.toUserOutput(); - m_rootForFuture->parent = 0; m_rootForFuture->fullPath = baseDir; m_rootForFuture->isDir = true; @@ -96,7 +92,10 @@ void SelectableFilesModel::buildTreeFinished() beginResetModel(); delete m_root; m_root = m_rootForFuture; - m_rootForFuture = 0; + m_rootForFuture = nullptr; + m_outOfBaseDirFiles + = Utils::filtered(m_files, [this](const Utils::FileName &fn) { return !fn.isChildOf(m_baseDir); }); + endResetModel(); emit parsingFinished(); } @@ -158,7 +157,7 @@ void SelectableFilesModel::buildTree(const Utils::FileName &baseDir, Tree *tree, Tree *t = new Tree; t->parent = tree; t->name = fileInfo.fileName(); - t->checked = m_allFiles || m_files.contains(fn) ? Qt::Checked : Qt::Unchecked; + t->checked = (m_allFiles || m_files.contains(fn)) ? Qt::Checked : Qt::Unchecked; t->fullPath = fn; t->isDir = false; allChecked &= t->checked == Qt::Checked; @@ -562,7 +561,7 @@ SelectableFilesWidget::SelectableFilesWidget(QWidget *parent) : connect(m_baseDirChooser, &Utils::PathChooser::validChanged, this, &SelectableFilesWidget::baseDirectoryChanged); connect(m_startParsingButton, &QAbstractButton::clicked, - this, &SelectableFilesWidget::startParsing); + this, [this]() { startParsing(m_baseDirChooser->fileName()); }); m_showFilesFilterLabel->setText(tr("Show files matching:")); m_showFilesFilterEdit->setText(showFilter); @@ -627,7 +626,7 @@ bool SelectableFilesWidget::hasFilesSelected() const void SelectableFilesWidget::resetModel(const Utils::FileName &path, const Utils::FileNameList &files) { - m_view->setModel(0); + m_view->setModel(nullptr); delete m_model; m_model = new SelectableFilesModel(this); @@ -643,7 +642,7 @@ void SelectableFilesWidget::resetModel(const Utils::FileName &path, const Utils: m_baseDirChooser->setFileName(path); m_view->setModel(m_model); - startParsing(); + startParsing(path); } void SelectableFilesWidget::cancelParsing() @@ -677,13 +676,13 @@ void SelectableFilesWidget::baseDirectoryChanged(bool validState) m_startParsingButton->setEnabled(validState); } -void SelectableFilesWidget::startParsing() +void SelectableFilesWidget::startParsing(const Utils::FileName &baseDir) { if (!m_model) return; enableWidgets(false); - m_model->startParsing(m_baseDirChooser->fileName()); + m_model->startParsing(baseDir); } void SelectableFilesWidget::parsingProgress(const Utils::FileName &fileName) @@ -696,7 +695,6 @@ void SelectableFilesWidget::parsingFinished() if (!m_model) return; - m_model->selectAllFiles(); applyFilter(); smartExpand(m_model->index(0,0, QModelIndex())); diff --git a/src/plugins/projectexplorer/selectablefilesmodel.h b/src/plugins/projectexplorer/selectablefilesmodel.h index d31159931b..f4de2fd253 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.h +++ b/src/plugins/projectexplorer/selectablefilesmodel.h @@ -57,7 +57,7 @@ public: QList<Tree *> visibleFiles; QIcon icon; Utils::FileName fullPath; - Tree *parent; + Tree *parent = nullptr; }; class Glob @@ -133,14 +133,14 @@ private: void propagateDown(const QModelIndex &index); void selectAllFiles(Tree *root); - Tree *m_root = 0; + Tree *m_root = nullptr; // Used in the future thread need to all not used after calling startParsing Utils::FileName m_baseDir; QSet<Utils::FileName> m_files; QSet<Utils::FileName> m_outOfBaseDirFiles; QFutureWatcher<void> m_watcher; - Tree *m_rootForFuture = 0; + Tree *m_rootForFuture = nullptr; int m_futureCount = 0; bool m_allFiles = true; @@ -153,9 +153,9 @@ class PROJECTEXPLORER_EXPORT SelectableFilesWidget : public QWidget Q_OBJECT public: - explicit SelectableFilesWidget(QWidget *parent = 0); + explicit SelectableFilesWidget(QWidget *parent = nullptr); SelectableFilesWidget(const Utils::FileName &path, const Utils::FileNameList &files, - QWidget *parent = 0); + QWidget *parent = nullptr); void setAddFileFilter(const QString &filter); void setBaseDirEditable(bool edit); @@ -176,7 +176,7 @@ private: void applyFilter(); void baseDirectoryChanged(bool validState); - void startParsing(); + void startParsing(const Utils::FileName &baseDir); void parsingProgress(const Utils::FileName &fileName); void parsingFinished(); diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index 2840cc878e..e42a76ec1d 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -590,14 +590,10 @@ void Target::updateDefaultRunConfigurations() QList<RunConfiguration *> newConfigured; // NEW configured Rcs QList<RunConfiguration *> newUnconfigured; // NEW unconfigured RCs - // sort existing RCs into configured/unconfigured. - foreach (RunConfiguration *rc, runConfigurations()) { - if (!rc->isConfigured()) - existingUnconfigured << rc; - else - existingConfigured << rc; - } + std::tie(existingConfigured, existingUnconfigured) + = Utils::partition(runConfigurations(), + [](const RunConfiguration *rc) { return rc->isConfigured(); }); int configuredCount = existingConfigured.count(); // find all RC ids that can get created: @@ -617,7 +613,7 @@ void Target::updateDefaultRunConfigurations() foreach (RunConfiguration *rc, existingConfigured) { if (availableFactoryIds.contains(rc->id())) toIgnore.append(rc->id()); // Already there - else + else if (project()->knowsAllBuildExecutables()) toRemove << rc; } foreach (Core::Id i, toIgnore) @@ -679,25 +675,27 @@ void Target::updateDefaultRunConfigurations() // Make sure a configured RC will be active after we delete the RCs: RunConfiguration *active = activeRunConfiguration(); - if (removalList.contains(active)) { - if (!existingConfigured.isEmpty()) { - setActiveRunConfiguration(existingConfigured.at(0)); - } else if (!newConfigured.isEmpty()) { - RunConfiguration *selected = newConfigured.at(0); - // Try to find a runconfiguration that matches the project name. That is a good - // candidate for something to run initially. - selected = Utils::findOr(newConfigured, selected, - Utils::equal(&RunConfiguration::displayName, project()->displayName())); - setActiveRunConfiguration(selected); - } else if (!newUnconfigured.isEmpty()){ - setActiveRunConfiguration(newUnconfigured.at(0)); - } else { - if (!removalList.isEmpty()) - setActiveRunConfiguration(removalList.last()); - // Nothing will be left after removal: We set this to the last of in the removal list - // since that gives us the minimum number of signals (one signal for the change here and - // one more when the last RC is removed and the active RC becomes 0). + if (removalList.contains(active) || !active->isEnabled()) { + RunConfiguration *newConfiguredDefault = newConfigured.isEmpty() ? nullptr : newConfigured.at(0); + + RunConfiguration *rc + = Utils::findOrDefault(existingConfigured, + [](RunConfiguration *rc) { return rc->isEnabled(); }); + if (!rc) { + rc = Utils::findOr(newConfigured, newConfiguredDefault, + Utils::equal(&RunConfiguration::displayName, project()->displayName())); } + if (!rc) + rc = newUnconfigured.isEmpty() ? nullptr : newUnconfigured.at(0); + if (!rc) { + // No RCs will be deleted, so use the one that will emit the minimum number of signals. + // One signal will be emitted from the next setActiveRunConfiguration, another one + // when the RC gets removed (and the activeRunConfiguration turns into a nullptr). + rc = removalList.isEmpty() ? nullptr : removalList.last(); + } + + if (rc) + setActiveRunConfiguration(rc); } // Remove the RCs that are no longer needed: diff --git a/src/plugins/projectexplorer/task.cpp b/src/plugins/projectexplorer/task.cpp index bdb6e26125..91e6d5c987 100644 --- a/src/plugins/projectexplorer/task.cpp +++ b/src/plugins/projectexplorer/task.cpp @@ -98,13 +98,15 @@ bool Task::isNull() const void Task::clear() { taskId = 0; + type = Task::Unknown; description.clear(); file = Utils::FileName(); line = -1; movedLine = -1; category = Core::Id(); - type = Task::Unknown; icon = QIcon(); + formats.clear(); + m_mark.clear(); } // diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index 92648cdad3..efa9057997 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -30,6 +30,7 @@ #include <coreplugin/icore.h> #include <coreplugin/coreconstants.h> +#include <coreplugin/coreicons.h> #include <coreplugin/documentmanager.h> #include <coreplugin/fileiconprovider.h> #include <coreplugin/id.h> @@ -47,7 +48,6 @@ #include <projectexplorer/target.h> #include <projectexplorer/iprojectmanager.h> #include <projectexplorer/projectnodes.h> -#include <projectexplorer/projectexplorericons.h> #include <texteditor/texteditorconstants.h> @@ -1061,7 +1061,7 @@ RunControl *PythonRunControlFactory::create(RunConfiguration *runConfiguration, PythonRunControl::PythonRunControl(PythonRunConfiguration *rc, Core::Id mode) : RunControl(rc, mode), m_running(false) { - setIcon(ProjectExplorer::Icons::RUN_SMALL); + setIcon(Core::Icons::RUN_SMALL); m_interpreter = rc->interpreter(); m_mainScript = rc->mainScript(); diff --git a/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp index 68b468a0ef..8a02827803 100644 --- a/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp @@ -30,6 +30,7 @@ #include "qbsproject.h" #include <coreplugin/coreicons.h> +#include <coreplugin/messagemanager.h> #include <projectexplorer/buildmanager.h> #include <projectexplorer/buildstep.h> #include <projectexplorer/buildsteplist.h> @@ -276,7 +277,12 @@ void QbsRunConfiguration::addToBaseEnvironment(Utils::Environment &env) const procEnv.insert(QLatin1String("QBS_RUN_FILE_PATH"), executable()); qbs::RunEnvironment qbsRunEnv = project->qbsProject().getRunEnvironment(product, installOptions(), procEnv, QbsManager::settings()); - procEnv = qbsRunEnv.runEnvironment(); + qbs::ErrorInfo error; + procEnv = qbsRunEnv.runEnvironment(&error); + if (error.hasError()) { + Core::MessageManager::write(tr("Error retrieving run environment: %1") + .arg(error.toString())); + } if (!procEnv.isEmpty()) { env = Utils::Environment(); foreach (const QString &key, procEnv.keys()) diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp index 6a18b55fdb..b419d7fc2e 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp @@ -300,7 +300,7 @@ bool singleSelectionAndInQtQuickLayout(const SelectionContext &context) if (!metaInfo.isValid()) return false; - return metaInfo.isSubclassOf("QtQuick.Layouts.Layout", -1, -1); + return metaInfo.isSubclassOf("QtQuick.Layouts.Layout"); } bool isLayout(const SelectionContext &context) @@ -321,7 +321,7 @@ bool isLayout(const SelectionContext &context) if (!metaInfo.isValid()) return false; - return metaInfo.isSubclassOf("QtQuick.Layouts.Layout", -1, -1); + return metaInfo.isSubclassOf("QtQuick.Layouts.Layout"); } bool isPositioner(const SelectionContext &context) @@ -342,8 +342,8 @@ bool isPositioner(const SelectionContext &context) if (!metaInfo.isValid()) return false; - return metaInfo.isSubclassOf("<cpp>.QDeclarativeBasePositioner", -1, -1) - || metaInfo.isSubclassOf("QtQuick.Positioner", -1, -1); + return metaInfo.isSubclassOf("<cpp>.QDeclarativeBasePositioner") + || metaInfo.isSubclassOf("QtQuick.Positioner"); } bool layoutOptionVisible(const SelectionContext &context) diff --git a/src/plugins/qmldesigner/components/formeditor/contentnoteditableindicator.cpp b/src/plugins/qmldesigner/components/formeditor/contentnoteditableindicator.cpp index fc84448788..d2bb2e02b0 100644 --- a/src/plugins/qmldesigner/components/formeditor/contentnoteditableindicator.cpp +++ b/src/plugins/qmldesigner/components/formeditor/contentnoteditableindicator.cpp @@ -88,7 +88,7 @@ void ContentNotEditableIndicator::updateItems(const QList<FormEditorItem *> &ite void ContentNotEditableIndicator::addAddiationEntries(const QList<FormEditorItem *> &itemList) { foreach (FormEditorItem *formEditorItem, itemList) { - if (formEditorItem->qmlItemNode().modelNode().metaInfo().isSubclassOf("QtQuick.Loader", -1, -1)) { + if (formEditorItem->qmlItemNode().modelNode().metaInfo().isSubclassOf("QtQuick.Loader")) { if (!m_entryList.contains(EntryPair(formEditorItem, 0))) { QGraphicsRectItem *indicatorShape = new QGraphicsRectItem(m_layerItem); diff --git a/src/plugins/qmldesigner/components/formeditor/formeditor.qrc b/src/plugins/qmldesigner/components/formeditor/formeditor.qrc index 4b949ad92c..6f986b3a1e 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditor.qrc +++ b/src/plugins/qmldesigner/components/formeditor/formeditor.qrc @@ -6,8 +6,6 @@ <file>no_snapping@2x.png</file> <file>snapping_and_anchoring.png</file> <file>snapping_and_anchoring@2x.png</file> - <file>boundingrect.png</file> - <file>boundingrect@2x.png</file> </qresource> <qresource prefix="/icon"> <file>reset.png</file> diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp index 8ffd1da11e..664be17399 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp @@ -416,7 +416,7 @@ void FormEditorView::instanceInformationsChange(const QMultiHash<ModelNode, Info { QList<FormEditorItem*> itemNodeList; - foreach (const ModelNode &node, informationChangeHash.keys()) { + foreach (const ModelNode &node, informationChangeHash.keys().toSet()) { QmlItemNode qmlItemNode(node); if (qmlItemNode.isValid() && scene()->hasItemForQmlItemNode(qmlItemNode)) { scene()->synchronizeTransformation(qmlItemNode); diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp index 8ca2afd850..936c299b84 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp @@ -40,6 +40,7 @@ #include <lineeditaction.h> #include <backgroundaction.h> +#include <coreplugin/coreicons.h> #include <utils/fileutils.h> namespace QmlDesigner { @@ -97,7 +98,7 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) m_showBoundingRectAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); m_showBoundingRectAction->setCheckable(true); m_showBoundingRectAction->setChecked(true); - m_showBoundingRectAction->setIcon(Icons::BOUNDING_RECT.icon()); + m_showBoundingRectAction->setIcon(Core::Icons::BOUNDING_RECT.icon()); addAction(m_showBoundingRectAction.data()); upperActions.append(m_showBoundingRectAction.data()); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp index d2472826ac..3080c9befe 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp @@ -148,7 +148,7 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model) foreach (ItemLibraryEntry entry, itemLibraryInfo->entries()) { - NodeMetaInfo metaInfo = model->metaInfo(entry.typeName(), -1, -1); + NodeMetaInfo metaInfo = model->metaInfo(entry.typeName()); bool valid = metaInfo.isValid() && metaInfo.majorVersion() == entry.majorVersion(); if (valid diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp index 0b01e02e03..db3fb2183d 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp @@ -693,7 +693,7 @@ void NavigatorTreeModel::moveNodesInteractive(NodeAbstractProperty &parentProper if (modelNode.isValid() && modelNode != parentProperty.parentModelNode() && !modelNode.isAncestorOf(parentProperty.parentModelNode()) - && (modelNode.metaInfo().isSubclassOf(propertyQmlType, -1, -1) || propertyQmlType == "alias")) { + && (modelNode.metaInfo().isSubclassOf(propertyQmlType) || propertyQmlType == "alias")) { //### todo: allowing alias is just a heuristic //once the MetaInfo is part of instances we can do this right diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index ce23c29ade..06d6e53a80 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -100,7 +100,7 @@ PropertyEditorQmlBackend::PropertyEditorQmlBackend(PropertyEditorView *propertyE m_contextObject->setBackendValues(&m_backendValuesPropertyMap); m_contextObject->insertInQmlContext(context()); - QObject::connect(&m_backendValuesPropertyMap, SIGNAL(valueChanged(QString,QVariant)), propertyEditor, SLOT(changeValue(QString))); + QObject::connect(&m_backendValuesPropertyMap, &DesignerPropertyMap::valueChanged, propertyEditor, &PropertyEditorView::changeValue); } PropertyEditorQmlBackend::~PropertyEditorQmlBackend() @@ -114,8 +114,8 @@ void PropertyEditorQmlBackend::setupPropertyEditorValue(const PropertyName &name PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(backendValuesPropertyMap().value(QString::fromUtf8(propertyName)))); if (!valueObject) { valueObject = new PropertyEditorValue(&backendValuesPropertyMap()); - QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &backendValuesPropertyMap(), SIGNAL(valueChanged(QString,QVariant))); - QObject::connect(valueObject, SIGNAL(expressionChanged(QString)), propertyEditor, SLOT(changeExpression(QString))); + QObject::connect(valueObject, &PropertyEditorValue::valueChanged, &backendValuesPropertyMap(), &DesignerPropertyMap::valueChanged); + QObject::connect(valueObject, &PropertyEditorValue::expressionChanged, propertyEditor, &PropertyEditorView::changeExpression); backendValuesPropertyMap().insert(QString::fromUtf8(propertyName), QVariant::fromValue(valueObject)); } valueObject->setName(propertyName); @@ -183,8 +183,8 @@ void PropertyEditorQmlBackend::createPropertyEditorValue(const QmlObjectNode &qm PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(backendValuesPropertyMap().value(QString::fromUtf8(propertyName)))); if (!valueObject) { valueObject = new PropertyEditorValue(&backendValuesPropertyMap()); - QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &backendValuesPropertyMap(), SIGNAL(valueChanged(QString,QVariant))); - QObject::connect(valueObject, SIGNAL(expressionChanged(QString)), propertyEditor, SLOT(changeExpression(QString))); + QObject::connect(valueObject, &PropertyEditorValue::valueChanged, &backendValuesPropertyMap(), &DesignerPropertyMap::valueChanged); + QObject::connect(valueObject, &PropertyEditorValue::expressionChanged, propertyEditor, &PropertyEditorView::changeExpression); backendValuesPropertyMap().insert(QString::fromUtf8(propertyName), QVariant::fromValue(valueObject)); } valueObject->setName(name); @@ -274,7 +274,7 @@ void PropertyEditorQmlBackend::setup(const QmlObjectNode &qmlObjectNode, const Q valueObject->setName("className"); valueObject->setModelNode(qmlObjectNode.modelNode()); valueObject->setValue(qmlObjectNode.modelNode().simplifiedTypeName()); - QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString,QVariant))); + QObject::connect(valueObject, &PropertyEditorValue::valueChanged, &backendValuesPropertyMap(), &DesignerPropertyMap::valueChanged); m_backendValuesPropertyMap.insert(QLatin1String("className"), QVariant::fromValue(valueObject)); // id @@ -283,7 +283,7 @@ void PropertyEditorQmlBackend::setup(const QmlObjectNode &qmlObjectNode, const Q valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap); valueObject->setName("id"); valueObject->setValue(qmlObjectNode.id()); - QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString,QVariant))); + QObject::connect(valueObject, &PropertyEditorValue::valueChanged, &backendValuesPropertyMap(), &DesignerPropertyMap::valueChanged); m_backendValuesPropertyMap.insert(QLatin1String("id"), QVariant::fromValue(valueObject)); QmlItemNode itemNode(qmlObjectNode.modelNode()); @@ -331,7 +331,7 @@ void PropertyEditorQmlBackend::setup(const QmlObjectNode &qmlObjectNode, const Q void PropertyEditorQmlBackend::initialSetup(const TypeName &typeName, const QUrl &qmlSpecificsFile, PropertyEditorView *propertyEditor) { - NodeMetaInfo metaInfo = propertyEditor->model()->metaInfo(typeName, 4, 7); + NodeMetaInfo metaInfo = propertyEditor->model()->metaInfo(typeName); foreach (const PropertyName &propertyName, metaInfo.propertyNames()) setupPropertyEditorValue(propertyName, propertyEditor, QString::fromUtf8(metaInfo.propertyTypeName(propertyName))); @@ -342,7 +342,7 @@ void PropertyEditorQmlBackend::initialSetup(const TypeName &typeName, const QUrl valueObject->setName("className"); valueObject->setValue(typeName); - QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString,QVariant))); + QObject::connect(valueObject, &PropertyEditorValue::valueChanged, &backendValuesPropertyMap(), &DesignerPropertyMap::valueChanged); m_backendValuesPropertyMap.insert(QLatin1String("className"), QVariant::fromValue(valueObject)); // id @@ -350,8 +350,8 @@ void PropertyEditorQmlBackend::initialSetup(const TypeName &typeName, const QUrl if (!valueObject) valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap); valueObject->setName("id"); - valueObject->setValue(QLatin1String("id")); - QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString,QVariant))); + valueObject->setValue("id"); + QObject::connect(valueObject, &PropertyEditorValue::valueChanged, &backendValuesPropertyMap(), &DesignerPropertyMap::valueChanged); m_backendValuesPropertyMap.insert(QLatin1String("id"), QVariant::fromValue(valueObject)); context()->setContextProperty(QLatin1String("anchorBackend"), &m_backendAnchorBinding); @@ -444,8 +444,6 @@ TypeName PropertyEditorQmlBackend::fixTypeNameForPanes(const TypeName &typeName) TypeName PropertyEditorQmlBackend::qmlFileName(const NodeMetaInfo &nodeInfo) { - if (nodeInfo.typeName().split('.').last() == "QDeclarativeItem") - return "QtQuick/ItemPane.qml"; const TypeName fixedTypeName = fixTypeNameForPanes(nodeInfo.typeName()); return fixedTypeName + "Pane.qml"; } diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.h index 28af9cce67..ac3bb9e7d0 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.h @@ -81,6 +81,10 @@ public: void rootNodeTypeChanged(const QString &type, int majorVersion, int minorVersion) override; +public slots: + void changeValue(const QString &name); + void changeExpression(const QString &name); + protected: void timerEvent(QTimerEvent *event) override; void setupPane(const TypeName &typeName); @@ -88,8 +92,6 @@ protected: private slots: void reloadQml(); - void changeValue(const QString &name); - void changeExpression(const QString &name); void updateSize(); void setupPanes(); diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp index 46fd80e40c..493fbf3bd7 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp @@ -77,7 +77,7 @@ void StatesEditorView::removeState(int nodeId) try { if (nodeId > 0 && hasModelNodeForInternalId(nodeId)) { ModelNode stateNode(modelNodeForInternalId(nodeId)); - Q_ASSERT(stateNode.metaInfo().isSubclassOf("QtQuick.State", -1, -1)); + Q_ASSERT(stateNode.metaInfo().isSubclassOf("QtQuick.State")); NodeListProperty parentProperty = stateNode.parentProperty().toNodeListProperty(); if (parentProperty.count() <= 1) { @@ -188,7 +188,7 @@ void StatesEditorView::duplicateCurrentState() void StatesEditorView::checkForWindow() { if (m_statesEditorWidget) - m_statesEditorWidget->showAddNewStatesButton(!rootModelNode().metaInfo().isSubclassOf("QtQuick.Window.Window", -1, -1)); + m_statesEditorWidget->showAddNewStatesButton(!rootModelNode().metaInfo().isSubclassOf("QtQuick.Window.Window")); } void StatesEditorView::setCurrentState(const QmlModelState &state) diff --git a/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp b/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp index 15310e221f..43b9230b1e 100644 --- a/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp +++ b/src/plugins/qmldesigner/componentsplugin/addtabdesigneraction.cpp @@ -44,14 +44,14 @@ namespace QmlDesigner { bool isTabView(const ModelNode &modelNode) { - return modelNode.metaInfo().isSubclassOf("QtQuick.Controls.TabView", -1, -1); + return modelNode.metaInfo().isSubclassOf("QtQuick.Controls.TabView"); } bool isTabAndParentIsTabView(const ModelNode &modelNode) { - return modelNode.metaInfo().isSubclassOf("QtQuick.Controls.Tab", -1, -1) + return modelNode.metaInfo().isSubclassOf("QtQuick.Controls.Tab") && modelNode.hasParentProperty() - && modelNode.parentProperty().parentModelNode().metaInfo().isSubclassOf("QtQuick.Controls.TabView", -1, -1); + && modelNode.parentProperty().parentModelNode().metaInfo().isSubclassOf("QtQuick.Controls.TabView"); } AddTabDesignerAction::AddTabDesignerAction() @@ -97,7 +97,7 @@ bool AddTabDesignerAction::isEnabled(const SelectionContext &selectionContext) c static ModelNode findTabViewModelNode(const ModelNode ¤tModelNode) { - if (currentModelNode.metaInfo().isSubclassOf("QtQuick.Controls.TabView", -1, -1)) + if (currentModelNode.metaInfo().isSubclassOf("QtQuick.Controls.TabView")) return currentModelNode; else return findTabViewModelNode(currentModelNode.parentProperty().parentModelNode()); diff --git a/src/plugins/qmldesigner/componentsplugin/entertabdesigneraction.cpp b/src/plugins/qmldesigner/componentsplugin/entertabdesigneraction.cpp index 6500bf268c..c45b14dded 100644 --- a/src/plugins/qmldesigner/componentsplugin/entertabdesigneraction.cpp +++ b/src/plugins/qmldesigner/componentsplugin/entertabdesigneraction.cpp @@ -83,7 +83,7 @@ void EnterTabDesignerAction::updateContext() if (action()->isEnabled()) { const ModelNode selectedModelNode = selectionContext().currentSingleSelectedNode(); if (selectedModelNode.metaInfo().isValid() - && selectedModelNode.metaInfo().isSubclassOf("QtQuick.Controls.TabView", -1, -1)) { + && selectedModelNode.metaInfo().isSubclassOf("QtQuick.Controls.TabView")) { const NodeAbstractProperty defaultProperty = selectedModelNode.defaultNodeAbstractProperty(); foreach (const QmlDesigner::ModelNode &childModelNode, defaultProperty.directSubNodes()) { @@ -117,7 +117,7 @@ bool EnterTabDesignerAction::isEnabled(const SelectionContext &selectionContext) void EnterTabDesignerAction::createActionForTab(const ModelNode &modelNode) { if (modelNode.metaInfo().isValid() - && modelNode.metaInfo().isSubclassOf("QtQuick.Controls.Tab", -1, -1)) { + && modelNode.metaInfo().isSubclassOf("QtQuick.Controls.Tab")) { QmlDesigner::QmlItemNode itemNode(modelNode); diff --git a/src/plugins/qmldesigner/componentsplugin/tabviewindexmodel.cpp b/src/plugins/qmldesigner/componentsplugin/tabviewindexmodel.cpp index 5fc9d6e54a..751ec18235 100644 --- a/src/plugins/qmldesigner/componentsplugin/tabviewindexmodel.cpp +++ b/src/plugins/qmldesigner/componentsplugin/tabviewindexmodel.cpp @@ -60,11 +60,11 @@ void TabViewIndexModel::setupModel() m_tabViewIndexModel.clear(); if (m_modelNode.isValid() && m_modelNode.metaInfo().isValid() - && m_modelNode.metaInfo().isSubclassOf("QtQuick.Controls.TabView", -1, -1)) { + && m_modelNode.metaInfo().isSubclassOf("QtQuick.Controls.TabView")) { foreach (const QmlDesigner::ModelNode &childModelNode, m_modelNode.defaultNodeAbstractProperty().directSubNodes()) { if (childModelNode.metaInfo().isValid() - && childModelNode.metaInfo().isSubclassOf("QtQuick.Controls.Tab", -1, -1)) { + && childModelNode.metaInfo().isSubclassOf("QtQuick.Controls.Tab")) { QmlDesigner::QmlItemNode itemNode(childModelNode); if (itemNode.isValid()) { m_tabViewIndexModel.append(itemNode.instanceValue("title").toString()); diff --git a/src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h b/src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h index 68df5eced9..2fc5a9b794 100644 --- a/src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h +++ b/src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h @@ -75,7 +75,7 @@ public: QList<Property> properties() const; - void setType(const TypeName &typeName, int majorVersion, int minorVersion); + void setType(const TypeName &typeName, int majorVersion = -1, int minorVersion = -1); void setName(const QString &name); void setLibraryEntryIconPath(const QString &libraryEntryIconPath); void addProperty(const Property &p); diff --git a/src/plugins/qmldesigner/designercore/include/nodemetainfo.h b/src/plugins/qmldesigner/designercore/include/nodemetainfo.h index d2166b92cc..0ed326b804 100644 --- a/src/plugins/qmldesigner/designercore/include/nodemetainfo.h +++ b/src/plugins/qmldesigner/designercore/include/nodemetainfo.h @@ -95,7 +95,7 @@ public: bool hasCustomParser() const; bool availableInVersion(int majorVersion, int minorVersion) const; - bool isSubclassOf(const TypeName &type, int majorVersion, int minorVersio) const; + bool isSubclassOf(const TypeName &type, int majorVersion = -1, int minorVersion = -1) const; bool isGraphicalItem() const; bool isLayoutable() const; diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp index 5699a680ef..d5bcfaff6b 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp @@ -783,7 +783,7 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand() InstanceContainer::NodeSourceType nodeSourceType = static_cast<InstanceContainer::NodeSourceType>(instance.modelNode().nodeSourceType()); InstanceContainer::NodeMetaType nodeMetaType = InstanceContainer::ObjectMetaType; - if (instance.modelNode().metaInfo().isSubclassOf("QtQuick.Item", -1, -1)) + if (instance.modelNode().metaInfo().isSubclassOf("QtQuick.Item")) nodeMetaType = InstanceContainer::ItemMetaType; InstanceContainer container(instance.instanceId(), @@ -885,7 +885,7 @@ CreateInstancesCommand NodeInstanceView::createCreateInstancesCommand(const QLis InstanceContainer::NodeSourceType nodeSourceType = static_cast<InstanceContainer::NodeSourceType>(instance.modelNode().nodeSourceType()); InstanceContainer::NodeMetaType nodeMetaType = InstanceContainer::ObjectMetaType; - if (instance.modelNode().metaInfo().isSubclassOf("QtQuick.Item", -1, -1)) + if (instance.modelNode().metaInfo().isSubclassOf("QtQuick.Item")) nodeMetaType = InstanceContainer::ItemMetaType; InstanceContainer container(instance.instanceId(), instance.modelNode().type(), instance.modelNode().majorVersion(), instance.modelNode().minorVersion(), diff --git a/src/plugins/qmldesigner/designercore/metainfo/metainforeader.cpp b/src/plugins/qmldesigner/designercore/metainfo/metainforeader.cpp index 31baa4c193..68f093578b 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/metainforeader.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/metainforeader.cpp @@ -160,7 +160,7 @@ MetaInfoReader::ParserSate MetaInfoReader::readTypeElement(const QString &name) { if (name == ItemLibraryEntryElementName) { m_currentEntry = ItemLibraryEntry(); - m_currentEntry.setType(m_currentClassName, -1, -1); + m_currentEntry.setType(m_currentClassName); m_currentEntry.setTypeIcon(QIcon(m_currentIcon)); return ParsingItemLibrary; } else { diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp index e013561d89..e7f13239fd 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp @@ -1520,7 +1520,7 @@ bool NodeMetaInfo::isSubclassOf(const TypeName &type, int majorVersion, int mino bool NodeMetaInfo::isGraphicalItem() const { - return isSubclassOf("QtQuick.Item", -1, -1) || isSubclassOf("QtQuick.Window.Window", -1, -1); + return isSubclassOf("QtQuick.Item") || isSubclassOf("QtQuick.Window.Window"); } void NodeMetaInfo::clearCache() @@ -1530,25 +1530,25 @@ void NodeMetaInfo::clearCache() bool NodeMetaInfo::isLayoutable() const { - if (isSubclassOf("<cpp>.QDeclarativeBasePositioner", -1, -1)) + if (isSubclassOf("<cpp>.QDeclarativeBasePositioner")) return true; //QtQuick 1 - return isSubclassOf("QtQuick.Positioner", -1, -1) - || isSubclassOf("QtQuick.Layouts.Layout", -1, -1) - || isSubclassOf("QtQuick.Controls.SplitView", -1, -1); + return isSubclassOf("QtQuick.Positioner") + || isSubclassOf("QtQuick.Layouts.Layout") + || isSubclassOf("QtQuick.Controls.SplitView"); } bool NodeMetaInfo::isView() const { return isValid() && - (isSubclassOf("QtQuick.ListView", -1, -1) || - isSubclassOf("QtQuick.GridView", -1, -1) || - isSubclassOf("QtQuick.PathView", -1, -1)); + (isSubclassOf("QtQuick.ListView") || + isSubclassOf("QtQuick.GridView") || + isSubclassOf("QtQuick.PathView")); } bool NodeMetaInfo::isTabView() const { - return isSubclassOf("QtQuick.Controls.TabView", -1, -1); + return isSubclassOf("QtQuick.Controls.TabView"); } } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp index ea9523a706..ea829d5e18 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp @@ -384,7 +384,7 @@ void SubComponentManager::registerQmlFile(const QFileInfo &fileInfo, const QStri if (addToLibrary) { // Add file components to the library ItemLibraryEntry itemLibraryEntry; - itemLibraryEntry.setType(componentName.toUtf8(), -1, -1); + itemLibraryEntry.setType(componentName.toUtf8()); itemLibraryEntry.setName(baseComponentName); itemLibraryEntry.setCategory(QLatin1String("QML Components")); if (!qualifier.isEmpty()) { diff --git a/src/plugins/qmldesigner/designercore/model/modelnode.cpp b/src/plugins/qmldesigner/designercore/model/modelnode.cpp index e8e586c3ed..8af40b27aa 100644 --- a/src/plugins/qmldesigner/designercore/model/modelnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/modelnode.cpp @@ -1056,7 +1056,7 @@ bool ModelNode::isComponent() const return true; } - if (metaInfo().isSubclassOf("QtQuick.Loader", -1 , -1)) { + if (metaInfo().isSubclassOf("QtQuick.Loader")) { if (hasNodeListProperty("component")) { diff --git a/src/plugins/qmldesigner/designercore/model/qmlchangeset.cpp b/src/plugins/qmldesigner/designercore/model/qmlchangeset.cpp index 564654882c..cb9a43753e 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlchangeset.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlchangeset.cpp @@ -51,7 +51,7 @@ bool QmlPropertyChanges::isValid() const bool QmlPropertyChanges::isValidQmlPropertyChanges(const ModelNode &modelNode) { - return isValidQmlModelNodeFacade(modelNode) && modelNode.metaInfo().isSubclassOf("QtQuick.PropertyChanges", -1, -1); + return isValidQmlModelNodeFacade(modelNode) && modelNode.metaInfo().isSubclassOf("QtQuick.PropertyChanges"); } bool QmlModelStateOperation::isValid() const @@ -62,8 +62,8 @@ bool QmlModelStateOperation::isValid() const bool QmlModelStateOperation::isValidQmlModelStateOperation(const ModelNode &modelNode) { return isValidQmlModelNodeFacade(modelNode) - && (modelNode.metaInfo().isSubclassOf("<cpp>.QDeclarative1StateOperation", -1, -1) - || modelNode.metaInfo().isSubclassOf("<cpp>.QQuickStateOperation", -1, -1)); + && (modelNode.metaInfo().isSubclassOf("<cpp>.QDeclarative1StateOperation") + || modelNode.metaInfo().isSubclassOf("<cpp>.QQuickStateOperation")); } void QmlPropertyChanges::removeProperty(const PropertyName &name) diff --git a/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp index 177a36acaf..4503650c8d 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp @@ -47,10 +47,10 @@ namespace QmlDesigner { bool QmlItemNode::isItemOrWindow(const ModelNode &modelNode) { - if (modelNode.metaInfo().isSubclassOf("QtQuick.Item", -1, -1)) + if (modelNode.metaInfo().isSubclassOf("QtQuick.Item")) return true; - if (modelNode.metaInfo().isSubclassOf("QtQuick.Window.Window", -1, -1) && modelNode.isRootNode()) + if (modelNode.metaInfo().isSubclassOf("QtQuick.Window.Window") && modelNode.isRootNode()) return true; return false; @@ -364,7 +364,7 @@ bool QmlItemNode::instanceHasRotationTransform() const bool itemIsMovable(const ModelNode &modelNode) { - if (modelNode.metaInfo().isSubclassOf("QtQuick.Controls.Tab", -1, -1)) + if (modelNode.metaInfo().isSubclassOf("QtQuick.Controls.Tab")) return false; if (modelNode.hasParentProperty()) { @@ -599,7 +599,7 @@ bool QmlItemNode::isInLayout() const ModelNode parent = modelNode().parentProperty().parentModelNode(); if (parent.isValid() && parent.metaInfo().isValid()) - return parent.metaInfo().isSubclassOf("QtQuick.Layouts.Layout", -1, -1); + return parent.metaInfo().isSubclassOf("QtQuick.Layouts.Layout"); } return false; diff --git a/src/plugins/qmldesigner/designercore/model/qmlstate.cpp b/src/plugins/qmldesigner/designercore/model/qmlstate.cpp index bb6edff74c..aecc77d491 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlstate.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlstate.cpp @@ -224,7 +224,7 @@ bool QmlModelState::isValidQmlModelState(const ModelNode &modelNode) { return isValidQmlModelNodeFacade(modelNode) && modelNode.metaInfo().isValid() - && (modelNode.metaInfo().isSubclassOf("QtQuick.State", -1, -1) || isBaseState(modelNode)); + && (modelNode.metaInfo().isSubclassOf("QtQuick.State") || isBaseState(modelNode)); } /** diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index d0293a17c7..b1750aaede 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -86,7 +86,8 @@ static inline QStringList globalQtEnums() static inline QStringList knownEnumScopes() { - static QStringList list = QStringList() << QStringLiteral("TextInput") << QStringLiteral("TextEdit"); + static QStringList list = QStringList() << QStringLiteral("TextInput") << QStringLiteral("TextEdit") + << QStringLiteral("Material") << QStringLiteral("Universal") ;; return list; } @@ -293,7 +294,7 @@ static bool isConnectionsType(const QmlDesigner::TypeName &type) static bool propertyIsComponentType(const QmlDesigner::NodeAbstractProperty &property, const QmlDesigner::TypeName &type, QmlDesigner::Model *model) { - if (model->metaInfo(type, -1, -1).isSubclassOf("QtQuick.Component", -1, -1) && !isComponentType(type)) + if (model->metaInfo(type).isSubclassOf("QtQuick.Component") && !isComponentType(type)) return false; //If the type is already a subclass of Component keep it return property.parentModelNode().isValid() && diff --git a/src/plugins/qmldesigner/documentmanager.cpp b/src/plugins/qmldesigner/documentmanager.cpp index baa8d6a441..2870a87ce6 100644 --- a/src/plugins/qmldesigner/documentmanager.cpp +++ b/src/plugins/qmldesigner/documentmanager.cpp @@ -240,7 +240,7 @@ static bool isLoaderWithSourceComponent(const ModelNode &modelNode) { if (modelNode.isValid() && modelNode.metaInfo().isValid() - && modelNode.metaInfo().isSubclassOf("QtQuick.Loader", -1, -1)) { + && modelNode.metaInfo().isSubclassOf("QtQuick.Loader")) { if (modelNode.hasNodeProperty("sourceComponent")) return true; @@ -256,7 +256,7 @@ static bool hasSourceWithFileComponent(const ModelNode &modelNode) { if (modelNode.isValid() && modelNode.metaInfo().isValid() - && modelNode.metaInfo().isSubclassOf("QtQuick.Loader", -1, -1) + && modelNode.metaInfo().isSubclassOf("QtQuick.Loader") && modelNode.hasVariantProperty("source")) return true; diff --git a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtool.cpp b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtool.cpp index f9e768a48c..4b73ee59ba 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtool.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtool.cpp @@ -78,7 +78,7 @@ static int pathRankForModelNode(const ModelNode &modelNode) { if (modelNode.metaInfo().hasProperty("path")) { if (modelNode.hasNodeProperty("path")) { ModelNode pathNode = modelNode.nodeProperty("path").modelNode(); - if (pathNode.metaInfo().isSubclassOf("QtQuick.Path", -1, -1) && pathNode.hasNodeListProperty("pathElements")) { + if (pathNode.metaInfo().isSubclassOf("QtQuick.Path") && pathNode.hasNodeListProperty("pathElements")) { QList<ModelNode> pathElements = pathNode.nodeListProperty("pathElements").toModelNodeList(); if (pathElements.isEmpty()) return 0; diff --git a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtoolview.cpp b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtoolview.cpp index 25e0d83043..a15abf569e 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtoolview.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/pathtool/pathtoolview.cpp @@ -47,7 +47,7 @@ static bool isInEditedPath(const NodeAbstractProperty &propertyParent, const Mod if (editingPathViewModelNode.isValid()) { if (editingPathViewModelNode.hasNodeProperty("path")) { ModelNode pathModelNode = editingPathViewModelNode.nodeProperty("path").modelNode(); - if (pathModelNode.metaInfo().isSubclassOf("QtQuick.Path", -1, -1)) { + if (pathModelNode.metaInfo().isSubclassOf("QtQuick.Path")) { if (propertyParent.name() == "pathElements" && propertyParent.parentModelNode() == pathModelNode) return true; } diff --git a/src/plugins/qmldesigner/qmldesignerextension/texttool/textedititem.cpp b/src/plugins/qmldesigner/qmldesignerextension/texttool/textedititem.cpp index 38f62bfb64..bd22558a4e 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/texttool/textedititem.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/texttool/textedititem.cpp @@ -65,8 +65,8 @@ void TextEditItem::setFormEditorItem(FormEditorItem *formEditorItem) NodeMetaInfo metaInfo = m_formEditorItem->qmlItemNode().modelNode().metaInfo(); if (metaInfo.isValid() && - (metaInfo.isSubclassOf("QtQuick.TextEdit", -1, -1) - || metaInfo.isSubclassOf("QtQuick.Controls.TextArea", -1, -1))) { + (metaInfo.isSubclassOf("QtQuick.TextEdit") + || metaInfo.isSubclassOf("QtQuick.Controls.TextArea"))) { QSize maximumSize = rect.size().toSize(); activateTextEdit(maximumSize); } else { diff --git a/src/plugins/qmldesigner/qmldesignericons.h b/src/plugins/qmldesigner/qmldesignericons.h index ab10dda7e3..922e385f55 100644 --- a/src/plugins/qmldesigner/qmldesignericons.h +++ b/src/plugins/qmldesigner/qmldesignericons.h @@ -46,8 +46,6 @@ const Utils::Icon EXPORT_CHECKED({ {QLatin1String(":/navigator/icon/export_checked.png"), Utils::Theme::IconsBaseColor}}); const Utils::Icon EXPORT_UNCHECKED({ {QLatin1String(":/navigator/icon/export_unchecked.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon BOUNDING_RECT({ - {QLatin1String(":/icon/layout/boundingrect.png"), Utils::Theme::IconsBaseColor}}); const Utils::Icon SNAPPING({ {QLatin1String(":/icon/layout/snapping.png"), Utils::Theme::IconsBaseColor}}); const Utils::Icon NO_SNAPPING({ diff --git a/src/plugins/qmldesigner/settingspage.ui b/src/plugins/qmldesigner/settingspage.ui index 451d98fe11..0ca22cc9cd 100644 --- a/src/plugins/qmldesigner/settingspage.ui +++ b/src/plugins/qmldesigner/settingspage.ui @@ -6,7 +6,7 @@ <rect> <x>0</x> <y>0</y> - <width>629</width> + <width>706</width> <height>472</height> </rect> </property> @@ -343,7 +343,7 @@ <item> <widget class="QLabel" name="label_4"> <property name="text"> - <string>Forward puppet output:</string> + <string>Forward QML emulation layer output:</string> </property> </widget> </item> @@ -384,7 +384,7 @@ <item> <widget class="QLabel" name="label_5"> <property name="text"> - <string>Debug puppet:</string> + <string>Debug QML emulation layer:</string> </property> </widget> </item> diff --git a/src/plugins/qmljseditor/qmloutlinemodel.cpp b/src/plugins/qmljseditor/qmloutlinemodel.cpp index 077e0ee34a..7102c078d7 100644 --- a/src/plugins/qmljseditor/qmloutlinemodel.cpp +++ b/src/plugins/qmljseditor/qmloutlinemodel.cpp @@ -472,7 +472,7 @@ QModelIndex QmlOutlineModel::enterObjectDefinition(AST::UiObjectDefinition *objD } else { // it's a grouped propery like 'anchors' data.insert(ItemTypeRole, NonElementBindingType); - icon = m_icons->scriptBindingIcon(); + icon = Icons::scriptBindingIcon(); } QmlOutlineItem *item = enterNode(data, objDef, idNode, icon); @@ -492,7 +492,7 @@ QModelIndex QmlOutlineModel::enterObjectBinding(AST::UiObjectBinding *objBinding bindingData.insert(Qt::DisplayRole, asString(objBinding->qualifiedId)); bindingData.insert(ItemTypeRole, ElementBindingType); - QmlOutlineItem *bindingItem = enterNode(bindingData, objBinding, objBinding->qualifiedId, m_icons->scriptBindingIcon()); + QmlOutlineItem *bindingItem = enterNode(bindingData, objBinding, objBinding->qualifiedId, Icons::scriptBindingIcon()); const QString typeName = asString(objBinding->qualifiedTypeNameId); if (!m_typeToIcon.contains(typeName)) @@ -521,7 +521,7 @@ QModelIndex QmlOutlineModel::enterArrayBinding(AST::UiArrayBinding *arrayBinding bindingData.insert(Qt::DisplayRole, asString(arrayBinding->qualifiedId)); bindingData.insert(ItemTypeRole, ElementBindingType); - QmlOutlineItem *item = enterNode(bindingData, arrayBinding, arrayBinding->qualifiedId, m_icons->scriptBindingIcon()); + QmlOutlineItem *item = enterNode(bindingData, arrayBinding, arrayBinding->qualifiedId, Icons::scriptBindingIcon()); return item->index(); } @@ -539,7 +539,7 @@ QModelIndex QmlOutlineModel::enterScriptBinding(AST::UiScriptBinding *scriptBind objectData.insert(AnnotationRole, getAnnotation(scriptBinding->statement)); objectData.insert(ItemTypeRole, NonElementBindingType); - QmlOutlineItem *item = enterNode(objectData, scriptBinding, scriptBinding->qualifiedId, m_icons->scriptBindingIcon()); + QmlOutlineItem *item = enterNode(objectData, scriptBinding, scriptBinding->qualifiedId, Icons::scriptBindingIcon()); return item->index(); } @@ -558,7 +558,7 @@ QModelIndex QmlOutlineModel::enterPublicMember(AST::UiPublicMember *publicMember objectData.insert(AnnotationRole, getAnnotation(publicMember->statement)); objectData.insert(ItemTypeRole, NonElementBindingType); - QmlOutlineItem *item = enterNode(objectData, publicMember, 0, m_icons->publicMemberIcon()); + QmlOutlineItem *item = enterNode(objectData, publicMember, 0, Icons::publicMemberIcon()); return item->index(); } @@ -576,7 +576,7 @@ QModelIndex QmlOutlineModel::enterFunctionDeclaration(AST::FunctionDeclaration * objectData.insert(Qt::DisplayRole, functionDeclaration->name.toString()); objectData.insert(ItemTypeRole, ElementBindingType); - QmlOutlineItem *item = enterNode(objectData, functionDeclaration, 0, m_icons->functionDeclarationIcon()); + QmlOutlineItem *item = enterNode(objectData, functionDeclaration, 0, Icons::functionDeclarationIcon()); return item->index(); } @@ -593,7 +593,7 @@ QModelIndex QmlOutlineModel::enterTestCase(AST::ObjectLiteral *objectLiteral) objectData.insert(Qt::DisplayRole, QLatin1String("testcase")); objectData.insert(ItemTypeRole, ElementBindingType); - QmlOutlineItem *item = enterNode(objectData, objectLiteral, 0, m_icons->objectDefinitionIcon()); + QmlOutlineItem *item = enterNode(objectData, objectLiteral, 0, Icons::objectDefinitionIcon()); return item->index(); } @@ -613,11 +613,11 @@ QModelIndex QmlOutlineModel::enterTestCaseProperties(AST::PropertyAssignmentList objectData.insert(ItemTypeRole, ElementBindingType); QmlOutlineItem *item; if (assignment->value->kind == AST::Node::Kind_FunctionExpression) - item = enterNode(objectData, assignment, 0, m_icons->functionDeclarationIcon()); + item = enterNode(objectData, assignment, 0, Icons::functionDeclarationIcon()); else if (assignment->value->kind == AST::Node::Kind_ObjectLiteral) - item = enterNode(objectData, assignment, 0, m_icons->objectDefinitionIcon()); + item = enterNode(objectData, assignment, 0, Icons::objectDefinitionIcon()); else - item = enterNode(objectData, assignment, 0, m_icons->scriptBindingIcon()); + item = enterNode(objectData, assignment, 0, Icons::scriptBindingIcon()); return item->index(); } @@ -628,7 +628,7 @@ QModelIndex QmlOutlineModel::enterTestCaseProperties(AST::PropertyAssignmentList objectData.insert(Qt::DisplayRole, propertyName->id.toString()); objectData.insert(ItemTypeRole, ElementBindingType); QmlOutlineItem *item; - item = enterNode(objectData, getterSetter, 0, m_icons->functionDeclarationIcon()); + item = enterNode(objectData, getterSetter, 0, Icons::functionDeclarationIcon()); return item->index(); diff --git a/src/plugins/qmlprofiler/qml/qmlprofiler.qrc b/src/plugins/qmlprofiler/qml/qmlprofiler.qrc index ffef45e6a8..88bd7130ec 100644 --- a/src/plugins/qmlprofiler/qml/qmlprofiler.qrc +++ b/src/plugins/qmlprofiler/qml/qmlprofiler.qrc @@ -1,7 +1,5 @@ <RCC> <qresource prefix="/qmlprofiler"> - <file>recordOff.png</file> - <file>recordOn.png</file> <file>bindingloops.vert</file> <file>bindingloops.frag</file> </qresource> diff --git a/src/plugins/qmlprofiler/qml/recordOff.png b/src/plugins/qmlprofiler/qml/recordOff.png Binary files differdeleted file mode 100644 index 45f5136ca8..0000000000 --- a/src/plugins/qmlprofiler/qml/recordOff.png +++ /dev/null diff --git a/src/plugins/qmlprofiler/qml/recordOn.png b/src/plugins/qmlprofiler/qml/recordOn.png Binary files differdeleted file mode 100644 index e693af8162..0000000000 --- a/src/plugins/qmlprofiler/qml/recordOn.png +++ /dev/null diff --git a/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp b/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp index efc94d143b..f2ce13c544 100644 --- a/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerdetailsrewriter.cpp @@ -133,6 +133,8 @@ void QmlProfilerDetailsRewriter::requestDetailsForLocation(int requestId, if (!QmlJS::ModelManagerInterface::guessLanguageOfFile(localFile).isQmlLikeLanguage()) return; + localFile = fileInfo.canonicalFilePath(); + PendingEvent ev = {location, localFile, requestId}; d->m_pendingEvents << ev; if (!d->m_pendingDocs.contains(localFile)) { diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index fd69d95de4..7c9ad18606 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -37,6 +37,7 @@ #include "qmlprofilersettings.h" #include "qmlprofilerplugin.h" +#include <debugger/debuggericons.h> #include <debugger/analyzer/analyzermanager.h> #include <debugger/analyzer/analyzerruncontrol.h> #include <debugger/analyzer/analyzerstartparameters.h> @@ -204,7 +205,7 @@ QmlProfilerTool::QmlProfilerTool(QObject *parent) setRecording(d->m_profilerState->clientRecording()); d->m_clearButton = new QToolButton; - d->m_clearButton->setIcon(Icons::CLEAN_PANE.icon()); + d->m_clearButton->setIcon(Core::Icons::CLEAN_PANE.icon()); d->m_clearButton->setToolTip(tr("Discard data")); connect(d->m_clearButton, &QAbstractButton::clicked, [this](){ @@ -213,13 +214,13 @@ QmlProfilerTool::QmlProfilerTool(QObject *parent) }); d->m_searchButton = new QToolButton; - d->m_searchButton->setIcon(Icons::ZOOM.icon()); + d->m_searchButton->setIcon(Core::Icons::ZOOM_TOOLBAR.icon()); d->m_searchButton->setToolTip(tr("Search timeline event notes.")); connect(d->m_searchButton, &QToolButton::clicked, this, &QmlProfilerTool::showTimeLineSearch); d->m_displayFeaturesButton = new QToolButton; - d->m_displayFeaturesButton->setIcon(Icons::FILTER.icon()); + d->m_displayFeaturesButton->setIcon(Core::Icons::FILTER.icon()); d->m_displayFeaturesButton->setToolTip(tr("Hide or show event categories.")); d->m_displayFeaturesButton->setPopupMode(QToolButton::InstantPopup); d->m_displayFeaturesButton->setProperty("noArrow", true); @@ -428,10 +429,12 @@ void QmlProfilerTool::recordingButtonChanged(bool recording) void QmlProfilerTool::setRecording(bool recording) { + const static QIcon recordOn = Debugger::Icons::RECORD_ON.icon(); + const static QIcon recordOff = Debugger::Icons::RECORD_OFF.icon(); + // update display d->m_recordButton->setToolTip( recording ? tr("Disable Profiling") : tr("Enable Profiling")); - d->m_recordButton->setIcon(QIcon(recording ? QLatin1String(":/qmlprofiler/recordOn.png") : - QLatin1String(":/qmlprofiler/recordOff.png"))); + d->m_recordButton->setIcon(recording ? recordOn : recordOff); d->m_recordButton->setChecked(recording); diff --git a/src/plugins/qmlprofilerextension/qmlprofilerextensionplugin.cpp b/src/plugins/qmlprofilerextension/qmlprofilerextensionplugin.cpp index 05c7ac9b9e..e5492d3c31 100644 --- a/src/plugins/qmlprofilerextension/qmlprofilerextensionplugin.cpp +++ b/src/plugins/qmlprofilerextension/qmlprofilerextensionplugin.cpp @@ -128,8 +128,8 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerExtensionPlugin::aboutToShutdo void QmlProfilerExtensionPlugin::triggerAction() { QMessageBox::information(Core::ICore::mainWindow(), - tr("Action triggered"), - tr("This is an action from QmlProfilerExtension.")); + tr("Action Triggered"), + tr("This is an action from QML Profiler Extension.")); } #include "qmlprofilerextensionplugin.moc" diff --git a/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp b/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp index 0bb23d8a46..8cf0b1d26d 100644 --- a/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp +++ b/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp @@ -56,7 +56,7 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE m_executableChooser = new PathChooser(this); m_executableChooser->setHistoryCompleter(QLatin1String("Qt.CustomExecutable.History")); - m_executableChooser->setExpectedKind(PathChooser::Command); + m_executableChooser->setExpectedKind(PathChooser::ExistingCommand); layout->addRow(tr("Executable:"), m_executableChooser); auto argumentsAspect = rc->extraAspect<ArgumentsAspect>(); diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 40f5bb37a8..6f960c0786 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -31,6 +31,7 @@ #include "publickeydeploymentdialog.h" #include "remotelinux_constants.h" #include "remotelinuxsignaloperation.h" +#include "remotelinuxenvironmentreader.h" #include <coreplugin/id.h> #include <projectexplorer/devicesupport/sshdeviceprocesslist.h> @@ -254,4 +255,29 @@ DeviceProcessSignalOperation::Ptr LinuxDevice::signalOperation() const return DeviceProcessSignalOperation::Ptr(new RemoteLinuxSignalOperation(sshParameters())); } +class LinuxDeviceEnvironmentFetcher : public DeviceEnvironmentFetcher +{ +public: + LinuxDeviceEnvironmentFetcher(const IDevice::ConstPtr &device) + : m_reader(device) + { + connect(&m_reader, &Internal::RemoteLinuxEnvironmentReader::finished, + this, &LinuxDeviceEnvironmentFetcher::readerFinished); + connect(&m_reader, &Internal::RemoteLinuxEnvironmentReader::error, + this, &LinuxDeviceEnvironmentFetcher::readerError); + } + +private: + void start() override { m_reader.start(); } + void readerFinished() { emit finished(m_reader.remoteEnvironment(), true); } + void readerError() { emit finished(Utils::Environment(), false); } + + Internal::RemoteLinuxEnvironmentReader m_reader; +}; + +DeviceEnvironmentFetcher::Ptr LinuxDevice::environmentFetcher() const +{ + return DeviceEnvironmentFetcher::Ptr(new LinuxDeviceEnvironmentFetcher(sharedFromThis())); +} + } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/linuxdevice.h b/src/plugins/remotelinux/linuxdevice.h index c834bfa519..f9469abeb5 100644 --- a/src/plugins/remotelinux/linuxdevice.h +++ b/src/plugins/remotelinux/linuxdevice.h @@ -65,6 +65,7 @@ public: bool hasDeviceTester() const { return true; } ProjectExplorer::DeviceTester *createDeviceTester() const; ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const; + ProjectExplorer::DeviceEnvironmentFetcher::Ptr environmentFetcher() const; protected: LinuxDevice() {} diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.cpp index f3f6820311..dce7464e8e 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspectwidget.cpp @@ -28,10 +28,16 @@ #include "remotelinuxrunconfiguration.h" #include "remotelinuxenvironmentreader.h" +#include <projectexplorer/target.h> +#include <projectexplorer/kitinformation.h> + #include <QCoreApplication> #include <QMessageBox> #include <QPushButton> +using namespace ProjectExplorer; +using namespace RemoteLinux::Internal; + namespace { const QString FetchEnvButtonText = QCoreApplication::translate("RemoteLinux::RemoteLinuxEnvironmentAspectWidget", @@ -41,15 +47,22 @@ const QString FetchEnvButtonText namespace RemoteLinux { RemoteLinuxEnvironmentAspectWidget::RemoteLinuxEnvironmentAspectWidget(RemoteLinuxEnvironmentAspect *aspect) : - ProjectExplorer::EnvironmentAspectWidget(aspect, new QPushButton), - deviceEnvReader(new Internal::RemoteLinuxEnvironmentReader(aspect->runConfiguration(), this)) + EnvironmentAspectWidget(aspect, new QPushButton) { + RunConfiguration *runConfiguration = aspect->runConfiguration(); + Target *target = runConfiguration->target(); + IDevice::ConstPtr device = DeviceKitInformation::device(target->kit()); + + deviceEnvReader = new RemoteLinuxEnvironmentReader(device, this); + connect(target, &ProjectExplorer::Target::kitChanged, + deviceEnvReader, &RemoteLinuxEnvironmentReader::handleCurrentDeviceConfigChanged); + QPushButton *button = fetchButton(); button->setText(FetchEnvButtonText); connect(button, &QPushButton::clicked, this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironment); - connect(deviceEnvReader, &Internal::RemoteLinuxEnvironmentReader::finished, + connect(deviceEnvReader, &RemoteLinuxEnvironmentReader::finished, this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironmentFinished); - connect(deviceEnvReader, &Internal::RemoteLinuxEnvironmentReader::error, + connect(deviceEnvReader, &RemoteLinuxEnvironmentReader::error, this, &RemoteLinuxEnvironmentAspectWidget::fetchEnvironmentError); } diff --git a/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp b/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp index 3d79335b5c..81bca05e97 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentreader.cpp @@ -27,38 +27,39 @@ #include <projectexplorer/devicesupport/deviceprocess.h> #include <projectexplorer/devicesupport/idevice.h> -#include <projectexplorer/kitinformation.h> -#include <projectexplorer/runconfiguration.h> -#include <projectexplorer/target.h> +#include <projectexplorer/runnables.h> using namespace ProjectExplorer; namespace RemoteLinux { namespace Internal { -RemoteLinuxEnvironmentReader::RemoteLinuxEnvironmentReader(RunConfiguration *config, QObject *parent) +RemoteLinuxEnvironmentReader::RemoteLinuxEnvironmentReader(const IDevice::ConstPtr &device, + QObject *parent) : QObject(parent) , m_stop(false) , m_env(Utils::OsTypeLinux) - , m_kit(config->target()->kit()) + , m_device(device) , m_deviceProcess(0) { - connect(config->target(), SIGNAL(kitChanged()), - this, SLOT(handleCurrentDeviceConfigChanged())); } void RemoteLinuxEnvironmentReader::start() { - IDevice::ConstPtr device = DeviceKitInformation::device(m_kit); - if (!device) + if (!m_device) { + emit error(tr("Error: No device")); + setFinished(); return; + } m_stop = false; - m_deviceProcess = device->createProcess(this); + m_deviceProcess = m_device->createProcess(this); connect(m_deviceProcess, &DeviceProcess::error, this, &RemoteLinuxEnvironmentReader::handleError); connect(m_deviceProcess, &DeviceProcess::finished, this, &RemoteLinuxEnvironmentReader::remoteProcessFinished); - m_deviceProcess->start(QLatin1String("env")); + StandardRunnable runnable; + runnable.executable = QLatin1String("env"); + m_deviceProcess->start(runnable); } void RemoteLinuxEnvironmentReader::stop() diff --git a/src/plugins/remotelinux/remotelinuxenvironmentreader.h b/src/plugins/remotelinux/remotelinuxenvironmentreader.h index 99db24ee08..3642a556e0 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentreader.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentreader.h @@ -25,15 +25,12 @@ #pragma once +#include <projectexplorer/devicesupport/idevice.h> #include <utils/environment.h> #include <QObject> -namespace ProjectExplorer { -class DeviceProcess; -class Kit; -class RunConfiguration; -} +namespace ProjectExplorer { class DeviceProcess; } namespace RemoteLinux { namespace Internal { @@ -43,29 +40,27 @@ class RemoteLinuxEnvironmentReader : public QObject Q_OBJECT public: - RemoteLinuxEnvironmentReader(ProjectExplorer::RunConfiguration *config, QObject *parent = 0); - + RemoteLinuxEnvironmentReader(const ProjectExplorer::IDevice::ConstPtr &device, + QObject *parent = 0); void start(); void stop(); Utils::Environment remoteEnvironment() const { return m_env; } + void handleCurrentDeviceConfigChanged(); signals: void finished(); void error(const QString &error); -private slots: +private: void handleError(); - void handleCurrentDeviceConfigChanged(); void remoteProcessFinished(); - -private: void setFinished(); void destroyProcess(); bool m_stop; Utils::Environment m_env; - ProjectExplorer::Kit *m_kit; + ProjectExplorer::IDevice::ConstPtr m_device; ProjectExplorer::DeviceProcess *m_deviceProcess; }; diff --git a/src/plugins/remotelinux/remotelinuxruncontrol.cpp b/src/plugins/remotelinux/remotelinuxruncontrol.cpp index 63d4012679..9108b8597d 100644 --- a/src/plugins/remotelinux/remotelinuxruncontrol.cpp +++ b/src/plugins/remotelinux/remotelinuxruncontrol.cpp @@ -25,8 +25,9 @@ #include "remotelinuxruncontrol.h" +#include <coreplugin/coreicons.h> + #include <projectexplorer/devicesupport/deviceapplicationrunner.h> -#include <projectexplorer/projectexplorericons.h> using namespace ProjectExplorer; @@ -42,7 +43,7 @@ public: RemoteLinuxRunControl::RemoteLinuxRunControl(RunConfiguration *rc) : RunControl(rc, ProjectExplorer::Constants::NORMAL_RUN_MODE), d(new RemoteLinuxRunControlPrivate) { - setIcon(ProjectExplorer::Icons::RUN_SMALL); + setIcon(Core::Icons::RUN_SMALL); setRunnable(rc->runnable()); d->running = false; diff --git a/src/plugins/texteditor/autocompleter.cpp b/src/plugins/texteditor/autocompleter.cpp index d2de0effc8..8cf39ac6ec 100644 --- a/src/plugins/texteditor/autocompleter.cpp +++ b/src/plugins/texteditor/autocompleter.cpp @@ -208,7 +208,6 @@ bool AutoCompleter::autoBackspace(QTextCursor &cursor) QTextDocument *doc = cursor.document(); const QChar lookAhead = doc->characterAt(pos); const QChar lookBehind = doc->characterAt(pos - 1); - const QChar lookFurtherBehind = doc->characterAt(pos - 2); const QChar character = lookBehind; if (character == QLatin1Char('(') || character == QLatin1Char('[')) { @@ -237,11 +236,7 @@ bool AutoCompleter::autoBackspace(QTextCursor &cursor) // ### this code needs to be generalized if ((lookBehind == QLatin1Char('(') && lookAhead == QLatin1Char(')')) - || (lookBehind == QLatin1Char('[') && lookAhead == QLatin1Char(']')) - || (lookBehind == QLatin1Char('"') && lookAhead == QLatin1Char('"') - && lookFurtherBehind != QLatin1Char('\\')) - || (lookBehind == QLatin1Char('\'') && lookAhead == QLatin1Char('\'') - && lookFurtherBehind != QLatin1Char('\\'))) { + || (lookBehind == QLatin1Char('[') && lookAhead == QLatin1Char(']'))) { if (! isInComment(c)) { cursor.beginEditBlock(); cursor.deleteChar(); diff --git a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp index b1f72f7924..6a792c152c 100644 --- a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp +++ b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp @@ -275,6 +275,7 @@ GenericProposalWidgetPrivate::GenericProposalWidgetPrivate(QWidget *completionWi , m_assistant(0) , m_autoWidth(true) { + m_completionListView->setIconSize(QSize(16, 16)); connect(m_completionListView, &QAbstractItemView::activated, this, &GenericProposalWidgetPrivate::handleActivation); diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 064d8bc1e0..b4aee7ad10 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -4763,10 +4763,13 @@ void TextEditorWidgetPrivate::updateCurrentLineInScrollbar() m_highlightScrollBar->removeHighlights(Constants::SCROLL_BAR_CURRENT_LINE); if (m_highlightScrollBar->maximum() > 0) { const QTextCursor &tc = q->textCursor(); - const int lineNumberInBlock = - tc.block().layout()->lineForTextPosition(tc.positionInBlock()).lineNumber(); - m_highlightScrollBar->addHighlight(Constants::SCROLL_BAR_CURRENT_LINE, - q->textCursor().block().firstLineNumber() + lineNumberInBlock); + if (QTextLayout *layout = tc.block().layout()) { + const int lineNumberInBlock = + layout->lineForTextPosition(tc.positionInBlock()).lineNumber(); + m_highlightScrollBar->addHighlight( + Constants::SCROLL_BAR_CURRENT_LINE, + q->textCursor().block().firstLineNumber() + lineNumberInBlock); + } } } } diff --git a/src/plugins/todo/todoplugin.cpp b/src/plugins/todo/todoplugin.cpp index c32007a9c3..475c04cc42 100644 --- a/src/plugins/todo/todoplugin.cpp +++ b/src/plugins/todo/todoplugin.cpp @@ -70,7 +70,7 @@ bool TodoPlugin::initialize(const QStringList& args, QString *errMsg) auto panelFactory = new ProjectExplorer::ProjectPanelFactory(); panelFactory->setPriority(100); - panelFactory->setDisplayName(TodoProjectSettingsWidget::tr("To-Do Settings")); + panelFactory->setDisplayName(TodoProjectSettingsWidget::tr("To-Do")); panelFactory->setCreateWidgetFunction([this, panelFactory](ProjectExplorer::Project *project) -> QWidget * { auto *panel = new ProjectExplorer::PropertiesPanel; panel->setDisplayName(panelFactory->displayName()); diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 246fe18883..182106f7e3 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -71,7 +71,6 @@ #include <utils/qtcassert.h> #include <utils/styledbar.h> -#include <projectexplorer/projectexplorericons.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projecttree.h> @@ -239,7 +238,7 @@ CallgrindTool::CallgrindTool(QObject *parent) m_stopAction = Debugger::createStopAction(); ActionDescription desc; - desc.setToolTip(tr("Valgrind Function Profile uses the " + desc.setToolTip(tr("Valgrind Function Profiler uses the " "Callgrind tool to record function calls when a program runs.")); if (!Utils::HostOsInfo::isWindowsHost()) { @@ -371,7 +370,7 @@ CallgrindTool::CallgrindTool(QObject *parent) // pause action m_pauseAction = action = new QAction(this); action->setCheckable(true); - action->setIcon(ProjectExplorer::Icons::INTERRUPT_SMALL.icon()); + action->setIcon(Core::Icons::INTERRUPT_SMALL.icon()); //action->setText(tr("Ignore")); action->setToolTip(tr("Pause event logging. No events are counted which will speed up program execution during profiling.")); connect(action, &QAction::toggled, this, &CallgrindTool::pauseToggled); @@ -431,7 +430,7 @@ CallgrindTool::CallgrindTool(QObject *parent) // Show costs relative to parent m_costRelativeToParent = new QAction(tr("Relative Costs to Parent"), this); - m_costRelativeToParent->setToolTip(tr("Show costs relative to parent functions inclusive cost.")); + m_costRelativeToParent->setToolTip(tr("Show costs relative to parent function's inclusive cost.")); m_costRelativeToParent->setCheckable(true); connect(m_costRelativeToParent, &QAction::toggled, this, &CallgrindTool::updateCostFormat); group->addAction(m_costRelativeToParent); @@ -456,7 +455,7 @@ CallgrindTool::CallgrindTool(QObject *parent) // Shorter template signature action = m_shortenTemplates = new QAction(QLatin1String("<>"), this); - action->setToolTip(tr("This removes template parameter lists when displaying function names.")); + action->setToolTip(tr("Remove template parameter lists when displaying function names.")); action->setCheckable(true); connect(action, &QAction::toggled, &m_dataModel, &DataModel::setShortenTemplates); connect(action, &QAction::toggled, settings, &ValgrindGlobalSettings::setShortenTemplates); @@ -850,7 +849,7 @@ void CallgrindTool::requestContextMenu(TextEditorWidget *widget, int line, QMenu foreach (CallgrindTextMark *textMark, m_textMarks) { if (textMark->fileName() == widget->textDocument()->filePath().toString() && textMark->lineNumber() == line) { const Function *func = textMark->function(); - QAction *action = menu->addAction(tr("Select this Function in the Analyzer Output")); + QAction *action = menu->addAction(tr("Select This Function in the Analyzer Output")); connect(action, &QAction::triggered, this, [this, func] { selectFunction(func); }); break; } diff --git a/src/plugins/winrt/winrtruncontrol.cpp b/src/plugins/winrt/winrtruncontrol.cpp index 9fad1e879f..d8be5885ea 100644 --- a/src/plugins/winrt/winrtruncontrol.cpp +++ b/src/plugins/winrt/winrtruncontrol.cpp @@ -29,6 +29,7 @@ #include "winrtrunconfiguration.h" #include "winrtrunnerhelper.h" +#include <coreplugin/coreicons.h> #include <coreplugin/idocument.h> #include <extensionsystem/pluginmanager.h> #include <projectexplorer/buildconfiguration.h> @@ -36,7 +37,6 @@ #include <projectexplorer/target.h> #include <projectexplorer/project.h> #include <projectexplorer/kitinformation.h> -#include <projectexplorer/projectexplorericons.h> #include <qtsupport/qtkitinformation.h> #include <QTimer> @@ -56,7 +56,7 @@ WinRtRunControl::WinRtRunControl(WinRtRunConfiguration *runConfiguration, Core:: , m_state(StoppedState) , m_runner(0) { - setIcon(ProjectExplorer::Icons::RUN_SMALL); + setIcon(Core::Icons::RUN_SMALL); } void WinRtRunControl::start() |