2016-09-03 19:39:43 +02:00
|
|
|
#ifndef DATA_SYNCTHINGPROCESS_H
|
|
|
|
#define DATA_SYNCTHINGPROCESS_H
|
|
|
|
|
2016-09-30 23:55:25 +02:00
|
|
|
#include "./global.h"
|
|
|
|
|
2016-09-03 19:39:43 +02:00
|
|
|
#include <QProcess>
|
|
|
|
|
|
|
|
namespace Data {
|
|
|
|
|
2016-09-30 23:55:25 +02:00
|
|
|
class LIB_SYNCTHING_CONNECTOR_EXPORT SyncthingProcess : public QProcess
|
2016-09-03 19:39:43 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2017-01-06 15:19:37 +01:00
|
|
|
explicit SyncthingProcess(QObject *parent = nullptr);
|
2016-09-03 19:39:43 +02:00
|
|
|
|
|
|
|
public Q_SLOTS:
|
2016-09-29 21:19:54 +02:00
|
|
|
void restartSyncthing(const QString &cmd);
|
|
|
|
void startSyncthing(const QString &cmd);
|
2017-03-17 00:38:42 +01:00
|
|
|
void stopSyncthing();
|
2016-09-03 19:39:43 +02:00
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void handleFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
|
|
|
void killToRestart();
|
|
|
|
|
|
|
|
private:
|
2016-09-29 21:19:54 +02:00
|
|
|
QString m_cmd;
|
2016-09-03 19:39:43 +02:00
|
|
|
};
|
|
|
|
|
2016-10-03 00:41:38 +02:00
|
|
|
SyncthingProcess LIB_SYNCTHING_CONNECTOR_EXPORT &syncthingProcess();
|
2016-09-03 19:39:43 +02:00
|
|
|
|
|
|
|
} // namespace Data
|
|
|
|
|
|
|
|
#endif // DATA_SYNCTHINGPROCESS_H
|