Commit 24e0750a authored by Milian Wolff's avatar Milian Wolff
Browse files

Port private slot to lamda

parent fa62c04c
......@@ -68,25 +68,21 @@ void QtHelpQtDoc::registerDocumentations()
p->setProcessChannelMode(QProcess::MergedChannels);
p->setProgram(qmake);
p->setArguments({QLatin1String("-query"), QLatin1String("QT_INSTALL_DOCS")});
connect(p, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, [this, p](int code) {
if (code == QProcess::NormalExit) {
m_path = QDir::fromNativeSeparators(QString::fromLatin1(p->readAllStandardOutput().trimmed()));
qCDebug(QTHELP) << "Detected doc path:" << m_path;
} else {
qCCritical(QTHELP) << "qmake query returned error:" << QString::fromLatin1(p->readAllStandardError());
qCDebug(QTHELP) << "last standard output was:" << QString::fromLatin1(p->readAllStandardOutput());
}
p->deleteLater();
});
p->start();
connect(p, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &QtHelpQtDoc::lookupDone);
}
}
void QtHelpQtDoc::lookupDone(int code)
{
auto *p = qobject_cast<QProcess*>(sender());
if(code == QProcess::NormalExit) {
m_path = QDir::fromNativeSeparators(QString::fromLatin1(p->readAllStandardOutput().trimmed()));
qCDebug(QTHELP) << "Detected doc path:" << m_path;
} else {
qCCritical(QTHELP) << "qmake query returned error:" << QString::fromLatin1(p->readAllStandardError());
qCDebug(QTHELP) << "last standard output was:" << QString::fromLatin1(p->readAllStandardOutput());
}
sender()->deleteLater();
}
void QtHelpQtDoc::loadDocumentation()
{
if(m_path.isEmpty()) {
......
......@@ -41,9 +41,6 @@ public:
private:
QString m_path;
private Q_SLOTS:
void lookupDone(int code);
};
#endif // QTHELPQTDOC_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment