2025-02-05 16:25:01 +01:00
|
|
|
#include "process/check_update_activation_command.h"
|
2025-02-06 16:25:50 +01:00
|
|
|
#include "worker.h"
|
2025-02-05 16:25:01 +01:00
|
|
|
|
2025-02-06 16:25:50 +01:00
|
|
|
#include <QDebug>
|
2025-02-05 16:25:01 +01:00
|
|
|
|
|
|
|
CheckUpdateActivationCommand::CheckUpdateActivationCommand(QString const &command,
|
|
|
|
Worker *worker,
|
2025-02-14 13:20:42 +01:00
|
|
|
int nextCommandIndex,
|
2025-02-05 16:25:01 +01:00
|
|
|
int start_timeout,
|
|
|
|
int finish_timeout)
|
2025-02-14 13:20:42 +01:00
|
|
|
: UpdateCommand(command, worker, nextCommandIndex, start_timeout, finish_timeout) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void CheckUpdateActivationCommand::finished(int exitCode, QProcess::ExitStatus exitStatus) {
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << command() << exitCode << exitStatus;
|
|
|
|
return UpdateCommand::finished(exitCode, exitStatus);
|
2025-02-05 16:25:01 +01:00
|
|
|
}
|
2025-02-06 16:25:50 +01:00
|
|
|
|
|
|
|
void CheckUpdateActivationCommand::readyReadStandardOutput() {
|
|
|
|
QProcess *p = (QProcess *)sender();
|
|
|
|
if (p) {
|
|
|
|
Worker *w = worker();
|
|
|
|
if (w) {
|
2025-02-14 13:20:42 +01:00
|
|
|
QString s = p->readAllStandardOutput().trimmed();
|
|
|
|
if (s == UpdateCommand::UPDATE_REQUESTED) {
|
|
|
|
emit w->showUpdateRequest(UpdateCommand::UPDATE_REQUESTED);
|
|
|
|
} else
|
|
|
|
if (s == UpdateCommand::UPDATE_NOT_NECESSARY) {
|
|
|
|
emit w->showUpdateRequest(UpdateCommand::UPDATE_NOT_NECESSARY);
|
|
|
|
} else
|
|
|
|
if (s == UpdateCommand::UPDATE_NOT_REQUESTED) {
|
|
|
|
emit w->showUpdateRequest(UpdateCommand::UPDATE_NOT_REQUESTED);
|
|
|
|
} else
|
|
|
|
if (s == UpdateCommand::NO_CUSTOMER_REPOSITORY) {
|
|
|
|
emit w->showUpdateRequest(UpdateCommand::NO_CUSTOMER_REPOSITORY);
|
|
|
|
}
|
2025-02-06 16:25:50 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|