Core/Utils: Migrate further to Utils::Id

The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2020-06-26 13:59:38 +02:00
parent c9eedbe0f3
commit e1c88116b3
655 changed files with 2115 additions and 2093 deletions

View File

@@ -28,7 +28,6 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/icontext.h>
#include <coreplugin/id.h>
#include <utils/qtcassert.h>
@@ -118,13 +117,13 @@ namespace Core {
*/
/*!
\fn QAction *Core::ActionContainer::insertLocation(Core::Id group) const
\fn QAction *Core::ActionContainer::insertLocation(Utils::Id group) const
Returns an action representing the \a group,
that could be used with \c{QWidget::insertAction}.
*/
/*!
\fn void Core::ActionContainer::appendGroup(Core::Id group)
\fn void Core::ActionContainer::appendGroup(Utils::Id group)
Adds \a group to the action container.
Use groups to segment your action container into logical parts. You can add
@@ -134,7 +133,7 @@ namespace Core {
*/
/*!
\fn void Core::ActionContainer::addAction(Core::Command *action, Core::Id group = Id())
\fn void Core::ActionContainer::addAction(Core::Command *action, Utils::Id group = Id())
Add the \a action as a menu item to this action container. The action is added as the
last item of the specified \a group.
\sa appendGroup()
@@ -142,7 +141,7 @@ namespace Core {
*/
/*!
\fn void Core::ActionContainer::addMenu(Core::ActionContainer *menu, Core::Id group = Core::Id())
\fn void Core::ActionContainer::addMenu(Core::ActionContainer *menu, Utils::Id group = Utils::Id())
Add the \a menu as a submenu to this action container. The menu is added as the
last item of the specified \a group.
\sa appendGroup()
@@ -166,7 +165,7 @@ namespace Core {
*/
/*!
\fn Core::ActionContainer::insertGroup(Core::Id before, Core::Id group)
\fn Core::ActionContainer::insertGroup(Utils::Id before, Utils::Id group)
Inserts \a group to the action container before the group specified by
\a before.
@@ -179,7 +178,7 @@ namespace Core {
*/
/*!
\fn Core::ActionContainer::addSeparator(const Core::Context &context, Core::Id group, QAction **outSeparator)
\fn Core::ActionContainer::addSeparator(const Core::Context &context, Utils::Id group, QAction **outSeparator)
Adds a separator to the end of the given \a group to the action container,
which is enabled for a given \a context. Returns the created separator

View File

@@ -56,20 +56,20 @@ public:
virtual void setOnAllDisabledBehavior(OnAllDisabledBehavior behavior) = 0;
virtual ActionContainer::OnAllDisabledBehavior onAllDisabledBehavior() const = 0;
virtual Id id() const = 0;
virtual Utils::Id id() const = 0;
virtual QMenu *menu() const = 0;
virtual QMenuBar *menuBar() const = 0;
virtual Utils::TouchBar *touchBar() const = 0;
virtual QAction *insertLocation(Id group) const = 0;
virtual void appendGroup(Id group) = 0;
virtual void insertGroup(Id before, Id group) = 0;
virtual void addAction(Command *action, Id group = Id()) = 0;
virtual void addMenu(ActionContainer *menu, Id group = Id()) = 0;
virtual QAction *insertLocation(Utils::Id group) const = 0;
virtual void appendGroup(Utils::Id group) = 0;
virtual void insertGroup(Utils::Id before, Utils::Id group) = 0;
virtual void addAction(Command *action, Utils::Id group = {}) = 0;
virtual void addMenu(ActionContainer *menu, Utils::Id group = {}) = 0;
virtual void addMenu(ActionContainer *before, ActionContainer *menu) = 0;
Command *addSeparator(Id group = Id());
virtual Command *addSeparator(const Context &context, Id group = Id(), QAction **outSeparator = nullptr) = 0;
Command *addSeparator(Utils::Id group = {});
virtual Command *addSeparator(const Context &context, Utils::Id group = {}, QAction **outSeparator = nullptr) = 0;
// This clears this menu and submenus from all actions and submenus.
// It does not destroy the submenus and commands, just removes them from their parents.

View File

@@ -37,8 +37,8 @@ namespace Internal {
struct Group
{
Group(Id id) : id(id) {}
Id id;
Group(Utils::Id id) : id(id) {}
Utils::Id id;
QList<QObject *> items; // Command * or ActionContainer *
};
@@ -47,22 +47,22 @@ class ActionContainerPrivate : public ActionContainer
Q_OBJECT
public:
ActionContainerPrivate(Id id);
ActionContainerPrivate(Utils::Id id);
~ActionContainerPrivate() override = default;
void setOnAllDisabledBehavior(OnAllDisabledBehavior behavior) override;
ActionContainer::OnAllDisabledBehavior onAllDisabledBehavior() const override;
QAction *insertLocation(Id groupId) const override;
void appendGroup(Id id) override;
void insertGroup(Id before, Id groupId) override;
void addAction(Command *action, Id group = Id()) override;
void addMenu(ActionContainer *menu, Id group = Id()) override;
QAction *insertLocation(Utils::Id groupId) const override;
void appendGroup(Utils::Id id) override;
void insertGroup(Utils::Id before, Utils::Id groupId) override;
void addAction(Command *action, Utils::Id group = {}) override;
void addMenu(ActionContainer *menu, Utils::Id group = {}) override;
void addMenu(ActionContainer *before, ActionContainer *menu) override;
Command *addSeparator(const Context &context, Id group = Id(), QAction **outSeparator = nullptr) override;
Command *addSeparator(const Context &context, Utils::Id group = {}, QAction **outSeparator = nullptr) override;
void clear() override;
Id id() const override;
Utils::Id id() const override;
QMenu *menu() const override;
QMenuBar *menuBar() const override;
@@ -92,11 +92,11 @@ private:
void update();
void itemDestroyed();
QList<Group>::const_iterator findGroup(Id groupId) const;
QList<Group>::const_iterator findGroup(Utils::Id groupId) const;
QAction *insertLocation(QList<Group>::const_iterator group) const;
OnAllDisabledBehavior m_onAllDisabledBehavior;
Id m_id;
Utils::Id m_id;
bool m_updateRequested;
};
@@ -105,7 +105,7 @@ class MenuActionContainer : public ActionContainerPrivate
Q_OBJECT
public:
explicit MenuActionContainer(Id id);
explicit MenuActionContainer(Utils::Id id);
~MenuActionContainer() override;
QMenu *menu() const override;
@@ -131,7 +131,7 @@ class MenuBarActionContainer : public ActionContainerPrivate
Q_OBJECT
public:
explicit MenuBarActionContainer(Id id);
explicit MenuBarActionContainer(Utils::Id id);
void setMenuBar(QMenuBar *menuBar);
QMenuBar *menuBar() const override;
@@ -157,7 +157,7 @@ class TouchBarActionContainer : public ActionContainerPrivate
Q_OBJECT
public:
TouchBarActionContainer(Id id, const QIcon &icon, const QString &text);
TouchBarActionContainer(Utils::Id id, const QIcon &icon, const QString &text);
~TouchBarActionContainer() override;
Utils::TouchBar *touchBar() const override;

View File

@@ -29,7 +29,7 @@
#include "command_p.h"
#include <coreplugin/icore.h>
#include <coreplugin/id.h>
#include <utils/algorithm.h>
#include <utils/fadingindicator.h>
#include <utils/qtcassert.h>
@@ -51,6 +51,7 @@ static const char kKeyboardSettingsKeyV2[] = "KeyboardShortcutsV2";
using namespace Core;
using namespace Core::Internal;
using namespace Utils;
/*!
\class Core::ActionManager
@@ -121,7 +122,7 @@ using namespace Core::Internal;
*/
/*!
\fn void Core::ActionManager::commandAdded(Core::Id id)
\fn void Core::ActionManager::commandAdded(Utils::Id id)
Emitted when a command (with the \a id) is added.
*/

View File

@@ -55,22 +55,22 @@ class CORE_EXPORT ActionManager : public QObject
public:
static ActionManager *instance();
static ActionContainer *createMenu(Id id);
static ActionContainer *createMenuBar(Id id);
static ActionContainer *createTouchBar(Id id,
static ActionContainer *createMenu(Utils::Id id);
static ActionContainer *createMenuBar(Utils::Id id);
static ActionContainer *createTouchBar(Utils::Id id,
const QIcon &icon,
const QString &text = QString());
static Command *registerAction(QAction *action, Id id,
static Command *registerAction(QAction *action, Utils::Id id,
const Context &context = Context(Constants::C_GLOBAL),
bool scriptable = false);
static Command *command(Id id);
static ActionContainer *actionContainer(Id id);
static Command *command(Utils::Id id);
static ActionContainer *actionContainer(Utils::Id id);
static QList<Command *> commands();
static void unregisterAction(QAction *action, Id id);
static void unregisterAction(QAction *action, Utils::Id id);
static void setPresentationModeEnabled(bool enabled);
static bool isPresentationModeEnabled();
@@ -79,7 +79,7 @@ public:
signals:
void commandListChanged();
void commandAdded(Core::Id id);
void commandAdded(Utils::Id id);
private:
ActionManager(QObject *parent = nullptr);

View File

@@ -46,8 +46,8 @@ class ActionManagerPrivate : public QObject
Q_OBJECT
public:
using IdCmdMap = QHash<Id, Action *>;
using IdContainerMap = QHash<Id, ActionContainerPrivate *>;
using IdCmdMap = QHash<Utils::Id, Action *>;
using IdContainerMap = QHash<Utils::Id, ActionContainerPrivate *>;
~ActionManagerPrivate() override;
@@ -59,9 +59,9 @@ public:
void showShortcutPopup(const QString &shortcut);
bool hasContext(const Context &context) const;
Action *overridableAction(Id id);
Action *overridableAction(Utils::Id id);
void readUserSettings(Id id, Action *cmd);
void readUserSettings(Utils::Id id, Action *cmd);
void containerDestroyed();
void actionTriggered();

View File

@@ -27,7 +27,6 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/icontext.h>
#include <coreplugin/id.h>
#include <utils/hostosinfo.h>
#include <utils/stringutils.h>
@@ -258,6 +257,8 @@
\internal
*/
using namespace Utils;
namespace Core {
namespace Internal {

View File

@@ -26,9 +26,9 @@
#pragma once
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <utils/hostosinfo.h>
#include <utils/id.h>
#include <QObject>
@@ -69,7 +69,7 @@ public:
virtual void setDescription(const QString &text) = 0;
virtual QString description() const = 0;
virtual Id id() const = 0;
virtual Utils::Id id() const = 0;
virtual QAction *action() const = 0;
virtual Context context() const = 0;

View File

@@ -27,9 +27,9 @@
#include "command.h"
#include <coreplugin/id.h>
#include <coreplugin/icontext.h>
#include <utils/id.h>
#include <utils/proxyaction.h>
#include <QList>
@@ -47,9 +47,9 @@ class Action : public Command
{
Q_OBJECT
public:
Action(Id id);
Action(Utils::Id id);
Id id() const override;
Utils::Id id() const override;
void setDefaultKeySequence(const QKeySequence &key) override;
void setDefaultKeySequences(const QList<QKeySequence> &key) override;
@@ -93,7 +93,7 @@ private:
Context m_context;
CommandAttributes m_attributes;
Id m_id;
Utils::Id m_id;
QList<QKeySequence> m_defaultKeys;
QString m_defaultText;
QString m_touchBarText;
@@ -104,7 +104,7 @@ private:
mutable std::unique_ptr<Utils::ProxyAction> m_touchBarAction;
QString m_toolTip;
QMap<Id, QPointer<QAction> > m_contextActionMap;
QMap<Utils::Id, QPointer<QAction> > m_contextActionMap;
QMap<QAction*, bool> m_scriptableMap;
bool m_active = false;
bool m_contextInitialized = false;

View File

@@ -26,11 +26,12 @@
#include "commandbutton.h"
#include "actionmanager.h"
#include "command.h"
#include "../id.h"
#include <utils/proxyaction.h>
using namespace Core;
using namespace Utils;
/*!
\class Core::CommandButton

View File

@@ -26,7 +26,8 @@
#pragma once
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <utils/id.h>
#include <QPointer>
#include <QString>
@@ -42,8 +43,8 @@ class CORE_EXPORT CommandButton : public QToolButton
Q_PROPERTY(QString toolTipBase READ toolTipBase WRITE setToolTipBase)
public:
explicit CommandButton(QWidget *parent = nullptr);
explicit CommandButton(Id id, QWidget *parent = nullptr);
void setCommandId(Id id);
explicit CommandButton(Utils::Id id, QWidget *parent = nullptr);
void setCommandId(Utils::Id id);
QString toolTipBase() const;
void setToolTipBase(const QString &toolTipBase);

View File

@@ -40,6 +40,8 @@
#include <QDebug>
#include <QDateTime>
using namespace Utils;
namespace Core {
namespace Internal {

View File

@@ -45,6 +45,8 @@
enum { debugWizard = 0 };
using namespace Utils;
namespace Core {
static int indexOfFile(const GeneratedFiles &f, const QString &path)

View File

@@ -54,8 +54,8 @@ public:
};
Q_DECLARE_FLAGS(DialogParameterFlags, DialogParameterEnum)
explicit WizardDialogParameters(const QString &defaultPath, Id platform,
const QSet<Id> &requiredFeatures, DialogParameterFlags flags,
explicit WizardDialogParameters(const QString &defaultPath, Utils::Id platform,
const QSet<Utils::Id> &requiredFeatures, DialogParameterFlags flags,
const QVariantMap &extraValues)
: m_defaultPath(defaultPath),
m_selectedPlatform(platform),
@@ -67,10 +67,10 @@ public:
QString defaultPath() const
{ return m_defaultPath; }
Id selectedPlatform() const
Utils::Id selectedPlatform() const
{ return m_selectedPlatform; }
QSet<Id> requiredFeatures() const
QSet<Utils::Id> requiredFeatures() const
{ return m_requiredFeatures; }
DialogParameterFlags flags() const
@@ -81,8 +81,8 @@ public:
private:
QString m_defaultPath;
Id m_selectedPlatform;
QSet<Id> m_requiredFeatures;
Utils::Id m_selectedPlatform;
QSet<Utils::Id> m_requiredFeatures;
DialogParameterFlags m_parameterFlags;
QVariantMap m_extraValues;
};
@@ -115,7 +115,7 @@ protected:
private:
// IWizard
Utils::Wizard *runWizardImpl(const QString &path, QWidget *parent, Id platform,
Utils::Wizard *runWizardImpl(const QString &path, QWidget *parent, Utils::Id platform,
const QVariantMap &extraValues) override;
};

View File

@@ -35,11 +35,10 @@
#include <extensionsystem/pluginmanager.h>
#include <QPointer>
#include <QStringList>
#include <QDebug>
#include <QPointer>
#include <QStackedWidget>
#include <QStringList>
namespace Core {
@@ -201,7 +200,7 @@ void DesignMode::updateActions()
emit actionsUpdated(d->m_currentEditor.data());
}
void DesignMode::updateContext(Id newMode, Id oldMode)
void DesignMode::updateContext(Utils::Id newMode, Utils::Id oldMode)
{
if (newMode == id())
ICore::addAdditionalContext(d->m_activeContext);

View File

@@ -64,7 +64,7 @@ private:
void updateActions();
void currentEditorChanged(IEditor *editor);
void updateContext(Id newMode, Id oldMode);
void updateContext(Utils::Id newMode, Utils::Id oldMode);
void setActiveContext(const Context &context);
};

View File

@@ -65,7 +65,7 @@ using namespace Utils;
/*!
\fn Core::Id Core::IOptionsPage::id() const
\fn Utils::Id Core::IOptionsPage::id() const
Returns a unique identifier for referencing the options page.
*/
@@ -77,7 +77,7 @@ using namespace Utils;
*/
/*!
\fn Core::Id Core::IOptionsPage::category() const
\fn Utils::Id Core::IOptionsPage::category() const
Returns the unique id for the category that the options page should be displayed in. This id is
used for sorting the list on the left side of the \uicontrol Options dialog.
@@ -171,7 +171,7 @@ void Core::IOptionsPage::setCategoryIconPath(const QString &categoryIconPath)
}
/*!
\fn void Core::IOptionsPage::setId(Core::Id id)
\fn void Core::IOptionsPage::setId(Utils::Id id)
Sets the \a id of the options page.
*/
@@ -183,7 +183,7 @@ void Core::IOptionsPage::setCategoryIconPath(const QString &categoryIconPath)
*/
/*!
\fn void Core::IOptionsPage::setCategory(Core::Id category)
\fn void Core::IOptionsPage::setCategory(Utils::Id category)
Uses \a category to sort the options pages.
*/

View File

@@ -26,9 +26,9 @@
#pragma once
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <utils/icon.h>
#include <utils/id.h>
#include <QObject>
#include <QPointer>
@@ -56,9 +56,9 @@ public:
static const QList<IOptionsPage *> allOptionsPages();
Id id() const { return m_id; }
Utils::Id id() const { return m_id; }
QString displayName() const { return m_displayName; }
Id category() const { return m_category; }
Utils::Id category() const { return m_category; }
QString displayCategory() const { return m_displayCategory; }
QIcon categoryIcon() const;
@@ -71,15 +71,15 @@ public:
virtual void finish();
protected:
void setId(Id id) { m_id = id; }
void setId(Utils::Id id) { m_id = id; }
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
void setCategory(Id category) { m_category = category; }
void setCategory(Utils::Id category) { m_category = category; }
void setDisplayCategory(const QString &displayCategory) { m_displayCategory = displayCategory; }
void setCategoryIcon(const Utils::Icon &categoryIcon) { m_categoryIcon = categoryIcon; }
void setCategoryIconPath(const QString &categoryIconPath);
Id m_id;
Id m_category;
Utils::Id m_id;
Utils::Id m_category;
QString m_displayName;
QString m_displayCategory;
Utils::Icon m_categoryIcon;
@@ -108,7 +108,7 @@ public:
static const QList<IOptionsPageProvider *> allOptionsPagesProviders();
Id category() const { return m_category; }
Utils::Id category() const { return m_category; }
QString displayCategory() const { return m_displayCategory; }
QIcon categoryIcon() const;
@@ -116,11 +116,11 @@ public:
virtual bool matches(const QRegularExpression &regexp) const = 0;
protected:
void setCategory(Id category) { m_category = category; }
void setCategory(Utils::Id category) { m_category = category; }
void setDisplayCategory(const QString &displayCategory) { m_displayCategory = displayCategory; }
void setCategoryIcon(const Utils::Icon &categoryIcon) { m_categoryIcon = categoryIcon; }
Id m_category;
Utils::Id m_category;
QString m_displayCategory;
Utils::Icon m_categoryIcon;
};

View File

@@ -45,6 +45,8 @@
Q_DECLARE_METATYPE(Core::IWizardFactory*)
using namespace Utils;
namespace {
const int ICON_SIZE = 48;
@@ -84,7 +86,7 @@ public:
Id::fromStringList(ICore::settings()->value(BLACKLISTED_CATEGORIES_KEY).toStringList());
}
void setPlatform(Core::Id platform)
void setPlatform(Id platform)
{
m_platform = platform;
invalidateFilter();
@@ -114,7 +116,7 @@ public:
factoryOfItem(qobject_cast<QStandardItemModel*>(sourceModel())->itemFromIndex(sourceIndex));
if (wizard) {
if (m_blacklistedCategories.contains(Core::Id::fromString(wizard->category())))
if (m_blacklistedCategories.contains(Id::fromString(wizard->category())))
return false;
return wizard->isAvailable(m_platform);
}
@@ -122,7 +124,7 @@ public:
return true;
}
private:
Core::Id m_platform;
Id m_platform;
QSet<Id> m_blacklistedCategories;
};

View File

@@ -57,7 +57,7 @@ public:
void setWizardFactories(QList<IWizardFactory*> factories, const QString &defaultLocation, const QVariantMap &extraVariables);
void showDialog();
Id selectedPlatform() const;
Utils::Id selectedPlatform() const;
static QWidget *currentDialog();

View File

@@ -64,6 +64,8 @@ const int kMaxMinimumHeight = 250;
static const char pageKeyC[] = "General/LastPreferencePage";
const int categoryIconSize = 24;
using namespace Utils;
namespace Core {
namespace Internal {

View File

@@ -25,14 +25,14 @@
#pragma once
#include <coreplugin/id.h>
#include <utils/id.h>
namespace Core {
namespace Internal {
// Run the settings dialog and wait for it to finish.
// Returns if the changes have been applied.
bool executeSettingsDialog(QWidget *parent, Id initialPage);
bool executeSettingsDialog(QWidget *parent, Utils::Id initialPage);
} // namespace Internal
} // namespace Core

View File

@@ -27,7 +27,6 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/documentmanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/id.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/actionmanager/command_p.h>
@@ -49,6 +48,8 @@
#include <QApplication>
#include <QDebug>
using namespace Utils;
Q_DECLARE_METATYPE(Core::Internal::ShortcutItem*)
const char kSeparator[] = " | ";

View File

@@ -26,7 +26,8 @@
#pragma once
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <utils/id.h>
#include <QObject>
#include <QPair>
@@ -55,7 +56,7 @@ public:
KeepLinks
};
using RecentFile = QPair<QString, Id>;
using RecentFile = QPair<QString, Utils::Id>;
static DocumentManager *instance();
@@ -71,7 +72,7 @@ public:
static void unexpectFileChange(const QString &fileName);
// recent files
static void addToRecentFiles(const QString &fileName, Id editorId = Id());
static void addToRecentFiles(const QString &fileName, Utils::Id editorId = {});
Q_SLOT void clearRecentFiles();
static QList<RecentFile> recentFiles();

View File

@@ -102,7 +102,7 @@ EditMode::~EditMode()
delete m_splitter;
}
void EditMode::grabEditorManager(Id mode)
void EditMode::grabEditorManager(Utils::Id mode)
{
if (mode != id())
return;

View File

@@ -47,7 +47,7 @@ public:
~EditMode() override;
private:
void grabEditorManager(Id mode);
void grabEditorManager(Utils::Id mode);
QSplitter *m_splitter;
QVBoxLayout *m_rightSplitWidgetLayout;

View File

@@ -43,6 +43,8 @@
#include <QSet>
#include <QUrl>
using namespace Utils;
static Core::Internal::DocumentModelPrivate *d;
namespace Core {

View File

@@ -26,9 +26,9 @@
#pragma once
#include "../core_global.h"
#include "../id.h"
#include <utils/fileutils.h>
#include <utils/id.h>
#include <utils/optional.h>
QT_BEGIN_NAMESPACE
@@ -57,7 +57,7 @@ public:
QString displayName() const;
QString plainDisplayName() const;
QString uniqueDisplayName() const;
Id id() const;
Utils::Id id() const;
IDocument *document;
// When an entry is suspended, it means that it is not in memory,

View File

@@ -70,7 +70,7 @@ public:
static void addEditor(IEditor *editor, bool *isNewDocument);
static DocumentModel::Entry *addSuspendedDocument(const QString &fileName,
const QString &displayName,
Id id);
Utils::Id id);
static DocumentModel::Entry *firstSuspendedEntry();
static DocumentModel::Entry *removeEditor(IEditor *editor);
static void removeEntry(DocumentModel::Entry *entry);

View File

@@ -807,7 +807,7 @@ IEditor *EditorManagerPrivate::openEditorAt(EditorView *view, const QString &fil
return editor;
}
IEditor *EditorManagerPrivate::openEditorWith(const QString &fileName, Core::Id editorId)
IEditor *EditorManagerPrivate::openEditorWith(const QString &fileName, Utils::Id editorId)
{
// close any open editors that have this file open
// remember the views to open new editors in there
@@ -2722,7 +2722,7 @@ void EditorManager::populateOpenWithMenu(QMenu *menu, const QString &fileName)
if (anyMatches) {
// Add all suitable editors
foreach (IEditorFactory *editorFactory, factories) {
Core::Id editorId = editorFactory->id();
Utils::Id editorId = editorFactory->id();
// Add action to open with this very editor factory
QString const actionTitle = editorFactory->displayName();
QAction *action = menu->addAction(actionTitle);
@@ -2738,7 +2738,7 @@ void EditorManager::populateOpenWithMenu(QMenu *menu, const QString &fileName)
// Add all suitable external editors
foreach (IExternalEditor *externalEditor, extEditors) {
QAction *action = menu->addAction(externalEditor->displayName());
Core::Id editorId = externalEditor->id();
Utils::Id editorId = externalEditor->id();
connect(action, &QAction::triggered, [fileName, editorId]() {
EditorManager::openExternalEditor(fileName, editorId);
});

View File

@@ -99,20 +99,20 @@ public:
int columnNumber; // extracted column number, -1 if none
};
static FilePathInfo splitLineAndColumnNumber(const QString &filePath);
static IEditor *openEditor(const QString &fileName, Id editorId = Id(),
static IEditor *openEditor(const QString &fileName, Utils::Id editorId = {},
OpenEditorFlags flags = NoFlags, bool *newEditor = nullptr);
static IEditor *openEditorAt(const QString &fileName, int line, int column = 0,
Id editorId = Id(), OpenEditorFlags flags = NoFlags,
Utils::Id editorId = {}, OpenEditorFlags flags = NoFlags,
bool *newEditor = nullptr);
static void openEditorAtSearchResult(const SearchResultItem &item, OpenEditorFlags flags = NoFlags);
static IEditor *openEditorWithContents(Id editorId, QString *titlePattern = nullptr,
static IEditor *openEditorWithContents(Utils::Id editorId, QString *titlePattern = nullptr,
const QByteArray &contents = QByteArray(),
const QString &uniqueId = QString(),
OpenEditorFlags flags = NoFlags);
static bool skipOpeningBigTextFile(const QString &filePath);
static void clearUniqueId(IDocument *document);
static bool openExternalEditor(const QString &fileName, Id editorId);
static bool openExternalEditor(const QString &fileName, Utils::Id editorId);
static void addCloseEditorListener(const std::function<bool(IEditor *)> &listener);
static QStringList getOpenFileNames();

View File

@@ -79,17 +79,17 @@ public:
static void setCurrentEditor(IEditor *editor, bool ignoreNavigationHistory = false);
static IEditor *openEditor(EditorView *view,
const QString &fileName,
Id editorId = Id(),
Utils::Id editorId = {},
EditorManager::OpenEditorFlags flags = EditorManager::NoFlags,
bool *newEditor = nullptr);
static IEditor *openEditorAt(EditorView *view,
const QString &fileName,
int line,
int column = 0,
Id editorId = Id(),
Utils::Id editorId = {},
EditorManager::OpenEditorFlags flags = EditorManager::NoFlags,
bool *newEditor = nullptr);
static IEditor *openEditorWith(const QString &fileName, Core::Id editorId);
static IEditor *openEditorWith(const QString &fileName, Utils::Id editorId);
static IEditor *duplicateEditor(IEditor *editor);
static IEditor *activateEditor(EditorView *view, IEditor *editor,
EditorManager::OpenEditorFlags flags = EditorManager::NoFlags);
@@ -108,7 +108,7 @@ public:
static MakeWritableResult makeFileWritable(IDocument *document);
static void doEscapeKeyFocusMoveMagic();
static Id getOpenWithEditorId(const QString &fileName, bool *isExternalEditor = nullptr);
static Utils::Id getOpenWithEditorId(const QString &fileName, bool *isExternalEditor = nullptr);
static void saveSettings();
static void readSettings();
@@ -193,7 +193,7 @@ private:
static OpenEditorsWindow *windowPopup();
static void showPopupOrSelectDocument();
static EditorFactoryList findFactories(Id editorId, const QString &fileName);
static EditorFactoryList findFactories(Utils::Id editorId, const QString &fileName);
static IEditor *createEditor(IEditorFactory *factory, const QString &fileName);
static void addEditor(IEditor *editor);
static void removeEditor(IEditor *editor, bool removeSusependedEntry);

View File

@@ -25,9 +25,8 @@
#pragma once
#include "../id.h"
#include <utils/dropsupport.h>
#include <utils/id.h>
#include <QMap>
#include <QList>
@@ -64,7 +63,7 @@ namespace Internal {
struct EditLocation {
QPointer<IDocument> document;
QString fileName;
Id id;
Utils::Id id;
QVariant state;
};

View File

@@ -70,7 +70,7 @@ EditorWindow::EditorWindow(QWidget *parent) :
static int windowId = 0;
ICore::registerWindow(this,
Context(Id("EditorManager.ExternalWindow.").withSuffix(++windowId),
Context(Utils::Id("EditorManager.ExternalWindow.").withSuffix(++windowId),
Constants::C_EDITORMANAGER));
connect(m_area, &EditorArea::windowTitleNeedsUpdate,

View File

@@ -70,7 +70,7 @@ namespace Core {
*/
/*!
\fn Core::Id Core::IEditorFactory::id() const
\fn Utils::Id Core::IEditorFactory::id() const
Returns the ID of the factory or editor type.
*/

View File

@@ -26,8 +26,8 @@
#pragma once
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <utils/id.h>
#include <utils/mimetypes/mimetype.h>
#include <QObject>
@@ -54,21 +54,21 @@ public:
static const EditorFactoryList defaultEditorFactories(const Utils::MimeType &mimeType);
static const EditorFactoryList preferredEditorFactories(const QString &fileName);
Id id() const { return m_id; }
Utils::Id id() const { return m_id; }
QString displayName() const { return m_displayName; }
QStringList mimeTypes() const { return m_mimeTypes; }
IEditor *createEditor() const;
protected:
void setId(Id id) { m_id = id; }
void setId(Utils::Id id) { m_id = id; }
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
void setMimeTypes(const QStringList &mimeTypes) { m_mimeTypes = mimeTypes; }
void addMimeType(const QString &mimeType) { m_mimeTypes.append(mimeType); }
void setEditorCreator(const std::function<IEditor *()> &creator);
private:
Id m_id;
Utils::Id m_id;
QString m_displayName;
QStringList m_mimeTypes;
std::function<IEditor *()> m_creator;

View File

@@ -45,7 +45,7 @@ namespace Core {
*/
/*!
\fn Core::Id Core::IExternalEditor::id() const
\fn Utils::Id Core::IExternalEditor::id() const
Returns the ID of the factory or editor type.
*/

View File

@@ -26,8 +26,8 @@
#pragma once
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <utils/id.h>
#include <utils/mimetypes/mimetype.h>
#include <QObject>
@@ -50,7 +50,7 @@ public:
static const ExternalEditorList externalEditors(const Utils::MimeType &mimeType);
virtual QStringList mimeTypes() const = 0;
virtual Id id() const = 0;
virtual Utils::Id id() const = 0;
virtual QString displayName() const = 0;
virtual bool startEditor(const QString &fileName, QString *errorMessage) = 0;
};

View File

@@ -24,7 +24,6 @@
****************************************************************************/
#include "systemeditor.h"
#include <coreplugin/id.h>
#include <QStringList>
#include <QUrl>
@@ -32,6 +31,7 @@
using namespace Core;
using namespace Core::Internal;
using namespace Utils;
SystemEditor::SystemEditor(QObject *parent) :
IExternalEditor(parent)

View File

@@ -38,7 +38,7 @@ public:
explicit SystemEditor(QObject *parent = nullptr);
QStringList mimeTypes() const override;
Id id() const override;
Utils::Id id() const override;
QString displayName() const override;
bool startEditor(const QString &fileName, QString *errorMessage) override;

View File

@@ -25,10 +25,9 @@
#pragma once
#include "id.h"
#include <utils/fileutils.h>
#include <utils/environment.h>
#include <utils/fileutils.h>
#include <utils/id.h>
#include <QObject>
#include <QStringList>
@@ -69,7 +68,7 @@ public:
QString arguments() const;
QString input() const;
QString workingDirectory() const;
Id baseEnvironmentProviderId() const;
Utils::Id baseEnvironmentProviderId() const;
Utils::Environment baseEnvironment() const;
Utils::EnvironmentItems environmentUserChanges() const;
@@ -100,7 +99,7 @@ public:
void setArguments(const QString &arguments);
void setInput(const QString &input);
void setWorkingDirectory(const QString &workingDirectory);
void setBaseEnvironmentProviderId(Id id);
void setBaseEnvironmentProviderId(Utils::Id id);
void setEnvironmentUserChanges(const Utils::EnvironmentItems &items);
private:
@@ -113,7 +112,7 @@ private:
QString m_arguments;
QString m_input;
QString m_workingDirectory;
Id m_baseEnvironmentProviderId;
Utils::Id m_baseEnvironmentProviderId;
Utils::EnvironmentItems m_environment;
OutputHandling m_outputHandling = ShowInPane;
OutputHandling m_errorHandling = ShowInPane;

View File

@@ -41,6 +41,7 @@
#include <QMenu>
using namespace Core::Internal;
using namespace Utils;
namespace Core {

View File

@@ -27,7 +27,7 @@
#include "core_global.h"
#include <coreplugin/id.h>
#include <utils/id.h>
#include <QSet>
#include <QStringList>
@@ -41,9 +41,9 @@ class CORE_EXPORT IFeatureProvider
public:
virtual ~IFeatureProvider() = default;
virtual QSet<Id> availableFeatures(Id id) const = 0;
virtual QSet<Id> availablePlatforms() const = 0;
virtual QString displayNameForPlatform(Id id) const = 0;
virtual QSet<Utils::Id> availableFeatures(Utils::Id id) const = 0;
virtual QSet<Utils::Id> availablePlatforms() const = 0;
virtual QString displayNameForPlatform(Utils::Id id) const = 0;
};
} // namespace Core

View File

@@ -38,7 +38,6 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/icontext.h>
#include <coreplugin/icore.h>
#include <coreplugin/id.h>
#include <coreplugin/coreplugin.h>
#include <extensionsystem/pluginmanager.h>
@@ -66,6 +65,7 @@
Q_DECLARE_METATYPE(Core::IFindFilter*)
using namespace Qt;
using namespace Utils;
namespace {
const int MAX_COMPLETIONS = 50;

View File

@@ -28,7 +28,7 @@
#include "ui_findwidget.h"
#include "currentdocumentfind.h"
#include <coreplugin/id.h>
#include <utils/id.h>
#include <utils/styledbar.h>
#include <QTimer>

View File

@@ -34,6 +34,7 @@
#include <QTimer>
using namespace Utils;
namespace Core {
/*!

View File

@@ -30,7 +30,8 @@
#include <QVector>
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <utils/id.h>
#include <utils/theme/theme.h>
QT_BEGIN_NAMESPACE
@@ -50,10 +51,10 @@ struct CORE_EXPORT Highlight
HighestPriority = 3
};
Highlight(Id category, int position, Utils::Theme::Color color, Priority priority);
Highlight(Utils::Id category, int position, Utils::Theme::Color color, Priority priority);
Highlight() = default;
Id category;
Utils::Id category;
int position = -1;
Utils::Theme::Color color = Utils::Theme::TextColorNormal;
Priority priority = Invalid;
@@ -80,14 +81,14 @@ public:
double margin() const;
void setMargin(double margin);
QHash<Id, QVector<Highlight>> highlights() const;
QHash<Utils::Id, QVector<Highlight>> highlights() const;
void addHighlight(Highlight highlight);
void removeHighlights(Id id);
void removeHighlights(Utils::Id id);
void removeAllHighlights();
private:
QHash<Id, QVector<Highlight> > m_highlights;
QHash<Utils::Id, QVector<Highlight> > m_highlights;
double m_lineHeight = 0.0;
double m_visibleRange = 0.0; // in pixels
double m_margin = 0.0; // in pixels

View File

@@ -35,6 +35,8 @@
#include <QKeyEvent>
#include <QVBoxLayout>
using namespace Utils;
namespace Core {
/*!

View File

@@ -26,7 +26,8 @@
#pragma once
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <utils/id.h>
#include <QMap>
#include <QWidget>
@@ -43,7 +44,7 @@ class CORE_EXPORT OptionsPopup : public QWidget
Q_OBJECT
public:
OptionsPopup(QWidget *parent, const QVector<Id> &commands);
OptionsPopup(QWidget *parent, const QVector<Utils::Id> &commands);
protected:
bool event(QEvent *ev) override;
@@ -52,7 +53,7 @@ protected:
private:
void actionChanged();
QCheckBox *createCheckboxForCommand(Id id);
QCheckBox *createCheckboxForCommand(Utils::Id id);
QMap<QAction *, QCheckBox *> m_checkboxMap;
};

View File

@@ -34,6 +34,8 @@
#include <QDir>
#include <QString>
using namespace Utils;
namespace Core {
/*!

View File

@@ -26,10 +26,11 @@
#pragma once
#include "core_global.h"
#include "id.h"
#include <QSharedDataPointer>
#include <utils/id.h>
#include <QList>
#include <QSharedDataPointer>
namespace Core {
class GeneratedFilePrivate;
@@ -75,8 +76,8 @@ public:
void setBinary(bool b);
// Id of editor to open the file with
Id editorId() const;
void setEditorId(Id id);
Utils::Id editorId() const;
void setEditorId(Utils::Id id);
bool write(QString *errorMessage) const;

View File

@@ -78,25 +78,25 @@ QDebug operator<<(QDebug debug, const Core::Context &context)
*/
/*!
\fn Core::Context::Context(Core::Id c1)
\fn Core::Context::Context(Utils::Id c1)
Creates a context list with a single ID \a c1.
*/
/*!
\fn Core::Context::Context(Core::Id c1, Core::Id c2)
\fn Core::Context::Context(Utils::Id c1, Utils::Id c2)
Creates a context list with IDs \a c1 and \a c2.
*/
/*!
\fn Core::Context::Context(Core::Id c1, Core::Id c2, Core::Id c3)
\fn Core::Context::Context(Utils::Id c1, Utils::Id c2, Utils::Id c3)
Creates a context list with IDs \a c1, \a c2 and \a c3.
*/
/*!
\fn bool Core::Context::contains(Core::Id c) const
\fn bool Core::Context::contains(Utils::Id c) const
Returns whether this context list contains the ID \a c.
*/
@@ -115,7 +115,7 @@ QDebug operator<<(QDebug debug, const Core::Context &context)
*/
/*!
\fn Core::Id Core::Context::at(int i) const
\fn Utils::Id Core::Context::at(int i) const
Returns the ID at index \a i in the context list.
*/
@@ -134,7 +134,7 @@ QDebug operator<<(QDebug debug, const Core::Context &context)
*/
/*!
\fn int Core::Context::indexOf(Core::Id c) const
\fn int Core::Context::indexOf(Utils::Id c) const
Returns the index position of the ID \a c in the context list. Returns -1
if no item matched.
@@ -147,7 +147,7 @@ QDebug operator<<(QDebug debug, const Core::Context &context)
*/
/*!
\fn void Core::Context::prepend(Core::Id c)
\fn void Core::Context::prepend(Utils::Id c)
Adds the ID \a c as the first item to the context list.
*/
@@ -159,7 +159,7 @@ QDebug operator<<(QDebug debug, const Core::Context &context)
*/
/*!
\fn void Core::Context::add(Core::Id c)
\fn void Core::Context::add(Utils::Id c)
Adds the ID \a c at the end of the context list.
*/

View File

@@ -43,27 +43,27 @@ class CORE_EXPORT Context
public:
Context() = default;
explicit Context(Id c1) { add(c1); }
Context(Id c1, Id c2) { add(c1); add(c2); }
Context(Id c1, Id c2, Id c3) { add(c1); add(c2); add(c3); }
bool contains(Id c) const { return d.contains(c); }
explicit Context(Utils::Id c1) { add(c1); }
Context(Utils::Id c1, Utils::Id c2) { add(c1); add(c2); }
Context(Utils::Id c1, Utils::Id c2, Utils::Id c3) { add(c1); add(c2); add(c3); }
bool contains(Utils::Id c) const { return d.contains(c); }
int size() const { return d.size(); }
bool isEmpty() const { return d.isEmpty(); }
Id at(int i) const { return d.at(i); }
Utils::Id at(int i) const { return d.at(i); }
// FIXME: Make interface slimmer.
using const_iterator = QList<Id>::const_iterator;
using const_iterator = QList<Utils::Id>::const_iterator;
const_iterator begin() const { return d.begin(); }
const_iterator end() const { return d.end(); }
int indexOf(Id c) const { return d.indexOf(c); }
int indexOf(Utils::Id c) const { return d.indexOf(c); }
void removeAt(int i) { d.removeAt(i); }
void prepend(Id c) { d.prepend(c); }
void prepend(Utils::Id c) { d.prepend(c); }
void add(const Context &c) { d += c.d; }
void add(Id c) { d.append(c); }
void add(Utils::Id c) { d.append(c); }
bool operator==(const Context &c) const { return d == c.d; }
private:
QList<Id> d;
QList<Utils::Id> d;
};
class CORE_EXPORT IContext : public QObject

View File

@@ -158,6 +158,7 @@
using namespace Core::Internal;
using namespace ExtensionSystem;
using namespace Utils;
namespace Core {

View File

@@ -78,13 +78,13 @@ public:
const QString &defaultLocation = QString(),
const QVariantMap &extraVariables = QVariantMap());
static bool showOptionsDialog(const Id page, QWidget *parent = nullptr);
static bool showOptionsDialog(const Utils::Id page, QWidget *parent = nullptr);
static QString msgShowOptionsDialog();
static QString msgShowOptionsDialogToolTip();
static bool showWarningWithOptions(const QString &title, const QString &text,
const QString &details = QString(),
Id settingsId = Id(),
Utils::Id settingsId = {},
QWidget *parent = nullptr);
static QSettings *settings(QSettings::Scope scope = QSettings::UserScope);

View File

@@ -31,4 +31,4 @@ namespace Core {
using Id = Utils::Id;
} // namespace Core
} // Core

View File

@@ -58,8 +58,9 @@
\sa setFilePath()
*/
namespace Core {
using namespace Utils;
namespace Core {
namespace Internal {
class IDocumentPrivate

View File

@@ -26,7 +26,8 @@
#pragma once
#include "core_global.h"
#include "id.h"
#include <utils/id.h>
#include <QObject>
@@ -84,8 +85,8 @@ public:
IDocument(QObject *parent = nullptr);
~IDocument() override;
void setId(Id id);
Id id() const;
void setId(Utils::Id id);
Utils::Id id() const;
// required to be re-implemented for documents of IEditors
virtual OpenResult open(QString *errorString, const QString &fileName, const QString &realFileName);

View File

@@ -26,7 +26,8 @@
#pragma once
#include "core_global.h"
#include "id.h"
#include <utils/id.h>
#include <QObject>
#include <QStringList>
@@ -58,7 +59,7 @@ public:
void addMimeType(const QString &mimeType) { m_mimeTypes.append(mimeType); }
private:
Id m_id;
Utils::Id m_id;
Opener m_opener;
QStringList m_mimeTypes;
QString m_displayName;

View File

@@ -39,7 +39,7 @@ class CORE_EXPORT IMode : public IContext
Q_PROPERTY(QString displayName READ displayName WRITE setDisplayName)
Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
Q_PROPERTY(int priority READ priority WRITE setPriority)
Q_PROPERTY(Id id READ id WRITE setId)
Q_PROPERTY(Utils::Id id READ id WRITE setId)
Q_PROPERTY(QMenu *menu READ menu WRITE setMenu)
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledStateChanged)
@@ -50,7 +50,7 @@ public:
QString displayName() const { return m_displayName; }
QIcon icon() const { return m_icon; }
int priority() const { return m_priority; }
Id id() const { return m_id; }
Utils::Id id() const { return m_id; }
bool isEnabled() const;
QMenu *menu() const { return m_menu; }
@@ -58,7 +58,7 @@ public:
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
void setIcon(const QIcon &icon) { m_icon = icon; }
void setPriority(int priority) { m_priority = priority; }
void setId(Id id) { m_id = id; }
void setId(Utils::Id id) { m_id = id; }
void setMenu(QMenu *menu) { m_menu = menu; }
signals:
@@ -69,7 +69,7 @@ private:
QIcon m_icon;
QMenu *m_menu = nullptr;
int m_priority = -1;
Id m_id;
Utils::Id m_id;
bool m_isEnabled = true;
};

View File

@@ -127,7 +127,7 @@ void INavigationWidgetFactory::setPriority(int priority)
\sa id()
*/
void INavigationWidgetFactory::setId(Id id)
void INavigationWidgetFactory::setId(Utils::Id id)
{
m_id = id;
}

View File

@@ -26,7 +26,8 @@
#pragma once
#include "core_global.h"
#include "id.h"
#include <utils/id.h>
#include <QObject>
#include <QList>
@@ -60,12 +61,12 @@ public:
void setDisplayName(const QString &displayName);
void setPriority(int priority);
void setId(Id id);
void setId(Utils::Id id);
void setActivationSequence(const QKeySequence &keys);
QString displayName() const { return m_displayName ; }
int priority() const { return m_priority; }
Id id() const { return m_id; }
Utils::Id id() const { return m_id; }
QKeySequence activationSequence() const;
// This design is not optimal, think about it again once we need to extend it
@@ -80,7 +81,7 @@ public:
private:
QString m_displayName;
int m_priority = 0;
Id m_id;
Utils::Id m_id;
QKeySequence m_activationSequence;
};

View File

@@ -26,9 +26,9 @@
#pragma once
#include "core_global.h"
#include "id.h"
#include <utils/fancylineedit.h>
#include <utils/id.h>
#include <QObject>
#include <QList>
@@ -115,9 +115,9 @@ private:
void filterOutputButtonClicked();
void setCaseSensitive(bool caseSensitive);
void setRegularExpressions(bool regularExpressions);
Id filterRegexpActionId() const;
Id filterCaseSensitivityActionId() const;
Id filterInvertedActionId() const;
Utils::Id filterRegexpActionId() const;
Utils::Id filterCaseSensitivityActionId() const;
Utils::Id filterInvertedActionId() const;
Core::CommandButton * const m_zoomInButton;
Core::CommandButton * const m_zoomOutButton;

View File

@@ -26,8 +26,8 @@
#pragma once
#include "core_global.h"
#include "id.h"
#include <utils/id.h>
#include <utils/fileutils.h>
#include <QDateTime>
@@ -92,7 +92,7 @@ public:
~IVersionControl() override;
virtual QString displayName() const = 0;
virtual Id id() const = 0;
virtual Utils::Id id() const = 0;
/*!
* \brief isVcsFileOrDirectory
@@ -277,7 +277,7 @@ class CORE_EXPORT TestVersionControl : public IVersionControl
{
Q_OBJECT
public:
TestVersionControl(Id id, const QString &name) :
TestVersionControl(Utils::Id id, const QString &name) :
m_id(id), m_displayName(name)
{ }
~TestVersionControl() override;
@@ -293,7 +293,7 @@ public:
// IVersionControl interface
QString displayName() const override { return m_displayName; }
Id id() const override { return m_id; }
Utils::Id id() const override { return m_id; }
bool managesDirectory(const QString &filename, QString *topLevel) const override;
bool managesFile(const QString &workingDirectory, const QString &fileName) const override;
bool isConfigured() const override { return true; }
@@ -307,7 +307,7 @@ public:
void vcsDescribe(const QString &, const QString &) override {}
private:
Id m_id;
Utils::Id m_id;
QString m_displayName;
QHash<QString, QString> m_managedDirs;
QSet<QString> m_managedFiles;
@@ -316,4 +316,5 @@ private:
};
} // namespace Core
#endif

View File

@@ -53,7 +53,7 @@ public:
virtual QString title() const = 0;
virtual int priority() const { return 0; }
virtual Core::Id id() const = 0;
virtual Utils::Id id() const = 0;
virtual QWidget *createWidget() const = 0;
static const QList<IWelcomePage *> allWelcomePages();

View File

@@ -125,7 +125,7 @@
*/
using namespace Core;
using namespace Utils;
namespace {
static QList<IFeatureProvider *> s_providerList;

View File

@@ -57,7 +57,7 @@ public:
};
Q_DECLARE_FLAGS(WizardFlags, WizardFlag)
Id id() const { return m_id; }
Utils::Id id() const { return m_id; }
WizardKind kind() const { return m_supportedProjectTypes.isEmpty() ? FileWizard : ProjectWizard; }
QIcon icon() const { return m_icon; }
QString iconText() const { return m_iconText; }
@@ -66,12 +66,12 @@ public:
QString category() const { return m_category; }
QString displayCategory() const { return m_displayCategory; }
QString descriptionImage() const { return m_descriptionImage; }
QSet<Id> requiredFeatures() const { return m_requiredFeatures; }
QSet<Utils::Id> requiredFeatures() const { return m_requiredFeatures; }
WizardFlags flags() const { return m_flags; }
QSet<Id> supportedProjectTypes() const { return m_supportedProjectTypes; }
QSet<Utils::Id> supportedProjectTypes() const { return m_supportedProjectTypes; }
void setId(const Id id) { m_id = id; }
void setSupportedProjectTypes(const QSet<Id> &projectTypes) { m_supportedProjectTypes = projectTypes; }
void setId(const Utils::Id id) { m_id = id; }
void setSupportedProjectTypes(const QSet<Utils::Id> &projectTypes) { m_supportedProjectTypes = projectTypes; }
void setIcon(const QIcon &icon) { m_icon = icon; }
void setIconText(const QString &iconText) { m_iconText = iconText; }
void setDescription(const QString &description) { m_description = description; }
@@ -79,26 +79,26 @@ public:
void setCategory(const QString &category) { m_category = category; }
void setDisplayCategory(const QString &displayCategory) { m_displayCategory = displayCategory; }
void setDescriptionImage(const QString &descriptionImage) { m_descriptionImage = descriptionImage; }
void setRequiredFeatures(const QSet<Id> &featureSet) { m_requiredFeatures = featureSet; }
void addRequiredFeature(const Id &feature) { m_requiredFeatures |= feature; }
void setRequiredFeatures(const QSet<Utils::Id> &featureSet) { m_requiredFeatures = featureSet; }
void addRequiredFeature(const Utils::Id &feature) { m_requiredFeatures |= feature; }
void setFlags(WizardFlags flags) { m_flags = flags; }
QString runPath(const QString &defaultPath);
// Does bookkeeping and the calls runWizardImpl. Please implement that.
Utils::Wizard *runWizard(const QString &path, QWidget *parent, Id platform,
Utils::Wizard *runWizard(const QString &path, QWidget *parent, Utils::Id platform,
const QVariantMap &variables);
virtual bool isAvailable(Id platformId) const;
QSet<Id> supportedPlatforms() const;
virtual bool isAvailable(Utils::Id platformId) const;
QSet<Utils::Id> supportedPlatforms() const;
using FactoryCreator = std::function<QList<IWizardFactory *>()>;
static void registerFactoryCreator(const FactoryCreator &creator);
// Utility to find all registered wizards
static QList<IWizardFactory*> allWizardFactories();
static QSet<Id> allAvailablePlatforms();
static QString displayNameForPlatform(Id i);
static QSet<Utils::Id> allAvailablePlatforms();
static QString displayNameForPlatform(Utils::Id i);
static void registerFeatureProvider(IFeatureProvider *provider);
@@ -111,10 +111,10 @@ public:
const QVariantMap &extraVariables);
protected:
QSet<Id> pluginFeatures() const;
QSet<Id> availableFeatures(Id platformId) const;
QSet<Utils::Id> pluginFeatures() const;
QSet<Utils::Id> availableFeatures(Utils::Id platformId) const;
virtual Utils::Wizard *runWizardImpl(const QString &path, QWidget *parent, Id platform,
virtual Utils::Wizard *runWizardImpl(const QString &path, QWidget *parent, Utils::Id platform,
const QVariantMap &variables) = 0;
private:
@@ -131,10 +131,10 @@ private:
QString m_category;
QString m_displayCategory;
QString m_descriptionImage;
QSet<Id> m_requiredFeatures;
QSet<Id> m_supportedProjectTypes;
QSet<Utils::Id> m_requiredFeatures;
QSet<Utils::Id> m_supportedProjectTypes;
WizardFlags m_flags;
Id m_id;
Utils::Id m_id;
friend class Internal::CorePlugin;
};

View File

@@ -33,6 +33,8 @@
#include <QAction>
#include <QTimer>
using namespace Utils;
namespace Core {
struct CommandLocatorPrivate

View File

@@ -39,7 +39,7 @@ class CORE_EXPORT CommandLocator : public ILocatorFilter
Q_OBJECT
public:
CommandLocator(Id id, const QString &displayName,
CommandLocator(Utils::Id id, const QString &displayName,
const QString &shortCutString, QObject *parent = nullptr);
~CommandLocator() override;

View File

@@ -35,6 +35,8 @@
#include <QFileDialog>
#include <QTimer>
using namespace Utils;
namespace Core {
/*!

View File

@@ -46,7 +46,7 @@ class CORE_EXPORT DirectoryFilter : public BaseFileFilter
Q_OBJECT
public:
DirectoryFilter(Id id);
DirectoryFilter(Utils::Id id);
QByteArray saveState() const override;
void restoreState(const QByteArray &state) override;
bool openConfigDialog(QWidget *parent, bool &needsRefresh) override;

View File

@@ -43,6 +43,7 @@
using namespace Core;
using namespace Core::Internal;
using namespace Utils;
ILocatorFilter::MatchLevel FileSystemFilter::matchLevelFor(const QRegularExpressionMatch &match,
const QString &matchText) const

View File

@@ -38,6 +38,7 @@
#include <QRegularExpression>
using namespace Core;
using namespace Utils;
/*!
\class Core::ILocatorFilter

View File

@@ -26,8 +26,8 @@
#pragma once
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <utils/id.h>
#include <utils/optional.h>
#include <QVariant>
@@ -121,8 +121,8 @@ public:
static const QList<ILocatorFilter *> allLocatorFilters();
Id id() const;
Id actionId() const;
Utils::Id id() const;
Utils::Id actionId() const;
QString displayName() const;
@@ -170,13 +170,13 @@ public slots:
protected:
void setHidden(bool hidden);
void setId(Id id);
void setId(Utils::Id id);
void setPriority(Priority priority);
void setDisplayName(const QString &displayString);
void setConfigurable(bool configurable);
private:
Id m_id;
Utils::Id m_id;
QString m_shortcut;
Priority m_priority = Medium;
QString m_displayName;

View File

@@ -63,6 +63,8 @@
#include "spotlightlocatorfilter.h"
#endif
using namespace Utils;
namespace Core {
namespace Internal {

View File

@@ -77,7 +77,7 @@ private:
bool m_settingsInitialized = false;
QList<ILocatorFilter *> m_filters;
QList<ILocatorFilter *> m_customFilters;
QMap<Id, QAction *> m_filterActionMap;
QMap<Utils::Id, QAction *> m_filterActionMap;
QTimer m_refreshTimer;
QFuture<void> m_refreshTask;
QList<ILocatorFilter *> m_refreshingFilters;

View File

@@ -31,6 +31,8 @@
#include <QMutexLocker>
#include <QUrl>
using namespace Utils;
namespace Core {
namespace Internal {

View File

@@ -40,8 +40,8 @@ class CORE_EXPORT UrlLocatorFilter final : public Core::ILocatorFilter
{
Q_OBJECT
public:
UrlLocatorFilter(Id id);
UrlLocatorFilter(const QString &displayName, Id id);
UrlLocatorFilter(Utils::Id id);
UrlLocatorFilter(const QString &displayName, Utils::Id id);
~UrlLocatorFilter() final;
// ILocatorFilter

View File

@@ -46,6 +46,8 @@
#include <QMouseEvent>
#include <QVector>
using namespace Utils;
namespace Core {
/*!

View File

@@ -26,7 +26,9 @@
#pragma once
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <utils/id.h>
#include <QObject>
QT_BEGIN_NAMESPACE
@@ -56,12 +58,12 @@ public:
static ModeManager *instance();
static IMode *currentMode();
static Id currentModeId();
static Utils::Id currentModeId();
static void addAction(QAction *action, int priority);
static void addProjectSelector(QAction *action);
static void activateMode(Id id);
static void activateMode(Utils::Id id);
static void setFocusToCurrentMode();
static Style modeStyle();
@@ -70,10 +72,10 @@ public slots:
static void cycleModeStyle();
signals:
void currentModeAboutToChange(Core::Id mode);
void currentModeAboutToChange(Utils::Id mode);
// the default argument '=0' is important for connects without the oldMode argument.
void currentModeChanged(Core::Id mode, Core::Id oldMode = Core::Id());
void currentModeChanged(Utils::Id mode, Utils::Id oldMode = {});
private:
explicit ModeManager(Internal::MainWindow *mainWindow, Internal::FancyTabWidget *modeStack);

View File

@@ -43,6 +43,8 @@
Q_DECLARE_METATYPE(Core::INavigationWidgetFactory *)
using namespace Utils;
namespace Core {
namespace Internal {

View File

@@ -48,6 +48,8 @@
Q_DECLARE_METATYPE(Core::INavigationWidgetFactory *)
using namespace Utils;
namespace Core {
NavigationWidgetPlaceHolder *NavigationWidgetPlaceHolder::s_currentLeft = nullptr;

View File

@@ -26,7 +26,8 @@
#pragma once
#include <coreplugin/minisplitter.h>
#include <coreplugin/id.h>
#include <utils/id.h>
#include <QHash>
@@ -53,17 +54,17 @@ class CORE_EXPORT NavigationWidgetPlaceHolder : public QWidget
friend class Core::NavigationWidget;
public:
explicit NavigationWidgetPlaceHolder(Id mode, Side side, QWidget *parent = nullptr);
explicit NavigationWidgetPlaceHolder(Utils::Id mode, Side side, QWidget *parent = nullptr);
~NavigationWidgetPlaceHolder() override;
static NavigationWidgetPlaceHolder *current(Side side);
static void setCurrent(Side side, NavigationWidgetPlaceHolder *navWidget);
void applyStoredSize();
private:
void currentModeAboutToChange(Id mode);
void currentModeAboutToChange(Utils::Id mode);
int storedWidth() const;
Id m_mode;
Utils::Id m_mode;
Side m_side;
static NavigationWidgetPlaceHolder *s_currentLeft;
static NavigationWidgetPlaceHolder *s_currentRight;
@@ -89,21 +90,21 @@ public:
void saveSettings(QSettings *settings);
void restoreSettings(QSettings *settings);
QWidget *activateSubWidget(Id factoryId, int preferredPosition);
QWidget *activateSubWidget(Utils::Id factoryId, int preferredPosition);
void closeSubWidgets();
bool isShown() const;
void setShown(bool b);
static NavigationWidget *instance(Side side);
static QWidget *activateSubWidget(Id factoryId, Side fallbackSide);
static QWidget *activateSubWidget(Utils::Id factoryId, Side fallbackSide);
int storedWidth();
// Called from the place holders
void placeHolderChanged(NavigationWidgetPlaceHolder *holder);
QHash<Id, Command *> commandMap() const;
QHash<Utils::Id, Command *> commandMap() const;
QAbstractItemModel *factoryModel() const;
protected:
@@ -114,7 +115,7 @@ private:
void closeSubWidget();
void updateToggleText();
Internal::NavigationSubWidget *insertSubItem(int position, int factoryIndex);
int factoryIndex(Id id);
int factoryIndex(Utils::Id id);
QString settingsKey(const QString &key) const;
void onSubWidgetFactoryIndexChanged(int factoryIndex);

View File

@@ -32,6 +32,8 @@
#include <QSplitter>
#include <QVBoxLayout>
using namespace Utils;
namespace Core {
class OutputPanePlaceHolderPrivate {

View File

@@ -26,7 +26,8 @@
#pragma once
#include "core_global.h"
#include "id.h"
#include <utils/id.h>
#include <QWidget>
@@ -43,7 +44,7 @@ class CORE_EXPORT OutputPanePlaceHolder : public QWidget
Q_OBJECT
public:
explicit OutputPanePlaceHolder(Id mode, QSplitter *parent = nullptr);
explicit OutputPanePlaceHolder(Utils::Id mode, QSplitter *parent = nullptr);
~OutputPanePlaceHolder() override;
static OutputPanePlaceHolder *getCurrent();
@@ -63,7 +64,7 @@ protected:
private:
void setHeight(int height);
void currentModeChanged(Id mode);
void currentModeChanged(Utils::Id mode);
OutputPanePlaceHolderPrivate *d;
};

View File

@@ -25,7 +25,7 @@
#pragma once
#include <coreplugin/id.h>
#include <utils/id.h>
#include <QToolButton>

View File

@@ -26,8 +26,6 @@
#include "futureprogress.h"
#include "progressbar.h"
#include <coreplugin/id.h>
#include <utils/stylehelper.h>
#include <utils/theme/theme.h>

View File

@@ -26,7 +26,8 @@
#pragma once
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <utils/id.h>
#include <QString>
#include <QFuture>
@@ -62,8 +63,8 @@ public:
void setSubtitleVisibleInStatusBar(bool visible);
bool isSubtitleVisibleInStatusBar() const;
void setType(Id type);
Id type() const;
void setType(Utils::Id type);
Utils::Id type() const;
void setKeepOnFinish(KeepOnFinishType keepType);
bool keepOnFinish() const;

View File

@@ -212,13 +212,13 @@ using namespace Utils;
*/
/*!
\fn void Core::ProgressManager::taskStarted(Core::Id type)
\fn void Core::ProgressManager::taskStarted(Utils::Id type)
Sent whenever a task of a given \a type is started.
*/
/*!
\fn void Core::ProgressManager::allTasksFinished(Core::Id type)
\fn void Core::ProgressManager::allTasksFinished(Utils::Id type)
Sent when all tasks of a \a type have finished.
*/

View File

@@ -26,7 +26,8 @@
#pragma once
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <utils/id.h>
#include <QFuture>
#include <QFutureInterfaceBase>
@@ -52,17 +53,17 @@ public:
static ProgressManager *instance();
static FutureProgress *addTask(const QFuture<void> &future, const QString &title,
Id type, ProgressFlags flags = {});
Utils::Id type, ProgressFlags flags = {});
static FutureProgress *addTimedTask(const QFutureInterface<void> &fi, const QString &title,
Id type, int expectedSeconds, ProgressFlags flags = {});
Utils::Id type, int expectedSeconds, ProgressFlags flags = {});
static void setApplicationLabel(const QString &text);
public slots:
static void cancelTasks(Id type);
static void cancelTasks(Utils::Id type);
signals:
void taskStarted(Core::Id type);
void allTasksFinished(Core::Id type);
void taskStarted(Utils::Id type);
void allTasksFinished(Utils::Id type);
private:
ProgressManager();

View File

@@ -54,14 +54,14 @@ public:
void init();
void cleanup();
FutureProgress *doAddTask(const QFuture<void> &future, const QString &title, Id type,
FutureProgress *doAddTask(const QFuture<void> &future, const QString &title, Utils::Id type,
ProgressFlags flags);
void doSetApplicationLabel(const QString &text);
ProgressView *progressView();
public slots:
void doCancelTasks(Core::Id type);
void doCancelTasks(Utils::Id type);
protected:
bool eventFilter(QObject *obj, QEvent *event) override;
@@ -89,14 +89,14 @@ private:
bool hasError() const;
bool isLastFading() const;
void removeOldTasks(Id type, bool keepOne = false);
void removeOldTasks(Utils::Id type, bool keepOne = false);
void removeOneOldTask();
void removeTask(FutureProgress *task);
void deleteTask(FutureProgress *task);
QPointer<ProgressView> m_progressView;
QList<FutureProgress *> m_taskList;
QMap<QFutureWatcher<void> *, Id> m_runningTasks;
QMap<QFutureWatcher<void> *, Utils::Id> m_runningTasks;
QFutureWatcher<void> *m_applicationTask = nullptr;
StatusBarWidget *m_statusBarWidgetContainer;
QWidget *m_statusBarWidget;

View File

@@ -37,6 +37,7 @@
using namespace Core;
using namespace Core::Internal;
using namespace Utils;
RightPanePlaceHolder *RightPanePlaceHolder::m_current = nullptr;

View File

@@ -45,14 +45,14 @@ class CORE_EXPORT RightPanePlaceHolder : public QWidget
Q_OBJECT
public:
explicit RightPanePlaceHolder(Id mode, QWidget *parent = nullptr);
explicit RightPanePlaceHolder(Utils::Id mode, QWidget *parent = nullptr);
~RightPanePlaceHolder() override;
static RightPanePlaceHolder *current();
private:
void currentModeChanged(Id mode);
void currentModeChanged(Utils::Id mode);
void applyStoredSize(int width);
Id m_mode;
Utils::Id m_mode;
static RightPanePlaceHolder* m_current;
};

View File

@@ -48,7 +48,7 @@ FutureProgress *ShellCommand::futureProgress() const
void ShellCommand::addTask(QFuture<void> &future)
{
const QString name = displayName();
const auto id = Core::Id::fromString(name + QLatin1String(".action"));
const auto id = Utils::Id::fromString(name + QLatin1String(".action"));
if (hasProgressParser()) {
m_progress = ProgressManager::addTask(future, name, id);
} else {

View File

@@ -25,7 +25,7 @@
#pragma once
#include "id.h"
#include <utils/id.h>
#include <coreplugin/dialogs/ioptionspage.h>
@@ -42,17 +42,17 @@ class ThemeEntry
{
public:
ThemeEntry() = default;
ThemeEntry(Id id, const QString &filePath);
ThemeEntry(Utils::Id id, const QString &filePath);
Id id() const;
Utils::Id id() const;
QString displayName() const;
QString filePath() const;
static QList<ThemeEntry> availableThemes();
static Id themeSetting();
static Utils::Theme *createTheme(Id id);
static Utils::Id themeSetting();
static Utils::Theme *createTheme(Utils::Id id);
private:
Id m_id;
Utils::Id m_id;
QString m_filePath;
mutable QString m_displayName;
};

View File

@@ -48,6 +48,8 @@
#include <QFileInfo>
#include <QMessageBox>
using namespace Utils;
namespace Core {
#if defined(WITH_TESTS)

View File

@@ -26,7 +26,8 @@
#pragma once
#include "core_global.h"
#include "id.h"
#include <utils/id.h>
#include <QString>
#include <QObject>
@@ -59,7 +60,7 @@ public:
static void extensionsInitialized();
static const QList<IVersionControl *> versionControls();
static IVersionControl *versionControl(Id id);
static IVersionControl *versionControl(Utils::Id id);
static void resetVersionControlForDirectory(const QString &inputDirectory);
static IVersionControl *findVersionControlForDirectory(const QString &directory,

View File

@@ -42,6 +42,8 @@
#include <QWidget>
#include <QWindowStateChangeEvent>
using namespace Utils;
namespace Core {
namespace Internal {

View File

@@ -55,7 +55,7 @@ private:
QMenu *m_dockMenu = nullptr;
QList<QWidget *> m_windows;
QList<QAction *> m_windowActions;
QList<Id> m_windowActionIds;
QList<Utils::Id> m_windowActionIds;
};
class WindowSupport : public QObject