forked from qt-creator/qt-creator
Git: Remove function pointer in changeRelatedActions
makes code more readable Change-Id: I8f6369bf571144dde468546b8f47695fd4ffdf44 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user