summaryrefslogtreecommitdiff
path: root/src/plugins/git
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2014-04-04 14:07:39 +0300
committerTobias Hunger <tobias.hunger@digia.com>2014-04-07 10:14:32 +0200
commitd24e509662cbc8bd0afb598e053262287317b748 (patch)
tree1269456d6a4bddb568e071c7a6706e02d306eb4f /src/plugins/git
parent550691923374dab4f982d441756a0cc7ed723944 (diff)
downloadqt-creator-d24e509662cbc8bd0afb598e053262287317b748.tar.gz
Gerrit: Some more cleanup
* Remove qualification for types in Gerrit::Internal * Remove action/command pair. Action is stored in Command. Change-Id: I946bedd3909e217279e9d7a538e8460e0a61de0f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git')
-rw-r--r--src/plugins/git/gerrit/gerritdialog.cpp2
-rw-r--r--src/plugins/git/gerrit/gerritplugin.cpp21
-rw-r--r--src/plugins/git/gerrit/gerritplugin.h6
3 files changed, 12 insertions, 17 deletions
diff --git a/src/plugins/git/gerrit/gerritdialog.cpp b/src/plugins/git/gerrit/gerritdialog.cpp
index 8a3a0d617b..329f23330e 100644
--- a/src/plugins/git/gerrit/gerritdialog.cpp
+++ b/src/plugins/git/gerrit/gerritdialog.cpp
@@ -305,7 +305,7 @@ void GerritDialog::slotCurrentChanged()
updateButtons();
}
-void GerritDialog::fetchStarted(const QSharedPointer<Gerrit::Internal::GerritChange> &change)
+void GerritDialog::fetchStarted(const QSharedPointer<GerritChange> &change)
{
// Disable buttons to prevent parallel gerrit operations which can cause mix-ups.
m_fetchRunning = true;
diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp
index 0a5555af04..38afd23d73 100644
--- a/src/plugins/git/gerrit/gerritplugin.cpp
+++ b/src/plugins/git/gerrit/gerritplugin.cpp
@@ -287,13 +287,11 @@ bool GerritPlugin::initialize(ActionContainer *ac)
QAction *pushAction = new QAction(tr("Push to Gerrit..."), this);
- Command *pushCommand =
+ m_pushToGerritCommand =
ActionManager::registerAction(pushAction, Constants::GERRIT_PUSH,
Context(Core::Constants::C_GLOBAL));
connect(pushAction, SIGNAL(triggered()), this, SLOT(push()));
- ac->addAction(pushCommand);
-
- m_pushToGerritPair = ActionCommandPair(pushAction, pushCommand);
+ ac->addAction(m_pushToGerritCommand);
GitPlugin::instance()->addAutoReleasedObject(new GerritOptionsPage(m_parameters));
return true;
@@ -302,13 +300,13 @@ bool GerritPlugin::initialize(ActionContainer *ac)
void GerritPlugin::updateActions(bool hasTopLevel)
{
m_gerritCommand->action()->setEnabled(hasTopLevel);
- m_pushToGerritPair.first->setEnabled(hasTopLevel);
+ m_pushToGerritCommand->action()->setEnabled(hasTopLevel);
}
void GerritPlugin::addToLocator(Core::CommandLocator *locator)
{
locator->appendCommand(m_gerritCommand);
- locator->appendCommand(m_pushToGerritPair.second);
+ locator->appendCommand(m_pushToGerritCommand);
}
void GerritPlugin::push(const QString &topLevel)
@@ -328,8 +326,7 @@ void GerritPlugin::push(const QString &topLevel)
QStringList args;
m_reviewers = dialog.reviewers();
- const QStringList reviewers = m_reviewers.split(QLatin1Char(','),
- QString::SkipEmptyParts);
+ const QStringList reviewers = m_reviewers.split(QLatin1Char(','), QString::SkipEmptyParts);
if (!reviewers.isEmpty()) {
QString reviewersFlag(QLatin1String("--receive-pack=git receive-pack"));
foreach (const QString &reviewer, reviewers) {
@@ -409,22 +406,22 @@ QString GerritPlugin::branch(const QString &repository)
return gitClient()->synchronousCurrentLocalBranch(repository);
}
-void GerritPlugin::fetchDisplay(const QSharedPointer<Gerrit::Internal::GerritChange> &change)
+void GerritPlugin::fetchDisplay(const QSharedPointer<GerritChange> &change)
{
fetch(change, FetchDisplay);
}
-void GerritPlugin::fetchCherryPick(const QSharedPointer<Gerrit::Internal::GerritChange> &change)
+void GerritPlugin::fetchCherryPick(const QSharedPointer<GerritChange> &change)
{
fetch(change, FetchCherryPick);
}
-void GerritPlugin::fetchCheckout(const QSharedPointer<Gerrit::Internal::GerritChange> &change)
+void GerritPlugin::fetchCheckout(const QSharedPointer<GerritChange> &change)
{
fetch(change, FetchCheckout);
}
-void GerritPlugin::fetch(const QSharedPointer<Gerrit::Internal::GerritChange> &change, int mode)
+void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode)
{
// Locate git.
const QString git = gitBinary();
diff --git a/src/plugins/git/gerrit/gerritplugin.h b/src/plugins/git/gerrit/gerritplugin.h
index 1d7217d9c4..cc5723c2f7 100644
--- a/src/plugins/git/gerrit/gerritplugin.h
+++ b/src/plugins/git/gerrit/gerritplugin.h
@@ -52,8 +52,6 @@ class GerritChange;
class GerritParameters;
class GerritDialog;
-typedef QPair<QAction *, Core::Command *> ActionCommandPair;
-
class GerritPlugin : public QObject
{
Q_OBJECT
@@ -84,12 +82,12 @@ private slots:
private:
QString findLocalRepository(QString project, const QString &branch) const;
- void fetch(const QSharedPointer<Gerrit::Internal::GerritChange> &change, int mode);
+ void fetch(const QSharedPointer<GerritChange> &change, int mode);
QSharedPointer<GerritParameters> m_parameters;
QPointer<GerritDialog> m_dialog;
Core::Command *m_gerritCommand;
- ActionCommandPair m_pushToGerritPair;
+ Core::Command *m_pushToGerritCommand;
QString m_reviewers;
};