From 3088f32115e58328cb7a7cced0f767f89a7d27cc Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 21 Apr 2022 22:47:12 +0200 Subject: [PATCH] SpotlightIterator: Connect to QtcProcess::done() signal Instead of connecting to errorOccurred() and finished() signals. Change-Id: I18548db319274ff28c78fc877711ce7536953212 Reviewed-by: Eike Ziller --- .../coreplugin/locator/spotlightlocatorfilter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp b/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp index 4c43a9832f8..3dde746a91e 100644 --- a/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/spotlightlocatorfilter.cpp @@ -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] {