Remove usages of Core::Id

It moved to Utils.

Change-Id: Ia4d12bb07db2d59b1cb084b2ebdea20e6e3b40ad
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Eike Ziller
2020-09-21 13:30:57 +02:00
parent 3b0de99cf5
commit 5cb5d8e585
14 changed files with 77 additions and 76 deletions

View File

@@ -26,7 +26,8 @@
#pragma once #pragma once
#include "icontext.h" #include "icontext.h"
#include "id.h"
#include <utils/id.h>
#include <QIcon> #include <QIcon>
#include <QMenu> #include <QMenu>

View File

@@ -27,7 +27,7 @@
#include "core_global.h" #include "core_global.h"
#include "id.h" #include <utils/id.h>
#include <QWidget> #include <QWidget>
#include <QObject> #include <QObject>

View File

@@ -39,7 +39,6 @@
#include "vcsmanager.h" #include "vcsmanager.h"
#include "versiondialog.h" #include "versiondialog.h"
#include "statusbarmanager.h" #include "statusbarmanager.h"
#include "id.h"
#include "manhattanstyle.h" #include "manhattanstyle.h"
#include "navigationwidget.h" #include "navigationwidget.h"
#include "rightpane.h" #include "rightpane.h"

View File

@@ -28,9 +28,9 @@
#include "inavigationwidgetfactory.h" #include "inavigationwidgetfactory.h"
#include "actionmanager/command.h" #include "actionmanager/command.h"
#include "id.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <utils/styledbar.h> #include <utils/styledbar.h>
#include <utils/utilsicons.h> #include <utils/utilsicons.h>

View File

@@ -31,7 +31,6 @@
#include "modemanager.h" #include "modemanager.h"
#include "actionmanager/actionmanager.h" #include "actionmanager/actionmanager.h"
#include "actionmanager/command.h" #include "actionmanager/command.h"
#include "id.h"
#include "imode.h" #include "imode.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>

View File

@@ -26,7 +26,8 @@
#pragma once #pragma once
#include "core_global.h" #include "core_global.h"
#include "id.h"
#include <utils/id.h>
#include <QWidget> #include <QWidget>
#include <QPointer> #include <QPointer>

View File

