VCS: Replace describe slots with lambdas

Change-Id: I05ca25aad8be43fdfa15d3fb5eaaa9bf753ee79f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Orgad Shaneh
2016-11-26 21:52:49 +02:00
committed by Orgad Shaneh
parent 565aed03a2
commit 5832f52cee
19 changed files with 52 additions and 57 deletions

View File

@@ -197,11 +197,13 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
addAutoReleasedObject(new VcsSubmitEditorFactory(&submitParameters,
[]() { return new PerforceSubmitEditor(&submitParameters); }));
static const char *describeSlot = SLOT(describe(QString,QString));
const auto describeFunc = [this](const QString &source, const QString &n) {
describe(source, n);
};
const int editorCount = sizeof(editorParameters) / sizeof(editorParameters[0]);
const auto widgetCreator = []() { return new PerforceEditorWidget; };
for (int i = 0; i < editorCount; i++)
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, this, describeSlot));
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, describeFunc));
const QString prefix = QLatin1String("p4");
m_commandLocator = new CommandLocator("Perforce", prefix, prefix);