From 9bb93246c1bf32ab9f1abfe74cd1ad8b3b96eec3 Mon Sep 17 00:00:00 2001 From: Petar Perisin Date: Tue, 22 Oct 2013 22:34:20 +0200 Subject: Git: Remove function pointer in changeRelatedActions makes code more readable Change-Id: I8f6369bf571144dde468546b8f47695fd4ffdf44 Reviewed-by: Orgad Shaneh --- src/plugins/git/gitplugin.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/plugins/git/gitplugin.cpp') 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() -- cgit v1.2.1