UpdateInfo: Fix checking for updates

Checking for updates failed when MaintenanceTool printed out log
messages. MaintenanceTool is expected to print out only xml data. So,
parsing the output failed.

MaintenanceTool printed out warnings about SSL and Qt account.

Logging is now disabled when running MaintenanceTool.

Change-Id: Ib163dae81368c8fec7218e5961590e07c208a73e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Riho Pihlak
2016-04-24 15:28:02 +03:00
parent 8f33979403
commit 26ba9e62f3

View File

@@ -123,7 +123,9 @@ void UpdateInfoPlugin::startCheckForUpdates()
{ {
stopCheckForUpdates(); stopCheckForUpdates();
d->m_checkUpdatesCommand = new ShellCommand(QString(), QProcessEnvironment()); QProcessEnvironment env;
env.insert("QT_LOGGING_RULES", "*=false");
d->m_checkUpdatesCommand = new ShellCommand(QString(), env);
connect(d->m_checkUpdatesCommand, &ShellCommand::stdOutText, this, &UpdateInfoPlugin::collectCheckForUpdatesOutput); connect(d->m_checkUpdatesCommand, &ShellCommand::stdOutText, this, &UpdateInfoPlugin::collectCheckForUpdatesOutput);
connect(d->m_checkUpdatesCommand, &ShellCommand::finished, this, &UpdateInfoPlugin::checkForUpdatesFinished); 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")));