diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-04-01 17:31:39 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-04-01 17:31:39 +0200 |
commit | e426d08e54bd10b7513a3ced9cf9237b75b06b45 (patch) | |
tree | b4f20c8d93877aa4ef6964ec8c700102def865d0 /src/plugins | |
parent | 26e51ff633a8d3b60ec25fe875724cfe5e3f92df (diff) | |
parent | ea1f5d2b6c896f9dc5791d981ab5a8630f4561f6 (diff) | |
download | qt-creator-e426d08e54bd10b7513a3ced9cf9237b75b06b45.tar.gz |
Merge remote-tracking branch 'origin/4.0'
Conflicts:
qtcreator.pri
qtcreator.qbs
src/plugins/debugger/debuggerruncontrol.cpp
Change-Id: I81b43480a1369e3d7be60ae26e812dda6b962b0b
Diffstat (limited to 'src/plugins')
94 files changed, 3032 insertions, 1170 deletions
diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index 7ca07b5499..81ce2350cf 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -234,7 +234,7 @@ void AndroidToolChain::setSecondaryToolChain(bool b) m_secondaryToolChain = b; } -QList<Abi> AndroidToolChain::detectSupportedAbis() const +GccToolChain::DetectedAbisResult AndroidToolChain::detectSupportedAbis() const { return QList<Abi>() << targetAbi(); } diff --git a/src/plugins/android/androidtoolchain.h b/src/plugins/android/androidtoolchain.h index 0f15f2db61..06d0944956 100644 --- a/src/plugins/android/androidtoolchain.h +++ b/src/plugins/android/androidtoolchain.h @@ -59,7 +59,7 @@ public: void setSecondaryToolChain(bool b); protected: - QList<ProjectExplorer::Abi> detectSupportedAbis() const override; + DetectedAbisResult detectSupportedAbis() const override; private: explicit AndroidToolChain(const ProjectExplorer::Abi &abi, const QString &ndkToolChainVersion, Detection d); diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index 6bb9fd8904..682824744e 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -284,9 +284,10 @@ static QString quickTestSrcDir(const CppTools::CppModelManager *cppMM, return QString(); } -static QString testClass(const CppTools::CppModelManager *modelManager, - CPlusPlus::Document::Ptr &document) +static QString testClass(const CppTools::CppModelManager *modelManager, const QString &fileName) { + const QByteArray &fileContent = getFileContent(fileName); + CPlusPlus::Document::Ptr document = modelManager->document(fileName); const QList<CPlusPlus::Document::MacroUse> macros = document->macroUses(); foreach (const CPlusPlus::Document::MacroUse ¯o, macros) { @@ -295,14 +296,13 @@ static QString testClass(const CppTools::CppModelManager *modelManager, const QByteArray name = macro.macro().name(); if (TestUtils::isQTestMacro(name)) { const CPlusPlus::Document::Block arg = macro.arguments().at(0); - return QLatin1String(getFileContent(document->fileName()) - .mid(arg.bytesBegin(), arg.bytesEnd() - arg.bytesBegin())); + return QLatin1String(fileContent.mid(arg.bytesBegin(), + arg.bytesEnd() - arg.bytesBegin())); } } // check if one has used a self-defined macro or QTest::qExec() directly const CPlusPlus::Snapshot snapshot = modelManager->snapshot(); - const QByteArray fileContent = getFileContent(document->fileName()); - document = snapshot.preprocessedDocument(fileContent, document->fileName()); + document = snapshot.preprocessedDocument(fileContent, fileName); document->check(); CPlusPlus::AST *ast = document->translationUnit()->ast(); TestAstVisitor astVisitor(document); @@ -523,7 +523,7 @@ static void checkDocumentForTestCode(QFutureInterface<TestParseResult> futureInt } else if (testCaseNames.contains(fileName) // if we do a reparse || (includesQtTest(document, modelManager) && qtTestLibDefined(modelManager, fileName))) { - QString testCaseName(testClass(modelManager, document)); + QString testCaseName(testClass(modelManager, fileName)); // we might be in a reparse without the original entry point with the QTest::qExec() if (testCaseName.isEmpty()) testCaseName = testCaseNames.value(fileName); @@ -537,6 +537,10 @@ static void checkDocumentForTestCode(QFutureInterface<TestParseResult> futureInt TestVisitor visitor(testCaseName); visitor.accept(declaringDoc->globalNamespace()); + + if (!visitor.resultValid()) + return; + const QMap<QString, TestCodeLocationAndType> testFunctions = visitor.privateSlots(); QMap<QString, TestCodeLocationList> dataTags = diff --git a/src/plugins/autotest/testnavigationwidget.cpp b/src/plugins/autotest/testnavigationwidget.cpp index 963fec32b6..ddcc53c43c 100644 --- a/src/plugins/autotest/testnavigationwidget.cpp +++ b/src/plugins/autotest/testnavigationwidget.cpp @@ -77,7 +77,7 @@ TestNavigationWidget::TestNavigationWidget(QWidget *parent) : m_progressTimer = new QTimer(this); m_progressTimer->setSingleShot(true); - m_progressTimer->setInterval(100); // don't display indicator if progress takes less than 100ms + m_progressTimer->setInterval(1000); // don't display indicator if progress takes less than 1s connect(m_model->parser(), &TestCodeParser::parsingStarted, this, &TestNavigationWidget::onParsingStarted); diff --git a/src/plugins/autotest/testsettings.cpp b/src/plugins/autotest/testsettings.cpp index 870b35f124..7e8d1911b5 100644 --- a/src/plugins/autotest/testsettings.cpp +++ b/src/plugins/autotest/testsettings.cpp @@ -47,7 +47,7 @@ static const int defaultTimeout = 60000; TestSettings::TestSettings() : timeout(defaultTimeout), metrics(Walltime), omitInternalMssg(true), omitRunConfigWarn(false), - limitResultOutput(true), autoScroll(true), alwaysParse(false) + limitResultOutput(true), autoScroll(true), alwaysParse(true) { } @@ -96,7 +96,7 @@ void TestSettings::fromSettings(const QSettings *s) omitRunConfigWarn = s->value(root + QLatin1String(omitRunConfigWarnKey), false).toBool(); limitResultOutput = s->value(root + QLatin1String(limitResultOutputKey), true).toBool(); autoScroll = s->value(root + QLatin1String(autoScrollKey), true).toBool(); - alwaysParse = s->value(root + QLatin1String(alwaysParseKey), false).toBool(); + alwaysParse = s->value(root + QLatin1String(alwaysParseKey), true).toBool(); gtestRunDisabled = s->value(root + QLatin1String(gtestRunDisabledKey), false).toBool(); gtestRepeat = s->value(root + QLatin1String(gtestRepeatKey), false).toBool(); gtestShuffle = s->value(root + QLatin1String(gtestShuffleKey), false).toBool(); diff --git a/src/plugins/autotest/testvisitor.cpp b/src/plugins/autotest/testvisitor.cpp index c4c9373ca3..a816aa33eb 100644 --- a/src/plugins/autotest/testvisitor.cpp +++ b/src/plugins/autotest/testvisitor.cpp @@ -73,6 +73,8 @@ bool TestVisitor::visit(CPlusPlus::Class *symbol) if (className != m_className) continue; + m_valid = true; + if (const auto func = type->asFunctionType()) { if (func->isSlot() && member->isPrivate()) { const QString name = o.prettyName(func->name()); diff --git a/src/plugins/autotest/testvisitor.h b/src/plugins/autotest/testvisitor.h index f79d612a4c..fa2869a44c 100644 --- a/src/plugins/autotest/testvisitor.h +++ b/src/plugins/autotest/testvisitor.h @@ -51,6 +51,7 @@ public: virtual ~TestVisitor(); QMap<QString, TestCodeLocationAndType> privateSlots() const { return m_privSlots; } + bool resultValid() const { return m_valid; } bool visit(CPlusPlus::Class *symbol); @@ -58,6 +59,7 @@ private: CppTools::SymbolFinder m_symbolFinder; QString m_className; QMap<QString, TestCodeLocationAndType> m_privSlots; + bool m_valid = false; }; class TestAstVisitor : public CPlusPlus::ASTVisitor diff --git a/src/plugins/beautifier/beautifierplugin.cpp b/src/plugins/beautifier/beautifierplugin.cpp index cbd0b96b8b..dd1fb2c16f 100644 --- a/src/plugins/beautifier/beautifierplugin.cpp +++ b/src/plugins/beautifier/beautifierplugin.cpp @@ -59,7 +59,6 @@ #include <QProcess> #include <QScrollBar> #include <QTextBlock> -#include <QTimer> #include <QtPlugin> using namespace TextEditor; @@ -179,6 +178,7 @@ bool BeautifierPlugin::initialize(const QStringList &arguments, QString *errorSt Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::MENU_ID); menu->menu()->setTitle(QCoreApplication::translate("Beautifier", Constants::OPTION_TR_CATEGORY)); + menu->setOnAllDisabledBehavior(Core::ActionContainer::Show); Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu); foreach (BeautifierAbstractTool *tool, m_tools) { @@ -188,9 +188,7 @@ bool BeautifierPlugin::initialize(const QStringList &arguments, QString *errorSt addAutoReleasedObject(object); } - // The single shot is needed, otherwise the menu will stay disabled even - // when the submenu's actions get enabled later on. - QTimer::singleShot(0, this, SLOT(updateActions())); + updateActions(); return true; } diff --git a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp index a535656c73..c0e8904d1b 100644 --- a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp +++ b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp @@ -280,7 +280,6 @@ IAssistProposal *ClangCompletionAssistProcessor::startCompletionHelper() return 0; } -// TODO: Extract duplicated logic from InternalCppCompletionAssistProcessor::startOfOperator int ClangCompletionAssistProcessor::startOfOperator(int positionInDocument, unsigned *kind, bool wantFunctionCall) const @@ -291,96 +290,13 @@ int ClangCompletionAssistProcessor::startOfOperator(int positionInDocument, wantFunctionCall); *kind = activationSequenceProcessor.completionKind(); - int start = activationSequenceProcessor.operatorStartPosition(); - if (start != positionInDocument) { - QTextCursor tc(m_interface->textDocument()); - tc.setPosition(positionInDocument); - - // Include completion: make sure the quote character is the first one on the line - if (*kind == T_STRING_LITERAL) { - QTextCursor s = tc; - s.movePosition(QTextCursor::StartOfLine, QTextCursor::KeepAnchor); - QString sel = s.selectedText(); - if (sel.indexOf(QLatin1Char('"')) < sel.length() - 1) { - *kind = T_EOF_SYMBOL; - start = positionInDocument; - } - } - - if (*kind == T_COMMA) { - ExpressionUnderCursor expressionUnderCursor(m_interface->languageFeatures()); - if (expressionUnderCursor.startOfFunctionCall(tc) == -1) { - *kind = T_EOF_SYMBOL; - start = positionInDocument; - } - } - - SimpleLexer tokenize; - tokenize.setLanguageFeatures(m_interface->languageFeatures()); - tokenize.setSkipComments(false); - const Tokens &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block())); - const int tokenIdx = SimpleLexer::tokenBefore(tokens, qMax(0, tc.positionInBlock() - 1)); // get the token at the left of the cursor - const Token tk = (tokenIdx == -1) ? Token() : tokens.at(tokenIdx); - - if (*kind == T_DOXY_COMMENT && !(tk.is(T_DOXY_COMMENT) || tk.is(T_CPP_DOXY_COMMENT))) { - *kind = T_EOF_SYMBOL; - start = positionInDocument; - } - // Don't complete in comments or strings, but still check for include completion - else if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT) - || tk.is(T_CPP_DOXY_COMMENT) || tk.is(T_DOXY_COMMENT) - || (tk.isLiteral() && (*kind != T_STRING_LITERAL - && *kind != T_ANGLE_STRING_LITERAL - && *kind != T_SLASH))) { - *kind = T_EOF_SYMBOL; - start = positionInDocument; - } - // Include completion: can be triggered by slash, but only in a string - else if (*kind == T_SLASH && (tk.isNot(T_STRING_LITERAL) && tk.isNot(T_ANGLE_STRING_LITERAL))) { - *kind = T_EOF_SYMBOL; - start = positionInDocument; - } - else if (*kind == T_LPAREN) { - if (tokenIdx > 0) { - const Token &previousToken = tokens.at(tokenIdx - 1); // look at the token at the left of T_LPAREN - switch (previousToken.kind()) { - case T_IDENTIFIER: - case T_GREATER: - case T_SIGNAL: - case T_SLOT: - break; // good - - default: - // that's a bad token :) - *kind = T_EOF_SYMBOL; - start = positionInDocument; - } - } - } - // Check for include preprocessor directive - else if (*kind == T_STRING_LITERAL || *kind == T_ANGLE_STRING_LITERAL || *kind == T_SLASH) { - bool include = false; - if (tokens.size() >= 3) { - if (tokens.at(0).is(T_POUND) && tokens.at(1).is(T_IDENTIFIER) && (tokens.at(2).is(T_STRING_LITERAL) || - tokens.at(2).is(T_ANGLE_STRING_LITERAL))) { - const Token &directiveToken = tokens.at(1); - QString directive = tc.block().text().mid(directiveToken.bytesBegin(), - directiveToken.bytes()); - if (directive == QLatin1String("include") || - directive == QLatin1String("include_next") || - directive == QLatin1String("import")) { - include = true; - } - } - } - if (!include) { - *kind = T_EOF_SYMBOL; - start = positionInDocument; - } - } - } + CppCompletionAssistProcessor::startOfOperator(m_interface->textDocument(), + positionInDocument, + kind, + start, + m_interface->languageFeatures()); return start; } diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp index e16c7a46c1..69ff061c83 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp @@ -80,6 +80,7 @@ ClangStaticAnalyzerRunControl::ClangStaticAnalyzerRunControl( BuildConfiguration *buildConfiguration = target->activeBuildConfiguration(); QTC_ASSERT(buildConfiguration, return); m_environment = buildConfiguration->environment(); + m_targetTriple = ToolChainKitInformation::toolChain(target->kit())->originalTargetTriple(); } static void prependWordWidthArgumentIfNotIncluded(QStringList *arguments, unsigned char wordWidth) @@ -96,11 +97,29 @@ static void prependWordWidthArgumentIfNotIncluded(QStringList *arguments, unsign QTC_CHECK(!arguments->contains(m32Argument) || !arguments->contains(m64Argument)); } +static void prependTargetTripleIfNotIncludedAndNotEmpty(QStringList *arguments, + const QString &targetTriple) +{ + QTC_ASSERT(arguments, return); + + if (targetTriple.isEmpty()) + return; + + const QString targetOption = QLatin1String("-target"); + + if (!arguments->contains(targetOption)) { + arguments->prepend(targetTriple); + arguments->prepend(targetOption); + } +} + // Removes (1) filePath (2) -o <somePath>. -// Adds -m64/-m32 argument if not already included. +// 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) + unsigned char wordWidth, + const QString &targetTriple) { QStringList newArguments; @@ -121,6 +140,7 @@ static QStringList tweakedArguments(const QString &filePath, QTC_CHECK(skip == false); prependWordWidthArgumentIfNotIncluded(&newArguments, wordWidth); + prependTargetTripleIfNotIncludedAndNotEmpty(&newArguments, targetTriple); return newArguments; } @@ -147,7 +167,8 @@ class ClangStaticAnalyzerOptionsBuilder : public CompilerOptionsBuilder public: static QStringList build(const CppTools::ProjectPart &projectPart, CppTools::ProjectFile::Kind fileKind, - unsigned char wordWidth) + unsigned char wordWidth, + const QString &targetTriple) { ClangStaticAnalyzerOptionsBuilder optionsBuilder(projectPart); optionsBuilder.addLanguageOption(fileKind); @@ -172,6 +193,8 @@ public: QStringList options = optionsBuilder.options(); prependWordWidthArgumentIfNotIncluded(&options, wordWidth); + prependTargetTripleIfNotIncludedAndNotEmpty(&options, targetTriple); + return options; } @@ -217,7 +240,8 @@ private: static AnalyzeUnits unitsToAnalyzeFromCompilerCallData( const ProjectInfo::CompilerCallData &compilerCallData, - unsigned char wordWidth) + unsigned char wordWidth, + const QString &targetTriple) { qCDebug(LOG) << "Taking arguments for analyzing from CompilerCallData."; @@ -229,7 +253,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); + const QStringList arguments = tweakedArguments(file, options, wordWidth, targetTriple); unitsToAnalyze << AnalyzeUnit(file, arguments); } } @@ -238,7 +262,8 @@ static AnalyzeUnits unitsToAnalyzeFromCompilerCallData( } static AnalyzeUnits unitsToAnalyzeFromProjectParts(const QList<ProjectPart::Ptr> projectParts, - unsigned char wordWidth) + unsigned char wordWidth, + const QString &targetTriple) { qCDebug(LOG) << "Taking arguments for analyzing from ProjectParts."; @@ -256,7 +281,8 @@ static AnalyzeUnits unitsToAnalyzeFromProjectParts(const QList<ProjectPart::Ptr> const QStringList arguments = ClangStaticAnalyzerOptionsBuilder::build(*projectPart.data(), file.kind, - wordWidth); + wordWidth, + targetTriple); unitsToAnalyze << AnalyzeUnit(file.path, arguments); } } @@ -273,9 +299,12 @@ AnalyzeUnits ClangStaticAnalyzerRunControl::sortedUnitsToAnalyze() const ProjectInfo::CompilerCallData compilerCallData = m_projectInfo.compilerCallData(); if (compilerCallData.isEmpty()) { units = unitsToAnalyzeFromProjectParts(m_projectInfo.projectParts(), - m_wordWidth); + m_wordWidth, + m_targetTriple); } else { - units = unitsToAnalyzeFromCompilerCallData(compilerCallData, m_wordWidth); + units = unitsToAnalyzeFromCompilerCallData(compilerCallData, + m_wordWidth, + m_targetTriple); } Utils::sort(units, [](const AnalyzeUnit &a1, const AnalyzeUnit &a2) -> bool { diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h index 0d286e17fe..f1e5e34c02 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h @@ -82,6 +82,7 @@ private: private: const CppTools::ProjectInfo m_projectInfo; const unsigned char m_wordWidth; + QString m_targetTriple; Utils::Environment m_environment; QString m_clangExecutable; diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.cpp b/src/plugins/cmakeprojectmanager/builddirmanager.cpp index 181ca556a7..37a0b4c921 100644 --- a/src/plugins/cmakeprojectmanager/builddirmanager.cpp +++ b/src/plugins/cmakeprojectmanager/builddirmanager.cpp @@ -280,7 +280,9 @@ CMakeConfig BuildDirManager::parsedConfiguration() const CMakeConfig result = parseConfiguration(cacheFile, &errorMessage); if (!errorMessage.isEmpty()) emit errorOccured(errorMessage); - if (CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", result) != sourceDirectory().toString().toUtf8()) + const Utils::FileName sourceOfBuildDir + = Utils::FileName::fromUtf8(CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", result)); + if (sourceOfBuildDir != sourceDirectory()) // Use case-insensitive compare where appropriate emit errorOccured(tr("The build directory is not for %1").arg(sourceDirectory().toUserOutput())); return result; @@ -605,8 +607,10 @@ void BuildDirManager::maybeForceReparse() const QByteArray EXTRA_GENERATOR_KEY = "CMAKE_EXTRA_GENERATOR"; const QByteArray CMAKE_COMMAND_KEY = "CMAKE_COMMAND"; - if (!m_hasData) + if (!m_hasData) { + forceReparse(); return; + } const CMakeConfig currentConfig = parsedConfiguration(); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 36046f9100..93593392e9 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -63,33 +63,7 @@ const char CONFIGURATION_KEY[] = "CMake.Configuration"; CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent) : BuildConfiguration(parent, Core::Id(Constants::CMAKE_BC_ID)) { - auto project = static_cast<CMakeProject *>(parent->project()); - setBuildDirectory(shadowBuildDirectory(project->projectFilePath(), - parent->kit(), - displayName(), BuildConfiguration::Unknown)); - - m_buildDirManager = new BuildDirManager(this); - connect(m_buildDirManager, &BuildDirManager::dataAvailable, - this, &CMakeBuildConfiguration::dataAvailable); - connect(m_buildDirManager, &BuildDirManager::errorOccured, - this, &CMakeBuildConfiguration::setError); - connect(m_buildDirManager, &BuildDirManager::configurationStarted, - this, [this]() { m_completeConfigurationCache.clear(); emit parsingStarted(); }); - - connect(this, &CMakeBuildConfiguration::environmentChanged, - m_buildDirManager, &BuildDirManager::forceReparse); - connect(this, &CMakeBuildConfiguration::buildDirectoryChanged, - m_buildDirManager, &BuildDirManager::forceReparse); - connect(target(), &Target::kitChanged, this, [this]() { - ProjectExplorer::Kit *k = target()->kit(); - CMakeConfig config = cmakeConfiguration(); - config.append(CMakeConfigurationKitInformation::configuration(k)); // last value wins... - setCMakeConfiguration(config); - m_buildDirManager->maybeForceReparse(); - }); - - connect(this, &CMakeBuildConfiguration::parsingStarted, project, &CMakeProject::handleParsingStarted); - connect(this, &CMakeBuildConfiguration::dataAvailable, project, &CMakeProject::parseCMakeOutput); + ctor(); } CMakeBuildConfiguration::~CMakeBuildConfiguration() @@ -112,7 +86,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent BuildConfiguration(parent, source), m_configuration(source->m_configuration) { - Q_ASSERT(parent); + ctor(); cloneSteps(source); } @@ -155,6 +129,39 @@ bool CMakeBuildConfiguration::fromMap(const QVariantMap &map) return true; } +void CMakeBuildConfiguration::ctor() +{ + auto project = static_cast<CMakeProject *>(target()->project()); + setBuildDirectory(shadowBuildDirectory(project->projectFilePath(), + target()->kit(), + displayName(), BuildConfiguration::Unknown)); + + m_buildDirManager = new BuildDirManager(this); + connect(m_buildDirManager, &BuildDirManager::dataAvailable, + this, &CMakeBuildConfiguration::dataAvailable); + connect(m_buildDirManager, &BuildDirManager::errorOccured, + this, &CMakeBuildConfiguration::setError); + connect(m_buildDirManager, &BuildDirManager::configurationStarted, + this, [this]() { m_completeConfigurationCache.clear(); emit parsingStarted(); }); + + connect(this, &CMakeBuildConfiguration::environmentChanged, + m_buildDirManager, &BuildDirManager::forceReparse); + connect(this, &CMakeBuildConfiguration::buildDirectoryChanged, + m_buildDirManager, &BuildDirManager::forceReparse); + + connect(this, &CMakeBuildConfiguration::parsingStarted, project, &CMakeProject::handleParsingStarted); + connect(this, &CMakeBuildConfiguration::dataAvailable, project, &CMakeProject::parseCMakeOutput); +} + +void CMakeBuildConfiguration::maybeForceReparse() +{ + ProjectExplorer::Kit *k = target()->kit(); + CMakeConfig config = cmakeConfiguration(); + config.append(CMakeConfigurationKitInformation::configuration(k)); // last value wins... + setCMakeConfiguration(config); + m_buildDirManager->maybeForceReparse(); +} + BuildDirManager *CMakeBuildConfiguration::buildDirManager() const { return m_buildDirManager; @@ -165,11 +172,6 @@ bool CMakeBuildConfiguration::isParsing() const return m_buildDirManager && m_buildDirManager->isParsing(); } -void CMakeBuildConfiguration::parse() -{ - m_buildDirManager->parse(); -} - void CMakeBuildConfiguration::resetData() { m_buildDirManager->resetData(); @@ -197,7 +199,7 @@ FileName CMakeBuildConfiguration::shadowBuildDirectory(const FileName &projectFi QList<ConfigModel::DataItem> CMakeBuildConfiguration::completeCMakeConfiguration() const { - if (m_buildDirManager->isParsing()) + if (!m_buildDirManager && m_buildDirManager->isParsing()) return QList<ConfigModel::DataItem>(); if (m_completeConfigurationCache.isEmpty()) @@ -409,14 +411,14 @@ ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::create(Proj auto cleanStep = new CMakeBuildStep(cleanSteps); cleanSteps->insertStep(0, cleanStep); - cleanStep->setBuildTarget(CMakeBuildStep::cleanTarget(), true); + cleanStep->setBuildTarget(CMakeBuildStep::cleanTarget()); bc->setBuildDirectory(copy.buildDirectory); bc->setCMakeConfiguration(copy.configuration); // Default to all - if (project->hasBuildTarget(QLatin1String("all"))) - buildStep->setBuildTarget(QLatin1String("all"), true); + if (project->hasBuildTarget(CMakeBuildStep::allTarget())) + buildStep->setBuildTarget(CMakeBuildStep::allTarget()); return bc; } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index 1bd00c3b64..01a6910240 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -73,7 +73,7 @@ public: bool isParsing() const; - void parse(); + void maybeForceReparse(); void resetData(); bool persistCMakeState(); @@ -92,6 +92,7 @@ protected: bool fromMap(const QVariantMap &map) override; private: + void ctor(); QList<ConfigModel::DataItem> completeCMakeConfiguration() const; void setCurrentCMakeConfiguration(const QList<ConfigModel::DataItem> &items); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 6d32868a9f..b4376d86ea 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -82,9 +82,8 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Core::Id id) : AbstractProces CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, CMakeBuildStep *bs) : AbstractProcessStep(bsl, bs), - m_buildTargets(bs->m_buildTargets), - m_toolArguments(bs->m_toolArguments), - m_addRunConfigurationArgument(bs->m_addRunConfigurationArgument) + m_buildTarget(bs->m_buildTarget), + m_toolArguments(bs->m_toolArguments) { ctor(bsl); } @@ -125,31 +124,34 @@ CMakeRunConfiguration *CMakeBuildStep::targetsActiveRunConfiguration() const void CMakeBuildStep::handleBuildTargetChanges() { - const QStringList filteredTargets - = Utils::filtered(static_cast<CMakeProject *>(project())->buildTargetTitles(), - [this](const QString &s) { return m_buildTargets.contains(s); }); - setBuildTargets(filteredTargets); + if (static_cast<CMakeProject *>(project())->buildTargetTitles().contains(m_buildTarget)) + setBuildTarget(m_buildTarget); + else + setBuildTarget(CMakeBuildStep::allTarget()); emit buildTargetsChanged(); } QVariantMap CMakeBuildStep::toMap() const { QVariantMap map(AbstractProcessStep::toMap()); - map.insert(QLatin1String(BUILD_TARGETS_KEY), m_buildTargets); + // Use QStringList for compatibility with old files + map.insert(QLatin1String(BUILD_TARGETS_KEY), QStringList(m_buildTarget)); map.insert(QLatin1String(TOOL_ARGUMENTS_KEY), m_toolArguments); - map.insert(QLatin1String(ADD_RUNCONFIGURATION_ARGUMENT_KEY), m_addRunConfigurationArgument); return map; } bool CMakeBuildStep::fromMap(const QVariantMap &map) { if (map.value(QLatin1String(CLEAN_KEY), false).toBool()) { - m_buildTargets = QStringList(CMakeBuildStep::cleanTarget()); + m_buildTarget = CMakeBuildStep::cleanTarget(); } else { - m_buildTargets = map.value(QLatin1String(BUILD_TARGETS_KEY)).toStringList(); + const QStringList targetList = map.value(QLatin1String(BUILD_TARGETS_KEY)).toStringList(); + if (!targetList.isEmpty()) + m_buildTarget = targetList.last(); m_toolArguments = map.value(QLatin1String(TOOL_ARGUMENTS_KEY)).toString(); } - m_addRunConfigurationArgument = map.value(QLatin1String(ADD_RUNCONFIGURATION_ARGUMENT_KEY), false).toBool(); + if (map.value(QLatin1String(ADD_RUNCONFIGURATION_ARGUMENT_KEY), false).toBool()) + m_buildTarget = QLatin1String(ADD_RUNCONFIGURATION_TEXT); return BuildStep::fromMap(map); } @@ -178,7 +180,7 @@ bool CMakeBuildStep::init(QList<const BuildStep *> &earlierSteps) } CMakeRunConfiguration *rc = targetsActiveRunConfiguration(); - if (m_addRunConfigurationArgument && (!rc || rc->title().isEmpty())) { + if ((m_buildTarget == QLatin1String(ADD_RUNCONFIGURATION_TEXT)) && (!rc || rc->title().isEmpty())) { emit addTask(Task(Task::Error, QCoreApplication::translate("ProjectExplorer::Task", "You asked to build the current Run Configuration's build target only, " @@ -196,7 +198,7 @@ bool CMakeBuildStep::init(QList<const BuildStep *> &earlierSteps) QString arguments = allArguments(rc); - setIgnoreReturnValue(m_buildTargets.contains(CMakeBuildStep::cleanTarget())); + setIgnoreReturnValue(m_buildTarget == CMakeBuildStep::cleanTarget()); ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); @@ -292,44 +294,27 @@ void CMakeBuildStep::stdOutput(const QString &line) AbstractProcessStep::stdOutput(line); } -QStringList CMakeBuildStep::buildTargets() const +QString CMakeBuildStep::buildTarget() const { - return m_buildTargets; + return m_buildTarget; } bool CMakeBuildStep::buildsBuildTarget(const QString &target) const { - if (target == tr(ADD_RUNCONFIGURATION_TEXT)) - return addRunConfigurationArgument(); - else - return m_buildTargets.contains(target); -} - -void CMakeBuildStep::setBuildTarget(const QString &buildTarget, bool on) -{ - if (buildTarget == tr(ADD_RUNCONFIGURATION_TEXT)) { - setAddRunConfigurationArgument(on); - } else { - QStringList old = m_buildTargets; - if (on && !old.contains(buildTarget)) - old << buildTarget; - else if (!on && old.contains(buildTarget)) - old.removeOne(buildTarget); - setBuildTargets(old); - } + return target == m_buildTarget; } -void CMakeBuildStep::setBuildTargets(const QStringList &targets) +void CMakeBuildStep::setBuildTarget(const QString &buildTarget) { - if (targets != m_buildTargets) { - m_buildTargets = targets; - emit targetsToBuildChanged(); - } + if (m_buildTarget == buildTarget) + return; + m_buildTarget = buildTarget; + emit targetToBuildChanged(); } void CMakeBuildStep::clearBuildTargets() { - m_buildTargets.clear(); + m_buildTarget.clear(); } QString CMakeBuildStep::toolArguments() const @@ -349,18 +334,20 @@ QString CMakeBuildStep::allArguments(const CMakeRunConfiguration *rc) const Utils::QtcProcess::addArg(&arguments, QLatin1String("--build")); Utils::QtcProcess::addArg(&arguments, QLatin1String(".")); - if (m_addRunConfigurationArgument) { - Utils::QtcProcess::addArg(&arguments, QLatin1String("--target")); + QString target; + + if (m_buildTarget == QLatin1String(ADD_RUNCONFIGURATION_TEXT)) { if (rc) - Utils::QtcProcess::addArg(&arguments, rc->title()); + target = rc->title(); else - Utils::QtcProcess::addArg(&arguments, QLatin1String("<i><") + tr(ADD_RUNCONFIGURATION_TEXT) + QLatin1String("></i>")); - } - foreach (const QString &t, m_buildTargets) { - Utils::QtcProcess::addArg(&arguments, QLatin1String("--target")); - Utils::QtcProcess::addArg(&arguments, t); + target = QLatin1String("<i><") + tr(ADD_RUNCONFIGURATION_TEXT) + QLatin1String("></i>"); + } else { + target = m_buildTarget; } + Utils::QtcProcess::addArg(&arguments, QLatin1String("--target")); + Utils::QtcProcess::addArg(&arguments, target); + if (!m_toolArguments.isEmpty()) { Utils::QtcProcess::addArg(&arguments, QLatin1String("--")); arguments += QLatin1Char(' ') + m_toolArguments; @@ -369,16 +356,6 @@ QString CMakeBuildStep::allArguments(const CMakeRunConfiguration *rc) const return arguments; } -bool CMakeBuildStep::addRunConfigurationArgument() const -{ - return m_addRunConfigurationArgument; -} - -void CMakeBuildStep::setAddRunConfigurationArgument(bool add) -{ - m_addRunConfigurationArgument = add; -} - QString CMakeBuildStep::cmakeCommand() const { CMakeTool *tool = CMakeKitInformation::cmakeTool(target()->kit()); @@ -390,6 +367,11 @@ QString CMakeBuildStep::cleanTarget() return QLatin1String("clean"); } +QString CMakeBuildStep::allTarget() +{ + return QLatin1String("all"); +} + // // CMakeBuildStepConfigWidget // @@ -407,7 +389,6 @@ CMakeBuildStepConfigWidget::CMakeBuildStepConfigWidget(CMakeBuildStep *buildStep fl->addRow(tr("Tool arguments:"), m_toolArguments); m_toolArguments->setText(m_buildStep->toolArguments()); - m_buildTargetsList->setFrameStyle(QFrame::NoFrame); m_buildTargetsList->setMinimumHeight(200); @@ -420,22 +401,7 @@ CMakeBuildStepConfigWidget::CMakeBuildStepConfigWidget(CMakeBuildStep *buildStep fl->addRow(tr("Targets:"), frame); - auto itemAddRunConfigurationArgument = new QListWidgetItem(tr(ADD_RUNCONFIGURATION_TEXT), m_buildTargetsList); - itemAddRunConfigurationArgument->setFlags(itemAddRunConfigurationArgument->flags() | Qt::ItemIsUserCheckable); - itemAddRunConfigurationArgument->setCheckState(m_buildStep->addRunConfigurationArgument() ? Qt::Checked : Qt::Unchecked); - QFont f; - f.setItalic(true); - itemAddRunConfigurationArgument->setFont(f); - - CMakeProject *pro = static_cast<CMakeProject *>(m_buildStep->project()); - QStringList targetList = pro->buildTargetTitles(); - targetList.sort(); - foreach (const QString &buildTarget, targetList) { - auto item = new QListWidgetItem(buildTarget, m_buildTargetsList); - item->setFlags(item->flags() | Qt::ItemIsUserCheckable); - item->setCheckState(m_buildStep->buildsBuildTarget(item->text()) ? Qt::Checked : Qt::Unchecked); - } - + buildTargetsChanged(); updateDetails(); connect(m_toolArguments, &QLineEdit::textEdited, this, &CMakeBuildStepConfigWidget::toolArgumentsEdited); @@ -444,8 +410,9 @@ CMakeBuildStepConfigWidget::CMakeBuildStepConfigWidget(CMakeBuildStep *buildStep this, &CMakeBuildStepConfigWidget::updateDetails); connect(m_buildStep, &CMakeBuildStep::buildTargetsChanged, this, &CMakeBuildStepConfigWidget::buildTargetsChanged); - connect(m_buildStep, &CMakeBuildStep::targetsToBuildChanged, this, &CMakeBuildStepConfigWidget::selectedBuildTargetsChanged); - connect(pro, &CMakeProject::environmentChanged, this, &CMakeBuildStepConfigWidget::updateDetails); + connect(m_buildStep, &CMakeBuildStep::targetToBuildChanged, this, &CMakeBuildStepConfigWidget::selectedBuildTargetsChanged); + connect(static_cast<CMakeProject *>(m_buildStep->project()), &CMakeProject::environmentChanged, + this, &CMakeBuildStepConfigWidget::updateDetails); } void CMakeBuildStepConfigWidget::toolArgumentsEdited() @@ -456,7 +423,9 @@ void CMakeBuildStepConfigWidget::toolArgumentsEdited() void CMakeBuildStepConfigWidget::itemChanged(QListWidgetItem *item) { - m_buildStep->setBuildTarget(item->text(), item->checkState() & Qt::Checked); + const QString target = + (item->checkState() == Qt::Checked) ? item->data(Qt::UserRole).toString() : CMakeBuildStep::allTarget(); + m_buildStep->setBuildTarget(target); updateDetails(); } @@ -467,30 +436,44 @@ QString CMakeBuildStepConfigWidget::displayName() const void CMakeBuildStepConfigWidget::buildTargetsChanged() { - disconnect(m_buildTargetsList, &QListWidget::itemChanged, this, &CMakeBuildStepConfigWidget::itemChanged); - - auto *addRunConfigurationArgumentItem = m_buildTargetsList->takeItem(0); + const bool wasBlocked = m_buildTargetsList->blockSignals(true); m_buildTargetsList->clear(); - m_buildTargetsList->insertItem(0, addRunConfigurationArgumentItem); - CMakeProject *pro = static_cast<CMakeProject *>(m_buildStep->target()->project()); - foreach (const QString& buildTarget, pro->buildTargetTitles()) { + auto item = new QListWidgetItem(tr(ADD_RUNCONFIGURATION_TEXT), m_buildTargetsList); + + item->setData(Qt::UserRole, QString::fromLatin1(ADD_RUNCONFIGURATION_TEXT)); + QFont f; + f.setItalic(true); + item->setFont(f); + + CMakeProject *pro = static_cast<CMakeProject *>(m_buildStep->project()); + QStringList targetList = pro->buildTargetTitles(); + targetList.sort(); + + foreach (const QString &buildTarget, targetList) { auto item = new QListWidgetItem(buildTarget, m_buildTargetsList); + item->setData(Qt::UserRole, buildTarget); + } + + for (int i = 0; i < m_buildTargetsList->count(); ++i) { + QListWidgetItem *item = m_buildTargetsList->item(i); item->setFlags(item->flags() | Qt::ItemIsUserCheckable); - item->setCheckState(m_buildStep->buildsBuildTarget(item->text()) ? Qt::Checked : Qt::Unchecked); + item->setCheckState(m_buildStep->buildsBuildTarget(item->data(Qt::UserRole).toString()) + ? Qt::Checked : Qt::Unchecked); } - connect(m_buildTargetsList, &QListWidget::itemChanged, this, &CMakeBuildStepConfigWidget::itemChanged); + m_buildTargetsList->blockSignals(wasBlocked); updateSummary(); } void CMakeBuildStepConfigWidget::selectedBuildTargetsChanged() { - disconnect(m_buildTargetsList, &QListWidget::itemChanged, this, &CMakeBuildStepConfigWidget::itemChanged); + const bool wasBlocked = m_buildTargetsList->blockSignals(true); for (int y = 0; y < m_buildTargetsList->count(); ++y) { QListWidgetItem *item = m_buildTargetsList->item(y); - item->setCheckState(m_buildStep->buildsBuildTarget(item->text()) ? Qt::Checked : Qt::Unchecked); + item->setCheckState(m_buildStep->buildsBuildTarget(item->data(Qt::UserRole).toString()) + ? Qt::Checked : Qt::Unchecked); } - connect(m_buildTargetsList, &QListWidget::itemChanged, this, &CMakeBuildStepConfigWidget::itemChanged); + m_buildTargetsList->blockSignals(wasBlocked); updateSummary(); } @@ -541,7 +524,7 @@ BuildStep *CMakeBuildStepFactory::create(BuildStepList *parent, Core::Id id) return 0; auto step = new CMakeBuildStep(parent); if (parent->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) - step->setBuildTarget(CMakeBuildStep::cleanTarget(), true); + step->setBuildTarget(CMakeBuildStep::cleanTarget()); return step; } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h index 7f4260551b..8249e1f1f2 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h @@ -61,10 +61,9 @@ public: ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; bool immutable() const override; - QStringList buildTargets() const; + QString buildTarget() const; bool buildsBuildTarget(const QString &target) const; - void setBuildTarget(const QString &target, bool on); - void setBuildTargets(const QStringList &targets); + void setBuildTarget(const QString &target); void clearBuildTargets(); QString toolArguments() const; @@ -72,18 +71,16 @@ public: QString allArguments(const CMakeRunConfiguration *rc) const; - bool addRunConfigurationArgument() const; - void setAddRunConfigurationArgument(bool add); - QString cmakeCommand() const; QVariantMap toMap() const override; static QString cleanTarget(); + static QString allTarget(); signals: void cmakeCommandChanged(); - void targetsToBuildChanged(); + void targetToBuildChanged(); void buildTargetsChanged(); protected: @@ -112,9 +109,8 @@ private: QRegExp m_percentProgress; QRegExp m_ninjaProgress; QString m_ninjaProgressString; - QStringList m_buildTargets; + QString m_buildTarget; QString m_toolArguments; - bool m_addRunConfigurationArgument = false; bool m_useNinja = false; }; diff --git a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp index 36b4ca661e..341330c88b 100644 --- a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp @@ -111,13 +111,13 @@ void CMakeLocatorFilter::accept(Core::LocatorFilterEntry selection) const return; // Change the make step to build only the given target - QStringList oldTargets = buildStep->buildTargets(); + QString oldTarget = buildStep->buildTarget(); buildStep->clearBuildTargets(); - buildStep->setBuildTarget(selection.displayName, true); + buildStep->setBuildTarget(selection.displayName); // Build ProjectExplorerPlugin::buildProject(cmakeProject); - buildStep->setBuildTargets(oldTargets); + buildStep->setBuildTarget(oldTarget); } void CMakeLocatorFilter::refresh(QFutureInterface<void> &future) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 1bb32c84c0..4ee11e6074 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -92,6 +92,8 @@ CMakeProject::CMakeProject(CMakeManager *manager, const FileName &fileName) setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX)); rootProjectNode()->setDisplayName(fileName.parentDir().fileName()); + + connect(this, &CMakeProject::activeTargetChanged, this, &CMakeProject::handleActiveTargetChanged); } CMakeProject::~CMakeProject() @@ -439,10 +441,6 @@ Project::RestoreResult CMakeProject::fromMap(const QVariantMap &map, QString *er RestoreResult result = Project::fromMap(map, errorMessage); if (result != RestoreResult::Ok) return result; - - handleActiveTargetChanged(); - handleActiveBuildConfigurationChanged(); - return RestoreResult::Ok; } @@ -461,7 +459,8 @@ void CMakeProject::handleActiveTargetChanged() if (m_connectedTarget) { disconnect(m_connectedTarget, &Target::activeBuildConfigurationChanged, this, &CMakeProject::handleActiveBuildConfigurationChanged); - + disconnect(m_connectedTarget, &Target::kitChanged, + this, &CMakeProject::handleActiveBuildConfigurationChanged); } m_connectedTarget = activeTarget(); @@ -469,7 +468,11 @@ void CMakeProject::handleActiveTargetChanged() if (m_connectedTarget) { connect(m_connectedTarget, &Target::activeBuildConfigurationChanged, this, &CMakeProject::handleActiveBuildConfigurationChanged); + connect(m_connectedTarget, &Target::kitChanged, + this, &CMakeProject::handleActiveBuildConfigurationChanged); } + + handleActiveBuildConfigurationChanged(); } void CMakeProject::handleActiveBuildConfigurationChanged() @@ -483,7 +486,7 @@ void CMakeProject::handleActiveBuildConfigurationChanged() auto i = qobject_cast<CMakeBuildConfiguration *>(bc); QTC_ASSERT(i, continue); if (i == activeBc) - i->parse(); + i->maybeForceReparse(); else i->resetData(); } diff --git a/src/plugins/coreplugin/core.qrc b/src/plugins/coreplugin/core.qrc index 46e55fb73b..291038d870 100644 --- a/src/plugins/coreplugin/core.qrc +++ b/src/plugins/coreplugin/core.qrc @@ -101,16 +101,6 @@ <file>images/dark_fileicon.png</file> <file>images/dark_foldericon.png</file> <file>images/Desktop.png</file> - <file>images/run_overlay_small.png</file> - <file>images/run_overlay_small@2x.png</file> - <file>images/stop_overlay_small.png</file> - <file>images/stop_overlay_small@2x.png</file> - <file>images/debugger_overlay_small.png</file> - <file>images/debugger_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/zoom.png</file> <file>images/zoom@2x.png</file> </qresource> diff --git a/src/plugins/coreplugin/coreicons.cpp b/src/plugins/coreplugin/coreicons.cpp index 4432a3c704..3b1d279334 100644 --- a/src/plugins/coreplugin/coreicons.cpp +++ b/src/plugins/coreplugin/coreicons.cpp @@ -132,18 +132,6 @@ const Icon INFO_TOOLBAR({ {QLatin1String(":/core/images/info.png"), Theme::IconsInfoToolBarColor}}); const Icon EXPAND({ {QLatin1String(":/find/images/expand.png"), Theme::IconsBaseColor}}); -const Icon DEBUG_START_SMALL({ - {QLatin1String(":/core/images/debugger_overlay_small.png"), Theme::IconsDebugColor}, - {QLatin1String(":/core/images/run_overlay_small.png"), Theme::IconsRunColor}}); -const Icon DEBUG_EXIT_SMALL({ - {QLatin1String(":/core/images/debugger_overlay_small.png"), Theme::IconsDebugColor}, - {QLatin1String(":/core/images/stop_overlay_small.png"), Theme::IconsStopColor}}); -const Icon DEBUG_INTERRUPT_SMALL({ - {QLatin1String(":/core/images/debugger_overlay_small.png"), Theme::IconsDebugColor}, - {QLatin1String(":/core/images/interrupt_overlay_small.png"), Theme::IconsInterruptColor}}); -const Icon DEBUG_CONTINUE_SMALL({ - {QLatin1String(":/core/images/debugger_overlay_small.png"), Theme::IconsDebugColor}, - {QLatin1String(":/core/images/continue_overlay_small.png"), Theme::IconsRunColor}}); const Icon ZOOM({ {QLatin1String(":/core/images/zoom.png"), Theme::IconsBaseColor}}); const Icon TOOLBAR_EXTENSION({ diff --git a/src/plugins/coreplugin/coreicons.h b/src/plugins/coreplugin/coreicons.h index b429060546..25f1663664 100644 --- a/src/plugins/coreplugin/coreicons.h +++ b/src/plugins/coreplugin/coreicons.h @@ -82,10 +82,6 @@ CORE_EXPORT extern const Utils::Icon ERROR_TASKBAR; 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 DEBUG_START_SMALL; -CORE_EXPORT extern const Utils::Icon DEBUG_EXIT_SMALL; -CORE_EXPORT extern const Utils::Icon DEBUG_INTERRUPT_SMALL; -CORE_EXPORT extern const Utils::Icon DEBUG_CONTINUE_SMALL; CORE_EXPORT extern const Utils::Icon ZOOM; CORE_EXPORT extern const Utils::Icon TOOLBAR_EXTENSION; diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 735eb9e83e..e25346785d 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -666,11 +666,15 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt if (act) { // Fill| - QColor baseColor = StyleHelper::baseColor(); - QLinearGradient grad(option->rect.topLeft(), option->rect.bottomLeft()); - grad.setColorAt(0, baseColor.lighter(120)); - grad.setColorAt(1, baseColor.lighter(130)); - painter->fillRect(option->rect, grad); + if (creatorTheme()->flag(Theme::FlatMenuBar)) { + painter->fillRect(option->rect, creatorTheme()->color(Theme::FancyToolButtonHoverColor)); + } else { + QColor baseColor = StyleHelper::baseColor(); + QLinearGradient grad(option->rect.topLeft(), option->rect.bottomLeft()); + grad.setColorAt(0, baseColor.lighter(120)); + grad.setColorAt(1, baseColor.lighter(130)); + painter->fillRect(option->rect, grad); + } QPalette pal = mbi->palette; uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; @@ -732,7 +736,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt if (creatorTheme()->flag(Theme::ComboBoxDrawTextShadow) && (option->state & State_Enabled)) { - painter->setPen(QColor(0, 0, 0, 70)); + painter->setPen(StyleHelper::toolBarDropShadowColor()); painter->drawText(editRect.adjusted(1, 0, -1, 0), Qt::AlignLeft | Qt::AlignVCenter, text); } if (!(option->state & State_Enabled)) diff --git a/src/plugins/coreplugin/variablechooser.cpp b/src/plugins/coreplugin/variablechooser.cpp index a420301303..bf58630a61 100644 --- a/src/plugins/coreplugin/variablechooser.cpp +++ b/src/plugins/coreplugin/variablechooser.cpp @@ -240,14 +240,17 @@ VariableChooserPrivate::VariableChooserPrivate(VariableChooser *parent) : q(parent), m_lineEdit(0), m_textEdit(0), - m_plainTextEdit(0) + m_plainTextEdit(0), + m_iconButton(0), + m_variableTree(0), + m_variableDescription(0) { m_defaultDescription = VariableChooser::tr("Select a variable to insert."); m_variableTree = new VariableTreeView(q, this); - m_variableTree->setModel(&m_model); - m_variableDescription = new QLabel(q); + + m_variableTree->setModel(&m_model); m_variableDescription->setText(m_defaultDescription); m_variableDescription->setMinimumSize(QSize(0, 60)); m_variableDescription->setAlignment(Qt::AlignLeft|Qt::AlignTop); @@ -403,7 +406,8 @@ void VariableChooser::addSupportForChildWidgets(QWidget *parent, MacroExpander * */ void VariableChooserPrivate::updateDescription(const QModelIndex &index) { - m_variableDescription->setText(m_model.data(index, Qt::ToolTipRole).toString()); + if (m_variableDescription) + m_variableDescription->setText(m_model.data(index, Qt::ToolTipRole).toString()); } /*! diff --git a/src/plugins/cppeditor/cppincludehierarchy_test.cpp b/src/plugins/cppeditor/cppincludehierarchy_test.cpp index ffef3a8b35..8bb29f4123 100644 --- a/src/plugins/cppeditor/cppincludehierarchy_test.cpp +++ b/src/plugins/cppeditor/cppincludehierarchy_test.cpp @@ -35,8 +35,6 @@ #include <QList> #include <QtTest> -Q_DECLARE_METATYPE(QList<QByteArray>) - using namespace CPlusPlus; using namespace CppTools; diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index b592d9f9da..ddd2b5097d 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -315,8 +315,6 @@ typedef QSharedPointer<CppQuickFixFactory> CppQuickFixFactoryPtr; } // namespace CppEditor -Q_DECLARE_METATYPE(CppEditor::CppQuickFixFactoryPtr) - namespace CppEditor { namespace Internal { diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp index c5bbf1f449..b2e1c98294 100644 --- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp +++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp @@ -89,7 +89,6 @@ public: }; typedef QList<OverrideItem> OverrideItemList; Q_DECLARE_METATYPE(OverrideItem) -Q_DECLARE_METATYPE(OverrideItemList) inline bool operator==(const OverrideItem &lhs, const OverrideItem &rhs) { diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index ad12c5b621..27cb35739e 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -24,6 +24,7 @@ ****************************************************************************/ #include "cppcompletionassist.h" +#include "cppdoxygen.h" #include "cppmodelmanager.h" #include "cpptoolsplugin.h" #include "cpptoolstestcase.h" @@ -110,6 +111,8 @@ public: ExplicitlyInvoked, m_snapshot, ProjectPartHeaderPaths(), languageFeatures); + ai->prepareForAsyncUse(); + ai->recreateTextDocument(); InternalCppCompletionAssistProcessor processor; const Tests::IAssistProposalScopedPointer proposal(processor.perform(ai)); @@ -171,6 +174,17 @@ bool isProbablyGlobalCompletion(const QStringList &list) && list.contains(QLatin1String("bool")); } +bool isDoxygenTagCompletion(const QStringList &list) +{ + for (int i = 1; i < T_DOXY_LAST_TAG; ++i) { + const QString doxygenTag = QString::fromLatin1(doxygenTagSpell(i)); + if (!list.contains(doxygenTag)) + return false; + } + + return true; +} + } // anonymous namespace void CppToolsPlugin::test_completion_basic_1() @@ -384,6 +398,34 @@ void CppToolsPlugin::test_global_completion() QVERIFY(completions.toSet().contains(requiredCompletionItems.toSet())); } +void CppToolsPlugin::test_doxygen_tag_completion_data() +{ + QTest::addColumn<QByteArray>("code"); + + QTest::newRow("C++ comment") + << _("/// @"); + + QTest::newRow("C comment single line") + << _("/*! @ */"); + + QTest::newRow("C comment multi line") + << _("/*! text\n" + " * @\n" + " */\n"); +} + +void CppToolsPlugin::test_doxygen_tag_completion() +{ + QFETCH(QByteArray, code); + + const QByteArray prefix = "\\"; + + CompletionTestCase test(code, prefix); + QVERIFY(test.succeededSoFar()); + const QStringList completions = test.getCompletions(); + QVERIFY(isDoxygenTagCompletion(completions)); +} + static void enumTestCase(const QByteArray &tag, const QByteArray &source, const QByteArray &prefix = QByteArray()) { diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp index b5b986eed7..c801fd7100 100644 --- a/src/plugins/cpptools/cppcompletionassist.cpp +++ b/src/plugins/cpptools/cppcompletionassist.cpp @@ -941,118 +941,35 @@ IAssistProposal *InternalCppCompletionAssistProcessor::createHintProposal( return proposal; } -int InternalCppCompletionAssistProcessor::startOfOperator(int pos, +int InternalCppCompletionAssistProcessor::startOfOperator(int positionInDocument, unsigned *kind, bool wantFunctionCall) const { - const QChar ch = pos > -1 ? m_interface->characterAt(pos - 1) : QChar(); - const QChar ch2 = pos > 0 ? m_interface->characterAt(pos - 2) : QChar(); - const QChar ch3 = pos > 1 ? m_interface->characterAt(pos - 3) : QChar(); - - int start = pos - CppCompletionAssistProvider::activationSequenceChar(ch, ch2, ch3, kind, - wantFunctionCall, /*wantQt5SignalSlots*/ true); - if (start != pos) { - QTextCursor tc(m_interface->textDocument()); - tc.setPosition(pos); - - // Include completion: make sure the quote character is the first one on the line - if (*kind == T_STRING_LITERAL) { - QTextCursor s = tc; - s.movePosition(QTextCursor::StartOfLine, QTextCursor::KeepAnchor); - QString sel = s.selectedText(); - if (sel.indexOf(QLatin1Char('"')) < sel.length() - 1) { - *kind = T_EOF_SYMBOL; - start = pos; - } - } - - if (*kind == T_COMMA) { - ExpressionUnderCursor expressionUnderCursor(m_interface->languageFeatures()); - if (expressionUnderCursor.startOfFunctionCall(tc) == -1) { - *kind = T_EOF_SYMBOL; - start = pos; - } - } - - SimpleLexer tokenize; - tokenize.setLanguageFeatures(m_interface->languageFeatures()); - tokenize.setSkipComments(false); - const Tokens &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block())); - const int tokenIdx = SimpleLexer::tokenBefore(tokens, qMax(0, tc.positionInBlock() - 1)); // get the token at the left of the cursor - const Token tk = (tokenIdx == -1) ? Token() : tokens.at(tokenIdx); - - if (*kind == T_AMPER && tokenIdx > 0) { - const Token &previousToken = tokens.at(tokenIdx - 1); - if (previousToken.kind() == T_COMMA) - start = pos - (tk.utf16charOffset - previousToken.utf16charOffset) - 1; - } else if (*kind == T_DOXY_COMMENT && !(tk.is(T_DOXY_COMMENT) || tk.is(T_CPP_DOXY_COMMENT))) { - *kind = T_EOF_SYMBOL; - start = pos; - } - // Don't complete in comments or strings, but still check for include completion - else if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT) - || tk.is(T_CPP_DOXY_COMMENT) || tk.is(T_DOXY_COMMENT) - || (tk.isLiteral() && (*kind != T_STRING_LITERAL - && *kind != T_ANGLE_STRING_LITERAL - && *kind != T_SLASH - && *kind != T_DOT))) { - *kind = T_EOF_SYMBOL; - start = pos; - // Include completion: can be triggered by slash, but only in a string - } else if (*kind == T_SLASH && (tk.isNot(T_STRING_LITERAL) && tk.isNot(T_ANGLE_STRING_LITERAL))) { - *kind = T_EOF_SYMBOL; - start = pos; - } else if (*kind == T_LPAREN) { - if (tokenIdx > 0) { - const Token &previousToken = tokens.at(tokenIdx - 1); // look at the token at the left of T_LPAREN - switch (previousToken.kind()) { - case T_IDENTIFIER: - case T_GREATER: - case T_SIGNAL: - case T_SLOT: - break; // good - - default: - // that's a bad token :) - *kind = T_EOF_SYMBOL; - start = pos; - } - } - } - // Check for include preprocessor directive - else if (*kind == T_STRING_LITERAL || *kind == T_ANGLE_STRING_LITERAL|| *kind == T_SLASH - || (*kind == T_DOT && (tk.is(T_STRING_LITERAL) || tk.is(T_ANGLE_STRING_LITERAL)))) { - bool include = false; - if (tokens.size() >= 3) { - if (tokens.at(0).is(T_POUND) && tokens.at(1).is(T_IDENTIFIER) && (tokens.at(2).is(T_STRING_LITERAL) || - tokens.at(2).is(T_ANGLE_STRING_LITERAL))) { - const Token &directiveToken = tokens.at(1); - QString directive = tc.block().text().mid(directiveToken.utf16charsBegin(), - directiveToken.utf16chars()); - if (directive == QLatin1String("include") || - directive == QLatin1String("include_next") || - directive == QLatin1String("import")) { - include = true; - } - } - } - - if (!include) { - *kind = T_EOF_SYMBOL; - start = pos; - } else { - if (*kind == T_DOT) { - start = findStartOfName(start); - const QChar ch4 = start > -1 ? m_interface->characterAt(start - 1) : QChar(); - const QChar ch5 = start > 0 ? m_interface->characterAt(start - 2) : QChar(); - const QChar ch6 = start > 1 ? m_interface->characterAt(start - 3) : QChar(); - start = start - CppCompletionAssistProvider::activationSequenceChar( - ch4, ch5, ch6, kind, wantFunctionCall, false); - } - } - } - } - + const QChar ch = m_interface->characterAt(positionInDocument - 1); + const QChar ch2 = m_interface->characterAt(positionInDocument - 2); + const QChar ch3 = m_interface->characterAt(positionInDocument - 3); + + int start = positionInDocument + - CppCompletionAssistProvider::activationSequenceChar(ch, ch2, ch3, kind, + wantFunctionCall, + /*wantQt5SignalSlots*/ true); + + const auto dotAtIncludeCompletionHandler = [this](int &start, unsigned *kind) { + start = findStartOfName(start); + const QChar ch4 = m_interface->characterAt(start - 1); + const QChar ch5 = m_interface->characterAt(start - 2); + const QChar ch6 = m_interface->characterAt(start - 3); + start = start - CppCompletionAssistProvider::activationSequenceChar( + ch4, ch5, ch6, kind, false, false); + }; + + CppCompletionAssistProcessor::startOfOperator(m_interface->textDocument(), + positionInDocument, + kind, + start, + m_interface->languageFeatures(), + /*adjustForQt5SignalSlotCompletion=*/ true, + dotAtIncludeCompletionHandler); return start; } diff --git a/src/plugins/cpptools/cppcompletionassist.h b/src/plugins/cpptools/cppcompletionassist.h index 14a9e9190c..809a5a1005 100644 --- a/src/plugins/cpptools/cppcompletionassist.h +++ b/src/plugins/cpptools/cppcompletionassist.h @@ -105,7 +105,7 @@ private: TextEditor::IAssistProposal *createHintProposal(QList<CPlusPlus::Function *> symbols) const; bool accepts() const; - int startOfOperator(int pos, unsigned *kind, bool wantFunctionCall) const; + int startOfOperator(int positionInDocument, unsigned *kind, bool wantFunctionCall) const; int findStartOfName(int pos = -1) const; int startCompletionHelper(); bool tryObjCCompletion(); diff --git a/src/plugins/cpptools/cppcompletionassistprocessor.cpp b/src/plugins/cpptools/cppcompletionassistprocessor.cpp index bcc7e9507d..5dd5228538 100644 --- a/src/plugins/cpptools/cppcompletionassistprocessor.cpp +++ b/src/plugins/cpptools/cppcompletionassistprocessor.cpp @@ -27,6 +27,17 @@ #include <cppeditor/cppeditorconstants.h> +#include <cplusplus/BackwardsScanner.h> +#include <cplusplus/ExpressionUnderCursor.h> +#include <cplusplus/SimpleLexer.h> +#include <cplusplus/Token.h> + +#include <QTextBlock> +#include <QTextCursor> +#include <QTextDocument> + +using namespace CPlusPlus; + namespace CppTools { CppCompletionAssistProcessor::CppCompletionAssistProcessor() @@ -70,4 +81,118 @@ void CppCompletionAssistProcessor::addSnippets() m_completions.append(m_snippetCollector.collect()); } +static bool isDoxygenTagCompletionCharacter(const QChar &character) +{ + return character == QLatin1Char('\\') + || character == QLatin1Char('@') ; +} + +void CppCompletionAssistProcessor::startOfOperator(QTextDocument *textDocument, + int positionInDocument, + unsigned *kind, + int &start, + const CPlusPlus::LanguageFeatures &languageFeatures, + bool adjustForQt5SignalSlotCompletion, + DotAtIncludeCompletionHandler dotAtIncludeCompletionHandler) +{ + if (start != positionInDocument) { + QTextCursor tc(textDocument); + tc.setPosition(positionInDocument); + + // Include completion: make sure the quote character is the first one on the line + if (*kind == T_STRING_LITERAL) { + QTextCursor s = tc; + s.movePosition(QTextCursor::StartOfLine, QTextCursor::KeepAnchor); + QString sel = s.selectedText(); + if (sel.indexOf(QLatin1Char('"')) < sel.length() - 1) { + *kind = T_EOF_SYMBOL; + start = positionInDocument; + } + } + + if (*kind == T_COMMA) { + ExpressionUnderCursor expressionUnderCursor(languageFeatures); + if (expressionUnderCursor.startOfFunctionCall(tc) == -1) { + *kind = T_EOF_SYMBOL; + start = positionInDocument; + } + } + + SimpleLexer tokenize; + tokenize.setLanguageFeatures(languageFeatures); + tokenize.setSkipComments(false); + const Tokens &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block())); + const int tokenIdx = SimpleLexer::tokenBefore(tokens, qMax(0, tc.positionInBlock() - 1)); // get the token at the left of the cursor + const Token tk = (tokenIdx == -1) ? Token() : tokens.at(tokenIdx); + const QChar characterBeforePositionInDocument + = textDocument->characterAt(positionInDocument - 1); + + if (adjustForQt5SignalSlotCompletion && *kind == T_AMPER && tokenIdx > 0) { + const Token &previousToken = tokens.at(tokenIdx - 1); + if (previousToken.kind() == T_COMMA) + start = positionInDocument - (tk.utf16charOffset - previousToken.utf16charOffset) - 1; + } else if (*kind == T_DOXY_COMMENT && !(tk.is(T_DOXY_COMMENT) || tk.is(T_CPP_DOXY_COMMENT))) { + *kind = T_EOF_SYMBOL; + start = positionInDocument; + // Do not complete in comments, except in doxygen comments for doxygen commands. + // Do not complete in strings, except it is for include completion. + } else if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT) + || ((tk.is(T_CPP_DOXY_COMMENT) || tk.is(T_DOXY_COMMENT)) + && !isDoxygenTagCompletionCharacter(characterBeforePositionInDocument)) + || (tk.isLiteral() && (*kind != T_STRING_LITERAL + && *kind != T_ANGLE_STRING_LITERAL + && *kind != T_SLASH + && *kind != T_DOT))) { + *kind = T_EOF_SYMBOL; + start = positionInDocument; + // Include completion: can be triggered by slash, but only in a string + } else if (*kind == T_SLASH && (tk.isNot(T_STRING_LITERAL) && tk.isNot(T_ANGLE_STRING_LITERAL))) { + *kind = T_EOF_SYMBOL; + start = positionInDocument; + } else if (*kind == T_LPAREN) { + if (tokenIdx > 0) { + const Token &previousToken = tokens.at(tokenIdx - 1); // look at the token at the left of T_LPAREN + switch (previousToken.kind()) { + case T_IDENTIFIER: + case T_GREATER: + case T_SIGNAL: + case T_SLOT: + break; // good + + default: + // that's a bad token :) + *kind = T_EOF_SYMBOL; + start = positionInDocument; + } + } + } + // Check for include preprocessor directive + else if (*kind == T_STRING_LITERAL || *kind == T_ANGLE_STRING_LITERAL || *kind == T_SLASH + || (*kind == T_DOT + && (tk.is(T_STRING_LITERAL) || tk.is(T_ANGLE_STRING_LITERAL)))) { + bool include = false; + if (tokens.size() >= 3) { + if (tokens.at(0).is(T_POUND) && tokens.at(1).is(T_IDENTIFIER) && (tokens.at(2).is(T_STRING_LITERAL) || + tokens.at(2).is(T_ANGLE_STRING_LITERAL))) { + const Token &directiveToken = tokens.at(1); + QString directive = tc.block().text().mid(directiveToken.utf16charsBegin(), + directiveToken.utf16chars()); + if (directive == QLatin1String("include") || + directive == QLatin1String("include_next") || + directive == QLatin1String("import")) { + include = true; + } + } + } + + if (!include) { + *kind = T_EOF_SYMBOL; + start = positionInDocument; + } else if (*kind == T_DOT && dotAtIncludeCompletionHandler){ + dotAtIncludeCompletionHandler(start, kind); + } + } + } +} + } // namespace CppTools diff --git a/src/plugins/cpptools/cppcompletionassistprocessor.h b/src/plugins/cpptools/cppcompletionassistprocessor.h index 49634539ce..6db68e1a1a 100644 --- a/src/plugins/cpptools/cppcompletionassistprocessor.h +++ b/src/plugins/cpptools/cppcompletionassistprocessor.h @@ -32,6 +32,16 @@ #include <cplusplus/Icons.h> +#include <functional> + +QT_BEGIN_NAMESPACE +class QTextDocument; +QT_END_NAMESPACE + +namespace CPlusPlus { +struct LanguageFeatures; +} + namespace CppTools { class CPPTOOLS_EXPORT CppCompletionAssistProcessor : public TextEditor::IAssistProcessor @@ -42,6 +52,16 @@ public: protected: void addSnippets(); + using DotAtIncludeCompletionHandler = std::function<void(int &startPosition, unsigned *kind)>; + static void startOfOperator(QTextDocument *textDocument, + int positionInDocument, + unsigned *kind, + int &start, + const CPlusPlus::LanguageFeatures &languageFeatures, + bool adjustForQt5SignalSlotCompletion = false, + DotAtIncludeCompletionHandler dotAtIncludeCompletionHandler + = DotAtIncludeCompletionHandler()); + int m_positionForProposal; QList<TextEditor::AssistProposalItemInterface *> m_completions; QStringList m_preprocessorCompletions; diff --git a/src/plugins/cpptools/cppdoxygen.cpp b/src/plugins/cpptools/cppdoxygen.cpp index 64a92c4c55..363e684010 100644 --- a/src/plugins/cpptools/cppdoxygen.cpp +++ b/src/plugins/cpptools/cppdoxygen.cpp @@ -23,6 +23,24 @@ ** ****************************************************************************/ +// +// W A R N I N G +// ------------- +// +// Main parts of this file are generated by "cplusplus-keywordgen". +// Use the tool to update new keywords/identifiers: +// +// 1. Update the input file cppdoxygen.kwgen with new keywords/identifiers. +// 2. Run the tool with the input file: +// $ INPUT_FILE=${QTC_SOURCE}/src/plugins/cpptools/cppdoxygen.kwgen +// $ OUTPUT_FILE=/tmp/new.cpp +// $ TOOL=${QTC_BUILD}/bin/cplusplus-keywordgen +// $ cat $INPUT_FILE | $TOOL > $OUTPUT_FILE +// 3. Copy over the classify* functions from $OUTPUT_FILE to this file, +// update the doxy_token_spell array in this file and the enums in the +// header. +// + #include "cppdoxygen.h" #include <QString> @@ -43,270 +61,353 @@ using namespace CppTools; static const char *doxy_token_spell[] = { "identifier", - "arg", - "attention", - "author", - "callgraph", - "code", - "dot", - "else", - "endcode", - "endcond", - "enddot", - "endhtmlonly", - "endif", - "endlatexonly", - "endlink", - "endmanonly", - "endverbatim", - "endxmlonly", - "hideinitializer", - "htmlonly", - "interface", - "internal", - "invariant", - "latexonly", - "li", - "manonly", - "n", - "nosubgrouping", - "note", - "only", - "post", - "pre", - "remarks", - "return", - "returns", - "sa", - "see", - "showinitializer", - "since", - "test", - "todo", - "verbatim", - "warning", - "xmlonly", + "a", + "abstract", + "addindex", "addtogroup", "anchor", + "annotatedlist", + "arg", + "attention", + "author", + "authors", "b", + "badcode", + "basename", + "bold", + "brief", + "bug", "c", + "callergraph", + "callgraph", + "caption", + "category", + "chapter", + "cite", "class", + "code", + "codeline", + "compat", "cond", + "contentspage", + "copybrief", + "copydetails", "copydoc", + "copyright", + "corelib", + "date", "def", + "default", + "defgroup", + "deprecated", + "details", + "diafile", + "dir", + "div", + "docbookonly", "dontinclude", + "dot", "dotfile", + "dots", "e", + "else", "elseif", "em", - "enum", - "example", - "exception", - "exceptions", - "file", - "htmlinclude", - "if", - "ifnot", - "include", - "link", - "namespace", - "p", - "package", - "ref", - "relates", - "relatesalso", - "retval", - "throw", - "throws", - "verbinclude", - "version", - "xrefitem", - "param", - "image", - "defgroup", - "page", - "paragraph", - "section", - "struct", - "subsection", - "subsubsection", - "union", - "weakgroup", - "addindex", - "brief", - "bug", - "date", - "deprecated", - "fn", - "ingroup", - "line", - "mainpage", - "name", - "overload", - "par", - "short", - "skip", - "skipline", - "typedef", - "until", - "var", - "abstract", - "badcode", - "basename", - "bold", - "caption", - "chapter", - "codeline", - "dots", "endabstract", "endchapter", + "endcode", + "endcond", + "enddocbookonly", + "enddot", "endfootnote", + "endhtmlonly", + "endif", + "endinternal", + "endlatexonly", "endlegalese", + "endlink", "endlist", + "endmanonly", + "endmsc", "endomit", + "endparblock", "endpart", "endquotation", "endraw", + "endrtfonly", + "endsecreflist", "endsection1", "endsection2", "endsection3", "endsection4", "endsidebar", "endtable", + "enduml", + "endverbatim", + "endxmlonly", + "enum", + "example", + "exception", + "exceptions", "expire", + "extends", + "externalpage", + "file", + "fn", "footnote", "generatelist", "granularity", + "group", + "gui", "header", + "headerfile", + "hidecallergraph", + "hidecallgraph", + "hideinitializer", + "htmlinclude", + "htmlonly", "i", + "idlexcept", + "if", + "ifnot", + "image", + "implements", + "include", + "includelineno", "index", + "indexpage", + "ingroup", + "inheaderfile", + "inherits", "inlineimage", + "inmodule", + "inpublicgroup", + "inqmlmodule", + "instantiates", + "interface", + "internal", + "invariant", "keyword", "l", + "latexinclude", + "latexonly", "legalese", + "li", + "line", + "link", "list", + "macro", + "mainclass", + "mainpage", + "manonly", + "memberof", "meta", + "module", + "msc", + "mscfile", + "n", + "name", + "namespace", + "network", "newcode", + "nextpage", + "noautolist", + "nonreentrant", + "nosubgrouping", + "note", "o", + "obsolete", "oldcode", "omit", "omitvalue", + "only", + "opengl", + "overload", + "p", + "package", + "page", + "par", + "paragraph", + "param", + "parblock", "part", + "post", + "pre", + "preliminary", + "previouspage", "printline", "printto", "printuntil", + "private", + "privatesection", + "property", + "protected", + "protectedsection", + "protocol", + "public", + "publicsection", + "pure", + "qmlabstract", + "qmlattachedproperty", + "qmlattachedsignal", + "qmlbasictype", + "qmlclass", + "qmlmethod", + "qmlmodule", + "qmlproperty", + "qmlsignal", + "qmltype", + "qt3support", + "qtestlib", "quotation", "quotefile", "quotefromfile", "quotefunction", "raw", + "reentrant", + "ref", + "refitem", + "reimp", + "related", + "relatedalso", + "relates", + "relatesalso", + "remark", + "remarks", + "result", + "return", + "returns", + "retval", "row", + "rtfonly", + "sa", + "secreflist", + "section", "section1", "section2", "section3", "section4", + "see", + "service", + "short", + "showinitializer", "sidebar", + "since", + "skip", + "skipline", "skipto", "skipuntil", "snippet", + "span", + "sql", + "startpage", + "startuml", + "struct", "sub", + "subpage", + "subsection", + "subsubsection", + "subtitle", "sup", + "svg", "table", "tableofcontents", "target", + "test", + "threadsafe", + "throw", + "throws", + "title", + "todo", + "tparam", "tt", + "typedef", + "uicontrol", + "uitools", "underline", "unicode", + "union", + "until", "value", - "contentspage", - "externalpage", - "group", - "headerfile", - "indexpage", - "inheaderfile", - "macro", - "module", - "nextpage", - "previouspage", - "property", - "reimp", - "service", - "startpage", + "var", "variable", - "compat", - "inmodule", - "mainclass", - "nonreentrant", - "obsolete", - "preliminary", - "inpublicgroup", - "reentrant", - "subtitle", - "threadsafe", - "title", - "corelib", - "uitools", - "gui", - "network", - "opengl", - "qt3support", - "svg", - "sql", - "qtestlib", + "verbatim", + "verbinclude", + "version", + "vhdlflow", + "warning", + "weakgroup", "webkit", - "xml" + "xml", + "xmlonly", + "xrefitem", }; const char *CppTools::doxygenTagSpell(int index) { return doxy_token_spell[index]; } static inline int classify1(const QChar *s) { - if (s[0].unicode() == 'a') + if (s[0].unicode() == 'a') { return T_DOXY_A; - else if (s[0].unicode() == 'b') + } + else if (s[0].unicode() == 'b') { return T_DOXY_B; - else if (s[0].unicode() == 'c') + } + else if (s[0].unicode() == 'c') { return T_DOXY_C; - else if (s[0].unicode() == 'e') + } + else if (s[0].unicode() == 'e') { return T_DOXY_E; - else if (s[0].unicode() == 'i') + } + else if (s[0].unicode() == 'i') { return T_DOXY_I; - else if (s[0].unicode() == 'l') + } + else if (s[0].unicode() == 'l') { return T_DOXY_L; - else if (s[0].unicode() == 'n') + } + else if (s[0].unicode() == 'n') { return T_DOXY_N; - else if (s[0].unicode() == 'o') + } + else if (s[0].unicode() == 'o') { return T_DOXY_O; - else if (s[0].unicode() == 'p') + } + else if (s[0].unicode() == 'p') { return T_DOXY_P; + } return T_DOXY_IDENTIFIER; } static inline int classify2(const QChar *s) { if (s[0].unicode() == 'e') { - if (s[1].unicode() == 'm') + if (s[1].unicode() == 'm') { return T_DOXY_EM; + } } else if (s[0].unicode() == 'f') { - if (s[1].unicode() == 'n') + if (s[1].unicode() == 'n') { return T_DOXY_FN; + } } else if (s[0].unicode() == 'i') { - if (s[1].unicode() == 'f') + if (s[1].unicode() == 'f') { return T_DOXY_IF; + } } else if (s[0].unicode() == 'l') { - if (s[1].unicode() == 'i') + if (s[1].unicode() == 'i') { return T_DOXY_LI; + } } else if (s[0].unicode() == 's') { - if (s[1].unicode() == 'a') + if (s[1].unicode() == 'a') { return T_DOXY_SA; + } } else if (s[0].unicode() == 't') { - if (s[1].unicode() == 't') + if (s[1].unicode() == 't') { return T_DOXY_TT; + } } return T_DOXY_IDENTIFIER; } @@ -314,86 +415,118 @@ static inline int classify2(const QChar *s) { static inline int classify3(const QChar *s) { if (s[0].unicode() == 'a') { if (s[1].unicode() == 'r') { - if (s[2].unicode() == 'g') + if (s[2].unicode() == 'g') { return T_DOXY_ARG; + } } } else if (s[0].unicode() == 'b') { if (s[1].unicode() == 'u') { - if (s[2].unicode() == 'g') + if (s[2].unicode() == 'g') { return T_DOXY_BUG; + } } } else if (s[0].unicode() == 'd') { if (s[1].unicode() == 'e') { - if (s[2].unicode() == 'f') + if (s[2].unicode() == 'f') { return T_DOXY_DEF; + } + } + else if (s[1].unicode() == 'i') { + if (s[2].unicode() == 'r') { + return T_DOXY_DIR; + } + else if (s[2].unicode() == 'v') { + return T_DOXY_DIV; + } } else if (s[1].unicode() == 'o') { - if (s[2].unicode() == 't') + if (s[2].unicode() == 't') { return T_DOXY_DOT; + } } } else if (s[0].unicode() == 'g') { if (s[1].unicode() == 'u') { - if (s[2].unicode() == 'i') + if (s[2].unicode() == 'i') { return T_DOXY_GUI; + } + } + } + else if (s[0].unicode() == 'm') { + if (s[1].unicode() == 's') { + if (s[2].unicode() == 'c') { + return T_DOXY_MSC; + } } } else if (s[0].unicode() == 'p') { if (s[1].unicode() == 'a') { - if (s[2].unicode() == 'r') + if (s[2].unicode() == 'r') { return T_DOXY_PAR; + } } else if (s[1].unicode() == 'r') { - if (s[2].unicode() == 'e') + if (s[2].unicode() == 'e') { return T_DOXY_PRE; + } } } else if (s[0].unicode() == 'r') { if (s[1].unicode() == 'a') { - if (s[2].unicode() == 'w') + if (s[2].unicode() == 'w') { return T_DOXY_RAW; + } } else if (s[1].unicode() == 'e') { - if (s[2].unicode() == 'f') + if (s[2].unicode() == 'f') { return T_DOXY_REF; + } } else if (s[1].unicode() == 'o') { - if (s[2].unicode() == 'w') + if (s[2].unicode() == 'w') { return T_DOXY_ROW; + } } } else if (s[0].unicode() == 's') { if (s[1].unicode() == 'e') { - if (s[2].unicode() == 'e') + if (s[2].unicode() == 'e') { return T_DOXY_SEE; + } } else if (s[1].unicode() == 'q') { - if (s[2].unicode() == 'l') + if (s[2].unicode() == 'l') { return T_DOXY_SQL; + } } else if (s[1].unicode() == 'u') { - if (s[2].unicode() == 'b') + if (s[2].unicode() == 'b') { return T_DOXY_SUB; - else if (s[2].unicode() == 'p') + } + else if (s[2].unicode() == 'p') { return T_DOXY_SUP; + } } else if (s[1].unicode() == 'v') { - if (s[2].unicode() == 'g') + if (s[2].unicode() == 'g') { return T_DOXY_SVG; + } } } else if (s[0].unicode() == 'v') { if (s[1].unicode() == 'a') { - if (s[2].unicode() == 'r') + if (s[2].unicode() == 'r') { return T_DOXY_VAR; + } } } else if (s[0].unicode() == 'x') { if (s[1].unicode() == 'm') { - if (s[2].unicode() == 'l') + if (s[2].unicode() == 'l') { return T_DOXY_XML; + } } } return T_DOXY_IDENTIFIER; @@ -403,146 +536,189 @@ static inline int classify4(const QChar *s) { if (s[0].unicode() == 'b') { if (s[1].unicode() == 'o') { if (s[2].unicode() == 'l') { - if (s[3].unicode() == 'd') + if (s[3].unicode() == 'd') { return T_DOXY_BOLD; + } } } } else if (s[0].unicode() == 'c') { - if (s[1].unicode() == 'o') { + if (s[1].unicode() == 'i') { + if (s[2].unicode() == 't') { + if (s[3].unicode() == 'e') { + return T_DOXY_CITE; + } + } + } + else if (s[1].unicode() == 'o') { if (s[2].unicode() == 'd') { - if (s[3].unicode() == 'e') + if (s[3].unicode() == 'e') { return T_DOXY_CODE; + } } else if (s[2].unicode() == 'n') { - if (s[3].unicode() == 'd') + if (s[3].unicode() == 'd') { return T_DOXY_COND; + } } } } else if (s[0].unicode() == 'd') { if (s[1].unicode() == 'a') { if (s[2].unicode() == 't') { - if (s[3].unicode() == 'e') + if (s[3].unicode() == 'e') { return T_DOXY_DATE; + } } } else if (s[1].unicode() == 'o') { if (s[2].unicode() == 't') { - if (s[3].unicode() == 's') + if (s[3].unicode() == 's') { return T_DOXY_DOTS; + } } } } else if (s[0].unicode() == 'e') { if (s[1].unicode() == 'l') { if (s[2].unicode() == 's') { - if (s[3].unicode() == 'e') + if (s[3].unicode() == 'e') { return T_DOXY_ELSE; + } } } else if (s[1].unicode() == 'n') { if (s[2].unicode() == 'u') { - if (s[3].unicode() == 'm') + if (s[3].unicode() == 'm') { return T_DOXY_ENUM; + } } } } else if (s[0].unicode() == 'f') { if (s[1].unicode() == 'i') { if (s[2].unicode() == 'l') { - if (s[3].unicode() == 'e') + if (s[3].unicode() == 'e') { return T_DOXY_FILE; + } } } } else if (s[0].unicode() == 'l') { if (s[1].unicode() == 'i') { if (s[2].unicode() == 'n') { - if (s[3].unicode() == 'e') + if (s[3].unicode() == 'e') { return T_DOXY_LINE; - else if (s[3].unicode() == 'k') + } + else if (s[3].unicode() == 'k') { return T_DOXY_LINK; + } } else if (s[2].unicode() == 's') { - if (s[3].unicode() == 't') + if (s[3].unicode() == 't') { return T_DOXY_LIST; + } } } } else if (s[0].unicode() == 'm') { if (s[1].unicode() == 'e') { if (s[2].unicode() == 't') { - if (s[3].unicode() == 'a') + if (s[3].unicode() == 'a') { return T_DOXY_META; + } } } } else if (s[0].unicode() == 'n') { if (s[1].unicode() == 'a') { if (s[2].unicode() == 'm') { - if (s[3].unicode() == 'e') + if (s[3].unicode() == 'e') { return T_DOXY_NAME; + } } } else if (s[1].unicode() == 'o') { if (s[2].unicode() == 't') { - if (s[3].unicode() == 'e') + if (s[3].unicode() == 'e') { return T_DOXY_NOTE; + } } } } else if (s[0].unicode() == 'o') { if (s[1].unicode() == 'm') { if (s[2].unicode() == 'i') { - if (s[3].unicode() == 't') + if (s[3].unicode() == 't') { return T_DOXY_OMIT; + } } } else if (s[1].unicode() == 'n') { if (s[2].unicode() == 'l') { - if (s[3].unicode() == 'y') + if (s[3].unicode() == 'y') { return T_DOXY_ONLY; + } } } } else if (s[0].unicode() == 'p') { if (s[1].unicode() == 'a') { if (s[2].unicode() == 'g') { - if (s[3].unicode() == 'e') + if (s[3].unicode() == 'e') { return T_DOXY_PAGE; + } } else if (s[2].unicode() == 'r') { - if (s[3].unicode() == 't') + if (s[3].unicode() == 't') { return T_DOXY_PART; + } } } else if (s[1].unicode() == 'o') { if (s[2].unicode() == 's') { - if (s[3].unicode() == 't') + if (s[3].unicode() == 't') { return T_DOXY_POST; + } + } + } + else if (s[1].unicode() == 'u') { + if (s[2].unicode() == 'r') { + if (s[3].unicode() == 'e') { + return T_DOXY_PURE; + } } } } else if (s[0].unicode() == 's') { if (s[1].unicode() == 'k') { if (s[2].unicode() == 'i') { - if (s[3].unicode() == 'p') + if (s[3].unicode() == 'p') { return T_DOXY_SKIP; + } + } + } + else if (s[1].unicode() == 'p') { + if (s[2].unicode() == 'a') { + if (s[3].unicode() == 'n') { + return T_DOXY_SPAN; + } } } } else if (s[0].unicode() == 't') { if (s[1].unicode() == 'e') { if (s[2].unicode() == 's') { - if (s[3].unicode() == 't') + if (s[3].unicode() == 't') { return T_DOXY_TEST; + } } } else if (s[1].unicode() == 'o') { if (s[2].unicode() == 'd') { - if (s[3].unicode() == 'o') + if (s[3].unicode() == 'o') { return T_DOXY_TODO; + } } } } @@ -554,8 +730,9 @@ static inline int classify5(const QChar *s) { if (s[1].unicode() == 'r') { if (s[2].unicode() == 'i') { if (s[3].unicode() == 'e') { - if (s[4].unicode() == 'f') + if (s[4].unicode() == 'f') { return T_DOXY_BRIEF; + } } } } @@ -564,8 +741,9 @@ static inline int classify5(const QChar *s) { if (s[1].unicode() == 'l') { if (s[2].unicode() == 'a') { if (s[3].unicode() == 's') { - if (s[4].unicode() == 's') + if (s[4].unicode() == 's') { return T_DOXY_CLASS; + } } } } @@ -574,8 +752,9 @@ static inline int classify5(const QChar *s) { if (s[1].unicode() == 'n') { if (s[2].unicode() == 'd') { if (s[3].unicode() == 'i') { - if (s[4].unicode() == 'f') + if (s[4].unicode() == 'f') { return T_DOXY_ENDIF; + } } } } @@ -584,8 +763,9 @@ static inline int classify5(const QChar *s) { if (s[1].unicode() == 'r') { if (s[2].unicode() == 'o') { if (s[3].unicode() == 'u') { - if (s[4].unicode() == 'p') + if (s[4].unicode() == 'p') { return T_DOXY_GROUP; + } } } } @@ -594,24 +774,27 @@ static inline int classify5(const QChar *s) { if (s[1].unicode() == 'f') { if (s[2].unicode() == 'n') { if (s[3].unicode() == 'o') { - if (s[4].unicode() == 't') + if (s[4].unicode() == 't') { return T_DOXY_IFNOT; + } } } } else if (s[1].unicode() == 'm') { if (s[2].unicode() == 'a') { if (s[3].unicode() == 'g') { - if (s[4].unicode() == 'e') + if (s[4].unicode() == 'e') { return T_DOXY_IMAGE; + } } } } else if (s[1].unicode() == 'n') { if (s[2].unicode() == 'd') { if (s[3].unicode() == 'e') { - if (s[4].unicode() == 'x') + if (s[4].unicode() == 'x') { return T_DOXY_INDEX; + } } } } @@ -620,8 +803,9 @@ static inline int classify5(const QChar *s) { if (s[1].unicode() == 'a') { if (s[2].unicode() == 'c') { if (s[3].unicode() == 'r') { - if (s[4].unicode() == 'o') + if (s[4].unicode() == 'o') { return T_DOXY_MACRO; + } } } } @@ -630,8 +814,9 @@ static inline int classify5(const QChar *s) { if (s[1].unicode() == 'a') { if (s[2].unicode() == 'r') { if (s[3].unicode() == 'a') { - if (s[4].unicode() == 'm') + if (s[4].unicode() == 'm') { return T_DOXY_PARAM; + } } } } @@ -640,8 +825,9 @@ static inline int classify5(const QChar *s) { if (s[1].unicode() == 'e') { if (s[2].unicode() == 'i') { if (s[3].unicode() == 'm') { - if (s[4].unicode() == 'p') + if (s[4].unicode() == 'p') { return T_DOXY_REIMP; + } } } } @@ -650,16 +836,18 @@ static inline int classify5(const QChar *s) { if (s[1].unicode() == 'h') { if (s[2].unicode() == 'o') { if (s[3].unicode() == 'r') { - if (s[4].unicode() == 't') + if (s[4].unicode() == 't') { return T_DOXY_SHORT; + } } } } else if (s[1].unicode() == 'i') { if (s[2].unicode() == 'n') { if (s[3].unicode() == 'c') { - if (s[4].unicode() == 'e') + if (s[4].unicode() == 'e') { return T_DOXY_SINCE; + } } } } @@ -668,24 +856,27 @@ static inline int classify5(const QChar *s) { if (s[1].unicode() == 'a') { if (s[2].unicode() == 'b') { if (s[3].unicode() == 'l') { - if (s[4].unicode() == 'e') + if (s[4].unicode() == 'e') { return T_DOXY_TABLE; + } } } } else if (s[1].unicode() == 'h') { if (s[2].unicode() == 'r') { if (s[3].unicode() == 'o') { - if (s[4].unicode() == 'w') + if (s[4].unicode() == 'w') { return T_DOXY_THROW; + } } } } else if (s[1].unicode() == 'i') { if (s[2].unicode() == 't') { if (s[3].unicode() == 'l') { - if (s[4].unicode() == 'e') + if (s[4].unicode() == 'e') { return T_DOXY_TITLE; + } } } } @@ -694,14 +885,16 @@ static inline int classify5(const QChar *s) { if (s[1].unicode() == 'n') { if (s[2].unicode() == 'i') { if (s[3].unicode() == 'o') { - if (s[4].unicode() == 'n') + if (s[4].unicode() == 'n') { return T_DOXY_UNION; + } } } else if (s[2].unicode() == 't') { if (s[3].unicode() == 'i') { - if (s[4].unicode() == 'l') + if (s[4].unicode() == 'l') { return T_DOXY_UNTIL; + } } } } @@ -710,8 +903,9 @@ static inline int classify5(const QChar *s) { if (s[1].unicode() == 'a') { if (s[2].unicode() == 'l') { if (s[3].unicode() == 'u') { - if (s[4].unicode() == 'e') + if (s[4].unicode() == 'e') { return T_DOXY_VALUE; + } } } } @@ -725,8 +919,9 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 'c') { if (s[3].unicode() == 'h') { if (s[4].unicode() == 'o') { - if (s[5].unicode() == 'r') + if (s[5].unicode() == 'r') { return T_DOXY_ANCHOR; + } } } } @@ -735,8 +930,9 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 't') { if (s[3].unicode() == 'h') { if (s[4].unicode() == 'o') { - if (s[5].unicode() == 'r') + if (s[5].unicode() == 'r') { return T_DOXY_AUTHOR; + } } } } @@ -747,8 +943,9 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 'm') { if (s[3].unicode() == 'p') { if (s[4].unicode() == 'a') { - if (s[5].unicode() == 't') + if (s[5].unicode() == 't') { return T_DOXY_COMPAT; + } } } } @@ -759,8 +956,9 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 's') { if (s[3].unicode() == 'e') { if (s[4].unicode() == 'i') { - if (s[5].unicode() == 'f') + if (s[5].unicode() == 'f') { return T_DOXY_ELSEIF; + } } } } @@ -769,14 +967,30 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 'd') { if (s[3].unicode() == 'd') { if (s[4].unicode() == 'o') { - if (s[5].unicode() == 't') + if (s[5].unicode() == 't') { return T_DOXY_ENDDOT; + } + } + } + else if (s[3].unicode() == 'm') { + if (s[4].unicode() == 's') { + if (s[5].unicode() == 'c') { + return T_DOXY_ENDMSC; + } } } else if (s[3].unicode() == 'r') { if (s[4].unicode() == 'a') { - if (s[5].unicode() == 'w') + if (s[5].unicode() == 'w') { return T_DOXY_ENDRAW; + } + } + } + else if (s[3].unicode() == 'u') { + if (s[4].unicode() == 'm') { + if (s[5].unicode() == 'l') { + return T_DOXY_ENDUML; + } } } } @@ -785,8 +999,9 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 'p') { if (s[3].unicode() == 'i') { if (s[4].unicode() == 'r') { - if (s[5].unicode() == 'e') + if (s[5].unicode() == 'e') { return T_DOXY_EXPIRE; + } } } } @@ -797,8 +1012,9 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 'a') { if (s[3].unicode() == 'd') { if (s[4].unicode() == 'e') { - if (s[5].unicode() == 'r') + if (s[5].unicode() == 'r') { return T_DOXY_HEADER; + } } } } @@ -809,8 +1025,9 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 'd') { if (s[3].unicode() == 'u') { if (s[4].unicode() == 'l') { - if (s[5].unicode() == 'e') + if (s[5].unicode() == 'e') { return T_DOXY_MODULE; + } } } } @@ -821,8 +1038,22 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 'e') { if (s[3].unicode() == 'n') { if (s[4].unicode() == 'g') { - if (s[5].unicode() == 'l') + if (s[5].unicode() == 'l') { return T_DOXY_OPENGL; + } + } + } + } + } + } + else if (s[0].unicode() == 'p') { + if (s[1].unicode() == 'u') { + if (s[2].unicode() == 'b') { + if (s[3].unicode() == 'l') { + if (s[4].unicode() == 'i') { + if (s[5].unicode() == 'c') { + return T_DOXY_PUBLIC; + } } } } @@ -830,17 +1061,37 @@ static inline int classify6(const QChar *s) { } else if (s[0].unicode() == 'r') { if (s[1].unicode() == 'e') { - if (s[2].unicode() == 't') { + if (s[2].unicode() == 'm') { + if (s[3].unicode() == 'a') { + if (s[4].unicode() == 'r') { + if (s[5].unicode() == 'k') { + return T_DOXY_REMARK; + } + } + } + } + else if (s[2].unicode() == 's') { + if (s[3].unicode() == 'u') { + if (s[4].unicode() == 'l') { + if (s[5].unicode() == 't') { + return T_DOXY_RESULT; + } + } + } + } + else if (s[2].unicode() == 't') { if (s[3].unicode() == 'u') { if (s[4].unicode() == 'r') { - if (s[5].unicode() == 'n') + if (s[5].unicode() == 'n') { return T_DOXY_RETURN; + } } } else if (s[3].unicode() == 'v') { if (s[4].unicode() == 'a') { - if (s[5].unicode() == 'l') + if (s[5].unicode() == 'l') { return T_DOXY_RETVAL; + } } } } @@ -851,8 +1102,9 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 'i') { if (s[3].unicode() == 'p') { if (s[4].unicode() == 't') { - if (s[5].unicode() == 'o') + if (s[5].unicode() == 'o') { return T_DOXY_SKIPTO; + } } } } @@ -861,8 +1113,9 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 'r') { if (s[3].unicode() == 'u') { if (s[4].unicode() == 'c') { - if (s[5].unicode() == 't') + if (s[5].unicode() == 't') { return T_DOXY_STRUCT; + } } } } @@ -873,8 +1126,9 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 'r') { if (s[3].unicode() == 'g') { if (s[4].unicode() == 'e') { - if (s[5].unicode() == 't') + if (s[5].unicode() == 't') { return T_DOXY_TARGET; + } } } } @@ -883,8 +1137,20 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 'r') { if (s[3].unicode() == 'o') { if (s[4].unicode() == 'w') { - if (s[5].unicode() == 's') + if (s[5].unicode() == 's') { return T_DOXY_THROWS; + } + } + } + } + } + else if (s[1].unicode() == 'p') { + if (s[2].unicode() == 'a') { + if (s[3].unicode() == 'r') { + if (s[4].unicode() == 'a') { + if (s[5].unicode() == 'm') { + return T_DOXY_TPARAM; + } } } } @@ -895,8 +1161,9 @@ static inline int classify6(const QChar *s) { if (s[2].unicode() == 'b') { if (s[3].unicode() == 'k') { if (s[4].unicode() == 'i') { - if (s[5].unicode() == 't') + if (s[5].unicode() == 't') { return T_DOXY_WEBKIT; + } } } } @@ -906,14 +1173,30 @@ static inline int classify6(const QChar *s) { } static inline int classify7(const QChar *s) { - if (s[0].unicode() == 'b') { + if (s[0].unicode() == 'a') { + if (s[1].unicode() == 'u') { + if (s[2].unicode() == 't') { + if (s[3].unicode() == 'h') { + if (s[4].unicode() == 'o') { + if (s[5].unicode() == 'r') { + if (s[6].unicode() == 's') { + return T_DOXY_AUTHORS; + } + } + } + } + } + } + } + else if (s[0].unicode() == 'b') { if (s[1].unicode() == 'a') { if (s[2].unicode() == 'd') { if (s[3].unicode() == 'c') { if (s[4].unicode() == 'o') { if (s[5].unicode() == 'd') { - if (s[6].unicode() == 'e') + if (s[6].unicode() == 'e') { return T_DOXY_BADCODE; + } } } } @@ -926,8 +1209,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 't') { if (s[4].unicode() == 'i') { if (s[5].unicode() == 'o') { - if (s[6].unicode() == 'n') + if (s[6].unicode() == 'n') { return T_DOXY_CAPTION; + } } } } @@ -938,8 +1222,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'p') { if (s[4].unicode() == 't') { if (s[5].unicode() == 'e') { - if (s[6].unicode() == 'r') + if (s[6].unicode() == 'r') { return T_DOXY_CHAPTER; + } } } } @@ -950,8 +1235,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'y') { if (s[4].unicode() == 'd') { if (s[5].unicode() == 'o') { - if (s[6].unicode() == 'c') + if (s[6].unicode() == 'c') { return T_DOXY_COPYDOC; + } } } } @@ -960,8 +1246,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'e') { if (s[4].unicode() == 'l') { if (s[5].unicode() == 'i') { - if (s[6].unicode() == 'b') + if (s[6].unicode() == 'b') { return T_DOXY_CORELIB; + } } } } @@ -969,13 +1256,51 @@ static inline int classify7(const QChar *s) { } } else if (s[0].unicode() == 'd') { - if (s[1].unicode() == 'o') { + if (s[1].unicode() == 'e') { + if (s[2].unicode() == 'f') { + if (s[3].unicode() == 'a') { + if (s[4].unicode() == 'u') { + if (s[5].unicode() == 'l') { + if (s[6].unicode() == 't') { + return T_DOXY_DEFAULT; + } + } + } + } + } + else if (s[2].unicode() == 't') { + if (s[3].unicode() == 'a') { + if (s[4].unicode() == 'i') { + if (s[5].unicode() == 'l') { + if (s[6].unicode() == 's') { + return T_DOXY_DETAILS; + } + } + } + } + } + } + else if (s[1].unicode() == 'i') { + if (s[2].unicode() == 'a') { + if (s[3].unicode() == 'f') { + if (s[4].unicode() == 'i') { + if (s[5].unicode() == 'l') { + if (s[6].unicode() == 'e') { + return T_DOXY_DIAFILE; + } + } + } + } + } + } + else if (s[1].unicode() == 'o') { if (s[2].unicode() == 't') { if (s[3].unicode() == 'f') { if (s[4].unicode() == 'i') { if (s[5].unicode() == 'l') { - if (s[6].unicode() == 'e') + if (s[6].unicode() == 'e') { return T_DOXY_DOTFILE; + } } } } @@ -988,40 +1313,46 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'c') { if (s[4].unicode() == 'o') { if (s[5].unicode() == 'd') { - if (s[6].unicode() == 'e') + if (s[6].unicode() == 'e') { return T_DOXY_ENDCODE; + } } else if (s[5].unicode() == 'n') { - if (s[6].unicode() == 'd') + if (s[6].unicode() == 'd') { return T_DOXY_ENDCOND; + } } } } else if (s[3].unicode() == 'l') { if (s[4].unicode() == 'i') { if (s[5].unicode() == 'n') { - if (s[6].unicode() == 'k') + if (s[6].unicode() == 'k') { return T_DOXY_ENDLINK; + } } else if (s[5].unicode() == 's') { - if (s[6].unicode() == 't') + if (s[6].unicode() == 't') { return T_DOXY_ENDLIST; + } } } } else if (s[3].unicode() == 'o') { if (s[4].unicode() == 'm') { if (s[5].unicode() == 'i') { - if (s[6].unicode() == 't') + if (s[6].unicode() == 't') { return T_DOXY_ENDOMIT; + } } } } else if (s[3].unicode() == 'p') { if (s[4].unicode() == 'a') { if (s[5].unicode() == 'r') { - if (s[6].unicode() == 't') + if (s[6].unicode() == 't') { return T_DOXY_ENDPART; + } } } } @@ -1032,8 +1363,20 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'm') { if (s[4].unicode() == 'p') { if (s[5].unicode() == 'l') { - if (s[6].unicode() == 'e') + if (s[6].unicode() == 'e') { return T_DOXY_EXAMPLE; + } + } + } + } + } + else if (s[2].unicode() == 't') { + if (s[3].unicode() == 'e') { + if (s[4].unicode() == 'n') { + if (s[5].unicode() == 'd') { + if (s[6].unicode() == 's') { + return T_DOXY_EXTENDS; + } } } } @@ -1046,8 +1389,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'l') { if (s[4].unicode() == 'u') { if (s[5].unicode() == 'd') { - if (s[6].unicode() == 'e') + if (s[6].unicode() == 'e') { return T_DOXY_INCLUDE; + } } } } @@ -1056,8 +1400,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'r') { if (s[4].unicode() == 'o') { if (s[5].unicode() == 'u') { - if (s[6].unicode() == 'p') + if (s[6].unicode() == 'p') { return T_DOXY_INGROUP; + } } } } @@ -1070,8 +1415,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'w') { if (s[4].unicode() == 'o') { if (s[5].unicode() == 'r') { - if (s[6].unicode() == 'd') + if (s[6].unicode() == 'd') { return T_DOXY_KEYWORD; + } } } } @@ -1084,8 +1430,22 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'o') { if (s[4].unicode() == 'n') { if (s[5].unicode() == 'l') { - if (s[6].unicode() == 'y') + if (s[6].unicode() == 'y') { return T_DOXY_MANONLY; + } + } + } + } + } + } + else if (s[1].unicode() == 's') { + if (s[2].unicode() == 'c') { + if (s[3].unicode() == 'f') { + if (s[4].unicode() == 'i') { + if (s[5].unicode() == 'l') { + if (s[6].unicode() == 'e') { + return T_DOXY_MSCFILE; + } } } } @@ -1098,8 +1458,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'w') { if (s[4].unicode() == 'o') { if (s[5].unicode() == 'r') { - if (s[6].unicode() == 'k') + if (s[6].unicode() == 'k') { return T_DOXY_NETWORK; + } } } } @@ -1108,8 +1469,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'c') { if (s[4].unicode() == 'o') { if (s[5].unicode() == 'd') { - if (s[6].unicode() == 'e') + if (s[6].unicode() == 'e') { return T_DOXY_NEWCODE; + } } } } @@ -1122,8 +1484,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'c') { if (s[4].unicode() == 'o') { if (s[5].unicode() == 'd') { - if (s[6].unicode() == 'e') + if (s[6].unicode() == 'e') { return T_DOXY_OLDCODE; + } } } } @@ -1136,8 +1499,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'k') { if (s[4].unicode() == 'a') { if (s[5].unicode() == 'g') { - if (s[6].unicode() == 'e') + if (s[6].unicode() == 'e') { return T_DOXY_PACKAGE; + } } } } @@ -1148,8 +1512,33 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'n') { if (s[4].unicode() == 't') { if (s[5].unicode() == 't') { - if (s[6].unicode() == 'o') + if (s[6].unicode() == 'o') { return T_DOXY_PRINTTO; + } + } + } + } + else if (s[3].unicode() == 'v') { + if (s[4].unicode() == 'a') { + if (s[5].unicode() == 't') { + if (s[6].unicode() == 'e') { + return T_DOXY_PRIVATE; + } + } + } + } + } + } + } + else if (s[0].unicode() == 'q') { + if (s[1].unicode() == 'm') { + if (s[2].unicode() == 'l') { + if (s[3].unicode() == 't') { + if (s[4].unicode() == 'y') { + if (s[5].unicode() == 'p') { + if (s[6].unicode() == 'e') { + return T_DOXY_QMLTYPE; + } } } } @@ -1158,12 +1547,27 @@ static inline int classify7(const QChar *s) { } else if (s[0].unicode() == 'r') { if (s[1].unicode() == 'e') { - if (s[2].unicode() == 'l') { + if (s[2].unicode() == 'f') { + if (s[3].unicode() == 'i') { + if (s[4].unicode() == 't') { + if (s[5].unicode() == 'e') { + if (s[6].unicode() == 'm') { + return T_DOXY_REFITEM; + } + } + } + } + } + else if (s[2].unicode() == 'l') { if (s[3].unicode() == 'a') { if (s[4].unicode() == 't') { if (s[5].unicode() == 'e') { - if (s[6].unicode() == 's') + if (s[6].unicode() == 'd') { + return T_DOXY_RELATED; + } + else if (s[6].unicode() == 's') { return T_DOXY_RELATES; + } } } } @@ -1172,8 +1576,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'a') { if (s[4].unicode() == 'r') { if (s[5].unicode() == 'k') { - if (s[6].unicode() == 's') + if (s[6].unicode() == 's') { return T_DOXY_REMARKS; + } } } } @@ -1182,8 +1587,22 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'u') { if (s[4].unicode() == 'r') { if (s[5].unicode() == 'n') { - if (s[6].unicode() == 's') + if (s[6].unicode() == 's') { return T_DOXY_RETURNS; + } + } + } + } + } + } + else if (s[1].unicode() == 't') { + if (s[2].unicode() == 'f') { + if (s[3].unicode() == 'o') { + if (s[4].unicode() == 'n') { + if (s[5].unicode() == 'l') { + if (s[6].unicode() == 'y') { + return T_DOXY_RTFONLY; + } } } } @@ -1196,8 +1615,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 't') { if (s[4].unicode() == 'i') { if (s[5].unicode() == 'o') { - if (s[6].unicode() == 'n') + if (s[6].unicode() == 'n') { return T_DOXY_SECTION; + } } } } @@ -1206,8 +1626,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'v') { if (s[4].unicode() == 'i') { if (s[5].unicode() == 'c') { - if (s[6].unicode() == 'e') + if (s[6].unicode() == 'e') { return T_DOXY_SERVICE; + } } } } @@ -1218,8 +1639,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'e') { if (s[4].unicode() == 'b') { if (s[5].unicode() == 'a') { - if (s[6].unicode() == 'r') + if (s[6].unicode() == 'r') { return T_DOXY_SIDEBAR; + } } } } @@ -1230,8 +1652,22 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'p') { if (s[4].unicode() == 'p') { if (s[5].unicode() == 'e') { - if (s[6].unicode() == 't') + if (s[6].unicode() == 't') { return T_DOXY_SNIPPET; + } + } + } + } + } + } + else if (s[1].unicode() == 'u') { + if (s[2].unicode() == 'b') { + if (s[3].unicode() == 'p') { + if (s[4].unicode() == 'a') { + if (s[5].unicode() == 'g') { + if (s[6].unicode() == 'e') { + return T_DOXY_SUBPAGE; + } } } } @@ -1244,8 +1680,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'e') { if (s[4].unicode() == 'd') { if (s[5].unicode() == 'e') { - if (s[6].unicode() == 'f') + if (s[6].unicode() == 'f') { return T_DOXY_TYPEDEF; + } } } } @@ -1258,8 +1695,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'o') { if (s[4].unicode() == 'o') { if (s[5].unicode() == 'l') { - if (s[6].unicode() == 's') + if (s[6].unicode() == 's') { return T_DOXY_UITOOLS; + } } } } @@ -1270,8 +1708,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'c') { if (s[4].unicode() == 'o') { if (s[5].unicode() == 'd') { - if (s[6].unicode() == 'e') + if (s[6].unicode() == 'e') { return T_DOXY_UNICODE; + } } } } @@ -1284,8 +1723,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 's') { if (s[4].unicode() == 'i') { if (s[5].unicode() == 'o') { - if (s[6].unicode() == 'n') + if (s[6].unicode() == 'n') { return T_DOXY_VERSION; + } } } } @@ -1298,8 +1738,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'n') { if (s[4].unicode() == 'i') { if (s[5].unicode() == 'n') { - if (s[6].unicode() == 'g') + if (s[6].unicode() == 'g') { return T_DOXY_WARNING; + } } } } @@ -1312,8 +1753,9 @@ static inline int classify7(const QChar *s) { if (s[3].unicode() == 'o') { if (s[4].unicode() == 'n') { if (s[5].unicode() == 'l') { - if (s[6].unicode() == 'y') + if (s[6].unicode() == 'y') { return T_DOXY_XMLONLY; + } } } } @@ -1331,8 +1773,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'r') { if (s[5].unicode() == 'a') { if (s[6].unicode() == 'c') { - if (s[7].unicode() == 't') + if (s[7].unicode() == 't') { return T_DOXY_ABSTRACT; + } } } } @@ -1345,8 +1788,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'n') { if (s[5].unicode() == 'd') { if (s[6].unicode() == 'e') { - if (s[7].unicode() == 'x') + if (s[7].unicode() == 'x') { return T_DOXY_ADDINDEX; + } } } } @@ -1361,8 +1805,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'n') { if (s[5].unicode() == 'a') { if (s[6].unicode() == 'm') { - if (s[7].unicode() == 'e') + if (s[7].unicode() == 'e') { return T_DOXY_BASENAME; + } } } } @@ -1371,14 +1816,30 @@ static inline int classify8(const QChar *s) { } } else if (s[0].unicode() == 'c') { - if (s[1].unicode() == 'o') { + if (s[1].unicode() == 'a') { + if (s[2].unicode() == 't') { + if (s[3].unicode() == 'e') { + if (s[4].unicode() == 'g') { + if (s[5].unicode() == 'o') { + if (s[6].unicode() == 'r') { + if (s[7].unicode() == 'y') { + return T_DOXY_CATEGORY; + } + } + } + } + } + } + } + else if (s[1].unicode() == 'o') { if (s[2].unicode() == 'd') { if (s[3].unicode() == 'e') { if (s[4].unicode() == 'l') { if (s[5].unicode() == 'i') { if (s[6].unicode() == 'n') { - if (s[7].unicode() == 'e') + if (s[7].unicode() == 'e') { return T_DOXY_CODELINE; + } } } } @@ -1393,8 +1854,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'r') { if (s[5].unicode() == 'o') { if (s[6].unicode() == 'u') { - if (s[7].unicode() == 'p') + if (s[7].unicode() == 'p') { return T_DOXY_DEFGROUP; + } } } } @@ -1409,8 +1871,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'a') { if (s[5].unicode() == 'b') { if (s[6].unicode() == 'l') { - if (s[7].unicode() == 'e') + if (s[7].unicode() == 'e') { return T_DOXY_ENDTABLE; + } } } } @@ -1425,8 +1888,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'n') { if (s[5].unicode() == 'o') { if (s[6].unicode() == 't') { - if (s[7].unicode() == 'e') + if (s[7].unicode() == 'e') { return T_DOXY_FOOTNOTE; + } } } } @@ -1441,8 +1905,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'o') { if (s[5].unicode() == 'n') { if (s[6].unicode() == 'l') { - if (s[7].unicode() == 'y') + if (s[7].unicode() == 'y') { return T_DOXY_HTMLONLY; + } } } } @@ -1452,13 +1917,27 @@ static inline int classify8(const QChar *s) { } else if (s[0].unicode() == 'i') { if (s[1].unicode() == 'n') { - if (s[2].unicode() == 'm') { + if (s[2].unicode() == 'h') { + if (s[3].unicode() == 'e') { + if (s[4].unicode() == 'r') { + if (s[5].unicode() == 'i') { + if (s[6].unicode() == 't') { + if (s[7].unicode() == 's') { + return T_DOXY_INHERITS; + } + } + } + } + } + } + else if (s[2].unicode() == 'm') { if (s[3].unicode() == 'o') { if (s[4].unicode() == 'd') { if (s[5].unicode() == 'u') { if (s[6].unicode() == 'l') { - if (s[7].unicode() == 'e') + if (s[7].unicode() == 'e') { return T_DOXY_INMODULE; + } } } } @@ -1469,8 +1948,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'r') { if (s[5].unicode() == 'n') { if (s[6].unicode() == 'a') { - if (s[7].unicode() == 'l') + if (s[7].unicode() == 'l') { return T_DOXY_INTERNAL; + } } } } @@ -1485,8 +1965,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'l') { if (s[5].unicode() == 'e') { if (s[6].unicode() == 's') { - if (s[7].unicode() == 'e') + if (s[7].unicode() == 'e') { return T_DOXY_LEGALESE; + } } } } @@ -1501,8 +1982,24 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'p') { if (s[5].unicode() == 'a') { if (s[6].unicode() == 'g') { - if (s[7].unicode() == 'e') + if (s[7].unicode() == 'e') { return T_DOXY_MAINPAGE; + } + } + } + } + } + } + } + else if (s[1].unicode() == 'e') { + if (s[2].unicode() == 'm') { + if (s[3].unicode() == 'b') { + if (s[4].unicode() == 'e') { + if (s[5].unicode() == 'r') { + if (s[6].unicode() == 'o') { + if (s[7].unicode() == 'f') { + return T_DOXY_MEMBEROF; + } } } } @@ -1517,8 +2014,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'p') { if (s[5].unicode() == 'a') { if (s[6].unicode() == 'g') { - if (s[7].unicode() == 'e') + if (s[7].unicode() == 'e') { return T_DOXY_NEXTPAGE; + } } } } @@ -1533,8 +2031,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'l') { if (s[5].unicode() == 'e') { if (s[6].unicode() == 't') { - if (s[7].unicode() == 'e') + if (s[7].unicode() == 'e') { return T_DOXY_OBSOLETE; + } } } } @@ -1547,8 +2046,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'l') { if (s[5].unicode() == 'o') { if (s[6].unicode() == 'a') { - if (s[7].unicode() == 'd') + if (s[7].unicode() == 'd') { return T_DOXY_OVERLOAD; + } } } } @@ -1557,14 +2057,41 @@ static inline int classify8(const QChar *s) { } } else if (s[0].unicode() == 'p') { - if (s[1].unicode() == 'r') { + if (s[1].unicode() == 'a') { + if (s[2].unicode() == 'r') { + if (s[3].unicode() == 'b') { + if (s[4].unicode() == 'l') { + if (s[5].unicode() == 'o') { + if (s[6].unicode() == 'c') { + if (s[7].unicode() == 'k') { + return T_DOXY_PARBLOCK; + } + } + } + } + } + } + } + else if (s[1].unicode() == 'r') { if (s[2].unicode() == 'o') { if (s[3].unicode() == 'p') { if (s[4].unicode() == 'e') { if (s[5].unicode() == 'r') { if (s[6].unicode() == 't') { - if (s[7].unicode() == 'y') + if (s[7].unicode() == 'y') { return T_DOXY_PROPERTY; + } + } + } + } + } + else if (s[3].unicode() == 't') { + if (s[4].unicode() == 'o') { + if (s[5].unicode() == 'c') { + if (s[6].unicode() == 'o') { + if (s[7].unicode() == 'l') { + return T_DOXY_PROTOCOL; + } } } } @@ -1573,14 +2100,30 @@ static inline int classify8(const QChar *s) { } } else if (s[0].unicode() == 'q') { - if (s[1].unicode() == 't') { + if (s[1].unicode() == 'm') { + if (s[2].unicode() == 'l') { + if (s[3].unicode() == 'c') { + if (s[4].unicode() == 'l') { + if (s[5].unicode() == 'a') { + if (s[6].unicode() == 's') { + if (s[7].unicode() == 's') { + return T_DOXY_QMLCLASS; + } + } + } + } + } + } + } + else if (s[1].unicode() == 't') { if (s[2].unicode() == 'e') { if (s[3].unicode() == 's') { if (s[4].unicode() == 't') { if (s[5].unicode() == 'l') { if (s[6].unicode() == 'i') { - if (s[7].unicode() == 'b') + if (s[7].unicode() == 'b') { return T_DOXY_QTESTLIB; + } } } } @@ -1595,14 +2138,18 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'i') { if (s[5].unicode() == 'o') { if (s[6].unicode() == 'n') { - if (s[7].unicode() == '1') + if (s[7].unicode() == '1') { return T_DOXY_SECTION1; - else if (s[7].unicode() == '2') + } + else if (s[7].unicode() == '2') { return T_DOXY_SECTION2; - else if (s[7].unicode() == '3') + } + else if (s[7].unicode() == '3') { return T_DOXY_SECTION3; - else if (s[7].unicode() == '4') + } + else if (s[7].unicode() == '4') { return T_DOXY_SECTION4; + } } } } @@ -1615,8 +2162,24 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'l') { if (s[5].unicode() == 'i') { if (s[6].unicode() == 'n') { - if (s[7].unicode() == 'e') + if (s[7].unicode() == 'e') { return T_DOXY_SKIPLINE; + } + } + } + } + } + } + } + else if (s[1].unicode() == 't') { + if (s[2].unicode() == 'a') { + if (s[3].unicode() == 'r') { + if (s[4].unicode() == 't') { + if (s[5].unicode() == 'u') { + if (s[6].unicode() == 'm') { + if (s[7].unicode() == 'l') { + return T_DOXY_STARTUML; + } } } } @@ -1629,8 +2192,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'i') { if (s[5].unicode() == 't') { if (s[6].unicode() == 'l') { - if (s[7].unicode() == 'e') + if (s[7].unicode() == 'e') { return T_DOXY_SUBTITLE; + } } } } @@ -1645,8 +2209,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'a') { if (s[5].unicode() == 'b') { if (s[6].unicode() == 'l') { - if (s[7].unicode() == 'e') + if (s[7].unicode() == 'e') { return T_DOXY_VARIABLE; + } } } } @@ -1659,8 +2224,24 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'a') { if (s[5].unicode() == 't') { if (s[6].unicode() == 'i') { - if (s[7].unicode() == 'm') + if (s[7].unicode() == 'm') { return T_DOXY_VERBATIM; + } + } + } + } + } + } + } + else if (s[1].unicode() == 'h') { + if (s[2].unicode() == 'd') { + if (s[3].unicode() == 'l') { + if (s[4].unicode() == 'f') { + if (s[5].unicode() == 'l') { + if (s[6].unicode() == 'o') { + if (s[7].unicode() == 'w') { + return T_DOXY_VHDLFLOW; + } } } } @@ -1675,8 +2256,9 @@ static inline int classify8(const QChar *s) { if (s[4].unicode() == 'i') { if (s[5].unicode() == 't') { if (s[6].unicode() == 'e') { - if (s[7].unicode() == 'm') + if (s[7].unicode() == 'm') { return T_DOXY_XREFITEM; + } } } } @@ -1696,8 +2278,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 't') { if (s[6].unicode() == 'i') { if (s[7].unicode() == 'o') { - if (s[8].unicode() == 'n') + if (s[8].unicode() == 'n') { return T_DOXY_ATTENTION; + } } } } @@ -1714,8 +2297,37 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'r') { if (s[6].unicode() == 'a') { if (s[7].unicode() == 'p') { - if (s[8].unicode() == 'h') + if (s[8].unicode() == 'h') { return T_DOXY_CALLGRAPH; + } + } + } + } + } + } + } + } + else if (s[1].unicode() == 'o') { + if (s[2].unicode() == 'p') { + if (s[3].unicode() == 'y') { + if (s[4].unicode() == 'b') { + if (s[5].unicode() == 'r') { + if (s[6].unicode() == 'i') { + if (s[7].unicode() == 'e') { + if (s[8].unicode() == 'f') { + return T_DOXY_COPYBRIEF; + } + } + } + } + } + else if (s[4].unicode() == 'r') { + if (s[5].unicode() == 'i') { + if (s[6].unicode() == 'g') { + if (s[7].unicode() == 'h') { + if (s[8].unicode() == 't') { + return T_DOXY_COPYRIGHT; + } } } } @@ -1732,8 +2344,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 't') { if (s[6].unicode() == 'i') { if (s[7].unicode() == 'o') { - if (s[8].unicode() == 'n') + if (s[8].unicode() == 'n') { return T_DOXY_EXCEPTION; + } } } } @@ -1743,15 +2356,33 @@ static inline int classify9(const QChar *s) { } } else if (s[0].unicode() == 'i') { - if (s[1].unicode() == 'n') { + if (s[1].unicode() == 'd') { + if (s[2].unicode() == 'l') { + if (s[3].unicode() == 'e') { + if (s[4].unicode() == 'x') { + if (s[5].unicode() == 'c') { + if (s[6].unicode() == 'e') { + if (s[7].unicode() == 'p') { + if (s[8].unicode() == 't') { + return T_DOXY_IDLEXCEPT; + } + } + } + } + } + } + } + } + else if (s[1].unicode() == 'n') { if (s[2].unicode() == 'd') { if (s[3].unicode() == 'e') { if (s[4].unicode() == 'x') { if (s[5].unicode() == 'p') { if (s[6].unicode() == 'a') { if (s[7].unicode() == 'g') { - if (s[8].unicode() == 'e') + if (s[8].unicode() == 'e') { return T_DOXY_INDEXPAGE; + } } } } @@ -1764,8 +2395,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'f') { if (s[6].unicode() == 'a') { if (s[7].unicode() == 'c') { - if (s[8].unicode() == 'e') + if (s[8].unicode() == 'e') { return T_DOXY_INTERFACE; + } } } } @@ -1778,8 +2410,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'i') { if (s[6].unicode() == 'a') { if (s[7].unicode() == 'n') { - if (s[8].unicode() == 't') + if (s[8].unicode() == 't') { return T_DOXY_INVARIANT; + } } } } @@ -1796,8 +2429,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'o') { if (s[6].unicode() == 'n') { if (s[7].unicode() == 'l') { - if (s[8].unicode() == 'y') + if (s[8].unicode() == 'y') { return T_DOXY_LATEXONLY; + } } } } @@ -1814,8 +2448,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'l') { if (s[6].unicode() == 'a') { if (s[7].unicode() == 's') { - if (s[8].unicode() == 's') + if (s[8].unicode() == 's') { return T_DOXY_MAINCLASS; + } } } } @@ -1832,8 +2467,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'p') { if (s[6].unicode() == 'a') { if (s[7].unicode() == 'c') { - if (s[8].unicode() == 'e') + if (s[8].unicode() == 'e') { return T_DOXY_NAMESPACE; + } } } } @@ -1850,8 +2486,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'a') { if (s[6].unicode() == 'l') { if (s[7].unicode() == 'u') { - if (s[8].unicode() == 'e') + if (s[8].unicode() == 'e') { return T_DOXY_OMITVALUE; + } } } } @@ -1868,8 +2505,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'r') { if (s[6].unicode() == 'a') { if (s[7].unicode() == 'p') { - if (s[8].unicode() == 'h') + if (s[8].unicode() == 'h') { return T_DOXY_PARAGRAPH; + } } } } @@ -1884,8 +2522,24 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'l') { if (s[6].unicode() == 'i') { if (s[7].unicode() == 'n') { - if (s[8].unicode() == 'e') + if (s[8].unicode() == 'e') { return T_DOXY_PRINTLINE; + } + } + } + } + } + } + } + else if (s[2].unicode() == 'o') { + if (s[3].unicode() == 't') { + if (s[4].unicode() == 'e') { + if (s[5].unicode() == 'c') { + if (s[6].unicode() == 't') { + if (s[7].unicode() == 'e') { + if (s[8].unicode() == 'd') { + return T_DOXY_PROTECTED; + } } } } @@ -1895,15 +2549,57 @@ static inline int classify9(const QChar *s) { } } else if (s[0].unicode() == 'q') { - if (s[1].unicode() == 'u') { + if (s[1].unicode() == 'm') { + if (s[2].unicode() == 'l') { + if (s[3].unicode() == 'm') { + if (s[4].unicode() == 'e') { + if (s[5].unicode() == 't') { + if (s[6].unicode() == 'h') { + if (s[7].unicode() == 'o') { + if (s[8].unicode() == 'd') { + return T_DOXY_QMLMETHOD; + } + } + } + } + } + else if (s[4].unicode() == 'o') { + if (s[5].unicode() == 'd') { + if (s[6].unicode() == 'u') { + if (s[7].unicode() == 'l') { + if (s[8].unicode() == 'e') { + return T_DOXY_QMLMODULE; + } + } + } + } + } + } + else if (s[3].unicode() == 's') { + if (s[4].unicode() == 'i') { + if (s[5].unicode() == 'g') { + if (s[6].unicode() == 'n') { + if (s[7].unicode() == 'a') { + if (s[8].unicode() == 'l') { + return T_DOXY_QMLSIGNAL; + } + } + } + } + } + } + } + } + else if (s[1].unicode() == 'u') { if (s[2].unicode() == 'o') { if (s[3].unicode() == 't') { if (s[4].unicode() == 'a') { if (s[5].unicode() == 't') { if (s[6].unicode() == 'i') { if (s[7].unicode() == 'o') { - if (s[8].unicode() == 'n') + if (s[8].unicode() == 'n') { return T_DOXY_QUOTATION; + } } } } @@ -1912,8 +2608,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'f') { if (s[6].unicode() == 'i') { if (s[7].unicode() == 'l') { - if (s[8].unicode() == 'e') + if (s[8].unicode() == 'e') { return T_DOXY_QUOTEFILE; + } } } } @@ -1930,8 +2627,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'r') { if (s[6].unicode() == 'a') { if (s[7].unicode() == 'n') { - if (s[8].unicode() == 't') + if (s[8].unicode() == 't') { return T_DOXY_REENTRANT; + } } } } @@ -1948,8 +2646,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'n') { if (s[6].unicode() == 't') { if (s[7].unicode() == 'i') { - if (s[8].unicode() == 'l') + if (s[8].unicode() == 'l') { return T_DOXY_SKIPUNTIL; + } } } } @@ -1964,8 +2663,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'p') { if (s[6].unicode() == 'a') { if (s[7].unicode() == 'g') { - if (s[8].unicode() == 'e') + if (s[8].unicode() == 'e') { return T_DOXY_STARTPAGE; + } } } } @@ -1975,15 +2675,33 @@ static inline int classify9(const QChar *s) { } } else if (s[0].unicode() == 'u') { - if (s[1].unicode() == 'n') { + if (s[1].unicode() == 'i') { + if (s[2].unicode() == 'c') { + if (s[3].unicode() == 'o') { + if (s[4].unicode() == 'n') { + if (s[5].unicode() == 't') { + if (s[6].unicode() == 'r') { + if (s[7].unicode() == 'o') { + if (s[8].unicode() == 'l') { + return T_DOXY_UICONTROL; + } + } + } + } + } + } + } + } + else if (s[1].unicode() == 'n') { if (s[2].unicode() == 'd') { if (s[3].unicode() == 'e') { if (s[4].unicode() == 'r') { if (s[5].unicode() == 'l') { if (s[6].unicode() == 'i') { if (s[7].unicode() == 'n') { - if (s[8].unicode() == 'e') + if (s[8].unicode() == 'e') { return T_DOXY_UNDERLINE; + } } } } @@ -2000,8 +2718,9 @@ static inline int classify9(const QChar *s) { if (s[5].unicode() == 'r') { if (s[6].unicode() == 'o') { if (s[7].unicode() == 'u') { - if (s[8].unicode() == 'p') + if (s[8].unicode() == 'p') { return T_DOXY_WEAKGROUP; + } } } } @@ -2023,8 +2742,9 @@ static inline int classify10(const QChar *s) { if (s[6].unicode() == 'r') { if (s[7].unicode() == 'o') { if (s[8].unicode() == 'u') { - if (s[9].unicode() == 'p') + if (s[9].unicode() == 'p') { return T_DOXY_ADDTOGROUP; + } } } } @@ -2043,8 +2763,9 @@ static inline int classify10(const QChar *s) { if (s[6].unicode() == 'a') { if (s[7].unicode() == 't') { if (s[8].unicode() == 'e') { - if (s[9].unicode() == 'd') + if (s[9].unicode() == 'd') { return T_DOXY_DEPRECATED; + } } } } @@ -2063,8 +2784,9 @@ static inline int classify10(const QChar *s) { if (s[6].unicode() == 'p') { if (s[7].unicode() == 't') { if (s[8].unicode() == 'e') { - if (s[9].unicode() == 'r') + if (s[9].unicode() == 'r') { return T_DOXY_ENDCHAPTER; + } } } } @@ -2077,8 +2799,24 @@ static inline int classify10(const QChar *s) { if (s[6].unicode() == 'o') { if (s[7].unicode() == 'n') { if (s[8].unicode() == 'l') { - if (s[9].unicode() == 'y') + if (s[9].unicode() == 'y') { return T_DOXY_ENDMANONLY; + } + } + } + } + } + } + } + else if (s[3].unicode() == 'r') { + if (s[4].unicode() == 't') { + if (s[5].unicode() == 'f') { + if (s[6].unicode() == 'o') { + if (s[7].unicode() == 'n') { + if (s[8].unicode() == 'l') { + if (s[9].unicode() == 'y') { + return T_DOXY_ENDRTFONLY; + } } } } @@ -2091,8 +2829,9 @@ static inline int classify10(const QChar *s) { if (s[6].unicode() == 'e') { if (s[7].unicode() == 'b') { if (s[8].unicode() == 'a') { - if (s[9].unicode() == 'r') + if (s[9].unicode() == 'r') { return T_DOXY_ENDSIDEBAR; + } } } } @@ -2105,8 +2844,9 @@ static inline int classify10(const QChar *s) { if (s[6].unicode() == 'o') { if (s[7].unicode() == 'n') { if (s[8].unicode() == 'l') { - if (s[9].unicode() == 'y') + if (s[9].unicode() == 'y') { return T_DOXY_ENDXMLONLY; + } } } } @@ -2123,8 +2863,9 @@ static inline int classify10(const QChar *s) { if (s[6].unicode() == 'i') { if (s[7].unicode() == 'o') { if (s[8].unicode() == 'n') { - if (s[9].unicode() == 's') + if (s[9].unicode() == 's') { return T_DOXY_EXCEPTIONS; + } } } } @@ -2143,8 +2884,51 @@ static inline int classify10(const QChar *s) { if (s[6].unicode() == 'f') { if (s[7].unicode() == 'i') { if (s[8].unicode() == 'l') { - if (s[9].unicode() == 'e') + if (s[9].unicode() == 'e') { return T_DOXY_HEADERFILE; + } + } + } + } + } + } + } + } + } + } + else if (s[0].unicode() == 'i') { + if (s[1].unicode() == 'm') { + if (s[2].unicode() == 'p') { + if (s[3].unicode() == 'l') { + if (s[4].unicode() == 'e') { + if (s[5].unicode() == 'm') { + if (s[6].unicode() == 'e') { + if (s[7].unicode() == 'n') { + if (s[8].unicode() == 't') { + if (s[9].unicode() == 's') { + return T_DOXY_IMPLEMENTS; + } + } + } + } + } + } + } + } + } + } + else if (s[0].unicode() == 'n') { + if (s[1].unicode() == 'o') { + if (s[2].unicode() == 'a') { + if (s[3].unicode() == 'u') { + if (s[4].unicode() == 't') { + if (s[5].unicode() == 'o') { + if (s[6].unicode() == 'l') { + if (s[7].unicode() == 'i') { + if (s[8].unicode() == 's') { + if (s[9].unicode() == 't') { + return T_DOXY_NOAUTOLIST; + } } } } @@ -2163,8 +2947,9 @@ static inline int classify10(const QChar *s) { if (s[6].unicode() == 'n') { if (s[7].unicode() == 't') { if (s[8].unicode() == 'i') { - if (s[9].unicode() == 'l') + if (s[9].unicode() == 'l') { return T_DOXY_PRINTUNTIL; + } } } } @@ -2183,8 +2968,9 @@ static inline int classify10(const QChar *s) { if (s[6].unicode() == 'p') { if (s[7].unicode() == 'o') { if (s[8].unicode() == 'r') { - if (s[9].unicode() == 't') + if (s[9].unicode() == 't') { return T_DOXY_QT3SUPPORT; + } } } } @@ -2195,7 +2981,26 @@ static inline int classify10(const QChar *s) { } } else if (s[0].unicode() == 's') { - if (s[1].unicode() == 'u') { + if (s[1].unicode() == 'e') { + if (s[2].unicode() == 'c') { + if (s[3].unicode() == 'r') { + if (s[4].unicode() == 'e') { + if (s[5].unicode() == 'f') { + if (s[6].unicode() == 'l') { + if (s[7].unicode() == 'i') { + if (s[8].unicode() == 's') { + if (s[9].unicode() == 't') { + return T_DOXY_SECREFLIST; + } + } + } + } + } + } + } + } + } + else if (s[1].unicode() == 'u') { if (s[2].unicode() == 'b') { if (s[3].unicode() == 's') { if (s[4].unicode() == 'e') { @@ -2203,8 +3008,9 @@ static inline int classify10(const QChar *s) { if (s[6].unicode() == 't') { if (s[7].unicode() == 'i') { if (s[8].unicode() == 'o') { - if (s[9].unicode() == 'n') + if (s[9].unicode() == 'n') { return T_DOXY_SUBSECTION; + } } } } @@ -2223,8 +3029,9 @@ static inline int classify10(const QChar *s) { if (s[6].unicode() == 's') { if (s[7].unicode() == 'a') { if (s[8].unicode() == 'f') { - if (s[9].unicode() == 'e') + if (s[9].unicode() == 'e') { return T_DOXY_THREADSAFE; + } } } } @@ -2238,9 +3045,72 @@ static inline int classify10(const QChar *s) { } static inline int classify11(const QChar *s) { - if (s[0].unicode() == 'd') { + if (s[0].unicode() == 'c') { + if (s[1].unicode() == 'a') { + if (s[2].unicode() == 'l') { + if (s[3].unicode() == 'l') { + if (s[4].unicode() == 'e') { + if (s[5].unicode() == 'r') { + if (s[6].unicode() == 'g') { + if (s[7].unicode() == 'r') { + if (s[8].unicode() == 'a') { + if (s[9].unicode() == 'p') { + if (s[10].unicode() == 'h') { + return T_DOXY_CALLERGRAPH; + } + } + } + } + } + } + } + } + } + } + else if (s[1].unicode() == 'o') { + if (s[2].unicode() == 'p') { + if (s[3].unicode() == 'y') { + if (s[4].unicode() == 'd') { + if (s[5].unicode() == 'e') { + if (s[6].unicode() == 't') { + if (s[7].unicode() == 'a') { + if (s[8].unicode() == 'i') { + if (s[9].unicode() == 'l') { + if (s[10].unicode() == 's') { + return T_DOXY_COPYDETAILS; + } + } + } + } + } + } + } + } + } + } + } + else if (s[0].unicode() == 'd') { if (s[1].unicode() == 'o') { - if (s[2].unicode() == 'n') { + if (s[2].unicode() == 'c') { + if (s[3].unicode() == 'b') { + if (s[4].unicode() == 'o') { + if (s[5].unicode() == 'o') { + if (s[6].unicode() == 'k') { + if (s[7].unicode() == 'o') { + if (s[8].unicode() == 'n') { + if (s[9].unicode() == 'l') { + if (s[10].unicode() == 'y') { + return T_DOXY_DOCBOOKONLY; + } + } + } + } + } + } + } + } + } + else if (s[2].unicode() == 'n') { if (s[3].unicode() == 't') { if (s[4].unicode() == 'i') { if (s[5].unicode() == 'n') { @@ -2248,8 +3118,9 @@ static inline int classify11(const QChar *s) { if (s[7].unicode() == 'l') { if (s[8].unicode() == 'u') { if (s[9].unicode() == 'd') { - if (s[10].unicode() == 'e') + if (s[10].unicode() == 'e') { return T_DOXY_DONTINCLUDE; + } } } } @@ -2270,8 +3141,9 @@ static inline int classify11(const QChar *s) { if (s[7].unicode() == 'r') { if (s[8].unicode() == 'a') { if (s[9].unicode() == 'c') { - if (s[10].unicode() == 't') + if (s[10].unicode() == 't') { return T_DOXY_ENDABSTRACT; + } } } } @@ -2286,8 +3158,9 @@ static inline int classify11(const QChar *s) { if (s[7].unicode() == 'n') { if (s[8].unicode() == 'o') { if (s[9].unicode() == 't') { - if (s[10].unicode() == 'e') + if (s[10].unicode() == 'e') { return T_DOXY_ENDFOOTNOTE; + } } } } @@ -2302,8 +3175,26 @@ static inline int classify11(const QChar *s) { if (s[7].unicode() == 'o') { if (s[8].unicode() == 'n') { if (s[9].unicode() == 'l') { - if (s[10].unicode() == 'y') + if (s[10].unicode() == 'y') { return T_DOXY_ENDHTMLONLY; + } + } + } + } + } + } + } + } + else if (s[3].unicode() == 'i') { + if (s[4].unicode() == 'n') { + if (s[5].unicode() == 't') { + if (s[6].unicode() == 'e') { + if (s[7].unicode() == 'r') { + if (s[8].unicode() == 'n') { + if (s[9].unicode() == 'a') { + if (s[10].unicode() == 'l') { + return T_DOXY_ENDINTERNAL; + } } } } @@ -2318,8 +3209,26 @@ static inline int classify11(const QChar *s) { if (s[7].unicode() == 'l') { if (s[8].unicode() == 'e') { if (s[9].unicode() == 's') { - if (s[10].unicode() == 'e') + if (s[10].unicode() == 'e') { return T_DOXY_ENDLEGALESE; + } + } + } + } + } + } + } + } + else if (s[3].unicode() == 'p') { + if (s[4].unicode() == 'a') { + if (s[5].unicode() == 'r') { + if (s[6].unicode() == 'b') { + if (s[7].unicode() == 'l') { + if (s[8].unicode() == 'o') { + if (s[9].unicode() == 'c') { + if (s[10].unicode() == 'k') { + return T_DOXY_ENDPARBLOCK; + } } } } @@ -2334,14 +3243,18 @@ static inline int classify11(const QChar *s) { if (s[7].unicode() == 'i') { if (s[8].unicode() == 'o') { if (s[9].unicode() == 'n') { - if (s[10].unicode() == '1') + if (s[10].unicode() == '1') { return T_DOXY_ENDSECTION1; - else if (s[10].unicode() == '2') + } + else if (s[10].unicode() == '2') { return T_DOXY_ENDSECTION2; - else if (s[10].unicode() == '3') + } + else if (s[10].unicode() == '3') { return T_DOXY_ENDSECTION3; - else if (s[10].unicode() == '4') + } + else if (s[10].unicode() == '4') { return T_DOXY_ENDSECTION4; + } } } } @@ -2356,8 +3269,9 @@ static inline int classify11(const QChar *s) { if (s[7].unicode() == 'a') { if (s[8].unicode() == 't') { if (s[9].unicode() == 'i') { - if (s[10].unicode() == 'm') + if (s[10].unicode() == 'm') { return T_DOXY_ENDVERBATIM; + } } } } @@ -2378,8 +3292,9 @@ static inline int classify11(const QChar *s) { if (s[7].unicode() == 'r') { if (s[8].unicode() == 'i') { if (s[9].unicode() == 't') { - if (s[10].unicode() == 'y') + if (s[10].unicode() == 'y') { return T_DOXY_GRANULARITY; + } } } } @@ -2400,8 +3315,9 @@ static inline int classify11(const QChar *s) { if (s[7].unicode() == 'l') { if (s[8].unicode() == 'u') { if (s[9].unicode() == 'd') { - if (s[10].unicode() == 'e') + if (s[10].unicode() == 'e') { return T_DOXY_HTMLINCLUDE; + } } } } @@ -2422,8 +3338,28 @@ static inline int classify11(const QChar *s) { if (s[7].unicode() == 'm') { if (s[8].unicode() == 'a') { if (s[9].unicode() == 'g') { - if (s[10].unicode() == 'e') + if (s[10].unicode() == 'e') { return T_DOXY_INLINEIMAGE; + } + } + } + } + } + } + } + } + } + else if (s[2].unicode() == 'q') { + if (s[3].unicode() == 'm') { + if (s[4].unicode() == 'l') { + if (s[5].unicode() == 'm') { + if (s[6].unicode() == 'o') { + if (s[7].unicode() == 'd') { + if (s[8].unicode() == 'u') { + if (s[9].unicode() == 'l') { + if (s[10].unicode() == 'e') { + return T_DOXY_INQMLMODULE; + } } } } @@ -2444,8 +3380,49 @@ static inline int classify11(const QChar *s) { if (s[7].unicode() == 'n') { if (s[8].unicode() == 'a') { if (s[9].unicode() == 'r') { - if (s[10].unicode() == 'y') + if (s[10].unicode() == 'y') { return T_DOXY_PRELIMINARY; + } + } + } + } + } + } + } + } + } + } + } + else if (s[0].unicode() == 'q') { + if (s[1].unicode() == 'm') { + if (s[2].unicode() == 'l') { + if (s[3].unicode() == 'a') { + if (s[4].unicode() == 'b') { + if (s[5].unicode() == 's') { + if (s[6].unicode() == 't') { + if (s[7].unicode() == 'r') { + if (s[8].unicode() == 'a') { + if (s[9].unicode() == 'c') { + if (s[10].unicode() == 't') { + return T_DOXY_QMLABSTRACT; + } + } + } + } + } + } + } + } + else if (s[3].unicode() == 'p') { + if (s[4].unicode() == 'r') { + if (s[5].unicode() == 'o') { + if (s[6].unicode() == 'p') { + if (s[7].unicode() == 'e') { + if (s[8].unicode() == 'r') { + if (s[9].unicode() == 't') { + if (s[10].unicode() == 'y') { + return T_DOXY_QMLPROPERTY; + } } } } @@ -2462,12 +3439,24 @@ static inline int classify11(const QChar *s) { if (s[3].unicode() == 'a') { if (s[4].unicode() == 't') { if (s[5].unicode() == 'e') { - if (s[6].unicode() == 's') { + if (s[6].unicode() == 'd') { + if (s[7].unicode() == 'a') { + if (s[8].unicode() == 'l') { + if (s[9].unicode() == 's') { + if (s[10].unicode() == 'o') { + return T_DOXY_RELATEDALSO; + } + } + } + } + } + else if (s[6].unicode() == 's') { if (s[7].unicode() == 'a') { if (s[8].unicode() == 'l') { if (s[9].unicode() == 's') { - if (s[10].unicode() == 'o') + if (s[10].unicode() == 'o') { return T_DOXY_RELATESALSO; + } } } } @@ -2488,8 +3477,9 @@ static inline int classify11(const QChar *s) { if (s[7].unicode() == 'l') { if (s[8].unicode() == 'u') { if (s[9].unicode() == 'd') { - if (s[10].unicode() == 'e') + if (s[10].unicode() == 'e') { return T_DOXY_VERBINCLUDE; + } } } } @@ -2515,8 +3505,9 @@ static inline int classify12(const QChar *s) { if (s[8].unicode() == 'p') { if (s[9].unicode() == 'a') { if (s[10].unicode() == 'g') { - if (s[11].unicode() == 'e') + if (s[11].unicode() == 'e') { return T_DOXY_CONTENTSPAGE; + } } } } @@ -2539,8 +3530,9 @@ static inline int classify12(const QChar *s) { if (s[8].unicode() == 'o') { if (s[9].unicode() == 'n') { if (s[10].unicode() == 'l') { - if (s[11].unicode() == 'y') + if (s[11].unicode() == 'y') { return T_DOXY_ENDLATEXONLY; + } } } } @@ -2557,8 +3549,9 @@ static inline int classify12(const QChar *s) { if (s[8].unicode() == 't') { if (s[9].unicode() == 'i') { if (s[10].unicode() == 'o') { - if (s[11].unicode() == 'n') + if (s[11].unicode() == 'n') { return T_DOXY_ENDQUOTATION; + } } } } @@ -2579,8 +3572,9 @@ static inline int classify12(const QChar *s) { if (s[8].unicode() == 'p') { if (s[9].unicode() == 'a') { if (s[10].unicode() == 'g') { - if (s[11].unicode() == 'e') + if (s[11].unicode() == 'e') { return T_DOXY_EXTERNALPAGE; + } } } } @@ -2603,8 +3597,9 @@ static inline int classify12(const QChar *s) { if (s[8].unicode() == 'l') { if (s[9].unicode() == 'i') { if (s[10].unicode() == 's') { - if (s[11].unicode() == 't') + if (s[11].unicode() == 't') { return T_DOXY_GENERATELIST; + } } } } @@ -2627,8 +3622,55 @@ static inline int classify12(const QChar *s) { if (s[8].unicode() == 'f') { if (s[9].unicode() == 'i') { if (s[10].unicode() == 'l') { - if (s[11].unicode() == 'e') + if (s[11].unicode() == 'e') { return T_DOXY_INHEADERFILE; + } + } + } + } + } + } + } + } + } + } + else if (s[2].unicode() == 's') { + if (s[3].unicode() == 't') { + if (s[4].unicode() == 'a') { + if (s[5].unicode() == 'n') { + if (s[6].unicode() == 't') { + if (s[7].unicode() == 'i') { + if (s[8].unicode() == 'a') { + if (s[9].unicode() == 't') { + if (s[10].unicode() == 'e') { + if (s[11].unicode() == 's') { + return T_DOXY_INSTANTIATES; + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0].unicode() == 'l') { + if (s[1].unicode() == 'a') { + if (s[2].unicode() == 't') { + if (s[3].unicode() == 'e') { + if (s[4].unicode() == 'x') { + if (s[5].unicode() == 'i') { + if (s[6].unicode() == 'n') { + if (s[7].unicode() == 'c') { + if (s[8].unicode() == 'l') { + if (s[9].unicode() == 'u') { + if (s[10].unicode() == 'd') { + if (s[11].unicode() == 'e') { + return T_DOXY_LATEXINCLUDE; + } } } } @@ -2651,8 +3693,9 @@ static inline int classify12(const QChar *s) { if (s[8].unicode() == 'r') { if (s[9].unicode() == 'a') { if (s[10].unicode() == 'n') { - if (s[11].unicode() == 't') + if (s[11].unicode() == 't') { return T_DOXY_NONREENTRANT; + } } } } @@ -2675,8 +3718,34 @@ static inline int classify12(const QChar *s) { if (s[8].unicode() == 'p') { if (s[9].unicode() == 'a') { if (s[10].unicode() == 'g') { - if (s[11].unicode() == 'e') + if (s[11].unicode() == 'e') { return T_DOXY_PREVIOUSPAGE; + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0].unicode() == 'q') { + if (s[1].unicode() == 'm') { + if (s[2].unicode() == 'l') { + if (s[3].unicode() == 'b') { + if (s[4].unicode() == 'a') { + if (s[5].unicode() == 's') { + if (s[6].unicode() == 'i') { + if (s[7].unicode() == 'c') { + if (s[8].unicode() == 't') { + if (s[9].unicode() == 'y') { + if (s[10].unicode() == 'p') { + if (s[11].unicode() == 'e') { + return T_DOXY_QMLBASICTYPE; + } } } } @@ -2692,9 +3761,113 @@ static inline int classify12(const QChar *s) { } static inline int classify13(const QChar *s) { - if (s[0].unicode() == 'i') { + if (s[0].unicode() == 'a') { if (s[1].unicode() == 'n') { - if (s[2].unicode() == 'p') { + if (s[2].unicode() == 'n') { + if (s[3].unicode() == 'o') { + if (s[4].unicode() == 't') { + if (s[5].unicode() == 'a') { + if (s[6].unicode() == 't') { + if (s[7].unicode() == 'e') { + if (s[8].unicode() == 'd') { + if (s[9].unicode() == 'l') { + if (s[10].unicode() == 'i') { + if (s[11].unicode() == 's') { + if (s[12].unicode() == 't') { + return T_DOXY_ANNOTATEDLIST; + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0].unicode() == 'e') { + if (s[1].unicode() == 'n') { + if (s[2].unicode() == 'd') { + if (s[3].unicode() == 's') { + if (s[4].unicode() == 'e') { + if (s[5].unicode() == 'c') { + if (s[6].unicode() == 'r') { + if (s[7].unicode() == 'e') { + if (s[8].unicode() == 'f') { + if (s[9].unicode() == 'l') { + if (s[10].unicode() == 'i') { + if (s[11].unicode() == 's') { + if (s[12].unicode() == 't') { + return T_DOXY_ENDSECREFLIST; + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0].unicode() == 'h') { + if (s[1].unicode() == 'i') { + if (s[2].unicode() == 'd') { + if (s[3].unicode() == 'e') { + if (s[4].unicode() == 'c') { + if (s[5].unicode() == 'a') { + if (s[6].unicode() == 'l') { + if (s[7].unicode() == 'l') { + if (s[8].unicode() == 'g') { + if (s[9].unicode() == 'r') { + if (s[10].unicode() == 'a') { + if (s[11].unicode() == 'p') { + if (s[12].unicode() == 'h') { + return T_DOXY_HIDECALLGRAPH; + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0].unicode() == 'i') { + if (s[1].unicode() == 'n') { + if (s[2].unicode() == 'c') { + if (s[3].unicode() == 'l') { + if (s[4].unicode() == 'u') { + if (s[5].unicode() == 'd') { + if (s[6].unicode() == 'e') { + if (s[7].unicode() == 'l') { + if (s[8].unicode() == 'i') { + if (s[9].unicode() == 'n') { + if (s[10].unicode() == 'e') { + if (s[11].unicode() == 'n') { + if (s[12].unicode() == 'o') { + return T_DOXY_INCLUDELINENO; + } + } + } + } + } + } + } + } + } + } + } + else if (s[2].unicode() == 'p') { if (s[3].unicode() == 'u') { if (s[4].unicode() == 'b') { if (s[5].unicode() == 'l') { @@ -2704,8 +3877,9 @@ static inline int classify13(const QChar *s) { if (s[9].unicode() == 'r') { if (s[10].unicode() == 'o') { if (s[11].unicode() == 'u') { - if (s[12].unicode() == 'p') + if (s[12].unicode() == 'p') { return T_DOXY_INPUBLICGROUP; + } } } } @@ -2730,8 +3904,36 @@ static inline int classify13(const QChar *s) { if (s[9].unicode() == 'p') { if (s[10].unicode() == 'i') { if (s[11].unicode() == 'n') { - if (s[12].unicode() == 'g') + if (s[12].unicode() == 'g') { return T_DOXY_NOSUBGROUPING; + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0].unicode() == 'p') { + if (s[1].unicode() == 'u') { + if (s[2].unicode() == 'b') { + if (s[3].unicode() == 'l') { + if (s[4].unicode() == 'i') { + if (s[5].unicode() == 'c') { + if (s[6].unicode() == 's') { + if (s[7].unicode() == 'e') { + if (s[8].unicode() == 'c') { + if (s[9].unicode() == 't') { + if (s[10].unicode() == 'i') { + if (s[11].unicode() == 'o') { + if (s[12].unicode() == 'n') { + return T_DOXY_PUBLICSECTION; + } } } } @@ -2756,8 +3958,9 @@ static inline int classify13(const QChar *s) { if (s[9].unicode() == 'f') { if (s[10].unicode() == 'i') { if (s[11].unicode() == 'l') { - if (s[12].unicode() == 'e') + if (s[12].unicode() == 'e') { return T_DOXY_QUOTEFROMFILE; + } } } } @@ -2770,8 +3973,9 @@ static inline int classify13(const QChar *s) { if (s[9].unicode() == 't') { if (s[10].unicode() == 'i') { if (s[11].unicode() == 'o') { - if (s[12].unicode() == 'n') + if (s[12].unicode() == 'n') { return T_DOXY_QUOTEFUNCTION; + } } } } @@ -2796,8 +4000,71 @@ static inline int classify13(const QChar *s) { if (s[9].unicode() == 't') { if (s[10].unicode() == 'i') { if (s[11].unicode() == 'o') { - if (s[12].unicode() == 'n') + if (s[12].unicode() == 'n') { return T_DOXY_SUBSUBSECTION; + } + } + } + } + } + } + } + } + } + } + } + } + } + return T_DOXY_IDENTIFIER; +} + +static inline int classify14(const QChar *s) { + if (s[0].unicode() == 'e') { + if (s[1].unicode() == 'n') { + if (s[2].unicode() == 'd') { + if (s[3].unicode() == 'd') { + if (s[4].unicode() == 'o') { + if (s[5].unicode() == 'c') { + if (s[6].unicode() == 'b') { + if (s[7].unicode() == 'o') { + if (s[8].unicode() == 'o') { + if (s[9].unicode() == 'k') { + if (s[10].unicode() == 'o') { + if (s[11].unicode() == 'n') { + if (s[12].unicode() == 'l') { + if (s[13].unicode() == 'y') { + return T_DOXY_ENDDOCBOOKONLY; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + else if (s[0].unicode() == 'p') { + if (s[1].unicode() == 'r') { + if (s[2].unicode() == 'i') { + if (s[3].unicode() == 'v') { + if (s[4].unicode() == 'a') { + if (s[5].unicode() == 't') { + if (s[6].unicode() == 'e') { + if (s[7].unicode() == 's') { + if (s[8].unicode() == 'e') { + if (s[9].unicode() == 'c') { + if (s[10].unicode() == 't') { + if (s[11].unicode() == 'i') { + if (s[12].unicode() == 'o') { + if (s[13].unicode() == 'n') { + return T_DOXY_PRIVATESECTION; + } + } } } } @@ -2818,7 +4085,30 @@ static inline int classify15(const QChar *s) { if (s[1].unicode() == 'i') { if (s[2].unicode() == 'd') { if (s[3].unicode() == 'e') { - if (s[4].unicode() == 'i') { + if (s[4].unicode() == 'c') { + if (s[5].unicode() == 'a') { + if (s[6].unicode() == 'l') { + if (s[7].unicode() == 'l') { + if (s[8].unicode() == 'e') { + if (s[9].unicode() == 'r') { + if (s[10].unicode() == 'g') { + if (s[11].unicode() == 'r') { + if (s[12].unicode() == 'a') { + if (s[13].unicode() == 'p') { + if (s[14].unicode() == 'h') { + return T_DOXY_HIDECALLERGRAPH; + } + } + } + } + } + } + } + } + } + } + } + else if (s[4].unicode() == 'i') { if (s[5].unicode() == 'n') { if (s[6].unicode() == 'i') { if (s[7].unicode() == 't') { @@ -2828,8 +4118,9 @@ static inline int classify15(const QChar *s) { if (s[11].unicode() == 'i') { if (s[12].unicode() == 'z') { if (s[13].unicode() == 'e') { - if (s[14].unicode() == 'r') + if (s[14].unicode() == 'r') { return T_DOXY_HIDEINITIALIZER; + } } } } @@ -2858,8 +4149,9 @@ static inline int classify15(const QChar *s) { if (s[11].unicode() == 'i') { if (s[12].unicode() == 'z') { if (s[13].unicode() == 'e') { - if (s[14].unicode() == 'r') + if (s[14].unicode() == 'r') { return T_DOXY_SHOWINITIALIZER; + } } } } @@ -2888,8 +4180,128 @@ static inline int classify15(const QChar *s) { if (s[11].unicode() == 'e') { if (s[12].unicode() == 'n') { if (s[13].unicode() == 't') { - if (s[14].unicode() == 's') + if (s[14].unicode() == 's') { return T_DOXY_TABLEOFCONTENTS; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return T_DOXY_IDENTIFIER; +} + +static inline int classify16(const QChar *s) { + if (s[0].unicode() == 'p') { + if (s[1].unicode() == 'r') { + if (s[2].unicode() == 'o') { + if (s[3].unicode() == 't') { + if (s[4].unicode() == 'e') { + if (s[5].unicode() == 'c') { + if (s[6].unicode() == 't') { + if (s[7].unicode() == 'e') { + if (s[8].unicode() == 'd') { + if (s[9].unicode() == 's') { + if (s[10].unicode() == 'e') { + if (s[11].unicode() == 'c') { + if (s[12].unicode() == 't') { + if (s[13].unicode() == 'i') { + if (s[14].unicode() == 'o') { + if (s[15].unicode() == 'n') { + return T_DOXY_PROTECTEDSECTION; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return T_DOXY_IDENTIFIER; +} + +static inline int classify17(const QChar *s) { + if (s[0].unicode() == 'q') { + if (s[1].unicode() == 'm') { + if (s[2].unicode() == 'l') { + if (s[3].unicode() == 'a') { + if (s[4].unicode() == 't') { + if (s[5].unicode() == 't') { + if (s[6].unicode() == 'a') { + if (s[7].unicode() == 'c') { + if (s[8].unicode() == 'h') { + if (s[9].unicode() == 'e') { + if (s[10].unicode() == 'd') { + if (s[11].unicode() == 's') { + if (s[12].unicode() == 'i') { + if (s[13].unicode() == 'g') { + if (s[14].unicode() == 'n') { + if (s[15].unicode() == 'a') { + if (s[16].unicode() == 'l') { + return T_DOXY_QMLATTACHEDSIGNAL; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return T_DOXY_IDENTIFIER; +} + +static inline int classify19(const QChar *s) { + if (s[0].unicode() == 'q') { + if (s[1].unicode() == 'm') { + if (s[2].unicode() == 'l') { + if (s[3].unicode() == 'a') { + if (s[4].unicode() == 't') { + if (s[5].unicode() == 't') { + if (s[6].unicode() == 'a') { + if (s[7].unicode() == 'c') { + if (s[8].unicode() == 'h') { + if (s[9].unicode() == 'e') { + if (s[10].unicode() == 'd') { + if (s[11].unicode() == 'p') { + if (s[12].unicode() == 'r') { + if (s[13].unicode() == 'o') { + if (s[14].unicode() == 'p') { + if (s[15].unicode() == 'e') { + if (s[16].unicode() == 'r') { + if (s[17].unicode() == 't') { + if (s[18].unicode() == 'y') { + return T_DOXY_QMLATTACHEDPROPERTY; + } + } + } + } + } } } } @@ -2922,8 +4334,11 @@ int CppTools::classifyDoxygenTag(const QChar *s, int n) { case 11: return classify11(s); case 12: return classify12(s); case 13: return classify13(s); + case 14: return classify14(s); case 15: return classify15(s); + case 16: return classify16(s); + case 17: return classify17(s); + case 19: return classify19(s); default: return T_DOXY_IDENTIFIER; } // switch } - diff --git a/src/plugins/cpptools/cppdoxygen.h b/src/plugins/cpptools/cppdoxygen.h index 2eb8b001f1..f1e708bd98 100644 --- a/src/plugins/cpptools/cppdoxygen.h +++ b/src/plugins/cpptools/cppdoxygen.h @@ -33,222 +33,287 @@ namespace CppTools { enum DoxygenReservedWord { T_DOXY_IDENTIFIER, - T_DOXY_ARG, - T_DOXY_ATTENTION, - T_DOXY_AUTHOR, - T_DOXY_CALLGRAPH, - T_DOXY_CODE, - T_DOXY_DOT, - T_DOXY_ELSE, - T_DOXY_ENDCODE, - T_DOXY_ENDCOND, - T_DOXY_ENDDOT, - T_DOXY_ENDHTMLONLY, - T_DOXY_ENDIF, - T_DOXY_ENDLATEXONLY, - T_DOXY_ENDLINK, - T_DOXY_ENDMANONLY, - T_DOXY_ENDVERBATIM, - T_DOXY_ENDXMLONLY, - T_DOXY_HIDEINITIALIZER, - T_DOXY_HTMLONLY, - T_DOXY_INTERFACE, - T_DOXY_INTERNAL, - T_DOXY_INVARIANT, - T_DOXY_LATEXONLY, - T_DOXY_LI, - T_DOXY_MANONLY, - T_DOXY_N, - T_DOXY_NOSUBGROUPING, - T_DOXY_NOTE, - T_DOXY_ONLY, - T_DOXY_POST, - T_DOXY_PRE, - T_DOXY_REMARKS, - T_DOXY_RETURN, - T_DOXY_RETURNS, - T_DOXY_SA, - T_DOXY_SEE, - T_DOXY_SHOWINITIALIZER, - T_DOXY_SINCE, - T_DOXY_TEST, - T_DOXY_TODO, - T_DOXY_VERBATIM, - T_DOXY_WARNING, - T_DOXY_XMLONLY, + T_DOXY_A, + T_DOXY_ABSTRACT, + T_DOXY_ADDINDEX, T_DOXY_ADDTOGROUP, T_DOXY_ANCHOR, + T_DOXY_ANNOTATEDLIST, + T_DOXY_ARG, + T_DOXY_ATTENTION, + T_DOXY_AUTHOR, + T_DOXY_AUTHORS, T_DOXY_B, + T_DOXY_BADCODE, + T_DOXY_BASENAME, + T_DOXY_BOLD, + T_DOXY_BRIEF, + T_DOXY_BUG, T_DOXY_C, + T_DOXY_CALLERGRAPH, + T_DOXY_CALLGRAPH, + T_DOXY_CAPTION, + T_DOXY_CATEGORY, + T_DOXY_CHAPTER, + T_DOXY_CITE, T_DOXY_CLASS, + T_DOXY_CODE, + T_DOXY_CODELINE, + T_DOXY_COMPAT, T_DOXY_COND, + T_DOXY_CONTENTSPAGE, + T_DOXY_COPYBRIEF, + T_DOXY_COPYDETAILS, T_DOXY_COPYDOC, + T_DOXY_COPYRIGHT, + T_DOXY_CORELIB, + T_DOXY_DATE, T_DOXY_DEF, + T_DOXY_DEFAULT, + T_DOXY_DEFGROUP, + T_DOXY_DEPRECATED, + T_DOXY_DETAILS, + T_DOXY_DIAFILE, + T_DOXY_DIR, + T_DOXY_DIV, + T_DOXY_DOCBOOKONLY, T_DOXY_DONTINCLUDE, + T_DOXY_DOT, T_DOXY_DOTFILE, + T_DOXY_DOTS, T_DOXY_E, + T_DOXY_ELSE, T_DOXY_ELSEIF, T_DOXY_EM, - T_DOXY_ENUM, - T_DOXY_EXAMPLE, - T_DOXY_EXCEPTION, - T_DOXY_EXCEPTIONS, - T_DOXY_FILE, - T_DOXY_HTMLINCLUDE, - T_DOXY_IF, - T_DOXY_IFNOT, - T_DOXY_INCLUDE, - T_DOXY_LINK, - T_DOXY_NAMESPACE, - T_DOXY_P, - T_DOXY_PACKAGE, - T_DOXY_REF, - T_DOXY_RELATES, - T_DOXY_RELATESALSO, - T_DOXY_RETVAL, - T_DOXY_THROW, - T_DOXY_THROWS, - T_DOXY_VERBINCLUDE, - T_DOXY_VERSION, - T_DOXY_XREFITEM, - T_DOXY_PARAM, - T_DOXY_IMAGE, - T_DOXY_DEFGROUP, - T_DOXY_PAGE, - T_DOXY_PARAGRAPH, - T_DOXY_SECTION, - T_DOXY_STRUCT, - T_DOXY_SUBSECTION, - T_DOXY_SUBSUBSECTION, - T_DOXY_UNION, - T_DOXY_WEAKGROUP, - T_DOXY_ADDINDEX, - T_DOXY_BRIEF, - T_DOXY_BUG, - T_DOXY_DATE, - T_DOXY_DEPRECATED, - T_DOXY_FN, - T_DOXY_INGROUP, - T_DOXY_LINE, - T_DOXY_MAINPAGE, - T_DOXY_NAME, - T_DOXY_OVERLOAD, - T_DOXY_PAR, - T_DOXY_SHORT, - T_DOXY_SKIP, - T_DOXY_SKIPLINE, - T_DOXY_TYPEDEF, - T_DOXY_UNTIL, - T_DOXY_VAR, - - T_FIRST_QDOC_TAG, - - T_DOXY_ABSTRACT = T_FIRST_QDOC_TAG, - T_DOXY_BADCODE, - T_DOXY_BASENAME, - T_DOXY_BOLD, - T_DOXY_CAPTION, - T_DOXY_CHAPTER, - T_DOXY_CODELINE, - T_DOXY_DOTS, T_DOXY_ENDABSTRACT, T_DOXY_ENDCHAPTER, + T_DOXY_ENDCODE, + T_DOXY_ENDCOND, + T_DOXY_ENDDOCBOOKONLY, + T_DOXY_ENDDOT, T_DOXY_ENDFOOTNOTE, + T_DOXY_ENDHTMLONLY, + T_DOXY_ENDIF, + T_DOXY_ENDINTERNAL, + T_DOXY_ENDLATEXONLY, T_DOXY_ENDLEGALESE, + T_DOXY_ENDLINK, T_DOXY_ENDLIST, + T_DOXY_ENDMANONLY, + T_DOXY_ENDMSC, T_DOXY_ENDOMIT, + T_DOXY_ENDPARBLOCK, T_DOXY_ENDPART, T_DOXY_ENDQUOTATION, T_DOXY_ENDRAW, + T_DOXY_ENDRTFONLY, + T_DOXY_ENDSECREFLIST, T_DOXY_ENDSECTION1, T_DOXY_ENDSECTION2, T_DOXY_ENDSECTION3, T_DOXY_ENDSECTION4, T_DOXY_ENDSIDEBAR, T_DOXY_ENDTABLE, + T_DOXY_ENDUML, + T_DOXY_ENDVERBATIM, + T_DOXY_ENDXMLONLY, + T_DOXY_ENUM, + T_DOXY_EXAMPLE, + T_DOXY_EXCEPTION, + T_DOXY_EXCEPTIONS, T_DOXY_EXPIRE, + T_DOXY_EXTENDS, + T_DOXY_EXTERNALPAGE, + T_DOXY_FILE, + T_DOXY_FN, T_DOXY_FOOTNOTE, T_DOXY_GENERATELIST, T_DOXY_GRANULARITY, + T_DOXY_GROUP, + T_DOXY_GUI, T_DOXY_HEADER, + T_DOXY_HEADERFILE, + T_DOXY_HIDECALLERGRAPH, + T_DOXY_HIDECALLGRAPH, + T_DOXY_HIDEINITIALIZER, + T_DOXY_HTMLINCLUDE, + T_DOXY_HTMLONLY, T_DOXY_I, + T_DOXY_IDLEXCEPT, + T_DOXY_IF, + T_DOXY_IFNOT, + T_DOXY_IMAGE, + T_DOXY_IMPLEMENTS, + T_DOXY_INCLUDE, + T_DOXY_INCLUDELINENO, T_DOXY_INDEX, + T_DOXY_INDEXPAGE, + T_DOXY_INGROUP, + T_DOXY_INHEADERFILE, + T_DOXY_INHERITS, T_DOXY_INLINEIMAGE, + T_DOXY_INMODULE, + T_DOXY_INPUBLICGROUP, + T_DOXY_INQMLMODULE, + T_DOXY_INSTANTIATES, + T_DOXY_INTERFACE, + T_DOXY_INTERNAL, + T_DOXY_INVARIANT, T_DOXY_KEYWORD, T_DOXY_L, + T_DOXY_LATEXINCLUDE, + T_DOXY_LATEXONLY, T_DOXY_LEGALESE, + T_DOXY_LI, + T_DOXY_LINE, + T_DOXY_LINK, T_DOXY_LIST, + T_DOXY_MACRO, + T_DOXY_MAINCLASS, + T_DOXY_MAINPAGE, + T_DOXY_MANONLY, + T_DOXY_MEMBEROF, T_DOXY_META, + T_DOXY_MODULE, + T_DOXY_MSC, + T_DOXY_MSCFILE, + T_DOXY_N, + T_DOXY_NAME, + T_DOXY_NAMESPACE, + T_DOXY_NETWORK, T_DOXY_NEWCODE, + T_DOXY_NEXTPAGE, + T_DOXY_NOAUTOLIST, + T_DOXY_NONREENTRANT, + T_DOXY_NOSUBGROUPING, + T_DOXY_NOTE, T_DOXY_O, + T_DOXY_OBSOLETE, T_DOXY_OLDCODE, T_DOXY_OMIT, T_DOXY_OMITVALUE, + T_DOXY_ONLY, + T_DOXY_OPENGL, + T_DOXY_OVERLOAD, + T_DOXY_P, + T_DOXY_PACKAGE, + T_DOXY_PAGE, + T_DOXY_PAR, + T_DOXY_PARAGRAPH, + T_DOXY_PARAM, + T_DOXY_PARBLOCK, T_DOXY_PART, + T_DOXY_POST, + T_DOXY_PRE, + T_DOXY_PRELIMINARY, + T_DOXY_PREVIOUSPAGE, T_DOXY_PRINTLINE, T_DOXY_PRINTTO, T_DOXY_PRINTUNTIL, + T_DOXY_PRIVATE, + T_DOXY_PRIVATESECTION, + T_DOXY_PROPERTY, + T_DOXY_PROTECTED, + T_DOXY_PROTECTEDSECTION, + T_DOXY_PROTOCOL, + T_DOXY_PUBLIC, + T_DOXY_PUBLICSECTION, + T_DOXY_PURE, + T_DOXY_QMLABSTRACT, + T_DOXY_QMLATTACHEDPROPERTY, + T_DOXY_QMLATTACHEDSIGNAL, + T_DOXY_QMLBASICTYPE, + T_DOXY_QMLCLASS, + T_DOXY_QMLMETHOD, + T_DOXY_QMLMODULE, + T_DOXY_QMLPROPERTY, + T_DOXY_QMLSIGNAL, + T_DOXY_QMLTYPE, + T_DOXY_QT3SUPPORT, + T_DOXY_QTESTLIB, T_DOXY_QUOTATION, T_DOXY_QUOTEFILE, T_DOXY_QUOTEFROMFILE, T_DOXY_QUOTEFUNCTION, T_DOXY_RAW, + T_DOXY_REENTRANT, + T_DOXY_REF, + T_DOXY_REFITEM, + T_DOXY_REIMP, + T_DOXY_RELATED, + T_DOXY_RELATEDALSO, + T_DOXY_RELATES, + T_DOXY_RELATESALSO, + T_DOXY_REMARK, + T_DOXY_REMARKS, + T_DOXY_RESULT, + T_DOXY_RETURN, + T_DOXY_RETURNS, + T_DOXY_RETVAL, T_DOXY_ROW, + T_DOXY_RTFONLY, + T_DOXY_SA, + T_DOXY_SECREFLIST, + T_DOXY_SECTION, T_DOXY_SECTION1, T_DOXY_SECTION2, T_DOXY_SECTION3, T_DOXY_SECTION4, + T_DOXY_SEE, + T_DOXY_SERVICE, + T_DOXY_SHORT, + T_DOXY_SHOWINITIALIZER, T_DOXY_SIDEBAR, + T_DOXY_SINCE, + T_DOXY_SKIP, + T_DOXY_SKIPLINE, T_DOXY_SKIPTO, T_DOXY_SKIPUNTIL, T_DOXY_SNIPPET, + T_DOXY_SPAN, + T_DOXY_SQL, + T_DOXY_STARTPAGE, + T_DOXY_STARTUML, + T_DOXY_STRUCT, T_DOXY_SUB, + T_DOXY_SUBPAGE, + T_DOXY_SUBSECTION, + T_DOXY_SUBSUBSECTION, + T_DOXY_SUBTITLE, T_DOXY_SUP, + T_DOXY_SVG, T_DOXY_TABLE, T_DOXY_TABLEOFCONTENTS, T_DOXY_TARGET, + T_DOXY_TEST, + T_DOXY_THREADSAFE, + T_DOXY_THROW, + T_DOXY_THROWS, + T_DOXY_TITLE, + T_DOXY_TODO, + T_DOXY_TPARAM, T_DOXY_TT, + T_DOXY_TYPEDEF, + T_DOXY_UICONTROL, + T_DOXY_UITOOLS, T_DOXY_UNDERLINE, T_DOXY_UNICODE, + T_DOXY_UNION, + T_DOXY_UNTIL, T_DOXY_VALUE, - T_DOXY_CONTENTSPAGE, - T_DOXY_EXTERNALPAGE, - T_DOXY_GROUP, - T_DOXY_HEADERFILE, - T_DOXY_INDEXPAGE, - T_DOXY_INHEADERFILE, - T_DOXY_MACRO, - T_DOXY_MODULE, - T_DOXY_NEXTPAGE, - T_DOXY_PREVIOUSPAGE, - T_DOXY_PROPERTY, - T_DOXY_REIMP, - T_DOXY_SERVICE, - T_DOXY_STARTPAGE, + T_DOXY_VAR, T_DOXY_VARIABLE, - T_DOXY_COMPAT, - T_DOXY_INMODULE, - T_DOXY_MAINCLASS, - T_DOXY_NONREENTRANT, - T_DOXY_OBSOLETE, - T_DOXY_PRELIMINARY, - T_DOXY_INPUBLICGROUP, - T_DOXY_REENTRANT, - T_DOXY_SUBTITLE, - T_DOXY_THREADSAFE, - T_DOXY_TITLE, - T_DOXY_CORELIB, - T_DOXY_UITOOLS, - T_DOXY_GUI, - T_DOXY_NETWORK, - T_DOXY_OPENGL, - T_DOXY_QT3SUPPORT, - T_DOXY_SVG, - T_DOXY_SQL, - T_DOXY_QTESTLIB, + T_DOXY_VERBATIM, + T_DOXY_VERBINCLUDE, + T_DOXY_VERSION, + T_DOXY_VHDLFLOW, + T_DOXY_WARNING, + T_DOXY_WEAKGROUP, T_DOXY_WEBKIT, T_DOXY_XML, + T_DOXY_XMLONLY, + T_DOXY_XREFITEM, T_DOXY_LAST_TAG }; diff --git a/src/plugins/cpptools/cppdoxygen.kwgen b/src/plugins/cpptools/cppdoxygen.kwgen new file mode 100644 index 0000000000..bb8995f110 --- /dev/null +++ b/src/plugins/cpptools/cppdoxygen.kwgen @@ -0,0 +1,286 @@ +%token-prefix=T_DOXY_ +%toupper +%char-type=QChar +%unicode-function=.unicode() + +%% +a +abstract +addindex +addtogroup +anchor +annotatedlist +arg +attention +author +authors +b +badcode +basename +bold +brief +bug +c +callergraph +callgraph +caption +category +chapter +cite +class +code +codeline +compat +cond +contentspage +copybrief +copydetails +copydoc +copyright +corelib +date +def +default +defgroup +deprecated +details +diafile +dir +div +docbookonly +dontinclude +dot +dotfile +dots +e +else +elseif +em +endabstract +endchapter +endcode +endcond +enddocbookonly +enddot +endfootnote +endhtmlonly +endif +endinternal +endlatexonly +endlegalese +endlink +endlist +endmanonly +endmsc +endomit +endparblock +endpart +endquotation +endraw +endrtfonly +endsecreflist +endsection1 +endsection2 +endsection3 +endsection4 +endsidebar +endtable +enduml +endverbatim +endxmlonly +enum +example +exception +exceptions +expire +extends +externalpage +file +fn +footnote +generatelist +granularity +group +gui +header +headerfile +hidecallergraph +hidecallgraph +hideinitializer +htmlinclude +htmlonly +i +idlexcept +if +ifnot +image +implements +include +includelineno +index +indexpage +ingroup +inheaderfile +inherits +inlineimage +inmodule +inpublicgroup +inqmlmodule +instantiates +interface +internal +invariant +keyword +l +latexinclude +latexonly +legalese +li +line +link +list +macro +mainclass +mainpage +manonly +memberof +meta +module +msc +mscfile +n +name +namespace +network +newcode +nextpage +noautolist +nonreentrant +nosubgrouping +note +o +obsolete +oldcode +omit +omitvalue +only +opengl +overload +p +package +page +par +paragraph +param +parblock +part +post +pre +preliminary +previouspage +printline +printto +printuntil +private +privatesection +property +protected +protectedsection +protocol +public +publicsection +pure +qmlabstract +qmlattachedproperty +qmlattachedsignal +qmlbasictype +qmlclass +qmlmethod +qmlmodule +qmlproperty +qmlsignal +qmltype +qt3support +qtestlib +quotation +quotefile +quotefromfile +quotefunction +raw +reentrant +ref +refitem +reimp +related +relatedalso +relates +relatesalso +remark +remarks +result +return +returns +retval +row +rtfonly +sa +secreflist +section +section1 +section2 +section3 +section4 +see +service +short +showinitializer +sidebar +since +skip +skipline +skipto +skipuntil +snippet +span +sql +startpage +startuml +struct +sub +subpage +subsection +subsubsection +subtitle +sup +svg +table +tableofcontents +target +test +threadsafe +throw +throws +title +todo +tparam +tt +typedef +uicontrol +uitools +underline +unicode +union +until +value +var +variable +verbatim +verbinclude +version +vhdlflow +warning +weakgroup +webkit +xml +xmlonly +xrefitem diff --git a/src/plugins/cpptools/cpplocalsymbols_test.cpp b/src/plugins/cpptools/cpplocalsymbols_test.cpp index 7fb8a921e2..9183c9bfcd 100644 --- a/src/plugins/cpptools/cpplocalsymbols_test.cpp +++ b/src/plugins/cpptools/cpplocalsymbols_test.cpp @@ -115,7 +115,6 @@ struct Result } // anonymous namespace Q_DECLARE_METATYPE(Result) -Q_DECLARE_METATYPE(QList<Result>) QT_BEGIN_NAMESPACE namespace QTest { diff --git a/src/plugins/cpptools/cpplocatorfilter_test.cpp b/src/plugins/cpptools/cpplocatorfilter_test.cpp index b9b08f3d54..27258855d8 100644 --- a/src/plugins/cpptools/cpplocatorfilter_test.cpp +++ b/src/plugins/cpptools/cpplocatorfilter_test.cpp @@ -48,8 +48,6 @@ using namespace CppTools::Internal; using namespace ExtensionSystem; using namespace Utils; -Q_DECLARE_METATYPE(ILocatorFilter *) - namespace { enum { debug = 0 }; diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index cdf5922e42..13b582cfed 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -67,8 +67,6 @@ #include <sstream> #endif -Q_DECLARE_METATYPE(QSet<QString>) - static const bool DumpProjectInfo = qgetenv("QTC_DUMP_PROJECT_INFO") == "1"; using namespace CppTools; diff --git a/src/plugins/cpptools/cppmodelmanager_test.cpp b/src/plugins/cpptools/cppmodelmanager_test.cpp index 2304221631..92bbebf91d 100644 --- a/src/plugins/cpptools/cppmodelmanager_test.cpp +++ b/src/plugins/cpptools/cppmodelmanager_test.cpp @@ -57,7 +57,7 @@ using namespace ProjectExplorer; typedef CPlusPlus::Document Document; -Q_DECLARE_METATYPE(QVector<ProjectFile>) +Q_DECLARE_METATYPE(ProjectFile) namespace { diff --git a/src/plugins/cpptools/cpptoolsplugin.h b/src/plugins/cpptools/cpptoolsplugin.h index c26df354f4..b4d55b9927 100644 --- a/src/plugins/cpptools/cpptoolsplugin.h +++ b/src/plugins/cpptools/cpptoolsplugin.h @@ -108,6 +108,9 @@ private slots: void test_global_completion_data(); void test_global_completion(); + void test_doxygen_tag_completion_data(); + void test_doxygen_tag_completion(); + void test_completion_member_access_operator_data(); void test_completion_member_access_operator(); diff --git a/src/plugins/cpptools/functionutils.cpp b/src/plugins/cpptools/functionutils.cpp index dd26c80f25..b8224923a0 100644 --- a/src/plugins/cpptools/functionutils.cpp +++ b/src/plugins/cpptools/functionutils.cpp @@ -175,8 +175,6 @@ typedef QList<Virtuality> VirtualityList; } // CppTools namespace Q_DECLARE_METATYPE(CppTools::Internal::Virtuality) -Q_DECLARE_METATYPE(CppTools::Internal::VirtualityList) -Q_DECLARE_METATYPE(QList<int>) namespace CppTools { namespace Internal { diff --git a/src/plugins/cpptools/modelmanagertesthelper.cpp b/src/plugins/cpptools/modelmanagertesthelper.cpp index 38573fcf07..f347cd81af 100644 --- a/src/plugins/cpptools/modelmanagertesthelper.cpp +++ b/src/plugins/cpptools/modelmanagertesthelper.cpp @@ -33,8 +33,6 @@ #include <cassert> -Q_DECLARE_METATYPE(QSet<QString>) - using namespace CppTools::Internal; using namespace CppTools::Tests; diff --git a/src/plugins/cpptools/symbolsearcher_test.cpp b/src/plugins/cpptools/symbolsearcher_test.cpp index 1eae1a9b9a..dc71fa1562 100644 --- a/src/plugins/cpptools/symbolsearcher_test.cpp +++ b/src/plugins/cpptools/symbolsearcher_test.cpp @@ -126,7 +126,6 @@ private: } // anonymous namespace Q_DECLARE_METATYPE(ResultData) -Q_DECLARE_METATYPE(ResultDataList) QT_BEGIN_NAMESPACE namespace QTest { diff --git a/src/plugins/debugger/console/console.cpp b/src/plugins/debugger/console/console.cpp index 25bed9768b..3ea294ef3e 100644 --- a/src/plugins/debugger/console/console.cpp +++ b/src/plugins/debugger/console/console.cpp @@ -57,7 +57,7 @@ namespace Internal { Console::Console() { - m_consoleItemModel = new ConsoleItemModel; + m_consoleItemModel = new ConsoleItemModel(this); m_consoleWidget = new QWidget; m_consoleWidget->setWindowTitle(displayName()); diff --git a/src/plugins/debugger/debugger.qrc b/src/plugins/debugger/debugger.qrc index 00d902ea0d..cea824430d 100644 --- a/src/plugins/debugger/debugger.qrc +++ b/src/plugins/debugger/debugger.qrc @@ -6,6 +6,12 @@ <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_empty_14.png</file> <file>images/debugger_interrupt.png</file> <file>images/debugger_interrupt@2x.png</file> diff --git a/src/plugins/debugger/debuggericons.h b/src/plugins/debugger/debuggericons.h index 10c77df10f..fd2d1837c4 100644 --- a/src/plugins/debugger/debuggericons.h +++ b/src/plugins/debugger/debuggericons.h @@ -47,11 +47,20 @@ const Utils::Icon CONTINUE( 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}}); +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}}); 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}}); +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}}); +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}}); const Utils::Icon LOCATION( QLatin1String(":/debugger/images/location_16.png")); const Utils::Icon SNAPSHOT( diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index 54390d844d..ea9ed897c2 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -79,11 +79,24 @@ DebuggerMainWindow::DebuggerMainWindow() DebuggerMainWindow::~DebuggerMainWindow() { - // 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 DockPtr &ptr, m_dockWidgets) { - if (ptr) - delete ptr.data(); + // We keep track of widgets for operations that haven't been activated, yet, 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; + } + } + } } } @@ -119,11 +132,6 @@ QDockWidget *DebuggerMainWindow::dockWidget(const QByteArray &dockId) const return m_dockForDockId.value(dockId); } -QWidget *DebuggerMainWindow::modeWindow() -{ - return m_modeWindow; -} - void DebuggerMainWindow::resetCurrentPerspective() { loadPerspectiveHelper(m_currentPerspectiveId, false); @@ -140,7 +148,7 @@ void DebuggerMainWindow::restorePerspective(const QByteArray &perspectiveId) m_perspectiveChooser->setCurrentIndex(index); } -void DebuggerMainWindow::finalizeSetup(Core::IMode *mode, QWidget *central) +void DebuggerMainWindow::finalizeSetup() { auto viewButton = new QToolButton; viewButton->setText(tr("Views")); @@ -195,7 +203,10 @@ void DebuggerMainWindow::finalizeSetup(Core::IMode *mode, QWidget *central) m_toolbarDock = dock; addDockWidget(Qt::BottomDockWidgetArea, dock); +} +QWidget *createModeWindow(Core::IMode *mode, DebuggerMainWindow *mainWindow, QWidget *central) +{ if (!central) central = new EditorManagerPlaceHolder(mode); @@ -225,7 +236,7 @@ void DebuggerMainWindow::finalizeSetup(Core::IMode *mode, QWidget *central) // Right-side window with editor, output etc. auto mainWindowSplitter = new MiniSplitter; - mainWindowSplitter->addWidget(this); + mainWindowSplitter->addWidget(mainWindow); mainWindowSplitter->addWidget(new OutputPanePlaceHolder(mode, mainWindowSplitter)); auto outputPane = new OutputPanePlaceHolder(mode, mainWindowSplitter); outputPane->setObjectName(QLatin1String("DebuggerOutputPanePlaceHolder")); @@ -242,9 +253,9 @@ void DebuggerMainWindow::finalizeSetup(Core::IMode *mode, QWidget *central) splitter->setStretchFactor(0, 0); splitter->setStretchFactor(1, 1); splitter->setObjectName(QLatin1String("DebugModeWidget")); - setCentralWidget(centralEditorWidget); + mainWindow->setCentralWidget(centralEditorWidget); - m_modeWindow = splitter; + return splitter; } void DebuggerMainWindow::loadPerspectiveHelper(const QByteArray &perspectiveId, bool fromStoredSettings) @@ -254,10 +265,10 @@ void DebuggerMainWindow::loadPerspectiveHelper(const QByteArray &perspectiveId, saveCurrentPerspective(); 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))); @@ -350,8 +361,7 @@ QDockWidget *DebuggerMainWindow::registerDockWidget(const QByteArray &dockId, QW { QTC_ASSERT(!widget->objectName().isEmpty(), return 0); QDockWidget *dockWidget = addDockForWidget(widget); - dockWidget->setParent(0); - m_dockWidgets.append(DebuggerMainWindow::DockPtr(dockWidget)); + dockWidget->setParent(this); m_dockForDockId[dockId] = dockWidget; return dockWidget; } diff --git a/src/plugins/debugger/debuggermainwindow.h b/src/plugins/debugger/debuggermainwindow.h index c52870cf38..5f0bc39a7a 100644 --- a/src/plugins/debugger/debuggermainwindow.h +++ b/src/plugins/debugger/debuggermainwindow.h @@ -60,7 +60,7 @@ public: Qt::DockWidgetArea area = Qt::BottomDockWidgetArea); QByteArray dockId; - QWidget *widget = 0; + QPointer<QWidget> widget; QByteArray anchorDockId; OperationType operationType; bool visibleByDefault; @@ -114,14 +114,12 @@ public: void resetCurrentPerspective(); void restorePerspective(const QByteArray &perspectiveId); - void finalizeSetup(Core::IMode *mode, QWidget *central = 0); + void finalizeSetup(); void showStatusMessage(const QString &message, int timeoutMS); QDockWidget *dockWidget(const QByteArray &dockId) const; QByteArray currentPerspective() const { return m_currentPerspectiveId; } - QWidget *modeWindow(); - private: QDockWidget *registerDockWidget(const QByteArray &dockId, QWidget *widget); void loadPerspectiveHelper(const QByteArray &perspectiveId, bool fromStoredSettings = true); @@ -135,12 +133,8 @@ private: QHash<QByteArray, QDockWidget *> m_dockForDockId; QHash<QByteArray, QWidget *> m_toolbarForPerspectiveId; QHash<QByteArray, Perspective> m_perspectiveForPerspectiveId; - - // list of dock widgets to prevent memory leak - typedef QPointer<QDockWidget> DockPtr; - QList<DockPtr> m_dockWidgets; - - QWidget *m_modeWindow = 0; }; +QWidget *createModeWindow(Core::IMode *mode, DebuggerMainWindow *mainWindow, QWidget *central); + } // Utils diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 466912b119..da9e4a6d86 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -486,41 +486,27 @@ bool DummyEngine::hasCapability(unsigned cap) const class DebugModeContext : public IContext { public: - DebugModeContext(DebuggerMainWindow *mainWindow) : m_mainWindow(mainWindow) + DebugModeContext(QWidget *modeWindow) { setContext(Context(CC::C_EDITORMANAGER)); + setWidget(modeWindow); ICore::addContextObject(this); } - - QWidget *widget() const override { return m_mainWindow->modeWindow(); } - - DebuggerMainWindow *m_mainWindow; }; class DebugMode : public IMode { public: - DebugMode(DebuggerMainWindow *mainWindow) : m_mainWindow(mainWindow) + DebugMode() { setObjectName(QLatin1String("DebugMode")); setContext(Context(C_DEBUGMODE, CC::C_NAVIGATION_PANE)); setDisplayName(DebuggerPlugin::tr("Debug")); setIcon(Utils::Icon::modeIcon(Icons::MODE_DEBUGGER_CLASSIC, Icons::MODE_DEBUGGER_FLAT, Icons::MODE_DEBUGGER_FLAT_ACTIVE)); -// setIcon(Utils::Icon::modeIcon(Icons::MODE_ANALYZE_CLASSIC, -// Icons::MODE_ANALYZE_FLAT, Icons::MODE_ANALYZE_FLAT_ACTIVE)); setPriority(85); setId(MODE_DEBUG); } - - QWidget *widget() const override { return m_mainWindow->modeWindow(); } - - ~DebugMode() - { -// delete m_widget; - } - - DebuggerMainWindow *m_mainWindow; }; /////////////////////////////////////////////////////////////////////// @@ -924,7 +910,9 @@ public: void updateActiveLanguages(); public: - DebuggerMainWindow *m_mainWindow = 0; + QPointer<DebuggerMainWindow> m_mainWindow; + QPointer<QWidget> m_modeWindow; + QPointer<DebugMode> m_mode; QHash<Id, ActionDescription> m_descriptions; ActionContainer *m_menu = 0; @@ -1051,11 +1039,6 @@ DebuggerPluginPrivate::~DebuggerPluginPrivate() delete m_breakHandler; m_breakHandler = 0; - -// delete m_debugMode; -// m_debugMode = 0; - delete m_mainWindow; - m_mainWindow = 0; } DebuggerEngine *DebuggerPluginPrivate::dummyEngine() @@ -1073,6 +1056,42 @@ static QString msgParameterMissing(const QString &a) return DebuggerPlugin::tr("Option \"%1\" is missing the parameter.").arg(a); } +static Kit *guessKitFromParameters(const DebuggerRunParameters &rp) +{ + Kit *kit = 0; + + // Try to find a kit via ABI. + QList<Abi> abis; + if (rp.toolChainAbi.isValid()) + abis.push_back(rp.toolChainAbi); + else if (!rp.inferior.executable.isEmpty()) + abis = Abi::abisOfBinary(FileName::fromString(rp.inferior.executable)); + + if (!abis.isEmpty()) { + // Try exact abis. + kit = KitManager::find(KitMatcher([abis](const Kit *k) -> bool { + if (const ToolChain *tc = ToolChainKitInformation::toolChain(k)) + return abis.contains(tc->targetAbi()) && DebuggerKitInformation::isValidDebugger(k); + return false; + })); + if (!kit) { + // Or something compatible. + kit = KitManager::find(KitMatcher([abis](const Kit *k) -> bool { + if (const ToolChain *tc = ToolChainKitInformation::toolChain(k)) + foreach (const Abi &a, abis) + if (a.isCompatibleWith(tc->targetAbi()) && DebuggerKitInformation::isValidDebugger(k)) + return true; + return false; + })); + } + } + + if (!kit) + kit = KitManager::defaultKit(); + + return kit; +} + bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, const QStringList::const_iterator &cend, QString *errorMessage) { @@ -1135,6 +1154,9 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, rp.inferior.environment = Utils::Environment::systemEnvironment(); rp.stubEnvironment = Utils::Environment::systemEnvironment(); rp.debuggerEnvironment = Utils::Environment::systemEnvironment(); + + if (!kit) + kit = guessKitFromParameters(rp); m_scheduledStarts.append(QPair<DebuggerRunParameters, Kit *>(rp, kit)); return true; } @@ -1323,14 +1345,14 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, this, &DebuggerPluginPrivate::updateWatchersHeader, Qt::QueuedConnection); auto act = m_continueAction = new QAction(tr("Continue"), this); - act->setIcon(Icon::combinedIcon({Core::Icons::DEBUG_CONTINUE_SMALL.icon(), continueSideBarIcon})); + act->setIcon(Icon::combinedIcon({Icons::DEBUG_CONTINUE_SMALL.icon(), continueSideBarIcon})); connect(act, &QAction::triggered, this, &DebuggerPluginPrivate::handleExecContinue); act = m_exitAction = new QAction(tr("Stop Debugger"), this); - act->setIcon(Core::Icons::DEBUG_EXIT_SMALL.icon()); + act->setIcon(Icons::DEBUG_EXIT_SMALL.icon()); connect(act, &QAction::triggered, this, &DebuggerPluginPrivate::handleExecExit); - auto interruptIcon = Icon::combinedIcon({Core::Icons::DEBUG_INTERRUPT_SMALL.icon(), interruptSideBarIcon}); + auto interruptIcon = Icon::combinedIcon({Icons::DEBUG_INTERRUPT_SMALL.icon(), interruptSideBarIcon}); act = m_interruptAction = new QAction(tr("Interrupt"), this); act->setIcon(interruptIcon); connect(act, &QAction::triggered, this, &DebuggerPluginPrivate::handleExecInterrupt); @@ -1417,7 +1439,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, act = m_startAction = new QAction(this); const QIcon sideBarIcon = Icon::sideBarIcon(ProjectExplorer::Icons::DEBUG_START, ProjectExplorer::Icons::DEBUG_START_FLAT); - const QIcon debuggerIcon = Icon::combinedIcon({Core::Icons::DEBUG_START_SMALL.icon(), sideBarIcon}); + const QIcon debuggerIcon = Icon::combinedIcon({ProjectExplorer::Icons::DEBUG_START_SMALL.icon(), sideBarIcon}); act->setIcon(debuggerIcon); act->setText(tr("Start Debugging")); connect(act, &QAction::triggered, [] { ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE); }); @@ -1709,13 +1731,16 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged, this, &DebuggerPluginPrivate::updateDebugWithoutDeployMenu); + m_mainWindow->finalizeSetup(); + // Debug mode setup - auto mode = new DebugMode(m_mainWindow); + m_mode = new DebugMode; + m_modeWindow = createModeWindow(m_mode, m_mainWindow, 0); + m_mode->setWidget(m_modeWindow); - (void) new DebugModeContext(m_mainWindow); - m_mainWindow->finalizeSetup(mode); + m_plugin->addAutoReleasedObject(new DebugModeContext(m_mainWindow)); - m_plugin->addAutoReleasedObject(mode); + m_plugin->addObject(m_mode); connect(SessionManager::instance(), &SessionManager::startupProjectChanged, @@ -2074,6 +2099,8 @@ void DebuggerPlugin::attachExternalApplication(RunControl *rc) if (const RunConfiguration *runConfiguration = rc->runConfiguration()) if (const Target *target = runConfiguration->target()) kit = target->kit(); + if (!kit) + kit = guessKitFromParameters(rp); createAndScheduleRun(rp, kit); } @@ -3005,6 +3032,23 @@ void DebuggerPluginPrivate::aboutToShutdown() disconnect(SessionManager::instance(), SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), this, 0); + + m_mainWindow->saveCurrentPerspective(); + delete m_mainWindow; + m_mainWindow = 0; + + // removeObject leads to aboutToRemoveObject, which leads to + // ModeManager::aboutToRemove, which leads to the mode manager + // removing the mode's widget from the stackwidget + // (currently by index, but possibly the stackwidget resets the + // parent and stuff on the widget) + m_plugin->removeObject(m_mode); + + delete m_modeWindow; + m_modeWindow = 0; + + delete m_mode; + m_mode = 0; } void updateState(DebuggerEngine *engine) @@ -3172,7 +3216,6 @@ IPlugin::ShutdownFlag DebuggerPlugin::aboutToShutdown() { removeObject(this); dd->aboutToShutdown(); - dd->m_mainWindow->saveCurrentPerspective(); return SynchronousShutdown; } @@ -3479,15 +3522,15 @@ void registerToolbar(const QByteArray &perspectiveId, const ToolbarDescription & QAction *createStartAction() { - auto action = new QAction(DebuggerMainWindow::tr("Start"), 0); - action->setIcon(Debugger::Icons::ANALYZER_CONTROL_START.icon()); + auto action = new QAction(DebuggerMainWindow::tr("Start"), DebuggerPlugin::instance()); + action->setIcon(Icons::ANALYZER_CONTROL_START.icon()); action->setEnabled(true); return action; } QAction *createStopAction() { - auto action = new QAction(DebuggerMainWindow::tr("Stop"), 0); + auto action = new QAction(DebuggerMainWindow::tr("Stop"), DebuggerPlugin::instance()); action->setIcon(ProjectExplorer::Icons::STOP_SMALL.icon()); action->setEnabled(true); return action; diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index ce539d358f..5b2a8cbecb 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -43,6 +43,7 @@ #include <projectexplorer/environmentaspect.h> // For the environment #include <projectexplorer/project.h> #include <projectexplorer/projectexplorer.h> +#include <projectexplorer/projectexplorericons.h> #include <projectexplorer/runnables.h> #include <projectexplorer/target.h> #include <projectexplorer/taskhub.h> @@ -54,7 +55,6 @@ #include <utils/qtcprocess.h> #include <coreplugin/icore.h> #include <coreplugin/coreconstants.h> -#include <coreplugin/coreicons.h> #include <qmldebug/qmldebugcommandlinearguments.h> #include <qtsupport/qtkitinformation.h> @@ -111,7 +111,7 @@ DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfig, DebuggerEngi m_engine(engine), m_running(false) { - setIcon(Core::Icons::DEBUG_START_SMALL); + setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL); connect(this, &RunControl::finished, this, &DebuggerRunControl::handleFinished); connect(engine, &DebuggerEngine::requestRemoteSetup, @@ -321,6 +321,7 @@ void DebuggerRunControlCreator::initialize(const DebuggerStartParameters &sp) void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const Kit *kit) { m_runConfig = runConfig; + QTC_ASSERT(kit, return); Target *target = 0; Project *project = 0; @@ -329,13 +330,6 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const if (m_runConfig) target = m_runConfig->target(); - if (!kit && target) - kit = target->kit(); - - // Make sure we have something sensible to start with. - m_rp.inferior.runMode = ApplicationLauncher::Console; - m_rp.useTerminal = false; - // Extract as much as possible from available RunConfiguration. if (m_runConfig && m_runConfig->runnable().is<StandardRunnable>()) { m_rp.inferior = m_runConfig->runnable().as<StandardRunnable>(); @@ -351,46 +345,6 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const m_rp.inferior.executable = p.exe; } - if (!kit) { - // This code can only be reached when starting via the command line - // (-debug pid or executable) or attaching from runconfiguration - // without specifying a kit. Try to find a kit via ABI. - QList<Abi> abis; - if (m_rp.toolChainAbi.isValid()) { - abis.push_back(m_rp.toolChainAbi); - } else if (!m_rp.inferior.executable.isEmpty()) { - abis = Abi::abisOfBinary(FileName::fromString(m_rp.inferior.executable)); - } - - if (!abis.isEmpty()) { - // Try exact abis. - kit = KitManager::find(KitMatcher([abis](const Kit *k) -> bool { - if (const ToolChain *tc = ToolChainKitInformation::toolChain(k)) - return abis.contains(tc->targetAbi()) && DebuggerKitInformation::isValidDebugger(k); - return false; - })); - if (!kit) { - // Or something compatible. - kit = KitManager::find(KitMatcher([abis](const Kit *k) -> bool { - if (const ToolChain *tc = ToolChainKitInformation::toolChain(k)) - foreach (const Abi &a, abis) - if (a.isCompatibleWith(tc->targetAbi()) && DebuggerKitInformation::isValidDebugger(k)) - return true; - return false; - })); - } - } - } - - if (!kit) - kit = KitManager::defaultKit(); - - // We really should have a kit now. - if (!kit) { - m_errors.append(DebuggerKitInformation::tr("No kit found.")); - return; - } - m_rp.macroExpander = kit->macroExpander(); if (m_runConfig) { @@ -416,7 +370,7 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const if (project && m_rp.projectSourceFiles.isEmpty()) m_rp.projectSourceFiles = project->files(Project::SourceFiles); - if (false && project && kit) { + if (false && project) { const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit); m_rp.nativeMixedEnabled = version && version->qtVersion() >= QtSupport::QtVersionNumber(5, 7, 0); } @@ -622,7 +576,7 @@ public: // We cover only local setup here. Remote setups are handled by the // RunControl factories in the target specific plugins. DebuggerRunControlCreator creator; - creator.enrich(runConfig, 0); + creator.enrich(runConfig, runConfig->target()->kit()); creator.createRunControl(mode); if (errorMessage) *errorMessage = creator.fullError(); @@ -660,6 +614,7 @@ QObject *createDebuggerRunControlFactory(QObject *parent) */ DebuggerRunControl *createAndScheduleRun(const DebuggerRunParameters &rp, const Kit *kit) { + QTC_ASSERT(kit, return 0); // Caller needs to look for a suitable kit. DebuggerRunControlCreator creator; creator.m_rp = rp; creator.enrich(0, kit); @@ -683,9 +638,10 @@ DebuggerRunControl *createDebuggerRunControl(const DebuggerStartParameters &sp, QString *errorMessage, Core::Id runMode) { + QTC_ASSERT(runConfig, return 0); DebuggerRunControlCreator creator; creator.initialize(sp); - creator.enrich(runConfig, 0); + creator.enrich(runConfig, runConfig->target()->kit()); creator.createRunControl(runMode); if (errorMessage) *errorMessage = creator.fullError(); diff --git a/src/plugins/coreplugin/images/continue_overlay_small.png b/src/plugins/debugger/images/continue_overlay_small.png Binary files differindex 75df55d1f6..75df55d1f6 100644 --- a/src/plugins/coreplugin/images/continue_overlay_small.png +++ b/src/plugins/debugger/images/continue_overlay_small.png diff --git a/src/plugins/coreplugin/images/continue_overlay_small@2x.png b/src/plugins/debugger/images/continue_overlay_small@2x.png Binary files differindex 5fc601ca17..5fc601ca17 100644 --- a/src/plugins/coreplugin/images/continue_overlay_small@2x.png +++ b/src/plugins/debugger/images/continue_overlay_small@2x.png diff --git a/src/plugins/coreplugin/images/interrupt_overlay_small.png b/src/plugins/debugger/images/interrupt_overlay_small.png Binary files differindex e61b75384a..e61b75384a 100644 --- a/src/plugins/coreplugin/images/interrupt_overlay_small.png +++ b/src/plugins/debugger/images/interrupt_overlay_small.png diff --git a/src/plugins/coreplugin/images/interrupt_overlay_small@2x.png b/src/plugins/debugger/images/interrupt_overlay_small@2x.png Binary files differindex 2d686964bf..2d686964bf 100644 --- a/src/plugins/coreplugin/images/interrupt_overlay_small@2x.png +++ b/src/plugins/debugger/images/interrupt_overlay_small@2x.png diff --git a/src/plugins/coreplugin/images/stop_overlay_small.png b/src/plugins/debugger/images/stop_overlay_small.png Binary files differindex 8350ba9eec..8350ba9eec 100644 --- a/src/plugins/coreplugin/images/stop_overlay_small.png +++ b/src/plugins/debugger/images/stop_overlay_small.png diff --git a/src/plugins/coreplugin/images/stop_overlay_small@2x.png b/src/plugins/debugger/images/stop_overlay_small@2x.png Binary files differindex f0fb92f670..f0fb92f670 100644 --- a/src/plugins/coreplugin/images/stop_overlay_small@2x.png +++ b/src/plugins/debugger/images/stop_overlay_small@2x.png diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 1337cb864f..4852bf1c97 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -1078,16 +1078,24 @@ Qt::ItemFlags WatchModel::flags(const QModelIndex &idx) const const Qt::ItemFlags notEditable = Qt::ItemIsSelectable | Qt::ItemIsEnabled; const Qt::ItemFlags editable = notEditable | Qt::ItemIsEditable; + bool isRunning = true; + switch (state) { + case InferiorStopOk: + case InferiorUnrunnable: + case DebuggerNotReady: + case DebuggerFinished: + isRunning = false; + break; + default: + break; + } if (item->isWatcher()) { if (state == InferiorUnrunnable) return (column == 0 && item->iname.count('.') == 1) ? editable : notEditable; - if (state != InferiorStopOk - && state != DebuggerNotReady - && state != DebuggerFinished - && !m_engine->hasCapability(AddWatcherWhileRunningCapability)) - return Qt::ItemFlags(); + if (isRunning && !m_engine->hasCapability(AddWatcherWhileRunningCapability)) + return notEditable; if (column == 0 && item->iname.count('.') == 1) return editable; // Watcher names are editable. if (column == 1 && item->arrayIndex >= 0) @@ -1101,8 +1109,10 @@ Qt::ItemFlags WatchModel::flags(const QModelIndex &idx) const return editable; // Watcher values are sometimes editable. } } else if (item->isLocal()) { - if (state != InferiorStopOk && !m_engine->hasCapability(AddWatcherWhileRunningCapability)) - return Qt::ItemFlags(); + if (state == InferiorUnrunnable) + return notEditable; + if (isRunning && !m_engine->hasCapability(AddWatcherWhileRunningCapability)) + return notEditable; if (column == 1 && item->valueEditable && !item->elided) return editable; // Locals values are sometimes editable. if (column == 1 && item->arrayIndex >= 0) @@ -1787,7 +1797,7 @@ static void showInEditorHelper(const WatchItem *item, QTextStream &ts, int depth { const QChar tab = QLatin1Char('\t'); const QChar nl = QLatin1Char('\n'); - ts << QString(depth, tab) << item->name << tab << item->value << tab + ts << QString(depth, tab) << item->name << tab << displayValue(item) << tab << item->type << nl; foreach (const TreeItem *child, item->children()) showInEditorHelper(static_cast<const WatchItem *>(child), ts, depth + 1); diff --git a/src/plugins/help/help.qrc b/src/plugins/help/help.qrc index a0b727d945..0532deb782 100644 --- a/src/plugins/help/help.qrc +++ b/src/plugins/help/help.qrc @@ -3,7 +3,9 @@ <file>images/find.png</file> <file>images/book.png</file> <file>images/home.png</file> + <file>images/home@2x.png</file> <file>images/bookmark.png</file> + <file>images/bookmark@2x.png</file> <file>images/category_help.png</file> <file>images/mode_help.png</file> <file>images/mode_help@2x.png</file> diff --git a/src/plugins/help/images/bookmark.png b/src/plugins/help/images/bookmark.png Binary files differindex 57e57e343b..4e2a562ac0 100644 --- a/src/plugins/help/images/bookmark.png +++ b/src/plugins/help/images/bookmark.png diff --git a/src/plugins/help/images/bookmark@2x.png b/src/plugins/help/images/bookmark@2x.png Binary files differnew file mode 100644 index 0000000000..6281a74230 --- /dev/null +++ b/src/plugins/help/images/bookmark@2x.png diff --git a/src/plugins/help/images/home.png b/src/plugins/help/images/home.png Binary files differindex 9cee3025d0..45b92a001e 100644 --- a/src/plugins/help/images/home.png +++ b/src/plugins/help/images/home.png diff --git a/src/plugins/help/images/home@2x.png b/src/plugins/help/images/home@2x.png Binary files differnew file mode 100644 index 0000000000..72629cb719 --- /dev/null +++ b/src/plugins/help/images/home@2x.png diff --git a/src/plugins/help/qtwebkithelpviewer.cpp b/src/plugins/help/qtwebkithelpviewer.cpp index 6b3541a273..395a89df9c 100644 --- a/src/plugins/help/qtwebkithelpviewer.cpp +++ b/src/plugins/help/qtwebkithelpviewer.cpp @@ -136,9 +136,9 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation op, return new HelpNetworkReply(request, data.data, data.mimeType); } -// - HelpPage +// - QtWebKitHelpPage -HelpPage::HelpPage(QObject *parent) +QtWebKitHelpPage::QtWebKitHelpPage(QObject *parent) : QWebPage(parent) , closeNewTabIfNeeded(false) , m_pressedButtons(Qt::NoButton) @@ -149,18 +149,18 @@ HelpPage::HelpPage(QObject *parent) SLOT(onHandleUnsupportedContent(QNetworkReply*))); } -QWebPage *HelpPage::createWindow(QWebPage::WebWindowType) +QWebPage *QtWebKitHelpPage::createWindow(QWebPage::WebWindowType) { // TODO: ensure that we'll get a QtWebKitHelpViewer here QtWebKitHelpViewer* viewer = static_cast<QtWebKitHelpViewer *>(OpenPagesManager::instance() .createPage()); - HelpPage *newPage = viewer->page(); + QtWebKitHelpPage *newPage = viewer->page(); newPage->closeNewTabIfNeeded = closeNewTabIfNeeded; closeNewTabIfNeeded = false; return newPage; } -void HelpPage::triggerAction(WebAction action, bool checked) +void QtWebKitHelpPage::triggerAction(WebAction action, bool checked) { switch (action) { case OpenLinkInNewWindow: @@ -171,7 +171,7 @@ void HelpPage::triggerAction(WebAction action, bool checked) } } -bool HelpPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, +bool QtWebKitHelpPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type) { const bool closeNewTab = closeNewTabIfNeeded; @@ -198,7 +198,7 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest & return true; } -void HelpPage::onHandleUnsupportedContent(QNetworkReply *reply) +void QtWebKitHelpPage::onHandleUnsupportedContent(QNetworkReply *reply) { // sub resource of this page if (m_loadingUrl != reply->url()) { @@ -254,7 +254,7 @@ QtWebKitHelpWidget::QtWebKitHelpWidget(QtWebKitHelpViewer *parent) QWebSettings::globalSettings()->setAttribute(QWebSettings::DnsPrefetchEnabled, true); - setPage(new HelpPage(this)); + setPage(new QtWebKitHelpPage(this)); HelpNetworkAccessManager *manager = new HelpNetworkAccessManager(this); page()->setNetworkAccessManager(manager); connect(manager, SIGNAL(finished(QNetworkReply*)), this, @@ -323,7 +323,7 @@ void QtWebKitHelpWidget::mousePressEvent(QMouseEvent *event) if (Utils::HostOsInfo::isLinuxHost() && m_parent->handleForwardBackwardMouseButtons(event)) return; - if (HelpPage *currentPage = static_cast<HelpPage*>(page())) { + if (QtWebKitHelpPage *currentPage = static_cast<QtWebKitHelpPage*>(page())) { currentPage->m_pressedButtons = event->buttons(); currentPage->m_keyboardModifiers = event->modifiers(); } @@ -402,7 +402,7 @@ QtWebKitHelpViewer::QtWebKitHelpViewer(QWidget *parent) connect(m_webView->page(), SIGNAL(printRequested(QWebFrame*)), this, SIGNAL(printRequested())); connect(m_webView, SIGNAL(backwardAvailable(bool)), this, SIGNAL(backwardAvailable(bool))); connect(m_webView, SIGNAL(forwardAvailable(bool)), this, SIGNAL(forwardAvailable(bool))); - connect(page(), &HelpPage::linkHovered, this, &QtWebKitHelpViewer::setToolTip); + connect(page(), &QtWebKitHelpPage::linkHovered, this, &QtWebKitHelpViewer::setToolTip); } QFont QtWebKitHelpViewer::viewerFont() const @@ -582,9 +582,9 @@ bool QtWebKitHelpViewer::findText(const QString &text, FindFlags flags, return found; } -HelpPage *QtWebKitHelpViewer::page() const +QtWebKitHelpPage *QtWebKitHelpViewer::page() const { - return static_cast<HelpPage *>(m_webView->page()); + return static_cast<QtWebKitHelpPage *>(m_webView->page()); } void QtWebKitHelpViewer::copy() diff --git a/src/plugins/help/qtwebkithelpviewer.h b/src/plugins/help/qtwebkithelpviewer.h index 186d6f4b18..ff85a92a28 100644 --- a/src/plugins/help/qtwebkithelpviewer.h +++ b/src/plugins/help/qtwebkithelpviewer.h @@ -35,7 +35,7 @@ namespace Help { namespace Internal { -class HelpPage; +class QtWebKitHelpPage; class QtWebKitHelpWidget; class QtWebKitHelpViewer : public HelpViewer @@ -69,7 +69,7 @@ public: bool findText(const QString &text, Core::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped = 0); - HelpPage *page() const; + QtWebKitHelpPage *page() const; public slots: void scaleUp(); @@ -127,11 +127,11 @@ private: QtWebKitHelpViewer *m_parent; }; -class HelpPage : public QWebPage +class QtWebKitHelpPage : public QWebPage { Q_OBJECT public: - HelpPage(QObject *parent); + QtWebKitHelpPage(QObject *parent); protected: virtual QWebPage *createWindow(QWebPage::WebWindowType); diff --git a/src/plugins/help/textbrowserhelpviewer.h b/src/plugins/help/textbrowserhelpviewer.h index cbe56524ec..fccf79a532 100644 --- a/src/plugins/help/textbrowserhelpviewer.h +++ b/src/plugins/help/textbrowserhelpviewer.h @@ -81,8 +81,6 @@ private slots: void goToHistoryItem(); private: - QVariant loadResource(int type, const QUrl &name); - TextBrowserHelpWidget *m_textBrowser; }; @@ -109,11 +107,11 @@ private: QString linkAt(const QPoint& pos); void openLink(const QUrl &url, bool newPage); -public: int zoomCount; bool forceFont; bool m_openInNewPageActionVisible; TextBrowserHelpViewer *m_parent; + friend class Help::Internal::TextBrowserHelpViewer; }; } // namespace Internal diff --git a/src/plugins/help/webenginehelpviewer.cpp b/src/plugins/help/webenginehelpviewer.cpp index 5d2e2d2f35..55ebc4e57e 100644 --- a/src/plugins/help/webenginehelpviewer.cpp +++ b/src/plugins/help/webenginehelpviewer.cpp @@ -73,7 +73,7 @@ WebEngineHelpViewer::WebEngineHelpViewer(QWidget *parent) : HelpViewer(parent), m_widget(new WebView(this)) { - m_widget->setPage(new HelpPage(this)); + m_widget->setPage(new WebEngineHelpPage(this)); auto layout = new QVBoxLayout; setLayout(layout); layout->setContentsMargins(0, 0, 0, 0); @@ -226,9 +226,9 @@ bool WebEngineHelpViewer::findText(const QString &text, Core::FindFlags flags, b return true; } -HelpPage *WebEngineHelpViewer::page() const +WebEngineHelpPage *WebEngineHelpViewer::page() const { - return static_cast<HelpPage *>(m_widget->page()); + return static_cast<WebEngineHelpPage *>(m_widget->page()); } void WebEngineHelpViewer::scaleUp() @@ -271,12 +271,12 @@ void WebEngineHelpViewer::print(QPrinter *printer) Q_UNUSED(printer) } -HelpPage::HelpPage(QObject *parent) +WebEngineHelpPage::WebEngineHelpPage(QObject *parent) : QWebEnginePage(parent) { } -QWebEnginePage *HelpPage::createWindow(QWebEnginePage::WebWindowType) +QWebEnginePage *WebEngineHelpPage::createWindow(QWebEnginePage::WebWindowType) { auto viewer = static_cast<WebEngineHelpViewer *>(OpenPagesManager::instance().createPage()); return viewer->page(); diff --git a/src/plugins/help/webenginehelpviewer.h b/src/plugins/help/webenginehelpviewer.h index 7d777ab487..ba8d0adfb3 100644 --- a/src/plugins/help/webenginehelpviewer.h +++ b/src/plugins/help/webenginehelpviewer.h @@ -40,10 +40,10 @@ public: void requestStarted(QWebEngineUrlRequestJob *job) override; }; -class HelpPage : public QWebEnginePage +class WebEngineHelpPage : public QWebEnginePage { public: - explicit HelpPage(QObject *parent = 0); + explicit WebEngineHelpPage(QObject *parent = 0); QWebEnginePage *createWindow(QWebEnginePage::WebWindowType) override; }; @@ -83,7 +83,7 @@ public: void setOpenInNewPageActionVisible(bool visible) override; bool findText(const QString &text, Core::FindFlags flags, bool incremental, bool fromSearch, bool *wrapped) override; - HelpPage *page() const; + WebEngineHelpPage *page() const; public slots: void scaleUp() override; diff --git a/src/plugins/ios/iosruncontrol.cpp b/src/plugins/ios/iosruncontrol.cpp index 90b276119c..47e019a6e6 100644 --- a/src/plugins/ios/iosruncontrol.cpp +++ b/src/plugins/ios/iosruncontrol.cpp @@ -28,8 +28,8 @@ #include "iosrunconfiguration.h" #include "iosrunner.h" -#include <coreplugin/coreicons.h> #include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/projectexplorericons.h> using namespace ProjectExplorer; @@ -41,7 +41,7 @@ IosRunControl::IosRunControl(IosRunConfiguration *rc) , m_runner(new IosRunner(this, rc, false, QmlDebug::NoQmlDebugServices)) , m_running(false) { - setIcon(Core::Icons::DEBUG_START_SMALL); + setIcon(Icons::RUN_SMALL); } IosRunControl::~IosRunControl() diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 0ca23e9e7d..4084290281 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -181,7 +181,7 @@ AppOutputPane::AppOutputPane() : // Attach m_attachButton->setToolTip(msgAttachDebuggerTooltip()); m_attachButton->setEnabled(false); - m_attachButton->setIcon(Core::Icons::DEBUG_START_SMALL.icon()); + m_attachButton->setIcon(Icons::DEBUG_START_SMALL.icon()); m_attachButton->setAutoRaise(true); connect(m_attachButton, &QAbstractButton::clicked, diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index f1f3d5dbbd..b65ee82776 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -62,6 +62,7 @@ static const char compilerCommandKeyC[] = "ProjectExplorer.GccToolChain.Path"; static const char compilerPlatformCodeGenFlagsKeyC[] = "ProjectExplorer.GccToolChain.PlatformCodeGenFlags"; static const char compilerPlatformLinkerFlagsKeyC[] = "ProjectExplorer.GccToolChain.PlatformLinkerFlags"; static const char targetAbiKeyC[] = "ProjectExplorer.GccToolChain.TargetAbi"; +static const char originalTargetTripleKeyC[] = "ProjectExplorer.GccToolChain.OriginalTargetTriple"; static const char supportedAbisKeyC[] = "ProjectExplorer.GccToolChain.SupportedAbis"; static QByteArray runGcc(const FileName &gcc, const QStringList &arguments, const QStringList &env) @@ -214,19 +215,20 @@ static QList<Abi> guessGccAbi(const QString &m, const QByteArray ¯os) return abiList; } -static QList<Abi> guessGccAbi(const FileName &path, const QStringList &env, - const QByteArray ¯os, - const QStringList &extraArgs = QStringList()) + +static GccToolChain::DetectedAbisResult guessGccAbi(const FileName &path, const QStringList &env, + const QByteArray ¯os, + const QStringList &extraArgs = QStringList()) { if (path.isEmpty()) - return QList<Abi>(); + return GccToolChain::DetectedAbisResult(); QStringList arguments = extraArgs; arguments << QLatin1String("-dumpmachine"); QString machine = QString::fromLocal8Bit(runGcc(path, arguments, env)).trimmed(); if (machine.isEmpty()) - return QList<Abi>(); // no need to continue if running failed once... - return guessGccAbi(machine, macros); + return GccToolChain::DetectedAbisResult(); // no need to continue if running failed once... + return GccToolChain::DetectedAbisResult(guessGccAbi(machine, macros), machine); } static QString gccVersion(const FileName &path, const QStringList &env) @@ -260,6 +262,11 @@ void GccToolChain::setSupportedAbis(const QList<Abi> &m_abis) m_supportedAbis = m_abis; } +void GccToolChain::setOriginalTargetTriple(const QString &targetTriple) +{ + m_originalTargetTriple = targetTriple; +} + void GccToolChain::setMacroCache(const QStringList &allCxxflags, const QByteArray ¯os) const { if (macros.isNull()) @@ -318,6 +325,11 @@ Abi GccToolChain::targetAbi() const return m_targetAbi; } +QString GccToolChain::originalTargetTriple() const +{ + return m_originalTargetTriple; +} + QString GccToolChain::version() const { if (m_version.isEmpty()) @@ -620,7 +632,9 @@ void GccToolChain::resetToolChain(const FileName &path) setCompilerCommand(path); Abi currentAbi = m_targetAbi; - m_supportedAbis = detectSupportedAbis(); + const DetectedAbisResult detectedAbis = detectSupportedAbis(); + m_supportedAbis = detectedAbis.supportedAbis; + m_originalTargetTriple = detectedAbis.originalTargetTriple; m_targetAbi = Abi(); if (!m_supportedAbis.isEmpty()) { @@ -687,6 +701,7 @@ QVariantMap GccToolChain::toMap() const data.insert(QLatin1String(compilerPlatformCodeGenFlagsKeyC), m_platformCodeGenFlags); data.insert(QLatin1String(compilerPlatformLinkerFlagsKeyC), m_platformLinkerFlags); data.insert(QLatin1String(targetAbiKeyC), m_targetAbi.toString()); + data.insert(QLatin1String(originalTargetTripleKeyC), m_originalTargetTriple); QStringList abiList = Utils::transform(m_supportedAbis, &Abi::toString); data.insert(QLatin1String(supportedAbisKeyC), abiList); return data; @@ -701,6 +716,7 @@ bool GccToolChain::fromMap(const QVariantMap &data) m_platformCodeGenFlags = data.value(QLatin1String(compilerPlatformCodeGenFlagsKeyC)).toStringList(); m_platformLinkerFlags = data.value(QLatin1String(compilerPlatformLinkerFlagsKeyC)).toStringList(); m_targetAbi = Abi(data.value(QLatin1String(targetAbiKeyC)).toString()); + m_originalTargetTriple = data.value(QLatin1String(originalTargetTripleKeyC)).toString(); QStringList abiList = data.value(QLatin1String(supportedAbisKeyC)).toStringList(); m_supportedAbis.clear(); foreach (const QString &a, abiList) { @@ -730,11 +746,14 @@ ToolChainConfigWidget *GccToolChain::configurationWidget() void GccToolChain::updateSupportedAbis() const { - if (m_supportedAbis.isEmpty()) - m_supportedAbis = detectSupportedAbis(); + if (m_supportedAbis.isEmpty()) { + const DetectedAbisResult detected = detectSupportedAbis(); + m_supportedAbis = detected.supportedAbis; + m_originalTargetTriple = detected.originalTargetTriple; + } } -QList<Abi> GccToolChain::detectSupportedAbis() const +GccToolChain::DetectedAbisResult GccToolChain::detectSupportedAbis() const { Environment env = Environment::systemEnvironment(); addToEnvironment(env); @@ -827,7 +846,10 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains(const QString &comp GccToolChain::addCommandPathToEnvironment(compilerPath, systemEnvironment); QByteArray macros = gccPredefinedMacros(compilerPath, gccPredefinedMacrosOptions(), systemEnvironment.toStringList()); - QList<Abi> abiList = guessGccAbi(compilerPath, systemEnvironment.toStringList(), macros); + const GccToolChain::DetectedAbisResult detectedAbis = guessGccAbi(compilerPath, + systemEnvironment.toStringList(), + macros); + QList<Abi> abiList = detectedAbis.supportedAbis; if (!abiList.contains(requiredAbi)) { if (requiredAbi.wordWidth() != 64 || !abiList.contains(Abi(requiredAbi.architecture(), requiredAbi.os(), requiredAbi.osFlavor(), @@ -844,6 +866,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains(const QString &comp tc->setCompilerCommand(compilerPath); tc->setSupportedAbis(abiList); tc->setTargetAbi(abi); + tc->setOriginalTargetTriple(detectedAbis.originalTargetTriple); tc->setDisplayName(tc->defaultDisplayName()); // reset displayname result.append(tc.take()); @@ -902,6 +925,7 @@ void GccToolChainConfigWidget::applyImpl() tc->setCompilerCommand(m_compilerCommand->fileName()); tc->setSupportedAbis(m_abiWidget->supportedAbis()); tc->setTargetAbi(m_abiWidget->currentAbi()); + tc->setOriginalTargetTriple(tc->detectSupportedAbis().originalTargetTriple); tc->setDisplayName(displayName); // reset display name tc->setPlatformCodeGenFlags(splitString(m_platformCodeGenFlagsLineEdit->text())); tc->setPlatformLinkerFlags(splitString(m_platformLinkerFlagsLineEdit->text())); @@ -975,7 +999,7 @@ void GccToolChainConfigWidget::handleCompilerCommandChange() QStringList args = gccPredefinedMacrosOptions() + splitString(m_platformCodeGenFlagsLineEdit->text()); m_macros = gccPredefinedMacros(path, args, env.toStringList()); abiList = guessGccAbi(path, env.toStringList(), m_macros, - splitString(m_platformCodeGenFlagsLineEdit->text())); + splitString(m_platformCodeGenFlagsLineEdit->text())).supportedAbis; } m_abiWidget->setEnabled(haveCompiler); diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 849bee9f10..33c900537a 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -54,6 +54,7 @@ public: GccToolChain(Core::Id typeId, Detection d); QString typeDisplayName() const override; Abi targetAbi() const override; + QString originalTargetTriple() const override; QString version() const; QList<Abi> supportedAbis() const; void setTargetAbi(const Abi &); @@ -89,6 +90,19 @@ public: static void addCommandPathToEnvironment(const Utils::FileName &command, Utils::Environment &env); + class DetectedAbisResult { + public: + DetectedAbisResult() = default; + DetectedAbisResult(const QList<Abi> &supportedAbis, + const QString &originalTargetTriple = QString()) + : supportedAbis(supportedAbis) + , originalTargetTriple(originalTargetTriple) + {} + + QList<Abi> supportedAbis; + QString originalTargetTriple; + }; + protected: typedef QList<QPair<QStringList, QByteArray> > GccCache; @@ -98,13 +112,14 @@ protected: void setCompilerCommand(const Utils::FileName &path); void setSupportedAbis(const QList<Abi> &m_abis); + void setOriginalTargetTriple(const QString &targetTriple); void setMacroCache(const QStringList &allCxxflags, const QByteArray ¯oCache) const; QByteArray macroCache(const QStringList &allCxxflags) const; virtual QString defaultDisplayName() const; virtual CompilerFlags defaultCompilerFlags() const; - virtual QList<Abi> detectSupportedAbis() const; + virtual DetectedAbisResult detectSupportedAbis() const; virtual QString detectVersion() const; // Reinterpret options for compiler drivers inheriting from GccToolChain (e.g qcc) to apply -Wp option @@ -139,6 +154,7 @@ private: Abi m_targetAbi; mutable QList<Abi> m_supportedAbis; + mutable QString m_originalTargetTriple; mutable QList<HeaderPath> m_headerPaths; mutable QString m_version; diff --git a/src/plugins/coreplugin/images/debugger_overlay_small.png b/src/plugins/projectexplorer/images/debugger_overlay_small.png Binary files differindex deb68239db..deb68239db 100644 --- a/src/plugins/coreplugin/images/debugger_overlay_small.png +++ b/src/plugins/projectexplorer/images/debugger_overlay_small.png diff --git a/src/plugins/coreplugin/images/debugger_overlay_small@2x.png b/src/plugins/projectexplorer/images/debugger_overlay_small@2x.png Binary files differindex fe9107f75f..fe9107f75f 100644 --- a/src/plugins/coreplugin/images/debugger_overlay_small@2x.png +++ b/src/plugins/projectexplorer/images/debugger_overlay_small@2x.png diff --git a/src/plugins/coreplugin/images/run_overlay_small.png b/src/plugins/projectexplorer/images/run_overlay_small.png Binary files differindex db22edd2fb..db22edd2fb 100644 --- a/src/plugins/coreplugin/images/run_overlay_small.png +++ b/src/plugins/projectexplorer/images/run_overlay_small.png diff --git a/src/plugins/coreplugin/images/run_overlay_small@2x.png b/src/plugins/projectexplorer/images/run_overlay_small@2x.png Binary files differindex a5ec8416b6..a5ec8416b6 100644 --- a/src/plugins/coreplugin/images/run_overlay_small@2x.png +++ b/src/plugins/projectexplorer/images/run_overlay_small@2x.png diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 8e92a6613c..0448ad2e15 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1352,6 +1352,15 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er return bc ? bc->displayName() : QString(); }); + expander->registerVariable(Constants::VAR_CURRENTRUN_NAME, + tr("The currently active run configuration's name."), + [this]() -> QString { + if (Target *target = activeTarget()) { + if (RunConfiguration *rc = target->activeRunConfiguration()) + return rc->displayName(); + } + return QString(); + }); expander->registerVariable(Constants::VAR_CURRENTBUILD_TYPE, tr("The currently active build configuration's type."), @@ -3232,32 +3241,35 @@ void ProjectExplorerPluginPrivate::handleRenameFile() void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath) { - QString orgFilePath = node->filePath().toFileInfo().absoluteFilePath(); + const QString oldFilePath = node->filePath().toFileInfo().absoluteFilePath(); FolderNode *folderNode = node->parentFolderNode(); - QString projectFileName = folderNode->projectNode()->filePath().fileName(); + const QString projectFileName = folderNode->projectNode()->filePath().fileName(); + + if (oldFilePath == newFilePath) + return; - if (!folderNode->canRenameFile(orgFilePath, newFilePath)) { - QTimer::singleShot(0, [orgFilePath, newFilePath, projectFileName] { + if (!folderNode->canRenameFile(oldFilePath, newFilePath)) { + QTimer::singleShot(0, [oldFilePath, newFilePath, projectFileName] { int res = QMessageBox::question(ICore::mainWindow(), tr("Project Editing Failed"), tr("The project file %1 cannot be automatically changed.\n\n" "Rename %2 to %3 anyway?") .arg(projectFileName) - .arg(QDir::toNativeSeparators(orgFilePath)) + .arg(QDir::toNativeSeparators(oldFilePath)) .arg(QDir::toNativeSeparators(newFilePath))); if (res == QMessageBox::Yes) - FileUtils::renameFile(orgFilePath, newFilePath); + FileUtils::renameFile(oldFilePath, newFilePath); }); return; } - if (FileUtils::renameFile(orgFilePath, newFilePath)) { + if (FileUtils::renameFile(oldFilePath, newFilePath)) { // Tell the project plugin about rename - if (!folderNode->renameFile(orgFilePath, newFilePath)) { + if (!folderNode->renameFile(oldFilePath, newFilePath)) { const QString renameFileError = tr("The file %1 was renamed to %2, but the project file %3 could not be automatically changed.") - .arg(QDir::toNativeSeparators(orgFilePath)) + .arg(QDir::toNativeSeparators(oldFilePath)) .arg(QDir::toNativeSeparators(newFilePath)) .arg(projectFileName); @@ -3269,7 +3281,7 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFilePath) } } else { const QString renameFileError = tr("The file %1 could not be renamed %2.") - .arg(QDir::toNativeSeparators(orgFilePath)) + .arg(QDir::toNativeSeparators(oldFilePath)) .arg(QDir::toNativeSeparators(newFilePath)); QTimer::singleShot(0, [renameFileError]() { diff --git a/src/plugins/projectexplorer/projectexplorer.qrc b/src/plugins/projectexplorer/projectexplorer.qrc index f86e900594..e8d0044e3f 100644 --- a/src/plugins/projectexplorer/projectexplorer.qrc +++ b/src/plugins/projectexplorer/projectexplorer.qrc @@ -24,6 +24,10 @@ <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> diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index 740e819025..15c657b249 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -236,6 +236,7 @@ const char VAR_CURRENTKIT_FILESYSTEMNAME[] = "CurrentKit:FileSystemName"; const char VAR_CURRENTKIT_ID[] = "CurrentKit:Id"; const char VAR_CURRENTBUILD_NAME[] = "CurrentBuild:Name"; const char VAR_CURRENTBUILD_TYPE[] = "CurrentBuild:Type"; +const char VAR_CURRENTRUN_NAME[] = "CurrentRun:Name"; const char VAR_CURRENTDEVICE_HOSTADDRESS[] = "CurrentDevice:HostAddress"; const char VAR_CURRENTDEVICE_SSHPORT[] = "CurrentDevice:SshPort"; const char VAR_CURRENTDEVICE_USERNAME[] = "CurrentDevice:UserName"; diff --git a/src/plugins/projectexplorer/projectexplorericons.h b/src/plugins/projectexplorer/projectexplorericons.h index 447c94ea5e..05a2ce3c36 100644 --- a/src/plugins/projectexplorer/projectexplorericons.h +++ b/src/plugins/projectexplorer/projectexplorericons.h @@ -57,6 +57,9 @@ const Utils::Icon DEBUG_START( 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}}); +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}}); const Utils::Icon BUILDSTEP_MOVEUP({ {QLatin1String(":/projectexplorer/images/buildstepmoveup.png"), Utils::Theme::PanelTextColorDark}}, Utils::Icon::Tint); diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 14fb83641b..c83c064de5 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -256,6 +256,9 @@ void RunConfiguration::ctor() BuildConfiguration *bc = target()->activeBuildConfiguration(); return bc ? bc->macroExpander() : target()->macroExpander(); }); + expander->registerVariable(Constants::VAR_CURRENTRUN_NAME, + QCoreApplication::translate("ProjectExplorer", "The currently active run configuration's name."), + [this] { return displayName(); }, false); } /*! diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index e00c2136aa..cac15dce6a 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -80,6 +80,7 @@ public: Core::Id typeId() const; virtual QString typeDisplayName() const = 0; virtual Abi targetAbi() const = 0; + virtual QString originalTargetTriple() const { return QString(); } virtual bool isValid() const = 0; diff --git a/src/plugins/qbsprojectmanager/qbsprojectparser.cpp b/src/plugins/qbsprojectmanager/qbsprojectparser.cpp index 5192ad38ef..e4fc351edf 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectparser.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectparser.cpp @@ -103,6 +103,8 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env, params.setSearchPaths(prefs.searchPaths(resourcesBaseDirectory())); params.setPluginPaths(prefs.pluginPaths(pluginsBaseDirectory())); params.setLibexecPath(libExecDirectory()); + params.setProductErrorMode(qbs::ErrorHandlingMode::Relaxed); + params.setPropertyCheckingMode(qbs::ErrorHandlingMode::Relaxed); m_qbsSetupProjectJob = m_project.setupProject(params, QbsManager::logSink(), 0); diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.cpp index d83879e6da..2bdf16f76c 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.cpp @@ -53,10 +53,6 @@ using namespace TextEditor; namespace QmakeProjectManager { -QmakeManager::~QmakeManager() -{ -} - void QmakeManager::registerProject(QmakeProject *project) { m_projects.append(project); diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h index ece682f76d..28b8014bb6 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h @@ -48,8 +48,6 @@ class QMAKEPROJECTMANAGER_EXPORT QmakeManager : public ProjectExplorer::IProject Q_OBJECT public: - ~QmakeManager(); - void registerProject(QmakeProject *project); void unregisterProject(QmakeProject *project); void notifyChanged(const Utils::FileName &name); diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp index 97c691c4f6..43a8d57030 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp @@ -125,7 +125,7 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString ActionManager::actionContainer(ProjectExplorer::Constants::M_FILECONTEXT); //register actions - Command *command; + Command *command = nullptr; m_buildSubProjectContextMenu = new Utils::ParameterAction(tr("Build"), tr("Build \"%1\""), Utils::ParameterAction::AlwaysEnabled/*handled manually*/, @@ -303,7 +303,7 @@ void QmakeProjectManagerPlugin::updateRunQMakeAction() bool enable = true; if (BuildManager::isBuilding(m_previousStartupProject)) enable = false; - QmakeProject *pro = qobject_cast<QmakeProject *>(m_previousStartupProject); + auto pro = qobject_cast<QmakeProject *>(m_previousStartupProject); m_runQMakeAction->setVisible(pro); if (!pro || !pro->activeTarget() @@ -317,20 +317,20 @@ void QmakeProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node { m_addLibraryActionContextMenu->setEnabled(dynamic_cast<QmakeProFileNode *>(node)); - QmakeProFileNode *proFileNode = dynamic_cast<QmakeProFileNode *>(node); - QmakeProject *qmakeProject = qobject_cast<QmakeProject *>(project); - QmakeProFileNode *subProjectNode = 0; + auto proFileNode = dynamic_cast<QmakeProFileNode *>(node); + auto qmakeProject = qobject_cast<QmakeProject *>(project); + QmakeProFileNode *subProjectNode = nullptr; if (node) { - if (QmakePriFileNode *subPriFileNode = dynamic_cast<QmakePriFileNode *>(node->projectNode())) + if (auto subPriFileNode = dynamic_cast<QmakePriFileNode *>(node->projectNode())) subProjectNode = subPriFileNode->proFileNode(); } - ProjectExplorer::FileNode *fileNode = node ? node->asFileNode() : 0; + ProjectExplorer::FileNode *fileNode = node ? node->asFileNode() : nullptr; bool buildFilePossible = subProjectNode && fileNode && (fileNode->fileType() == ProjectExplorer::SourceType); m_qmakeProjectManager->setContextNode(subProjectNode); m_qmakeProjectManager->setContextProject(qmakeProject); - m_qmakeProjectManager->setContextFile(buildFilePossible ? fileNode : 0); + m_qmakeProjectManager->setContextFile(buildFilePossible ? fileNode : nullptr); bool subProjectActionsVisible = qmakeProject && subProjectNode && (subProjectNode != qmakeProject->rootProjectNode()); @@ -344,8 +344,8 @@ void QmakeProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node m_buildSubProjectContextMenu->setParameter(subProjectName); m_buildFileAction->setParameter(buildFilePossible ? fileNode->filePath().fileName() : QString()); - QmakeBuildConfiguration *buildConfiguration = (qmakeProject && qmakeProject->activeTarget()) ? - static_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration()) : 0; + auto buildConfiguration = (qmakeProject && qmakeProject->activeTarget()) ? + static_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration()) : nullptr; bool isProjectNode = qmakeProject && proFileNode && buildConfiguration; bool isBuilding = BuildManager::isBuilding(project); bool enabled = subProjectActionsVisible && !isBuilding; diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp index 40ee9645dc..72de3a7cd0 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp @@ -34,6 +34,7 @@ #include "metainfo.h" #include <utils/stylehelper.h> +#include <utils/theme/theme.h> #include <QLineEdit> #include <QPen> @@ -169,18 +170,23 @@ NavigatorTreeView::NavigatorTreeView(QWidget *parent) void NavigatorTreeView::drawSelectionBackground(QPainter *painter, const QStyleOption &option) { painter->save(); - QLinearGradient gradient; - - QColor highlightColor = Utils::StyleHelper::notTooBrightHighlightColor(); - gradient.setColorAt(0, highlightColor.lighter(130)); - gradient.setColorAt(1, highlightColor.darker(130)); - gradient.setStart(option.rect.topLeft()); - gradient.setFinalStop(option.rect.bottomLeft()); - painter->fillRect(option.rect, gradient); - painter->setPen(highlightColor.lighter()); - painter->drawLine(option.rect.topLeft(),option.rect.topRight()); - painter->setPen(highlightColor.darker()); - painter->drawLine(option.rect.bottomLeft(),option.rect.bottomRight()); + if (Utils::creatorTheme()->widgetStyle() == Utils::Theme::StyleFlat) { + painter->setOpacity(0.5); + painter->fillRect(option.rect, option.palette.color(QPalette::Highlight)); + } else { + const QColor highlightColor = Utils::StyleHelper::notTooBrightHighlightColor(); + QLinearGradient gradient; + gradient.setColorAt(0, highlightColor.lighter(130)); + gradient.setColorAt(1, highlightColor.darker(130)); + gradient.setStart(option.rect.topLeft()); + gradient.setFinalStop(option.rect.bottomLeft()); + painter->fillRect(option.rect, gradient); + painter->setPen(highlightColor.lighter()); + const QRectF innerRect = QRectF(option.rect).adjusted(0.5, 0.5, -0.5, -0.5); + painter->drawLine(innerRect.topLeft(), innerRect.topRight()); + painter->setPen(highlightColor.darker()); + painter->drawLine(innerRect.bottomLeft(), innerRect.bottomRight()); + } painter->restore(); } diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp index 048a76033f..552a8ad18c 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp @@ -71,16 +71,10 @@ class QmlProfilerTraceView::QmlProfilerTraceViewPrivate public: QmlProfilerTraceViewPrivate(QmlProfilerTraceView *qq) : q(qq) {} QmlProfilerTraceView *q; - QmlProfilerViewManager *m_viewContainer; - - QSize m_sizeHint; - QQuickWidget *m_mainView; QmlProfilerModelManager *m_modelManager; Timeline::TimelineModelAggregator *m_modelProxy; - - Timeline::TimelineZoomControl *m_zoomControl; }; diff --git a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp index 1c4a67e5b9..22fb59934e 100644 --- a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp @@ -34,7 +34,6 @@ #include <coreplugin/icore.h> #include <utils/qtcassert.h> -#include <utils/fancymainwindow.h> #include <debugger/analyzer/analyzermanager.h> #include <extensionsystem/pluginmanager.h> @@ -81,8 +80,6 @@ void QmlProfilerViewManager::createViews() QTC_ASSERT(d->profilerModelManager, return); QTC_ASSERT(d->profilerState, return); - //Utils::FancyMainWindow *mw = Debugger::mainWindow(); - d->traceView = new QmlProfilerTraceView(0, this, d->profilerModelManager); d->traceView->setWindowTitle(tr("Timeline")); connect(d->traceView, &QmlProfilerTraceView::gotoSourceLocation, @@ -103,11 +100,6 @@ void QmlProfilerViewManager::createViews() if (d->eventsViewFactory) d->eventsViews.append(d->eventsViewFactory->create(0, d->profilerModelManager)); - // Clear settings if the new views aren't there yet. Otherwise we get glitches - QSettings *settings = Core::ICore::settings(); - settings->beginGroup(QLatin1String("AnalyzerViewSettings_") + - QLatin1String(QmlProfiler::Constants::QmlProfilerPerspectiveId)); - foreach (QmlProfilerEventsView *view, d->eventsViews) { connect(view, &QmlProfilerEventsView::typeSelected, this, &QmlProfilerViewManager::typeSelected); @@ -122,14 +114,9 @@ void QmlProfilerViewManager::createViews() QByteArray dockId = view->objectName().toLatin1(); perspective.addOperation({dockId, view, Constants::QmlProfilerTimelineDockId, Perspective::AddToTab}); new QmlProfilerStateWidget(d->profilerState, d->profilerModelManager, view); - -// if (!settings->contains(view->parent()->objectName())) // parent() is QDockWidget. -// settings->remove(QString()); } perspective.addOperation({Constants::QmlProfilerTimelineDockId, 0, {}, Perspective::Raise}); Debugger::registerPerspective(Constants::QmlProfilerPerspectiveId, perspective); - - settings->endGroup(); } bool QmlProfilerViewManager::hasValidSelection() const diff --git a/src/plugins/qnx/qnxtoolchain.cpp b/src/plugins/qnx/qnxtoolchain.cpp index 9c0970618c..3224521977 100644 --- a/src/plugins/qnx/qnxtoolchain.cpp +++ b/src/plugins/qnx/qnxtoolchain.cpp @@ -116,7 +116,7 @@ void QnxToolChain::setNdkPath(const QString &ndkPath) } // qcc doesn't support a "-dumpmachine" option to get supported abis -QList<Abi> QnxToolChain::detectSupportedAbis() const +GccToolChain::DetectedAbisResult QnxToolChain::detectSupportedAbis() const { return qccSupportedAbis(); } diff --git a/src/plugins/qnx/qnxtoolchain.h b/src/plugins/qnx/qnxtoolchain.h index 8314b9f62f..193e7e36f8 100644 --- a/src/plugins/qnx/qnxtoolchain.h +++ b/src/plugins/qnx/qnxtoolchain.h @@ -50,7 +50,7 @@ public: void setNdkPath(const QString &ndkPath); protected: - virtual QList<ProjectExplorer::Abi> detectSupportedAbis() const override; + virtual DetectedAbisResult detectSupportedAbis() const override; QStringList reinterpretOptions(const QStringList &args) const override; diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index facac8a9c0..66d1e1f445 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -285,10 +285,11 @@ void BaseFileFind::writeCommonSettings(QSettings *settings) void BaseFileFind::readCommonSettings(QSettings *settings, const QString &defaultFilter) { QStringList filters = settings->value(QLatin1String("filters")).toStringList(); - d->m_filterSetting = settings->value(QLatin1String("currentFilter")).toString(); + const QVariant currentFilter = settings->value(QLatin1String("currentFilter")); + d->m_filterSetting = currentFilter.toString(); if (filters.isEmpty()) filters << defaultFilter; - if (d->m_filterSetting.isEmpty()) + if (!currentFilter.isValid()) d->m_filterSetting = filters.first(); d->m_filterStrings.setStringList(filters); if (d->m_filterCombo) diff --git a/src/plugins/texteditor/codeassist/assistinterface.cpp b/src/plugins/texteditor/codeassist/assistinterface.cpp index 06e65d34d7..4267067889 100644 --- a/src/plugins/texteditor/codeassist/assistinterface.cpp +++ b/src/plugins/texteditor/codeassist/assistinterface.cpp @@ -93,9 +93,12 @@ using namespace TextEditor; #include <texteditor/convenience.h> +#include <QTextBlock> #include <QTextDocument> #include <QTextCursor> +#include <utils/qtcassert.h> + namespace TextEditor { AssistInterface::AssistInterface(QTextDocument *textDocument, @@ -128,6 +131,9 @@ QString AssistInterface::textAt(int pos, int length) const void AssistInterface::prepareForAsyncUse() { m_text = m_textDocument->toPlainText(); + m_userStates.reserve(m_textDocument->blockCount()); + for (QTextBlock block = m_textDocument->firstBlock(); block.isValid(); block = block.next()) + m_userStates.append(block.userState()); m_textDocument = 0; m_isAsync = true; } @@ -136,6 +142,11 @@ void AssistInterface::recreateTextDocument() { m_textDocument = new QTextDocument(m_text); m_text.clear(); + + QTC_CHECK(m_textDocument->blockCount() == m_userStates.count()); + QTextBlock block = m_textDocument->firstBlock(); + for (int i = 0; i < m_userStates.count() && block.isValid(); ++i, block = block.next()) + block.setUserState(m_userStates[i]); } AssistReason AssistInterface::reason() const diff --git a/src/plugins/texteditor/codeassist/assistinterface.h b/src/plugins/texteditor/codeassist/assistinterface.h index 5daa611dee..340713fc24 100644 --- a/src/plugins/texteditor/codeassist/assistinterface.h +++ b/src/plugins/texteditor/codeassist/assistinterface.h @@ -29,8 +29,8 @@ #include <texteditor/texteditor_global.h> - #include <QString> +#include <QVector> QT_BEGIN_NAMESPACE class QTextDocument; @@ -63,6 +63,7 @@ private: QString m_fileName; AssistReason m_reason; QString m_text; + QVector<int> m_userStates; }; } // namespace TextEditor diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index d13659146e..246fe18883 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -412,7 +412,6 @@ CallgrindTool::CallgrindTool(QObject *parent) // Cost formatting { - auto menu = new QMenu; auto group = new QActionGroup(this); // Show costs as absolute numbers @@ -422,7 +421,6 @@ CallgrindTool::CallgrindTool(QObject *parent) m_costAbsolute->setChecked(true); connect(m_costAbsolute, &QAction::toggled, this, &CallgrindTool::updateCostFormat); group->addAction(m_costAbsolute); - menu->addAction(m_costAbsolute); // Show costs in percentages m_costRelative = new QAction(tr("Relative Costs"), this); @@ -430,7 +428,6 @@ CallgrindTool::CallgrindTool(QObject *parent) m_costRelative->setCheckable(true); connect(m_costRelative, &QAction::toggled, this, &CallgrindTool::updateCostFormat); group->addAction(m_costRelative); - menu->addAction(m_costRelative); // Show costs relative to parent m_costRelativeToParent = new QAction(tr("Relative Costs to Parent"), this); @@ -438,10 +435,9 @@ CallgrindTool::CallgrindTool(QObject *parent) m_costRelativeToParent->setCheckable(true); connect(m_costRelativeToParent, &QAction::toggled, this, &CallgrindTool::updateCostFormat); group->addAction(m_costRelativeToParent); - menu->addAction(m_costRelativeToParent); auto button = new QToolButton; - button->setMenu(menu); + button->addActions(group->actions()); button->setPopupMode(QToolButton::InstantPopup); button->setText(QLatin1String("$")); button->setToolTip(tr("Cost Format")); @@ -503,7 +499,6 @@ CallgrindTool::CallgrindTool(QObject *parent) CallgrindTool::~CallgrindTool() { qDeleteAll(m_textMarks); - doClear(false); } void CallgrindTool::slotGoToOverview() diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index a0e4b539d1..412418d202 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -249,8 +249,6 @@ class MemcheckTool : public QObject public: MemcheckTool(QObject *parent); - void createWidgets(); - MemcheckRunControl *createRunControl(ProjectExplorer::RunConfiguration *runConfiguration, Core::Id runMode); |