Commit ae844bdf authored by hjk's avatar hjk

Git: Simplify code for action generation

Instead of returning (Action, Command) pairs for further modification,
pass in everything to setup the Command, and return only the Action.

Change-Id: I85695f2f35a9b9a1f34b00db7de5135909045e05
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 421d5120
This diff is collapsed.
......@@ -36,7 +36,7 @@
#include <QStringList>
#include <QPointer>
#include <QPair>
#include <QKeySequence>
#include <QVector>
QT_BEGIN_NAMESPACE
......@@ -69,9 +69,6 @@ class RemoteDialog;
typedef void (GitClient::*GitClientMemberFunc)(const QString &);
typedef QPair<QAction *, Core::Command* > ActionCommandPair;
typedef QPair<Utils::ParameterAction *, Core::Command* > ParameterActionCommandPair;
class GitPlugin : public VcsBase::VcsBasePlugin
{
Q_OBJECT
......@@ -155,40 +152,42 @@ protected:
bool submitEditorAboutToClose();
private:
inline ParameterActionCommandPair
createParameterAction(Core::ActionContainer *ac,
const QString &defaultText, const QString &parameterText,
Core::Id id, const Core::Context &context, bool addToLocator);
inline ParameterActionCommandPair
createFileAction(Core::ActionContainer *ac,
const QString &defaultText, const QString &parameterText,
Core::Id id, const Core::Context &context, bool addToLocator,
const char *pluginSlot);
inline ParameterActionCommandPair
createProjectAction(Core::ActionContainer *ac,
const QString &defaultText, const QString &parameterText,
Core::Id id, const Core::Context &context, bool addToLocator);
inline ParameterActionCommandPair
createProjectAction(Core::ActionContainer *ac,
const QString &defaultText, const QString &parameterText,
Core::Id id, const Core::Context &context, bool addToLocator,
const char *pluginSlot);
inline ActionCommandPair createRepositoryAction(Core::ActionContainer *ac,
const QString &text, Core::Id id,
const Core::Context &context, bool addToLocator);
inline ActionCommandPair createRepositoryAction(Core::ActionContainer *ac,
const QString &text, Core::Id id,
const Core::Context &context,
bool addToLocator, const char *pluginSlot);
inline ActionCommandPair createRepositoryAction(Core::ActionContainer *ac,
const QString &text, Core::Id id,
const Core::Context &context,
bool addToLocator, GitClientMemberFunc);
Utils::ParameterAction *createParameterAction(Core::ActionContainer *ac,
const QString &defaultText, const QString &parameterText,
Core::Id id, const Core::Context &context, bool addToLocator,
const QKeySequence &keys = QKeySequence());
QAction *createFileAction(Core::ActionContainer *ac,
const QString &defaultText, const QString &parameterText,
Core::Id id, const Core::Context &context, bool addToLocator,
const char *pluginSlot,
const QKeySequence &keys = QKeySequence());
QAction *createProjectAction(Core::ActionContainer *ac,
const QString &defaultText, const QString &parameterText,
Core::Id id, const Core::Context &context, bool addToLocator,
const QKeySequence &keys = QKeySequence());
QAction *createProjectAction(Core::ActionContainer *ac,
const QString &defaultText, const QString &parameterText,
Core::Id id, const Core::Context &context, bool addToLocator,
const char *pluginSlot, const QKeySequence &keys = QKeySequence());
QAction *createRepositoryAction(Core::ActionContainer *ac,
const QString &text, Core::Id id,
const Core::Context &context, bool addToLocator,
const QKeySequence &keys = QKeySequence());
QAction *createRepositoryAction(Core::ActionContainer *ac,
const QString &text, Core::Id id,
const Core::Context &context,
bool addToLocator, const char *pluginSlot,
const QKeySequence &keys = QKeySequence());
QAction *createRepositoryAction(Core::ActionContainer *ac,
const QString &text, Core::Id id,
const Core::Context &context,
bool addToLocator, GitClientMemberFunc,
const QKeySequence &keys = QKeySequence());
void updateRepositoryBrowserAction();
bool isCommitEditorOpen() const;
......
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