forked from qt-creator/qt-creator
SpotlightIterator: Connect to QtcProcess::done() signal
Instead of connecting to errorOccurred() and finished() signals. Change-Id: I18548db319274ff28c78fc877711ce7536953212 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -90,11 +90,11 @@ SpotlightIterator::SpotlightIterator(const QStringList &command)
|
||||
m_process->setCommand({Environment::systemEnvironment().searchInPath(command.first()),
|
||||
command.mid(1)});
|
||||
m_process->setEnvironment(Utils::Environment::systemEnvironment());
|
||||
QObject::connect(m_process.get(), &QtcProcess::finished, [this] { scheduleKillProcess(); });
|
||||
QObject::connect(m_process.get(), &QtcProcess::errorOccurred, [this, command] {
|
||||
MessageManager::writeFlashing(
|
||||
SpotlightLocatorFilter::tr("Locator: Error occurred when running \"%1\".")
|
||||
.arg(command.first()));
|
||||
QObject::connect(m_process.get(), &QtcProcess::done, [this, cmd = command.first()] {
|
||||
if (m_process->result() != ProcessResult::FinishedWithSuccess) {
|
||||
MessageManager::writeFlashing(SpotlightLocatorFilter::tr(
|
||||
"Locator: Error occurred when running \"%1\".").arg(cmd));
|
||||
}
|
||||
scheduleKillProcess();
|
||||
});
|
||||
QObject::connect(m_process.get(), &QtcProcess::readyReadStandardOutput, [this] {
|
||||
|
Reference in New Issue
Block a user