Ejemplo n.º 1
0
void UpdateInfoPlugin::startCheckForUpdates()
{
    stopCheckForUpdates();

    d->m_checkUpdatesCommand = new ShellCommand(QString(), QProcessEnvironment());
    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->execute();
    emit checkForUpdatesRunningChanged(true);
}
Ejemplo n.º 2
0
void UpdateInfoPlugin::stopCheckForUpdates()
{
    if (!d->m_checkUpdatesCommand)
        return;

    d->m_collectedOutput.clear();
    d->m_checkUpdatesCommand->disconnect();
    d->m_checkUpdatesCommand->cancel();
    d->m_checkUpdatesCommand = 0;
    emit checkForUpdatesRunningChanged(false);
}
Ejemplo n.º 3
0
void UpdateInfoPlugin::startCheckForUpdates()
{
    stopCheckForUpdates();

    QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
    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")),
                                     /*workingDirectory=*/QString(),
                                     [](int /*exitCode*/) { return Utils::SynchronousProcessResponse::Finished; });
    d->m_checkUpdatesCommand->execute();
    emit checkForUpdatesRunningChanged(true);
}