Core: Use std::function for info bar callbacks

Change-Id: Iae7cbef053bfe86a7692e09f66af91117815d2a6
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
hjk
2014-09-03 10:34:52 +02:00
parent 2e17339b05
commit f70ba9930e
18 changed files with 61 additions and 96 deletions

View File

@@ -713,7 +713,9 @@ void AndroidManifestEditorWidget::updateInfoBar(const QString &errorMessage, int
else
text = tr("%2: Could not parse file: \"%1\".").arg(errorMessage).arg(line);
Core::InfoBarEntry infoBarEntry(infoBarId, text);
infoBarEntry.setCustomButtonInfo(tr("Goto error"), this, SLOT(gotoError()));
infoBarEntry.setCustomButtonInfo(tr("Goto error"), [this]() {
m_textEditorWidget->gotoLine(m_errorLine, m_errorColumn);
});
infoBar->removeInfo(infoBarId);
infoBar->addInfo(infoBarEntry);
@@ -729,11 +731,6 @@ void AndroidManifestEditorWidget::hideInfoBar()
m_timerParseCheck.stop();
}
void AndroidManifestEditorWidget::gotoError()
{
m_textEditorWidget->gotoLine(m_errorLine, m_errorColumn);
}
void setApiLevel(QComboBox *box, const QDomElement &element, const QString &attribute)
{
if (!element.isNull() && element.hasAttribute(attribute)) {