adding commnds to execute

This commit is contained in:
2025-02-05 16:25:01 +01:00
parent b6f0615e9c
commit 7b4bee524f
20 changed files with 262 additions and 3 deletions

View File

@@ -1,6 +1,5 @@
#ifndef COMMAND_H_INCLUDED
#define COMMAND_H_INCLUDED
#endif // COMMAND_H_INCLUDED
#include <QObject>
#include <QCoreApplication>
@@ -13,14 +12,24 @@ class Worker;
class Command : public QObject {
Q_OBJECT
protected:
QString m_command;
mutable QString m_commandResult;
private:
int m_waitForStartTimeout;
int m_waitForFinishTimeout;
int m_exitCode;
protected:
mutable QMutex m_mtx;
private:
QProcess *m_p;
protected:
Worker *m_worker;
public:
explicit Command(QString const &command,
int start_timeout = 100000,
@@ -35,8 +44,10 @@ public:
void setWorker(Worker *worker) {m_worker = worker; }
private slots:
protected slots:
void readyReadStandardOutput();
void readyReadStandardError();
void finished(int exitCode, QProcess::ExitStatus exitStatus);
virtual void finished(int exitCode, QProcess::ExitStatus exitStatus);
};
#endif // COMMAND_H_INCLUDED