diff --git a/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h b/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h index f3934b7ba1c..9270a3429ca 100644 --- a/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h +++ b/src/libs/3rdparty/cplusplus/ASTPatternBuilder.h @@ -26,8 +26,7 @@ // Changes will be lost. // -#ifndef CPLUSPLUS_AST_PATTERN_BUILDER_H -#define CPLUSPLUS_AST_PATTERN_BUILDER_H +#pragma once #include "CPlusPlusForwardDeclarations.h" #include "AST.h" @@ -1385,5 +1384,3 @@ public: }; } // end of namespace CPlusPlus - -#endif // CPLUSPLUS_AST_PATTERN_BUILDER_H diff --git a/src/plugins/diffeditor/diffeditordocument.cpp b/src/plugins/diffeditor/diffeditordocument.cpp index 9928ef61972..aac0ba2f063 100644 --- a/src/plugins/diffeditor/diffeditordocument.cpp +++ b/src/plugins/diffeditor/diffeditordocument.cpp @@ -203,11 +203,19 @@ QString DiffEditorDocument::fallbackSaveAsPath() const return QDir::homePath(); } +bool DiffEditorDocument::isSaveAsAllowed() const +{ + return !isReloading(); +} + bool DiffEditorDocument::save(QString *errorString, const QString &fileName, bool autoSave) { Q_UNUSED(errorString) Q_UNUSED(autoSave) + if (isReloading()) + return false; + const bool ok = write(fileName, format(), plainText(), errorString); if (!ok) @@ -330,6 +338,7 @@ void DiffEditorDocument::beginReload() { emit aboutToReload(); m_isReloading = true; + emit changed(); const bool blocked = blockSignals(true); setDiffFiles(QList(), QString()); setDescription(QString()); @@ -339,6 +348,7 @@ void DiffEditorDocument::beginReload() void DiffEditorDocument::endReload(bool success) { m_isReloading = false; + emit changed(); emit reloadFinished(success); } diff --git a/src/plugins/diffeditor/diffeditordocument.h b/src/plugins/diffeditor/diffeditordocument.h index c61d17ad909..18c73b61cee 100644 --- a/src/plugins/diffeditor/diffeditordocument.h +++ b/src/plugins/diffeditor/diffeditordocument.h @@ -70,7 +70,7 @@ public: QString fallbackSaveAsPath() const override; QString fallbackSaveAsFileName() const override; - bool isSaveAsAllowed() const override { return true; } + bool isSaveAsAllowed() const override; bool save(QString *errorString, const QString &fileName, bool autoSave) override; void reload(); bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override; diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 338681ce854..b51b238118b 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -538,6 +538,19 @@ IRunConfigurationAspect *IRunControlFactory::createRunConfigurationAspect(RunCon than it needs to be. */ + +const char PRIORITY_KEY[] = "RunControlFactoryPriority"; + +int ProjectExplorer::IRunControlFactory::priority() const +{ + return property(PRIORITY_KEY).toInt(); // 0 by default. +} + +void IRunControlFactory::setPriority(int priority) +{ + setProperty(PRIORITY_KEY, priority); +} + namespace Internal { enum class RunWorkerState diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 4d7f927f81b..891c17a57e4 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -341,6 +341,10 @@ public: virtual RunControl *create(RunConfiguration *runConfiguration, Core::Id runMode, QString *errorMessage); virtual IRunConfigurationAspect *createRunConfigurationAspect(RunConfiguration *rc); + + int priority() const; +protected: + void setPriority(int priority); // Higher values will be preferred. }; class PROJECTEXPLORER_EXPORT RunConfigWidget : public QWidget diff --git a/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp b/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp index 9a5b7c67007..2b83d7fa4ea 100644 --- a/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp +++ b/src/tools/cplusplus-update-frontend/cplusplus-update-frontend.cpp @@ -1246,8 +1246,7 @@ void generateASTVisitor_H(const Snapshot &, const QDir &cplusplusDir, QTextStream out(&file); out << copyrightHeader << "\n" -"#ifndef CPLUSPLUS_ASTVISITOR_H\n" -"#define CPLUSPLUS_ASTVISITOR_H\n" +"#pragma once\n" "\n" "#include \"CPlusPlusForwardDeclarations.h\"\n" "#include \"ASTfwd.h\"\n" @@ -1317,9 +1316,7 @@ void generateASTVisitor_H(const Snapshot &, const QDir &cplusplusDir, " TranslationUnit *_translationUnit;\n" "};\n" "\n" -"} // namespace CPlusPlus\n" -"\n" -"#endif // CPLUSPLUS_ASTVISITOR_H\n"; +"} // namespace CPlusPlus\n"; closeAndPrintFilePath(file); } @@ -1339,8 +1336,7 @@ void generateASTMatcher_H(const Snapshot &, const QDir &cplusplusDir, QTextStream out(&file); out << copyrightHeader << "\n" -"#ifndef ASTMATCHER_H\n" -"#define ASTMATCHER_H\n" +"#pragma once\n" "\n" "#include \"ASTfwd.h\"\n" "\n" @@ -1360,9 +1356,7 @@ void generateASTMatcher_H(const Snapshot &, const QDir &cplusplusDir, out << "};\n" "\n" -"} // namespace CPlusPlus\n" -"\n" -"#endif // CPLUSPLUS_ASTMATCHER_H\n"; +"} // namespace CPlusPlus\n"; closeAndPrintFilePath(file); } @@ -1574,8 +1568,7 @@ void generateASTPatternBuilder_h(const QDir &cplusplusDir) out << copyrightHeader << generatedHeader - << "#ifndef CPLUSPLUS_AST_PATTERN_BUILDER_H" << endl - << "#define CPLUSPLUS_AST_PATTERN_BUILDER_H" << endl + << "#pragma once" << endl << endl << "#include \"CPlusPlusForwardDeclarations.h\"" << endl << "#include \"AST.h\"" << endl @@ -1683,9 +1676,7 @@ void generateASTPatternBuilder_h(const QDir &cplusplusDir) out << "};" << endl << endl - << "} // end of namespace CPlusPlus" << endl - << endl - << "#endif // CPLUSPLUS_AST_PATTERN_BUILDER_H" << endl; + << "} // end of namespace CPlusPlus" << endl; closeAndPrintFilePath(file); }