aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/updateinfo
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2016-04-25 11:48:06 +0200
committerEike Ziller <eike.ziller@qt.io>2016-04-25 11:24:04 +0000
commit728229690af3a5357c59790b58e10e9edddb3756 (patch)
treee1fd309af58e70b01fa20c1b8cfaaf9ad4fd7d5e /src/plugins/updateinfo
parentba75cf8b6d27008fb6b2c3816d6e41b7884054c0 (diff)
UpdateInfo: Fix status of progress bar
MaintenanceTool returns with exit status != 0 in case there are no updates, so that is no indicator of failure. Change-Id: Ibe94cc8b5ecbd7a04be5da41112a4eda0cd84153 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/updateinfo')
-rw-r--r--src/plugins/updateinfo/updateinfoplugin.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/plugins/updateinfo/updateinfoplugin.cpp b/src/plugins/updateinfo/updateinfoplugin.cpp
index b6c9d3b146..d17bcfe5b2 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)
@@ -128,7 +146,8 @@ void UpdateInfoPlugin::startCheckForUpdates()
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);
}