Commit 7fafeaa5 authored by hjk's avatar hjk
Browse files

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: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent 51273ab8
......@@ -164,7 +164,7 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
addAutoReleasedObject(new CloneWizard);
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);
createMenu();
......
......@@ -301,7 +301,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
const QString description = QLatin1String("ClearCase");
const QString prefix = QLatin1String("cc");
// register cc prefix in Locator
m_commandLocator = new Locator::CommandLocator(prefix, description, prefix);
m_commandLocator = new Locator::CommandLocator("cc", description, prefix);
addAutoReleasedObject(m_commandLocator);
//register actions
......
......@@ -249,7 +249,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
addAutoReleasedObject(new CheckoutWizard);
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);
// Register actions
......
......@@ -294,9 +294,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
addAutoReleasedObject(new CloneWizard);
addAutoReleasedObject(new Gitorious::Internal::GitoriousCloneWizard);
const QString description = 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);
//register actions
......
......@@ -31,7 +31,6 @@
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/icore.h>
#include <coreplugin/id.h>
#include <utils/qtcassert.h>
......@@ -44,14 +43,14 @@ struct CommandLocatorPrivate
QList<Core::Command *> commands;
};
CommandLocator::CommandLocator(const QString &prefix,
CommandLocator::CommandLocator(Core::Id id,
const QString &displayName,
const QString &shortCutString,
QObject *parent) :
Locator::ILocatorFilter(parent),
d(new CommandLocatorPrivate)
{
setId(Core::Id::fromString(prefix));
setId(id);
setDisplayName(displayName);
setShortcutString(shortCutString);
}
......
......@@ -46,10 +46,8 @@ class LOCATOR_EXPORT CommandLocator : public Locator::ILocatorFilter
Q_OBJECT
public:
explicit CommandLocator(const QString &prefix,
const QString &displayName,
const QString &shortCutString,
QObject *parent = 0);
CommandLocator(Core::Id id, const QString &displayName,
const QString &shortCutString, QObject *parent = 0);
~CommandLocator();
void appendCommand(Core::Command *cmd);
......
......@@ -162,7 +162,7 @@ bool MercurialPlugin::initialize(const QStringList & /* arguments */, QString *
addAutoReleasedObject(new CloneWizard);
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);
createMenu();
......
......@@ -239,7 +239,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
addAutoReleasedObject(new PerforceEditorFactory(editorParameters + i, this, describeSlot));
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);
Core::ActionContainer *mtools =
......
......@@ -269,9 +269,8 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
addAutoReleasedObject(new CheckoutWizard);
const QString description = QLatin1String("Subversion");
const QString prefix = QLatin1String("svn");
m_commandLocator = new Locator::CommandLocator(description, prefix, prefix);
m_commandLocator = new Locator::CommandLocator("Subversion", prefix, prefix);
addAutoReleasedObject(m_commandLocator);
//register actions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment