VCS: Use Qt5 connect for annotate

Connect directly to the editor widget, which has a strong type.

Change-Id: I4d9778bc4a3c8ba1b37c5a5c0286fd72cda135de
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Orgad Shaneh
2016-11-26 22:13:18 +02:00
committed by Orgad Shaneh
parent 5832f52cee
commit 414f49ea19
10 changed files with 5 additions and 40 deletions

View File

@@ -1170,11 +1170,10 @@ IEditor *PerforcePlugin::showOutputInEditor(const QString &title,
}
IEditor *editor = EditorManager::openEditorWithContents(id, &s, content.toUtf8());
QTC_ASSERT(editor, return 0);
connect(editor, SIGNAL(annotateRevisionRequested(QString,QString,QString,int)),
this, SLOT(vcsAnnotate(QString,QString,QString,int)));
auto e = qobject_cast<PerforceEditorWidget*>(editor->widget());
if (!e)
return 0;
connect(e, &VcsBaseEditorWidget::annotateRevisionRequested, this, &PerforcePlugin::annotate);
e->setForceReadOnly(true);
e->setSource(source);
s.replace(QLatin1Char(' '), QLatin1Char('_'));