From 97ee619876840ace749aa2c976418f118614ae39 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 12 Apr 2023 22:03:06 +0200 Subject: [PATCH] ProjectExplorer: Drop known namespaces Change-Id: I969a7f6c8e54c89b047611890a7ba80f4829d73b Reviewed-by: Christian Kandeler Reviewed-by: Reviewed-by: Qt CI Bot --- .../projectexplorer/projectexplorer.cpp | 70 +++++++++---------- 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 998b3d606e4..33b0b4130d4 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -306,12 +306,12 @@ static const RunConfiguration *runConfigForNode(const Target *target, const Proj static bool hideBuildMenu() { - return Core::ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_BUILD, false).toBool(); + return ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_BUILD, false).toBool(); } static bool hideDebugMenu() { - return Core::ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_DEBUG, false).toBool(); + return ICore::settings()->value(Constants::SETTINGS_MENU_HIDE_DEBUG, false).toBool(); } static bool canOpenTerminalWithRunEnv(const Project *project, const ProjectNode *node) @@ -408,13 +408,13 @@ protected: void restoreState(const QJsonObject &object) override; }; -class RunConfigurationLocatorFilter : public Core::ILocatorFilter +class RunConfigurationLocatorFilter : public ILocatorFilter { public: RunConfigurationLocatorFilter(); void prepareSearch(const QString &entry) override; - QList matchesFor(QFutureInterface &future, + QList matchesFor(QFutureInterface &future, const QString &entry) override; protected: using RunAcceptor = std::function; @@ -422,7 +422,7 @@ protected: private: void targetListUpdated(); - QList m_result; + QList m_result; RunAcceptor m_acceptor; }; @@ -489,7 +489,7 @@ public: void deleteFile(); void handleRenameFile(); void handleSetStartupProject(); - void setStartupProject(ProjectExplorer::Project *project); + void setStartupProject(Project *project); bool closeAllFilesInProject(const Project *project); void updateRecentProjectMenu(); @@ -501,11 +501,11 @@ public: void openTerminalHere(const EnvironmentGetter &env); void openTerminalHereWithRunEnv(); - void invalidateProject(ProjectExplorer::Project *project); + void invalidateProject(Project *project); - void projectAdded(ProjectExplorer::Project *pro); - void projectRemoved(ProjectExplorer::Project *pro); - void projectDisplayNameChanged(ProjectExplorer::Project *pro); + void projectAdded(Project *pro); + void projectRemoved(Project *pro); + void projectDisplayNameChanged(Project *pro); void doUpdateRunActions(); @@ -744,7 +744,7 @@ static void openProjectsInDirectory(const FilePath &filePath) { const FilePaths projectFiles = projectsInDirectory(filePath); if (!projectFiles.isEmpty()) - Core::ICore::openFiles(projectFiles); + ICore::openFiles(projectFiles); } static QStringList projectNames(const QVector &folders) @@ -767,7 +767,7 @@ static QVector renamableFolderNodes(const FilePath &before, const return folderNodes; } -static QVector removableFolderNodes(const Utils::FilePath &filePath) +static QVector removableFolderNodes(const FilePath &filePath) { QVector folderNodes; ProjectTree::forEachNode([&](Node *node) { @@ -1611,7 +1611,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er Command * const expandCmd = ActionManager::registerAction( dd->m_projectTreeExpandAllAction, Constants::PROJECTTREE_EXPAND_ALL, projectTreeContext); - for (Core::ActionContainer * const ac : {mfileContextMenu, msubProjectContextMenu, + for (ActionContainer * const ac : {mfileContextMenu, msubProjectContextMenu, mfolderContextMenu, mprojectContextMenu, msessionContextMenu}) { ac->addSeparator(treeGroup); ac->addAction(expandNodeCmd, treeGroup); @@ -1714,7 +1714,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er if (tmp < 0 || tmp > int(StopBeforeBuild::SameApp)) tmp = int(defaultSettings.stopBeforeBuild); dd->m_projectExplorerSettings.stopBeforeBuild = StopBeforeBuild(tmp); - dd->m_projectExplorerSettings.terminalMode = static_cast( + dd->m_projectExplorerSettings.terminalMode = static_cast( s->value(Constants::TERMINAL_MODE_SETTINGS_KEY, int(defaultSettings.terminalMode)).toInt()); dd->m_projectExplorerSettings.closeSourceFilesWithProject = s->value(Constants::CLOSE_FILES_WITH_PROJECT_SETTINGS_KEY, @@ -2128,13 +2128,13 @@ void ProjectExplorerPlugin::extensionsInitialized() Tr::tr("Sanitizer", "Category for sanitizer issues listed under 'Issues'")); TaskHub::addCategory(Constants::TASK_CATEGORY_TASKLIST_ID, Tr::tr("My Tasks")); - SshSettings::loadSettings(Core::ICore::settings()); + SshSettings::loadSettings(ICore::settings()); const auto searchPathRetriever = [] { - FilePaths searchPaths = {Core::ICore::libexecPath()}; + FilePaths searchPaths = {ICore::libexecPath()}; if (HostOsInfo::isWindowsHost()) { - const QString gitBinary = Core::ICore::settings()->value("Git/BinaryPath", "git") + const QString gitBinary = ICore::settings()->value("Git/BinaryPath", "git") .toString(); - const QStringList rawGitSearchPaths = Core::ICore::settings()->value("Git/Path") + const QStringList rawGitSearchPaths = ICore::settings()->value("Git/Path") .toString().split(':', Qt::SkipEmptyParts); const FilePaths gitSearchPaths = Utils::transform(rawGitSearchPaths, [](const QString &rawPath) { return FilePath::fromString(rawPath); }); @@ -2914,10 +2914,9 @@ void ProjectExplorerPluginPrivate::extendFolderNavigationWidgetFactory() "The file \"%1\" was renamed to \"%2\", " "but the following projects could not be automatically changed: %3") .arg(before.toUserOutput(), after.toUserOutput(), projects); - QTimer::singleShot(0, Core::ICore::instance(), [errorMessage] { - QMessageBox::warning(Core::ICore::dialogParent(), - Tr::tr("Project Editing Failed"), - errorMessage); + QTimer::singleShot(0, ICore::instance(), [errorMessage] { + QMessageBox::warning(ICore::dialogParent(), + Tr::tr("Project Editing Failed"), errorMessage); }); } }); @@ -2935,8 +2934,8 @@ void ProjectExplorerPluginPrivate::extendFolderNavigationWidgetFactory() const QString errorMessage = Tr::tr("The following projects failed to automatically remove the file: %1") .arg(projects); - QTimer::singleShot(0, Core::ICore::instance(), [errorMessage] { - QMessageBox::warning(Core::ICore::dialogParent(), + QTimer::singleShot(0, ICore::instance(), [errorMessage] { + QMessageBox::warning(ICore::dialogParent(), Tr::tr("Project Editing Failed"), errorMessage); }); @@ -3583,9 +3582,7 @@ void ProjectExplorerPluginPrivate::updateLocationSubMenus() : Tr::tr("%1 in %2").arg(li.displayName).arg(li.path.toUserOutput()); auto *action = new QAction(displayName, nullptr); connect(action, &QAction::triggered, this, [line, path] { - Core::EditorManager::openEditorAt(Link(path, line), - {}, - Core::EditorManager::AllowExternalEditor); + EditorManager::openEditorAt(Link(path, line), {}, EditorManager::AllowExternalEditor); }); projectMenu->addAction(action); @@ -3884,7 +3881,7 @@ void ProjectExplorerPluginPrivate::removeFile() if (!siblings.isEmpty()) { const QMessageBox::StandardButton reply = QMessageBox::question( - Core::ICore::dialogParent(), Tr::tr("Remove More Files?"), + ICore::dialogParent(), Tr::tr("Remove More Files?"), Tr::tr("Remove these files as well?\n %1") .arg(Utils::transform(siblings, [](const NodeAndPath &np) { return np.second.fileName(); @@ -4245,7 +4242,7 @@ void ProjectExplorerPlugin::updateActions() void ProjectExplorerPlugin::activateProjectPanel(Id panelId) { - Core::ModeManager::activateMode(Constants::MODE_SESSION); + ModeManager::activateMode(Constants::MODE_SESSION); dd->m_proWindow->activateProjectPanel(panelId); } @@ -4274,9 +4271,8 @@ RecentProjectsEntries ProjectExplorerPlugin::recentProjects() return dd->recentProjects(); } -void ProjectExplorerPlugin::renameFilesForSymbol( - const QString &oldSymbolName, const QString &newSymbolName, const Utils::FilePaths &files, - bool preferLowerCaseFileNames) +void ProjectExplorerPlugin::renameFilesForSymbol(const QString &oldSymbolName, + const QString &newSymbolName, const FilePaths &files, bool preferLowerCaseFileNames) { static const auto isAllLowerCase = [](const QString &text) { return text.toLower() == text; }; @@ -4427,8 +4423,8 @@ void RunConfigurationLocatorFilter::prepareSearch(const QString &entry) } } -QList RunConfigurationLocatorFilter::matchesFor( - QFutureInterface &future, const QString &entry) +QList RunConfigurationLocatorFilter::matchesFor( + QFutureInterface &future, const QString &entry) { Q_UNUSED(future) Q_UNUSED(entry) @@ -4464,9 +4460,9 @@ SwitchToRunConfigurationLocatorFilter::SwitchToRunConfigurationLocatorFilter() ProjectManager::startupTarget()->setActiveRunConfiguration(config); QTimer::singleShot(200, ICore::mainWindow(), [displayName = config->displayName()] { if (auto ks = ICore::mainWindow()->findChild("KitSelector.Button")) { - Utils::ToolTip::show(ks->mapToGlobal(QPoint{25, 25}), - Tr::tr("Switched run configuration to\n%1").arg(displayName), - ICore::dialogParent()); + ToolTip::show(ks->mapToGlobal(QPoint{25, 25}), + Tr::tr("Switched run configuration to\n%1").arg(displayName), + ICore::dialogParent()); } }); });