forked from qt-creator/qt-creator
Vcs: in VcsBaseClient use functors to create log/diff parameter widgets
Also API of VcsBaseEditorParameterWidget was changed to take benefit of C++11 lambdas. Slot executeCommand() is no longer virtual and only fires signal commandExecutionRequested(). The Vcs client just has to bind a lambda to this signal instead of some boiler-plate code like keeping track of the arguments of diff/log with "struct XxxDiffParameters", etc. Change-Id: I347c97d84a8324e9c661df4e6d9a6075980b020f Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -37,6 +37,8 @@
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
|
||||
#include <functional>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QFileInfo;
|
||||
class QVariant;
|
||||
@@ -155,12 +157,11 @@ protected:
|
||||
virtual Utils::ExitCodeInterpreter *exitCodeInterpreter(VcsCommandTag cmd, QObject *parent) const;
|
||||
|
||||
virtual QStringList revisionSpec(const QString &revision) const = 0;
|
||||
virtual VcsBaseEditorParameterWidget *createDiffEditor(const QString &workingDir,
|
||||
const QStringList &files,
|
||||
const QStringList &extraOptions);
|
||||
virtual VcsBaseEditorParameterWidget *createLogEditor(const QString &workingDir,
|
||||
const QStringList &files,
|
||||
const QStringList &extraOptions);
|
||||
|
||||
typedef std::function<VcsBaseEditorParameterWidget *()> ParameterWidgetCreator;
|
||||
void setDiffParameterWidgetCreator(ParameterWidgetCreator creator);
|
||||
void setLogParameterWidgetCreator(ParameterWidgetCreator creator);
|
||||
|
||||
virtual StatusItem parseStatusLine(const QString &line) const = 0;
|
||||
|
||||
QString vcsEditorTitle(const QString &vcsCmd, const QString &sourceId) const;
|
||||
|
||||
Reference in New Issue
Block a user