@@ -88,7 +88,7 @@ FolderNode::AddNewInformation QbsGroupNode::addNewInformation(const QStringList
return info; return info;
} }
QVariant QbsGroupNode::data(Core::Id role) const QVariant QbsGroupNode::data(Id role) const
{ {
if (role == ProjectExplorer::Constants::QT_KEYWORDS_ENABLED) { if (role == ProjectExplorer::Constants::QT_KEYWORDS_ENABLED) {
QJsonObject modProps = m_groupData.value("module-properties").toObject(); QJsonObject modProps = m_groupData.value("module-properties").toObject();
@@ -151,7 +151,7 @@ QString QbsProductNode::getBuildKey(const QJsonObject &product)
+ product.value("multiplex-configuration-id").toString(); + product.value("multiplex-configuration-id").toString();
} }
QVariant QbsProductNode::data(Core::Id role) const QVariant QbsProductNode::data(Id role) const
{ {
if (role == Android::Constants::AndroidDeploySettingsFile) { if (role == Android::Constants::AndroidDeploySettingsFile) {
for (const auto &a : m_productData.value("generated-artifacts").toArray()) { for (const auto &a : m_productData.value("generated-artifacts").toArray()) {

View File

@@ -399,23 +399,21 @@ void QbsProjectManagerPlugin::buildFile()
void QbsProjectManagerPlugin::buildProductContextMenu() void QbsProjectManagerPlugin::buildProductContextMenu()
{ {
runStepsForProductContextMenu({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)}); runStepsForProductContextMenu({Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)});
} }
void QbsProjectManagerPlugin::cleanProductContextMenu() void QbsProjectManagerPlugin::cleanProductContextMenu()
{ {
runStepsForProductContextMenu({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)}); runStepsForProductContextMenu({Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)});
} }
void QbsProjectManagerPlugin::rebuildProductContextMenu() void QbsProjectManagerPlugin::rebuildProductContextMenu()
{ {
runStepsForProductContextMenu({ runStepsForProductContextMenu({Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN),
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN), Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)});
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)
});
} }
void QbsProjectManagerPlugin::runStepsForProductContextMenu(const QList<Core::Id> &stepTypes) void QbsProjectManagerPlugin::runStepsForProductContextMenu(const QList<Utils::Id> &stepTypes)
{ {
const Node *node = ProjectTree::currentNode(); const Node *node = ProjectTree::currentNode();
QTC_ASSERT(node, return); QTC_ASSERT(node, return);
@@ -431,23 +429,23 @@ void QbsProjectManagerPlugin::runStepsForProductContextMenu(const QList<Core::Id
void QbsProjectManagerPlugin::buildProduct() void QbsProjectManagerPlugin::buildProduct()
{ {
runStepsForProduct({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)}); runStepsForProduct({Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)});
} }
void QbsProjectManagerPlugin::cleanProduct() void QbsProjectManagerPlugin::cleanProduct()
{ {
runStepsForProduct({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)}); runStepsForProduct({Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)});
} }
void QbsProjectManagerPlugin::rebuildProduct() void QbsProjectManagerPlugin::rebuildProduct()
{ {
runStepsForProduct({ runStepsForProduct({
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN), Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN),
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD), Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD),
}); });
} }
void QbsProjectManagerPlugin::runStepsForProduct(const QList<Core::Id> &stepTypes) void QbsProjectManagerPlugin::runStepsForProduct(const QList<Utils::Id> &stepTypes)
{ {
Node *node = currentEditorNode(); Node *node = currentEditorNode();
if (!node) if (!node)
@@ -464,23 +462,21 @@ void QbsProjectManagerPlugin::runStepsForProduct(const QList<Core::Id> &stepType
void QbsProjectManagerPlugin::buildSubprojectContextMenu() void QbsProjectManagerPlugin::buildSubprojectContextMenu()
{ {
runStepsForSubprojectContextMenu({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)}); runStepsForSubprojectContextMenu({Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)});
} }
void QbsProjectManagerPlugin::cleanSubprojectContextMenu() void QbsProjectManagerPlugin::cleanSubprojectContextMenu()
{ {
runStepsForSubprojectContextMenu({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)}); runStepsForSubprojectContextMenu({Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)});
} }
void QbsProjectManagerPlugin::rebuildSubprojectContextMenu() void QbsProjectManagerPlugin::rebuildSubprojectContextMenu()
{ {
runStepsForSubprojectContextMenu({ runStepsForSubprojectContextMenu({Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN),
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN), Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)});
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)
});
} }
void QbsProjectManagerPlugin::runStepsForSubprojectContextMenu(const QList<Core::Id> &stepTypes) void QbsProjectManagerPlugin::runStepsForSubprojectContextMenu(const QList<Utils::Id> &stepTypes)
{ {
const Node *node = ProjectTree::currentNode(); const Node *node = ProjectTree::currentNode();
QTC_ASSERT(node, return); QTC_ASSERT(node, return);
@@ -529,7 +525,8 @@ void QbsProjectManagerPlugin::buildSingleFile(QbsProject *project, const QString
} }
void QbsProjectManagerPlugin::runStepsForProducts(QbsProject *project, void QbsProjectManagerPlugin::runStepsForProducts(QbsProject *project,
const QStringList &products, const QList<Core::Id> &stepTypes) const QStringList &products,
const QList<Utils::Id> &stepTypes)
{ {
QTC_ASSERT(project, return); QTC_ASSERT(project, return);
QTC_ASSERT(!products.isEmpty(), return); QTC_ASSERT(!products.isEmpty(), return);
@@ -549,7 +546,7 @@ void QbsProjectManagerPlugin::runStepsForProducts(QbsProject *project,
bc->setChangedFiles(QStringList()); bc->setChangedFiles(QStringList());
bc->setProducts(products); bc->setProducts(products);
QList<ProjectExplorer::BuildStepList *> stepLists; QList<ProjectExplorer::BuildStepList *> stepLists;
for (const Core::Id &stepType : stepTypes) { for (const Utils::Id &stepType : stepTypes) {
if (stepType == ProjectExplorer::Constants::BUILDSTEPS_BUILD) if (stepType == ProjectExplorer::Constants::BUILDSTEPS_BUILD)
stepLists << bc->buildSteps(); stepLists << bc->buildSteps();
else if (stepType == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) else if (stepType == ProjectExplorer::Constants::BUILDSTEPS_CLEAN)
@@ -592,8 +589,8 @@ void QbsProjectManagerPlugin::reparseProject(QbsProject *project)
void QbsProjectManagerPlugin::buildNamedProduct(QbsProject *project, const QString &product) void QbsProjectManagerPlugin::buildNamedProduct(QbsProject *project, const QString &product)
{ {
QbsProjectManagerPlugin::runStepsForProducts(project, QStringList(product), QbsProjectManagerPlugin::runStepsForProducts(
{Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)}); project, QStringList(product), {Utils::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)});
} }
} // namespace Internal } // namespace Internal

View File

@@ -25,8 +25,8 @@
#pragma once #pragma once
#include <coreplugin/id.h>
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
#include <utils/id.h>
#include <utils/parameteraction.h> #include <utils/parameteraction.h>
namespace ProjectExplorer { class Target; } namespace ProjectExplorer { class Target; }
@@ -58,15 +58,15 @@ private:
void buildProductContextMenu(); void buildProductContextMenu();
void cleanProductContextMenu(); void cleanProductContextMenu();
void rebuildProductContextMenu(); void rebuildProductContextMenu();
void runStepsForProductContextMenu(const QList<Core::Id> &stepTypes); void runStepsForProductContextMenu(const QList<Utils::Id> &stepTypes);
void buildProduct(); void buildProduct();
void cleanProduct(); void cleanProduct();
void rebuildProduct(); void rebuildProduct();
void runStepsForProduct(const QList<Core::Id> &stepTypes); void runStepsForProduct(const QList<Utils::Id> &stepTypes);
void buildSubprojectContextMenu(); void buildSubprojectContextMenu();
void cleanSubprojectContextMenu(); void cleanSubprojectContextMenu();
void rebuildSubprojectContextMenu(); void rebuildSubprojectContextMenu();
void runStepsForSubprojectContextMenu(const QList<Core::Id> &stepTypes); void runStepsForSubprojectContextMenu(const QList<Utils::Id> &stepTypes);
void reparseSelectedProject(); void reparseSelectedProject();
void reparseCurrentProject(); void reparseCurrentProject();
@@ -80,8 +80,9 @@ private:
const QStringList &activeFileTags); const QStringList &activeFileTags);
void buildSingleFile(QbsProject *project, const QString &file); void buildSingleFile(QbsProject *project, const QString &file);
static void runStepsForProducts(QbsProject *project, const QStringList &products, static void runStepsForProducts(QbsProject *project,
const QList<Core::Id> &stepTypes); const QStringList &products,
const QList<Utils::Id> &stepTypes);
QbsProjectManagerPluginPrivate *d = nullptr; QbsProjectManagerPluginPrivate *d = nullptr;
QAction *m_reparseQbs = nullptr; QAction *m_reparseQbs = nullptr;

View File

@@ -175,7 +175,8 @@ void CrumbleBar::onCrumblePathElementClicked(const QVariant &data)
crumblePath()->popElement(); crumblePath()->popElement();
nextFileIsCalledInternally(); nextFileIsCalledInternally();
Core::EditorManager::openEditor(clickedCrumbleBarInfo.fileName.toString(), Core::EditorManager::openEditor(clickedCrumbleBarInfo.fileName.toString(),
Core::Id(), Core::EditorManager::DoNotMakeVisible); Utils::Id(),
Core::EditorManager::DoNotMakeVisible);
if (clickedCrumbleBarInfo.modelNode.isValid()) { if (clickedCrumbleBarInfo.modelNode.isValid()) {
currentDesignDocument()->changeToSubComponent(clickedCrumbleBarInfo.modelNode); currentDesignDocument()->changeToSubComponent(clickedCrumbleBarInfo.modelNode);
QmlDesignerPlugin::instance()->viewManager().setComponentNode(clickedCrumbleBarInfo.modelNode); QmlDesignerPlugin::instance()->viewManager().setComponentNode(clickedCrumbleBarInfo.modelNode);

View File

@@ -27,13 +27,13 @@
#include "qprocessuniqueptr.h" #include "qprocessuniqueptr.h"
#include <utils/id.h>
#include <QString> #include <QString>
#include <QProcessEnvironment> #include <QProcessEnvironment>
#include <designersettings.h> #include <designersettings.h>
#include <coreplugin/id.h>
namespace ProjectExplorer { namespace ProjectExplorer {
class Target; class Target;
} // namespace ProjectExplorer } // namespace ProjectExplorer

View File

@@ -295,7 +295,7 @@ void DesignModeWidget::setup()
// Create a DockWidget for each QWidget and add them to the DockManager // Create a DockWidget for each QWidget and add them to the DockManager
const Core::Context designContext(Core::Constants::C_DESIGN_MODE); const Core::Context designContext(Core::Constants::C_DESIGN_MODE);
static const Core::Id actionToggle("QmlDesigner.Toggle"); static const Utils::Id actionToggle("QmlDesigner.Toggle");
// First get all navigation views // First get all navigation views
QList<Core::INavigationWidgetFactory *> factories = Core::INavigationWidgetFactory::allNavigationFactories(); QList<Core::INavigationWidgetFactory *> factories = Core::INavigationWidgetFactory::allNavigationFactories();
@@ -426,15 +426,16 @@ void DesignModeWidget::setup()
m_dockManager->initialize(); m_dockManager->initialize();
connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged, connect(Core::ModeManager::instance(),
this, [this](Core::Id mode, Core::Id oldMode) { &Core::ModeManager::currentModeChanged,
this,
[this](Utils::Id mode, Utils::Id oldMode) {
if (mode == Core::Constants::MODE_DESIGN) { if (mode == Core::Constants::MODE_DESIGN) {
m_dockManager->reloadActiveWorkspace(); m_dockManager->reloadActiveWorkspace();
m_dockManager->setModeChangeState(false); m_dockManager->setModeChangeState(false);
} }
if (oldMode == Core::Constants::MODE_DESIGN if (oldMode == Core::Constants::MODE_DESIGN && mode != Core::Constants::MODE_DESIGN) {
&& mode != Core::Constants::MODE_DESIGN) {
m_dockManager->save(); m_dockManager->save();
m_dockManager->setModeChangeState(true); m_dockManager->setModeChangeState(true);
for (auto floatingWidget : m_dockManager->floatingWidgets()) for (auto floatingWidget : m_dockManager->floatingWidgets())
@@ -526,7 +527,8 @@ void DesignModeWidget::toolBarOnGoBackClicked()
--m_navigatorHistoryCounter; --m_navigatorHistoryCounter;
m_keepNavigatorHistory = true; m_keepNavigatorHistory = true;
Core::EditorManager::openEditor(m_navigatorHistory.at(m_navigatorHistoryCounter), Core::EditorManager::openEditor(m_navigatorHistory.at(m_navigatorHistoryCounter),
Core::Id(), Core::EditorManager::DoNotMakeVisible); Utils::Id(),
Core::EditorManager::DoNotMakeVisible);
m_keepNavigatorHistory = false; m_keepNavigatorHistory = false;
} }
} }
@@ -537,7 +539,8 @@ void DesignModeWidget::toolBarOnGoForwardClicked()
++m_navigatorHistoryCounter; ++m_navigatorHistoryCounter;
m_keepNavigatorHistory = true; m_keepNavigatorHistory = true;
Core::EditorManager::openEditor(m_navigatorHistory.at(m_navigatorHistoryCounter), Core::EditorManager::openEditor(m_navigatorHistory.at(m_navigatorHistoryCounter),
Core::Id(), Core::EditorManager::DoNotMakeVisible); Utils::Id(),
Core::EditorManager::DoNotMakeVisible);
m_keepNavigatorHistory = false; m_keepNavigatorHistory = false;
} }
} }

View File

@@ -153,12 +153,12 @@ static bool checkIfEditorIsQtQuick(Core::IEditor *editor)
return false; return false;
} }
static bool isDesignerMode(Core::Id mode) static bool isDesignerMode(Utils::Id mode)
{ {
return mode == Core::Constants::MODE_DESIGN; return mode == Core::Constants::MODE_DESIGN;
} }
static bool documentIsAlreadyOpen(DesignDocument *designDocument, Core::IEditor *editor, Core::Id newMode) static bool documentIsAlreadyOpen(DesignDocument *designDocument, Core::IEditor *editor, Utils::Id newMode)
{ {
return designDocument return designDocument
&& editor == designDocument->editor() && editor == designDocument->editor()
@@ -334,17 +334,16 @@ void QmlDesignerPlugin::integrateIntoQtCreator(QWidget *modeWidget)
} }
}); });
connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged, connect(Core::ModeManager::instance(),
[this] (Core::Id newMode, Core::Id oldMode) { &Core::ModeManager::currentModeChanged,
[this](Utils::Id newMode, Utils::Id oldMode) {
Core::IEditor *currentEditor = Core::EditorManager::currentEditor(); Core::IEditor *currentEditor = Core::EditorManager::currentEditor();
if (d && currentEditor && checkIfEditorIsQtQuick(currentEditor) && if (d && currentEditor && checkIfEditorIsQtQuick(currentEditor)
!documentIsAlreadyOpen(currentDesignDocument(), currentEditor, newMode)) { && !documentIsAlreadyOpen(currentDesignDocument(), currentEditor, newMode)) {
if (isDesignerMode(newMode)) { if (isDesignerMode(newMode)) {
showDesigner(); showDesigner();
} else if (currentDesignDocument() || } else if (currentDesignDocument()
(!isDesignerMode(newMode) && isDesignerMode(oldMode))) { || (!isDesignerMode(newMode) && isDesignerMode(oldMode))) {
hideDesigner(); hideDesigner();
} }
} }

View File

@@ -28,8 +28,8 @@
#include <projectexplorer/abi.h> #include <projectexplorer/abi.h>
#include <projectexplorer/headerpath.h> #include <projectexplorer/headerpath.h>
#include <projectexplorer/projectmacro.h> #include <projectexplorer/projectmacro.h>
#include <coreplugin/id.h>
#include <utils/cpplanguage_details.h> #include <utils/cpplanguage_details.h>
#include <utils/id.h>
#include <functional> #include <functional>
@@ -41,7 +41,7 @@ class ToolChain
{ {
public: public:
ToolChain() = default; ToolChain() = default;
Core::Id typeId() const { return Core::Id(); } Utils::Id typeId() const { return Utils::Id(); }
Abi targetAbi() const { return Abi(); } Abi targetAbi() const { return Abi(); }