diff options
-rw-r--r-- | src/plugins/bazaar/bazaarclient.cpp | 10 | ||||
-rw-r--r-- | src/plugins/bazaar/bazaarclient.h | 2 | ||||
-rw-r--r-- | src/plugins/mercurial/mercurialclient.cpp | 24 | ||||
-rw-r--r-- | src/plugins/mercurial/mercurialclient.h | 2 | ||||
-rw-r--r-- | src/plugins/vcsbase/vcsbaseclient.cpp | 12 | ||||
-rw-r--r-- | src/plugins/vcsbase/vcsbaseclient.h | 5 |
6 files changed, 28 insertions, 27 deletions
diff --git a/src/plugins/bazaar/bazaarclient.cpp b/src/plugins/bazaar/bazaarclient.cpp index 6b930bd4a8..f966dd653c 100644 --- a/src/plugins/bazaar/bazaarclient.cpp +++ b/src/plugins/bazaar/bazaarclient.cpp @@ -122,17 +122,17 @@ void BazaarClient::view(const QString &source, const QString &id, const QStringL VcsBaseClient::view(source, id, args); } -QString BazaarClient::vcsEditorKind(VcsCommand cmd) const +Core::Id BazaarClient::vcsEditorKind(VcsCommand cmd) const { switch (cmd) { case AnnotateCommand: - return QLatin1String(Constants::ANNOTATELOG); + return Constants::ANNOTATELOG; case DiffCommand: - return QLatin1String(Constants::DIFFLOG); + return Constants::DIFFLOG; case LogCommand: - return QLatin1String(Constants::FILELOG); + return Constants::FILELOG; default: - return QString(); + return Core::Id(); } } diff --git a/src/plugins/bazaar/bazaarclient.h b/src/plugins/bazaar/bazaarclient.h index 7c1c90d633..0bc49c2306 100644 --- a/src/plugins/bazaar/bazaarclient.h +++ b/src/plugins/bazaar/bazaarclient.h @@ -59,7 +59,7 @@ public: QString findTopLevelForFile(const QFileInfo &file) const; protected: - QString vcsEditorKind(VcsCommand cmd) const; + Core::Id vcsEditorKind(VcsCommand cmd) const; QString vcsCommandString(VcsCommand cmd) const; QStringList revisionSpec(const QString &revision) const; VcsBase::VcsBaseEditorParameterWidget *createDiffEditor(const QString &workingDir, diff --git a/src/plugins/mercurial/mercurialclient.cpp b/src/plugins/mercurial/mercurialclient.cpp index ecb552c433..db6fc6efca 100644 --- a/src/plugins/mercurial/mercurialclient.cpp +++ b/src/plugins/mercurial/mercurialclient.cpp @@ -248,10 +248,9 @@ void MercurialClient::incoming(const QString &repositoryRoot, const QString &rep id += repository; } - const QString kind = QLatin1String(Constants::DIFFLOG); const QString title = tr("Hg incoming %1").arg(id); - VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, repositoryRoot, + VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(Constants::DIFFLOG, title, repositoryRoot, true, "incoming", id); VcsBase::Command *cmd = createCommand(repository, editor); if (!repository.isEmpty() && VcsBase::VcsBasePlugin::isSshPromptConfigured()) @@ -264,11 +263,10 @@ void MercurialClient::outgoing(const QString &repositoryRoot) QStringList args; args << QLatin1String("outgoing") << QLatin1String("-g") << QLatin1String("-p"); - const QString kind = QLatin1String(Constants::DIFFLOG); const QString title = tr("Hg outgoing %1"). arg(QDir::toNativeSeparators(repositoryRoot)); - VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, repositoryRoot, true, + VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(Constants::DIFFLOG, title, repositoryRoot, true, "outgoing", repositoryRoot); VcsBase::Command *cmd = createCommand(repositoryRoot, editor); @@ -332,16 +330,18 @@ QString MercurialClient::findTopLevelForFile(const QFileInfo &file) const VcsBase::VcsBasePlugin::findRepositoryForDirectory(file.absolutePath(), repositoryCheckFile); } -QString MercurialClient::vcsEditorKind(VcsCommand cmd) const +Core::Id MercurialClient::vcsEditorKind(VcsCommand cmd) const { - switch (cmd) - { - case AnnotateCommand : return QLatin1String(Constants::ANNOTATELOG); - case DiffCommand : return QLatin1String(Constants::DIFFLOG); - case LogCommand : return QLatin1String(Constants::FILELOG); - default : return QLatin1String(""); + switch (cmd) { + case AnnotateCommand: + return Constants::ANNOTATELOG; + case DiffCommand: + return Constants::DIFFLOG; + case LogCommand: + return Constants::FILELOG; + default: + return Core::Id(); } - return QLatin1String(""); } QStringList MercurialClient::revisionSpec(const QString &revision) const diff --git a/src/plugins/mercurial/mercurialclient.h b/src/plugins/mercurial/mercurialclient.h index 89b106f88c..f2c2e6f01d 100644 --- a/src/plugins/mercurial/mercurialclient.h +++ b/src/plugins/mercurial/mercurialclient.h @@ -80,7 +80,7 @@ public: QString findTopLevelForFile(const QFileInfo &file) const; protected: - QString vcsEditorKind(VcsCommand cmd) const; + Core::Id vcsEditorKind(VcsCommand cmd) const; QStringList revisionSpec(const QString &revision) const; VcsBase::VcsBaseEditorParameterWidget *createDiffEditor(const QString &workingDir, const QStringList &files, diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index a48ca8a7ac..b778149ae3 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -333,7 +333,7 @@ void VcsBaseClient::annotate(const QString &workingDir, const QString &file, const QString vcsCmdString = vcsCommandString(AnnotateCommand); QStringList args; args << vcsCmdString << revisionSpec(revision) << extraOptions << file; - const QString kind = vcsEditorKind(AnnotateCommand); + const Core::Id kind = vcsEditorKind(AnnotateCommand); const QString id = VcsBase::VcsBaseEditorWidget::getSource(workingDir, QStringList(file)); const QString title = vcsEditorTitle(vcsCmdString, id); const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, file); @@ -350,7 +350,7 @@ void VcsBaseClient::diff(const QString &workingDir, const QStringList &files, const QStringList &extraOptions) { const QString vcsCmdString = vcsCommandString(DiffCommand); - const QString kind = vcsEditorKind(DiffCommand); + const Core::Id kind = vcsEditorKind(DiffCommand); const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, files); const QString title = vcsEditorTitle(vcsCmdString, id); const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files); @@ -376,7 +376,7 @@ void VcsBaseClient::log(const QString &workingDir, const QStringList &files, bool enableAnnotationContextMenu) { const QString vcsCmdString = vcsCommandString(LogCommand); - const QString kind = vcsEditorKind(LogCommand); + const Core::Id kind = vcsEditorKind(LogCommand); const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, files); const QString title = vcsEditorTitle(vcsCmdString, id); const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files); @@ -477,7 +477,7 @@ void VcsBaseClient::view(const QString &source, const QString &id, { QStringList args; args << extraOptions << revisionSpec(id); - const QString kind = vcsEditorKind(DiffCommand); + const Core::Id kind = vcsEditorKind(DiffCommand); const QString title = vcsEditorTitle(vcsCommandString(LogCommand), id); VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, source, @@ -552,7 +552,7 @@ QString VcsBaseClient::vcsEditorTitle(const QString &vcsCmd, const QString &sour QFileInfo(sourceId).fileName(); } -VcsBase::VcsBaseEditorWidget *VcsBaseClient::createVcsEditor(const QString &kind, QString title, +VcsBase::VcsBaseEditorWidget *VcsBaseClient::createVcsEditor(Core::Id kind, QString title, const QString &source, bool setSourceCodec, const char *registerDynamicProperty, const QString &dynamicPropertyValue) const @@ -566,7 +566,7 @@ VcsBase::VcsBaseEditorWidget *VcsBaseClient::createVcsEditor(const QString &kind baseEditor = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(outputEditor); QTC_ASSERT(baseEditor, return 0); } else { - outputEditor = Core::EditorManager::openEditorWithContents(Core::Id::fromString(kind), &title, progressMsg); + outputEditor = Core::EditorManager::openEditorWithContents(kind, &title, progressMsg); outputEditor->document()->setProperty(registerDynamicProperty, dynamicPropertyValue); baseEditor = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(outputEditor); connect(baseEditor, SIGNAL(annotateRevisionRequested(QString,QString,int)), diff --git a/src/plugins/vcsbase/vcsbaseclient.h b/src/plugins/vcsbase/vcsbaseclient.h index 32e9c05ebb..08659977ab 100644 --- a/src/plugins/vcsbase/vcsbaseclient.h +++ b/src/plugins/vcsbase/vcsbaseclient.h @@ -31,6 +31,7 @@ #define VCSBASECLIENT_H #include "vcsbase_global.h" +#include <coreplugin/id.h> #include <QObject> #include <QStringList> @@ -148,7 +149,7 @@ protected: StatusCommand }; virtual QString vcsCommandString(VcsCommand cmd) const; - virtual QString vcsEditorKind(VcsCommand cmd) const = 0; + virtual Core::Id vcsEditorKind(VcsCommand cmd) const = 0; virtual QStringList revisionSpec(const QString &revision) const = 0; virtual VcsBaseEditorParameterWidget *createDiffEditor(const QString &workingDir, @@ -170,7 +171,7 @@ protected: const QStringList &args, unsigned flags = 0, QTextCodec *outputCodec = 0); - VcsBase::VcsBaseEditorWidget *createVcsEditor(const QString &kind, QString title, + VcsBase::VcsBaseEditorWidget *createVcsEditor(Core::Id kind, QString title, const QString &source, bool setSourceCodec, const char *registerDynamicProperty, const QString &dynamicPropertyValue) const; |