CommandLocator: use Id instead of QString.

There seems to be still disagreement in the code what the
individual parameters are meant for.

Change-Id: I9c51e6ee9cc8fd1a55d202b8131027de1ef812a0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
hjk
2013-01-18 11:35:38 +01:00
parent 51273ab864
commit 7fafeaa513
9 changed files with 11 additions and 16 deletions

View File

@@ -164,7 +164,7 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
addAutoReleasedObject(new CloneWizard); addAutoReleasedObject(new CloneWizard);
const QString prefix = QLatin1String("bzr"); const QString prefix = QLatin1String("bzr");
m_commandLocator = new Locator::CommandLocator(QLatin1String("Bazaar"), prefix, prefix); m_commandLocator = new Locator::CommandLocator("Bazaar", prefix, prefix);
addAutoReleasedObject(m_commandLocator); addAutoReleasedObject(m_commandLocator);
createMenu(); createMenu();

View File

@@ -301,7 +301,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
const QString description = QLatin1String("ClearCase"); const QString description = QLatin1String("ClearCase");
const QString prefix = QLatin1String("cc"); const QString prefix = QLatin1String("cc");
// register cc prefix in Locator // register cc prefix in Locator
m_commandLocator = new Locator::CommandLocator(prefix, description, prefix); m_commandLocator = new Locator::CommandLocator("cc", description, prefix);
addAutoReleasedObject(m_commandLocator); addAutoReleasedObject(m_commandLocator);
//register actions //register actions

View File

@@ -249,7 +249,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
addAutoReleasedObject(new CheckoutWizard); addAutoReleasedObject(new CheckoutWizard);
const QString prefix = QLatin1String("cvs"); const QString prefix = QLatin1String("cvs");
m_commandLocator = new Locator::CommandLocator(QLatin1String("CVS"), prefix, prefix); m_commandLocator = new Locator::CommandLocator("CVS", prefix, prefix);
addAutoReleasedObject(m_commandLocator); addAutoReleasedObject(m_commandLocator);
// Register actions // Register actions

View File

@@ -294,9 +294,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
addAutoReleasedObject(new CloneWizard); addAutoReleasedObject(new CloneWizard);
addAutoReleasedObject(new Gitorious::Internal::GitoriousCloneWizard); addAutoReleasedObject(new Gitorious::Internal::GitoriousCloneWizard);
const QString description = QLatin1String("Git");
const QString prefix = QLatin1String("git"); const QString prefix = QLatin1String("git");
m_commandLocator = new Locator::CommandLocator(description, prefix, prefix); m_commandLocator = new Locator::CommandLocator("Git", prefix, prefix);
addAutoReleasedObject(m_commandLocator); addAutoReleasedObject(m_commandLocator);
//register actions //register actions

View File

@@ -31,7 +31,6 @@
#include <coreplugin/actionmanager/command.h> #include <coreplugin/actionmanager/command.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/id.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -44,14 +43,14 @@ struct CommandLocatorPrivate
QList<Core::Command *> commands; QList<Core::Command *> commands;
}; };
CommandLocator::CommandLocator(const QString &prefix, CommandLocator::CommandLocator(Core::Id id,
const QString &displayName, const QString &displayName,
const QString &shortCutString, const QString &shortCutString,
QObject *parent) : QObject *parent) :
Locator::ILocatorFilter(parent), Locator::ILocatorFilter(parent),
d(new CommandLocatorPrivate) d(new CommandLocatorPrivate)
{ {
setId(Core::Id::fromString(prefix)); setId(id);
setDisplayName(displayName); setDisplayName(displayName);
setShortcutString(shortCutString); setShortcutString(shortCutString);
} }

View File

@@ -46,10 +46,8 @@ class LOCATOR_EXPORT CommandLocator : public Locator::ILocatorFilter
Q_OBJECT Q_OBJECT
public: public:
explicit CommandLocator(const QString &prefix, CommandLocator(Core::Id id, const QString &displayName,
const QString &displayName, const QString &shortCutString, QObject *parent = 0);
const QString &shortCutString,
QObject *parent = 0);
~CommandLocator(); ~CommandLocator();
void appendCommand(Core::Command *cmd); void appendCommand(Core::Command *cmd);

View File

@@ -162,7 +162,7 @@ bool MercurialPlugin::initialize(const QStringList & /* arguments */, QString *
addAutoReleasedObject(new CloneWizard); addAutoReleasedObject(new CloneWizard);
const QString prefix = QLatin1String("hg"); const QString prefix = QLatin1String("hg");
m_commandLocator = new Locator::CommandLocator(QLatin1String("Mercurial"), prefix, prefix); m_commandLocator = new Locator::CommandLocator("Mercurial", prefix, prefix);
addAutoReleasedObject(m_commandLocator); addAutoReleasedObject(m_commandLocator);
createMenu(); createMenu();

View File

@@ -239,7 +239,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
addAutoReleasedObject(new PerforceEditorFactory(editorParameters + i, this, describeSlot)); addAutoReleasedObject(new PerforceEditorFactory(editorParameters + i, this, describeSlot));
const QString prefix = QLatin1String("p4"); const QString prefix = QLatin1String("p4");
m_commandLocator = new Locator::CommandLocator(QLatin1String("Perforce"), prefix, prefix); m_commandLocator = new Locator::CommandLocator("Perforce", prefix, prefix);
addAutoReleasedObject(m_commandLocator); addAutoReleasedObject(m_commandLocator);
Core::ActionContainer *mtools = Core::ActionContainer *mtools =

View File

@@ -269,9 +269,8 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
addAutoReleasedObject(new CheckoutWizard); addAutoReleasedObject(new CheckoutWizard);
const QString description = QLatin1String("Subversion");
const QString prefix = QLatin1String("svn"); const QString prefix = QLatin1String("svn");
m_commandLocator = new Locator::CommandLocator(description, prefix, prefix); m_commandLocator = new Locator::CommandLocator("Subversion", prefix, prefix);
addAutoReleasedObject(m_commandLocator); addAutoReleasedObject(m_commandLocator);
//register actions //register actions