summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPetar Perisin <petar.perisin@gmail.com>2013-10-22 22:34:20 +0200
committerPetar Perisin <petar.perisin@gmail.com>2013-10-29 07:27:19 +0100
commit9bb93246c1bf32ab9f1abfe74cd1ad8b3b96eec3 (patch)
tree54d44c3401d2c8583cd1a091ed31d642f22db254 /src
parente31426366bfb9ebefde10df13062c5aa76e3eb00 (diff)
downloadqt-creator-9bb93246c1bf32ab9f1abfe74cd1ad8b3b96eec3.tar.gz
Git: Remove function pointer in changeRelatedActions
makes code more readable Change-Id: I8f6369bf571144dde468546b8f47695fd4ffdf44 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/git/gitclient.h5
-rw-r--r--src/plugins/git/gitplugin.cpp10
2 files changed, 6 insertions, 9 deletions
diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h
index cb9d433422..58c7c8b24c 100644
--- a/src/plugins/git/gitclient.h
+++ b/src/plugins/git/gitclient.h
@@ -180,9 +180,8 @@ public:
QString revision = QString(), QString *errorMessage = 0,
bool revertStaging = true);
// Checkout branch
- bool synchronousCheckout(const QString &workingDirectory, const QString &ref, QString *errorMessage);
- bool synchronousCheckout(const QString &workingDirectory, const QString &ref)
- { return synchronousCheckout(workingDirectory, ref, 0); }
+ bool synchronousCheckout(const QString &workingDirectory, const QString &ref,
+ QString *errorMessage = 0);
void updateSubmodulesIfNeeded(const QString &workingDirectory, bool prompt);
// Do a stash and return identier.
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 9d806d7da1..06ed7d2ca9 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -894,24 +894,22 @@ void GitPlugin::startChangeRelatedAction()
if (!ensureAllDocumentsSaved())
return;
- bool (GitClient::*commandFunction)(const QString&, const QString&);
+
switch (dialog.command()) {
case CherryPick:
- commandFunction = &GitClient::synchronousCherryPick;
+ m_gitClient->synchronousCherryPick(workingDirectory, change);
break;
case Revert:
- commandFunction = &GitClient::synchronousRevert;
+ m_gitClient->synchronousRevert(workingDirectory, change);
break;
case Checkout:
if (!m_gitClient->beginStashScope(workingDirectory, QLatin1String("Checkout")))
return;
- commandFunction = &GitClient::synchronousCheckout;
+ m_gitClient->synchronousCheckout(workingDirectory, change);
break;
default:
return;
}
-
- (m_gitClient->*commandFunction)(workingDirectory, change);
}
void GitPlugin::stageFile()