forked from qt-creator/qt-creator
VCS: Replace describe slots with lambdas
Change-Id: I05ca25aad8be43fdfa15d3fb5eaaa9bf753ee79f Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
565aed03a2
commit
5832f52cee
@@ -55,8 +55,6 @@ public:
|
||||
bool isVcsDirectory(const Utils::FileName &fileName) const;
|
||||
QString findTopLevelForFile(const QFileInfo &file) const;
|
||||
bool managesFile(const QString &workingDirectory, const QString &fileName) const;
|
||||
|
||||
public slots:
|
||||
void view(const QString &source, const QString &id,
|
||||
const QStringList &extraOptions = QStringList());
|
||||
|
||||
|
||||
@@ -160,11 +160,13 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
|
||||
|
||||
addAutoReleasedObject(new OptionsPage(vcsCtrl));
|
||||
|
||||
static const char *describeSlot = SLOT(view(QString,QString));
|
||||
const auto describeFunc = [this](const QString &source, const QString &id) {
|
||||
m_client->view(source, id);
|
||||
};
|
||||
const int editorCount = sizeof(editorParameters) / sizeof(VcsBaseEditorParameters);
|
||||
const auto widgetCreator = []() { return new BazaarEditorWidget; };
|
||||
for (int i = 0; i < editorCount; i++)
|
||||
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, m_client, describeSlot));
|
||||
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc));
|
||||
|
||||
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitEditorParameters,
|
||||
[]() { return new CommitEditor(&submitEditorParameters); }));
|
||||
|
||||
Reference in New Issue
Block a user