diff options
Diffstat (limited to 'src/plugins/updateinfo')
-rw-r--r-- | src/plugins/updateinfo/updateinfoplugin.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/plugins/updateinfo/updateinfoplugin.cpp b/src/plugins/updateinfo/updateinfoplugin.cpp index a8c7ea64b99..d17bcfe5b2f 100644 --- a/src/plugins/updateinfo/updateinfoplugin.cpp +++ b/src/plugins/updateinfo/updateinfoplugin.cpp @@ -33,6 +33,7 @@ #include <coreplugin/settingsdatabase.h> #include <coreplugin/shellcommand.h> #include <utils/fileutils.h> +#include <utils/synchronousprocess.h> #include <QDate> #include <QDomDocument> @@ -60,6 +61,13 @@ using namespace Core; namespace UpdateInfo { namespace Internal { +class IgnoreExitCode : public Utils::ExitCodeInterpreter +{ +public: + IgnoreExitCode(QObject *parent); + Utils::SynchronousProcessResponse::Result interpretExitCode(int code) const override; +}; + class UpdateInfoPluginPrivate { public: @@ -76,6 +84,16 @@ public: QDate m_lastCheckDate; }; +IgnoreExitCode::IgnoreExitCode(QObject *parent) + : Utils::ExitCodeInterpreter(parent) +{ +} + +Utils::SynchronousProcessResponse::Result IgnoreExitCode::interpretExitCode(int code) const +{ + Q_UNUSED(code) + return Utils::SynchronousProcessResponse::Finished; +} UpdateInfoPlugin::UpdateInfoPlugin() : d(new UpdateInfoPluginPrivate) @@ -123,10 +141,13 @@ void UpdateInfoPlugin::startCheckForUpdates() { stopCheckForUpdates(); - d->m_checkUpdatesCommand = new ShellCommand(QString(), QProcessEnvironment()); + QProcessEnvironment env; + env.insert(QLatin1String("QT_LOGGING_RULES"), QLatin1String("*=false")); + d->m_checkUpdatesCommand = new ShellCommand(QString(), env); connect(d->m_checkUpdatesCommand, &ShellCommand::stdOutText, this, &UpdateInfoPlugin::collectCheckForUpdatesOutput); connect(d->m_checkUpdatesCommand, &ShellCommand::finished, this, &UpdateInfoPlugin::checkForUpdatesFinished); - d->m_checkUpdatesCommand->addJob(Utils::FileName(QFileInfo(d->m_maintenanceTool)), QStringList(QLatin1String("--checkupdates"))); + d->m_checkUpdatesCommand->addJob(Utils::FileName(QFileInfo(d->m_maintenanceTool)), QStringList(QLatin1String("--checkupdates")), + /*workingDirectory=*/QString(), new IgnoreExitCode(d->m_checkUpdatesCommand)); d->m_checkUpdatesCommand->execute(); emit checkForUpdatesRunningChanged(true); } |