diff options
55 files changed, 98 insertions, 88 deletions
diff --git a/src/plugins/analyzerbase/ianalyzertool.cpp b/src/plugins/analyzerbase/ianalyzertool.cpp index 8ce961c691..2f98593339 100644 --- a/src/plugins/analyzerbase/ianalyzertool.cpp +++ b/src/plugins/analyzerbase/ianalyzertool.cpp @@ -42,8 +42,8 @@ IAnalyzerTool::IAnalyzerTool(QObject *parent) Id IAnalyzerTool::defaultMenuGroup(StartMode mode) { if (mode == StartRemote) - return Constants::G_ANALYZER_REMOTE_TOOLS; - return Constants::G_ANALYZER_TOOLS; + return Id(Constants::G_ANALYZER_REMOTE_TOOLS); + return Id(Constants::G_ANALYZER_TOOLS); } Id IAnalyzerTool::defaultActionId(const IAnalyzerTool *tool, StartMode mode) @@ -51,11 +51,11 @@ Id IAnalyzerTool::defaultActionId(const IAnalyzerTool *tool, StartMode mode) Id id = tool->id(); switch (mode) { case StartLocal: - return Id(QByteArray("Analyzer." + id.name() + ".Local").data()); + return Id(QByteArray("Analyzer." + id.name() + ".Local")); case StartRemote: - return Id(QByteArray("Analyzer." + id.name() + ".Remote").data()); + return Id(QByteArray("Analyzer." + id.name() + ".Remote")); case StartQml: - return Id(QByteArray("Analyzer." + id.name() + ".Qml").data()); + return Id(QByteArray("Analyzer." + id.name() + ".Qml")); } return Id(); } diff --git a/src/plugins/bazaar/bazaarcontrol.cpp b/src/plugins/bazaar/bazaarcontrol.cpp index d726409cd1..628b4dfc48 100644 --- a/src/plugins/bazaar/bazaarcontrol.cpp +++ b/src/plugins/bazaar/bazaarcontrol.cpp @@ -51,7 +51,7 @@ QString BazaarControl::displayName() const Core::Id BazaarControl::id() const { - return VcsBase::Constants::VCS_ID_BAZAAR; + return Core::Id(VcsBase::Constants::VCS_ID_BAZAAR); } bool BazaarControl::managesDirectory(const QString &directory, QString *topLevel) const diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index 77b47bdeaa..3da2e89cbe 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -373,7 +373,7 @@ public: return m_file->open(errorString, fileName); } Core::IDocument *document() { return m_file; } - Core::Id id() const { return Core::Constants::K_DEFAULT_BINARY_EDITOR_ID; } + Core::Id id() const { return Core::Id(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID); } QString displayName() const { return m_displayName; } void setDisplayName(const QString &title) { m_displayName = title; emit changed(); } @@ -417,7 +417,7 @@ BinEditorFactory::BinEditorFactory(BinEditorPlugin *owner) : Core::Id BinEditorFactory::id() const { - return Core::Constants::K_DEFAULT_BINARY_EDITOR_ID; + return Core::Id(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID); } QString BinEditorFactory::displayName() const diff --git a/src/plugins/clearcase/clearcasecontrol.cpp b/src/plugins/clearcase/clearcasecontrol.cpp index b4fc953875..8ee90b2fe2 100644 --- a/src/plugins/clearcase/clearcasecontrol.cpp +++ b/src/plugins/clearcase/clearcasecontrol.cpp @@ -52,7 +52,7 @@ QString ClearCaseControl::displayName() const Core::Id ClearCaseControl::id() const { - return ClearCase::Constants::VCS_ID_CLEARCASE; + return Core::Id(ClearCase::Constants::VCS_ID_CLEARCASE); } bool ClearCaseControl::isConfigured() const diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp index 400b608afa..e1159dcf85 100644 --- a/src/plugins/clearcase/clearcaseplugin.cpp +++ b/src/plugins/clearcase/clearcaseplugin.cpp @@ -1261,7 +1261,7 @@ Core::IEditor *ClearCasePlugin::showOutputInEditor(const QString& title, const Q { const VcsBase::VcsBaseEditorParameters *params = findType(editorType); QTC_ASSERT(params, return 0); - const Core::Id id = params->id; + const Core::Id id = Core::Id(QByteArray(params->id)); if (ClearCase::Constants::debug) qDebug() << "ClearCasePlugin::showOutputInEditor" << title << id.name() << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index d770e3ee1b..ffd2f212c6 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -74,7 +74,7 @@ Core::IEditor *CMakeEditor::duplicate(QWidget *parent) Core::Id CMakeEditor::id() const { - return CMakeProjectManager::Constants::CMAKE_EDITOR_ID; + return Core::Id(CMakeProjectManager::Constants::CMAKE_EDITOR_ID); } void CMakeEditor::markAsChanged() diff --git a/src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp b/src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp index 97f62c1ae5..79d95c81c2 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp @@ -69,7 +69,7 @@ CMakeEditorFactory::CMakeEditorFactory(CMakeManager *manager) Core::Id CMakeEditorFactory::id() const { - return CMakeProjectManager::Constants::CMAKE_EDITOR_ID; + return Core::Id(CMakeProjectManager::Constants::CMAKE_EDITOR_ID); } QString CMakeEditorFactory::displayName() const diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index a0601d8476..cfcb70326a 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -565,5 +565,5 @@ QString CMakeRunConfigurationFactory::buildTargetFromId(Core::Id id) Core::Id CMakeRunConfigurationFactory::idFromBuildTarget(const QString &target) { QString id = QString::fromLatin1(CMAKE_RC_PREFIX) + target; - return Core::Id(id.toUtf8().constData()); + return Core::Id(id.toUtf8()); } diff --git a/src/plugins/coreplugin/featureprovider.h b/src/plugins/coreplugin/featureprovider.h index a408ea8cfc..7313bbf969 100644 --- a/src/plugins/coreplugin/featureprovider.h +++ b/src/plugins/coreplugin/featureprovider.h @@ -63,7 +63,7 @@ class CORE_EXPORT Feature : public Id { friend class FeatureSet; public: - Feature(const char *name) : Id(name) {} + Feature(const char *name) : Id(QByteArray(name)) {} explicit Feature(const QString &name) : Id(name) {} }; diff --git a/src/plugins/coreplugin/icontext.cpp b/src/plugins/coreplugin/icontext.cpp index 9a6fcd227d..80472d2fcc 100644 --- a/src/plugins/coreplugin/icontext.cpp +++ b/src/plugins/coreplugin/icontext.cpp @@ -42,12 +42,12 @@ Context::Context(const char *id, int offset) void Context::add(const char *id) { - d.append(Id(id).uniqueIdentifier()); + d.append(Id(QByteArray(id)).uniqueIdentifier()); } bool Context::contains(const char *id) const { - return d.contains(Id(id).uniqueIdentifier()); + return d.contains(Id(QByteArray(id)).uniqueIdentifier()); } } // namespace Core diff --git a/src/plugins/coreplugin/id.cpp b/src/plugins/coreplugin/id.cpp index aa98d4db01..cebc36830b 100644 --- a/src/plugins/coreplugin/id.cpp +++ b/src/plugins/coreplugin/id.cpp @@ -52,13 +52,13 @@ namespace Core { class StringHolder { public: - explicit StringHolder(const char *s) - : str(s) + StringHolder(const char *s, int length) + : n(length), str(s) { - n = strlen(s); - int m = n; + if (!n) + length = n = strlen(s); h = 0; - while (m--) { + while (length--) { h = (h << 4) + *s++; h ^= (h & 0xf0000000) >> 23; h &= 0x0fffffff; @@ -97,10 +97,10 @@ static int lastUid = 0; static QVector<QByteArray> stringFromId; static IdCache idFromString; -static int theId(const char *str) +static int theId(const char *str, int n = 0) { QTC_ASSERT(str && *str, return 0); - StringHolder sh(str); + StringHolder sh(str, n); int res = idFromString.value(sh, 0); if (res == 0) { if (lastUid == 0) @@ -113,8 +113,17 @@ static int theId(const char *str) return res; } +static int theId(const QByteArray &ba) +{ + return theId(ba.constData(), ba.size()); +} + Id::Id(const char *name) - : m_id(theId(name)) + : m_id(theId(name, 0)) +{} + +Id::Id(const QByteArray &name) + : m_id(theId(name)) {} Id::Id(const QString &name) diff --git a/src/plugins/coreplugin/id.h b/src/plugins/coreplugin/id.h index c5f485a0de..eae2aa68ed 100644 --- a/src/plugins/coreplugin/id.h +++ b/src/plugins/coreplugin/id.h @@ -43,7 +43,8 @@ class CORE_EXPORT Id public: Id() : m_id(0) {} Id(const char *name); - // FIXME: Replace with QByteArray + explicit Id(const QByteArray &name); + // FIXME: Remove explicit Id(const QString &name); QByteArray name() const; QString toString() const; diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 83b60c4897..399b108a25 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -1743,7 +1743,7 @@ Core::IEditor *CPPEditor::duplicate(QWidget *parent) Core::Id CPPEditor::id() const { - return CppEditor::Constants::CPPEDITOR_ID; + return Core::Id(CppEditor::Constants::CPPEDITOR_ID); } bool CPPEditor::open(QString *errorString, const QString &fileName, const QString &realFileName) diff --git a/src/plugins/cppeditor/cppplugin.cpp b/src/plugins/cppeditor/cppplugin.cpp index 8ad818b21d..aaed8e0f19 100644 --- a/src/plugins/cppeditor/cppplugin.cpp +++ b/src/plugins/cppeditor/cppplugin.cpp @@ -98,7 +98,7 @@ CppEditorFactory::CppEditorFactory(CppPlugin *owner) : Core::Id CppEditorFactory::id() const { - return CppEditor::Constants::CPPEDITOR_ID; + return Core::Id(CppEditor::Constants::CPPEDITOR_ID); } QString CppEditorFactory::displayName() const diff --git a/src/plugins/cvs/cvscontrol.cpp b/src/plugins/cvs/cvscontrol.cpp index 0604ecd0ee..5feb30ab52 100644 --- a/src/plugins/cvs/cvscontrol.cpp +++ b/src/plugins/cvs/cvscontrol.cpp @@ -50,7 +50,7 @@ QString CvsControl::displayName() const Core::Id CvsControl::id() const { - return VcsBase::Constants::VCS_ID_CVS; + return Core::Id(VcsBase::Constants::VCS_ID_CVS); } bool CvsControl::isConfigured() const diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index 059f51e3a6..1185aa2ce0 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -1269,7 +1269,7 @@ IEditor *CvsPlugin::showOutputInEditor(const QString& title, const QString &outp { const VcsBaseEditorParameters *params = findType(editorType); QTC_ASSERT(params, return 0); - const Id id = params->id; + const Id id = Core::Id(QByteArray(params->id)); if (Cvs::Constants::debug) qDebug() << "CVSPlugin::showOutputInEditor" << title << id.name() << "source=" << source << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index e2bde5e3b4..bbd6b33bdc 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -463,12 +463,12 @@ static QToolButton *toolButton(QAction *action) return button; } -static void setProxyAction(ProxyAction *proxy, const char *id) +static void setProxyAction(ProxyAction *proxy, Core::Id id) { proxy->setAction(ActionManager::command(id)->action()); } -static QToolButton *toolButton(const char *id) +static QToolButton *toolButton(Core::Id id) { return toolButton(ActionManager::command(id)->action()); } @@ -1562,7 +1562,7 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project) m_exitAction->setEnabled(false); m_startAction->setEnabled(true); m_debugWithoutDeployAction->setEnabled(true); - setProxyAction(m_visibleStartAction, Constants::DEBUG); + setProxyAction(m_visibleStartAction, Core::Id(Constants::DEBUG)); } void DebuggerPluginPrivate::languagesChanged() @@ -2233,7 +2233,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) m_exitAction->setEnabled(false); m_startAction->setEnabled(true); m_debugWithoutDeployAction->setEnabled(true); - setProxyAction(m_visibleStartAction, Constants::DEBUG); + setProxyAction(m_visibleStartAction, Core::Id(Constants::DEBUG)); m_hiddenStopAction->setAction(m_undisturbableAction); } else if (state == InferiorStopOk) { // F5 continues, Shift-F5 kills. It is "continuable". @@ -2242,7 +2242,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) m_exitAction->setEnabled(true); m_startAction->setEnabled(false); m_debugWithoutDeployAction->setEnabled(false); - setProxyAction(m_visibleStartAction, Constants::CONTINUE); + setProxyAction(m_visibleStartAction, Core::Id(Constants::CONTINUE)); m_hiddenStopAction->setAction(m_exitAction); m_localsAndExpressionsWindow->setShowLocals(true); } else if (state == InferiorRunOk) { @@ -2252,7 +2252,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) m_exitAction->setEnabled(true); m_startAction->setEnabled(false); m_debugWithoutDeployAction->setEnabled(false); - setProxyAction(m_visibleStartAction, Constants::INTERRUPT); + setProxyAction(m_visibleStartAction, Core::Id(Constants::INTERRUPT)); m_hiddenStopAction->setAction(m_interruptAction); m_localsAndExpressionsWindow->setShowLocals(false); } else if (state == DebuggerFinished) { @@ -2262,7 +2262,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) m_exitAction->setEnabled(false); m_startAction->setEnabled(true); m_debugWithoutDeployAction->setEnabled(true); - setProxyAction(m_visibleStartAction, Constants::DEBUG); + setProxyAction(m_visibleStartAction, Core::Id(Constants::DEBUG)); m_hiddenStopAction->setAction(m_undisturbableAction); m_codeModelSnapshot = CPlusPlus::Snapshot(); setBusyCursor(false); diff --git a/src/plugins/designer/formeditorfactory.cpp b/src/plugins/designer/formeditorfactory.cpp index 5a03eb61fb..833849ae67 100644 --- a/src/plugins/designer/formeditorfactory.cpp +++ b/src/plugins/designer/formeditorfactory.cpp @@ -61,7 +61,7 @@ FormEditorFactory::FormEditorFactory() Core::Id FormEditorFactory::id() const { - return K_DESIGNER_XML_EDITOR_ID; + return Core::Id(K_DESIGNER_XML_EDITOR_ID); } QString FormEditorFactory::displayName() const diff --git a/src/plugins/designer/formwindoweditor.cpp b/src/plugins/designer/formwindoweditor.cpp index f1d1c16374..509d57feb2 100644 --- a/src/plugins/designer/formwindoweditor.cpp +++ b/src/plugins/designer/formwindoweditor.cpp @@ -208,7 +208,7 @@ Core::IDocument *FormWindowEditor::document() Core::Id FormWindowEditor::id() const { - return Designer::Constants::K_DESIGNER_XML_EDITOR_ID; + return Core::Id(Designer::Constants::K_DESIGNER_XML_EDITOR_ID); } QString FormWindowEditor::displayName() const @@ -278,7 +278,7 @@ TextEditor::PlainTextEditor *FormWindowEditor::textEditor() Core::Id FormWindowEditor::preferredModeType() const { - return Core::Constants::MODE_DESIGN_TYPE; + return Core::Id(Core::Constants::MODE_DESIGN_TYPE); } } // namespace Designer diff --git a/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp b/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp index 1c9a6d21cb..b4cf19d02a 100644 --- a/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp +++ b/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp @@ -72,7 +72,7 @@ QStringList ProjectFilesFactory::mimeTypes() const Core::Id ProjectFilesFactory::id() const { - return Constants::FILES_EDITOR_ID; + return Core::Id(Constants::FILES_EDITOR_ID); } QString ProjectFilesFactory::displayName() const @@ -94,7 +94,7 @@ ProjectFilesEditor::ProjectFilesEditor(ProjectFilesEditorWidget *editor) Core::Id ProjectFilesEditor::id() const { - return Constants::FILES_EDITOR_ID; + return Core::Id(Constants::FILES_EDITOR_ID); } bool ProjectFilesEditor::duplicateSupported() const diff --git a/src/plugins/git/gitversioncontrol.cpp b/src/plugins/git/gitversioncontrol.cpp index 692e7fd38e..4e1b8a7eb0 100644 --- a/src/plugins/git/gitversioncontrol.cpp +++ b/src/plugins/git/gitversioncontrol.cpp @@ -56,7 +56,7 @@ QString GitVersionControl::displayName() const Core::Id GitVersionControl::id() const { - return VcsBase::Constants::VCS_ID_GIT; + return Core::Id(VcsBase::Constants::VCS_ID_GIT); } bool GitVersionControl::isConfigured() const diff --git a/src/plugins/glsleditor/glsleditor.cpp b/src/plugins/glsleditor/glsleditor.cpp index 28fdf86ab5..4f5bb5d663 100644 --- a/src/plugins/glsleditor/glsleditor.cpp +++ b/src/plugins/glsleditor/glsleditor.cpp @@ -199,7 +199,7 @@ Core::IEditor *GLSLEditorEditable::duplicate(QWidget *parent) Core::Id GLSLEditorEditable::id() const { - return GLSLEditor::Constants::C_GLSLEDITOR_ID; + return Core::Id(GLSLEditor::Constants::C_GLSLEDITOR_ID); } bool GLSLEditorEditable::open(QString *errorString, const QString &fileName, const QString &realFileName) diff --git a/src/plugins/glsleditor/glsleditorfactory.cpp b/src/plugins/glsleditor/glsleditorfactory.cpp index a611cda527..ddf857ce86 100644 --- a/src/plugins/glsleditor/glsleditorfactory.cpp +++ b/src/plugins/glsleditor/glsleditorfactory.cpp @@ -64,7 +64,7 @@ GLSLEditorFactory::GLSLEditorFactory(QObject *parent) Core::Id GLSLEditorFactory::id() const { - return C_GLSLEDITOR_ID; + return Core::Id(C_GLSLEDITOR_ID); } QString GLSLEditorFactory::displayName() const diff --git a/src/plugins/imageviewer/imageviewerfactory.cpp b/src/plugins/imageviewer/imageviewerfactory.cpp index 177d311e0a..040ebb8cbf 100644 --- a/src/plugins/imageviewer/imageviewerfactory.cpp +++ b/src/plugins/imageviewer/imageviewerfactory.cpp @@ -95,7 +95,7 @@ QStringList ImageViewerFactory::mimeTypes() const Core::Id ImageViewerFactory::id() const { - return Constants::IMAGEVIEWER_ID; + return Core::Id(Constants::IMAGEVIEWER_ID); } QString ImageViewerFactory::displayName() const diff --git a/src/plugins/mercurial/mercurialcontrol.cpp b/src/plugins/mercurial/mercurialcontrol.cpp index 2c53982323..cc6bf5ee59 100644 --- a/src/plugins/mercurial/mercurialcontrol.cpp +++ b/src/plugins/mercurial/mercurialcontrol.cpp @@ -52,7 +52,7 @@ QString MercurialControl::displayName() const Core::Id MercurialControl::id() const { - return VcsBase::Constants::VCS_ID_MERCURIAL; + return Core::Id(VcsBase::Constants::VCS_ID_MERCURIAL); } bool MercurialControl::managesDirectory(const QString &directory, QString *topLevel) const diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 4ddf5f2e1f..ae2b178140 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -1172,7 +1172,7 @@ Core::IEditor *PerforcePlugin::showOutputInEditor(const QString &title, const QS { const VcsBase::VcsBaseEditorParameters *params = findType(editorType); QTC_ASSERT(params, return 0); - const Core::Id id(params->id); + const Core::Id id = Core::Id(QByteArray(params->id)); if (Perforce::Constants::debug) qDebug() << "PerforcePlugin::showOutputInEditor" << title << id.name() << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); diff --git a/src/plugins/perforce/perforceversioncontrol.cpp b/src/plugins/perforce/perforceversioncontrol.cpp index 9de9032701..a88ea30475 100644 --- a/src/plugins/perforce/perforceversioncontrol.cpp +++ b/src/plugins/perforce/perforceversioncontrol.cpp @@ -52,7 +52,7 @@ QString PerforceVersionControl::displayName() const Core::Id PerforceVersionControl::id() const { - return VcsBase::Constants::VCS_ID_PERFORCE; + return Core::Id(VcsBase::Constants::VCS_ID_PERFORCE); } bool PerforceVersionControl::isConfigured() const diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index db0cf7790a..f522afd23c 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -300,7 +300,7 @@ void IDevice::fromMap(const QVariantMap &map) { d->type = typeFromMap(map); d->displayName = map.value(QLatin1String(DisplayNameKey)).toString(); - d->id = Core::Id(map.value(QLatin1String(IdKey), newId().name()).toByteArray().constData()); + d->id = Core::Id(map.value(QLatin1String(IdKey), newId().name()).toByteArray()); d->origin = static_cast<Origin>(map.value(QLatin1String(OriginKey), ManuallyAdded).toInt()); d->sshParameters.host = map.value(HostKey).toString(); diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 88c22c18e7..a540a4647e 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -401,7 +401,7 @@ int FolderNavigationWidgetFactory::priority() const Core::Id FolderNavigationWidgetFactory::id() const { - return "File System"; + return Core::Id("File System"); } QKeySequence FolderNavigationWidgetFactory::activationSequence() const diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index 2513a9f00d..0fc7d93a11 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -89,7 +89,7 @@ public: m_mustNotify(false) { if (!id.isValid()) - m_id = Core::Id(QUuid::createUuid().toString().toLatin1().constData()); + m_id = Core::Id(QUuid::createUuid().toString().toLatin1()); } QString m_displayName; diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index 3a3c398dcf..06a9e5121d 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -312,7 +312,7 @@ const Core::Id DeviceTypeKitInformation::deviceTypeId(const Kit *k) { if (!k) return Core::Id(); - return Core::Id(k->value(Core::Id(DEVICETYPE_INFORMATION)).toByteArray().constData()); + return Core::Id(k->value(Core::Id(DEVICETYPE_INFORMATION)).toByteArray()); } void DeviceTypeKitInformation::setDeviceTypeId(Kit *k, Core::Id type) diff --git a/src/plugins/projectexplorer/pluginfilefactory.cpp b/src/plugins/projectexplorer/pluginfilefactory.cpp index 60614b3f9e..15f9926705 100644 --- a/src/plugins/projectexplorer/pluginfilefactory.cpp +++ b/src/plugins/projectexplorer/pluginfilefactory.cpp @@ -65,7 +65,7 @@ QStringList ProjectFileFactory::mimeTypes() const Core::Id ProjectFileFactory::id() const { - return Constants::FILE_FACTORY_ID; + return Core::Id(Constants::FILE_FACTORY_ID); } QString ProjectFileFactory::displayName() const diff --git a/src/plugins/projectexplorer/projectconfiguration.cpp b/src/plugins/projectexplorer/projectconfiguration.cpp index d4c01d8747..b6a6bfa716 100644 --- a/src/plugins/projectexplorer/projectconfiguration.cpp +++ b/src/plugins/projectexplorer/projectconfiguration.cpp @@ -102,7 +102,7 @@ QVariantMap ProjectConfiguration::toMap() const bool ProjectConfiguration::fromMap(const QVariantMap &map) { - m_id = Core::Id(map.value(QLatin1String(CONFIGURATION_ID_KEY), QByteArray()).toByteArray().constData()); + m_id = Core::Id(map.value(QLatin1String(CONFIGURATION_ID_KEY), QByteArray()).toByteArray()); m_displayName = map.value(QLatin1String(DISPLAY_NAME_KEY), QString()).toString(); m_defaultDisplayName = map.value(QLatin1String(DEFAULT_DISPLAY_NAME_KEY), m_defaultDisplayName.isEmpty() ? diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index bbfd363a16..465c76ef74 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -558,14 +558,14 @@ void TaskWindow::updateCategoriesMenu() action->setCheckable(true); action->setText(displayName); action->setData(categoryId); - action->setChecked(!filteredCategories.contains(Core::Id(categoryId.constData()))); + action->setChecked(!filteredCategories.contains(Core::Id(categoryId))); d->m_categoriesMenu->addAction(action); } } void TaskWindow::filterCategoryTriggered(QAction *action) { - Core::Id categoryId(action->data().toByteArray().constData()); + Core::Id categoryId(action->data().toByteArray()); QTC_CHECK(categoryId.uniqueIdentifier() != 0); setCategoryVisibility(categoryId, action->isChecked()); diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index b7784c42bf..9e8a6513d3 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -580,7 +580,7 @@ Core::IEditor *QmlJSEditorEditable::duplicate(QWidget *parent) Core::Id QmlJSEditorEditable::id() const { - return QmlJSEditor::Constants::C_QMLJSEDITOR_ID; + return Core::Id(QmlJSEditor::Constants::C_QMLJSEDITOR_ID); } bool QmlJSEditorEditable::open(QString *errorString, const QString &fileName, const QString &realFileName) diff --git a/src/plugins/qmljseditor/qmljseditoreditable.cpp b/src/plugins/qmljseditor/qmljseditoreditable.cpp index 5a60f5c91a..e80ee04b12 100644 --- a/src/plugins/qmljseditor/qmljseditoreditable.cpp +++ b/src/plugins/qmljseditor/qmljseditoreditable.cpp @@ -85,7 +85,7 @@ Core::Id QmlJSEditorEditable::preferredModeType() const // have the user also access to this failsafe setting. if (editorWidget()->mimeType() == QLatin1String(QmlJSTools::Constants::QML_MIMETYPE) && openInDesignMode()) - return Core::Constants::MODE_DESIGN_TYPE; + return Core::Id(Core::Constants::MODE_DESIGN_TYPE); return Core::Id(); } diff --git a/src/plugins/qmljseditor/qmljseditorfactory.cpp b/src/plugins/qmljseditor/qmljseditorfactory.cpp index c42ce5ff81..17a9841b5f 100644 --- a/src/plugins/qmljseditor/qmljseditorfactory.cpp +++ b/src/plugins/qmljseditor/qmljseditorfactory.cpp @@ -66,7 +66,7 @@ QmlJSEditorFactory::QmlJSEditorFactory(QObject *parent) Core::Id QmlJSEditorFactory::id() const { - return C_QMLJSEDITOR_ID; + return Core::Id(C_QMLJSEDITOR_ID); } QString QmlJSEditorFactory::displayName() const diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 8b539bfa27..6ff47b359e 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -199,7 +199,7 @@ QmlProfilerTool::~QmlProfilerTool() Core::Id QmlProfilerTool::id() const { - return "QmlProfiler"; + return Core::Id("QmlProfiler"); } RunMode QmlProfilerTool::runMode() const diff --git a/src/plugins/qt4projectmanager/profileeditor.cpp b/src/plugins/qt4projectmanager/profileeditor.cpp index 1011805660..7fc68af0a7 100644 --- a/src/plugins/qt4projectmanager/profileeditor.cpp +++ b/src/plugins/qt4projectmanager/profileeditor.cpp @@ -73,7 +73,7 @@ Core::IEditor *ProFileEditor::duplicate(QWidget *parent) Core::Id ProFileEditor::id() const { - return Qt4ProjectManager::Constants::PROFILE_EDITOR_ID; + return Core::Id(Qt4ProjectManager::Constants::PROFILE_EDITOR_ID); } // diff --git a/src/plugins/qt4projectmanager/profileeditorfactory.cpp b/src/plugins/qt4projectmanager/profileeditorfactory.cpp index 406a5767aa..9a140abc76 100644 --- a/src/plugins/qt4projectmanager/profileeditorfactory.cpp +++ b/src/plugins/qt4projectmanager/profileeditorfactory.cpp @@ -68,7 +68,7 @@ ProFileEditorFactory::~ProFileEditorFactory() Core::Id ProFileEditorFactory::id() const { - return Qt4ProjectManager::Constants::PROFILE_EDITOR_ID; + return Core::Id(Qt4ProjectManager::Constants::PROFILE_EDITOR_ID); } QString ProFileEditorFactory::displayName() const diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index 6081ae9c28..d034f521d1 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -69,12 +69,12 @@ using namespace ProjectExplorer; using namespace Utils; namespace { -const char * const QMAKE_BS_ID("QtProjectManager.QMakeBuildStep"); +const char QMAKE_BS_ID[] = "QtProjectManager.QMakeBuildStep"; -const char * const QMAKE_ARGUMENTS_KEY("QtProjectManager.QMakeBuildStep.QMakeArguments"); -const char * const QMAKE_FORCED_KEY("QtProjectManager.QMakeBuildStep.QMakeForced"); -const char * const QMAKE_QMLDEBUGLIBAUTO_KEY("QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto"); -const char * const QMAKE_QMLDEBUGLIB_KEY("QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary"); +const char QMAKE_ARGUMENTS_KEY[] = "QtProjectManager.QMakeBuildStep.QMakeArguments"; +const char QMAKE_FORCED_KEY[] = "QtProjectManager.QMakeBuildStep.QMakeForced"; +const char QMAKE_QMLDEBUGLIBAUTO_KEY[] = "QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto"; +const char QMAKE_QMLDEBUGLIB_KEY[] = "QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary"; } QMakeStep::QMakeStep(BuildStepList *bsl) : diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp index a21288ca34..8848ee74cf 100644 --- a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp @@ -54,14 +54,14 @@ using namespace QtSupport; using namespace QtSupport::Internal; namespace { -const char * const CUSTOM_EXECUTABLE_ID("ProjectExplorer.CustomExecutableRunConfiguration"); - -const char * const EXECUTABLE_KEY("ProjectExplorer.CustomExecutableRunConfiguration.Executable"); -const char * const ARGUMENTS_KEY("ProjectExplorer.CustomExecutableRunConfiguration.Arguments"); -const char * const WORKING_DIRECTORY_KEY("ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory"); -const char * const USE_TERMINAL_KEY("ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal"); -const char * const USER_ENVIRONMENT_CHANGES_KEY("ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges"); -const char * const BASE_ENVIRONMENT_BASE_KEY("ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase"); +const char CUSTOM_EXECUTABLE_ID[] = "ProjectExplorer.CustomExecutableRunConfiguration"; + +const char EXECUTABLE_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.Executable"; +const char ARGUMENTS_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.Arguments"; +const char WORKING_DIRECTORY_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory"; +const char USE_TERMINAL_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal"; +const char USER_ENVIRONMENT_CHANGES_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges"; +const char BASE_ENVIRONMENT_BASE_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase"; } void CustomExecutableRunConfiguration::ctor() diff --git a/src/plugins/resourceeditor/resourceeditorfactory.cpp b/src/plugins/resourceeditor/resourceeditorfactory.cpp index 27ae0e5cf1..0dc0027181 100644 --- a/src/plugins/resourceeditor/resourceeditorfactory.cpp +++ b/src/plugins/resourceeditor/resourceeditorfactory.cpp @@ -54,7 +54,7 @@ ResourceEditorFactory::ResourceEditorFactory(ResourceEditorPlugin *plugin) : Core::Id ResourceEditorFactory::id() const { - return RESOURCEEDITOR_ID; + return Core::Id(RESOURCEEDITOR_ID); } QString ResourceEditorFactory::displayName() const diff --git a/src/plugins/subversion/subversioncontrol.cpp b/src/plugins/subversion/subversioncontrol.cpp index 88807a3b52..788e1fd176 100644 --- a/src/plugins/subversion/subversioncontrol.cpp +++ b/src/plugins/subversion/subversioncontrol.cpp @@ -50,7 +50,7 @@ QString SubversionControl::displayName() const Core::Id SubversionControl::id() const { - return VcsBase::Constants::VCS_ID_SUBVERSION; + return Core::Id(VcsBase::Constants::VCS_ID_SUBVERSION); } bool SubversionControl::isConfigured() const diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index edae916419..bf4768c218 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -1145,7 +1145,7 @@ Core::IEditor *SubversionPlugin::showOutputInEditor(const QString &title, const { const VcsBase::VcsBaseEditorParameters *params = findType(editorType); QTC_ASSERT(params, return 0); - const Core::Id id = params->id; + const Core::Id id = Core::Id(QByteArray(params->id)); if (Subversion::Constants::debug) qDebug() << "SubversionPlugin::showOutputInEditor" << title << id.name() << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); diff --git a/src/plugins/tasklist/taskfilefactory.cpp b/src/plugins/tasklist/taskfilefactory.cpp index e00aeb4c86..fcc02b5904 100644 --- a/src/plugins/tasklist/taskfilefactory.cpp +++ b/src/plugins/tasklist/taskfilefactory.cpp @@ -59,7 +59,7 @@ QStringList TaskFileFactory::mimeTypes() const Core::Id TaskFileFactory::id() const { - return "ProjectExplorer.TaskFileFactory"; + return Core::Id("ProjectExplorer.TaskFileFactory"); } QString TaskFileFactory::displayName() const diff --git a/src/plugins/texteditor/plaintexteditor.cpp b/src/plugins/texteditor/plaintexteditor.cpp index 237c21fa6a..84b03254cb 100644 --- a/src/plugins/texteditor/plaintexteditor.cpp +++ b/src/plugins/texteditor/plaintexteditor.cpp @@ -90,7 +90,7 @@ Core::IEditor *PlainTextEditor::duplicate(QWidget *parent) Core::Id PlainTextEditor::id() const { - return Core::Constants::K_DEFAULT_TEXT_EDITOR_ID; + return Core::Id(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID); } void PlainTextEditorWidget::unCommentSelection() diff --git a/src/plugins/texteditor/plaintexteditorfactory.cpp b/src/plugins/texteditor/plaintexteditorfactory.cpp index 3b2363dd7e..08977d7016 100644 --- a/src/plugins/texteditor/plaintexteditorfactory.cpp +++ b/src/plugins/texteditor/plaintexteditorfactory.cpp @@ -65,7 +65,7 @@ PlainTextEditorFactory::~PlainTextEditorFactory() Core::Id PlainTextEditorFactory::id() const { - return Core::Constants::K_DEFAULT_TEXT_EDITOR_ID; + return Core::Id(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID); } QString PlainTextEditorFactory::displayName() const diff --git a/src/plugins/texteditor/snippets/snippeteditor.cpp b/src/plugins/texteditor/snippets/snippeteditor.cpp index d9b8d31384..4d346aa499 100644 --- a/src/plugins/texteditor/snippets/snippeteditor.cpp +++ b/src/plugins/texteditor/snippets/snippeteditor.cpp @@ -53,7 +53,7 @@ SnippetEditor::SnippetEditor(SnippetEditorWidget *editor) Core::Id SnippetEditor::id() const { - return Constants::SNIPPET_EDITOR_ID; + return Core::Id(Constants::SNIPPET_EDITOR_ID); } SnippetEditorWidget::SnippetEditorWidget(QWidget *parent) : BaseTextEditorWidget(parent) diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 740b67e061..03cfd63904 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -516,7 +516,7 @@ CallgrindTool::~CallgrindTool() Core::Id CallgrindTool::id() const { - return "Callgrind"; + return Core::Id("Callgrind"); } ProjectExplorer::RunMode CallgrindTool::runMode() const diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index ddaed33490..1b26e02a45 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -283,7 +283,7 @@ void MemcheckTool::maybeActiveRunConfigurationChanged() Core::Id MemcheckTool::id() const { - return "Memcheck"; + return Core::Id("Memcheck"); } ProjectExplorer::RunMode MemcheckTool::runMode() const diff --git a/src/plugins/vcsbase/basevcseditorfactory.cpp b/src/plugins/vcsbase/basevcseditorfactory.cpp index 2b7d2f6ff5..4c3401cdee 100644 --- a/src/plugins/vcsbase/basevcseditorfactory.cpp +++ b/src/plugins/vcsbase/basevcseditorfactory.cpp @@ -62,7 +62,7 @@ public: BaseVcsEditorFactoryPrivate::BaseVcsEditorFactoryPrivate(const VcsBaseEditorParameters *t) : m_type(t), - m_id(t->id), + m_id(QByteArray(t->id)), m_mimeTypes(QStringList(QLatin1String(t->mimeType))), m_editorHandler(new TextEditor::TextEditorActionHandler(t->context)) { diff --git a/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp b/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp index e1654f7759..35b7187180 100644 --- a/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp +++ b/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp @@ -49,7 +49,7 @@ public: BaseVcsSubmitEditorFactoryPrivate::BaseVcsSubmitEditorFactoryPrivate(const VcsBaseSubmitEditorParameters *parameters) : m_parameters(parameters), - m_id(parameters->id), + m_id(QByteArray(parameters->id)), m_displayName(QLatin1String(parameters->displayName)), m_mimeTypes(QLatin1String(parameters->mimeType)) { diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 4d6594e800..1574460d47 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -178,7 +178,7 @@ private: VcsBaseEditor::VcsBaseEditor(VcsBaseEditorWidget *widget, const VcsBaseEditorParameters *type) : BaseTextEditor(widget), - m_id(type->id), + m_id(QByteArray(type->id)), m_temporary(false) { setContext(Core::Context(type->context, TextEditor::Constants::C_TEXTEDITOR)); diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index 15444e2b9c..c41f984cbb 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -426,7 +426,7 @@ Core::IEditor *VcsBaseSubmitEditor::duplicate(QWidget * /*parent*/) Core::Id VcsBaseSubmitEditor::id() const { - return d->m_parameters->id; + return Core::Id(QByteArray(d->m_parameters->id)); } static QToolBar *createToolBar(const QWidget *someWidget, QAction *submitAction, QAction *diffAction) |