mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
- Replaced direct process management with IPC calls for starting and stopping the Xray process. - Improved error handling for IPC communication and config file loading. - Removed unused methods and variables related to direct process handling. - Updated logging to reflect changes in process management.
24 lines
495 B
C++
24 lines
495 B
C++
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
|
|
class XrayController : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit XrayController(QObject* parent = nullptr);
|
|
~XrayController();
|
|
|
|
bool start(const QString& configPath);
|
|
bool stop();
|
|
bool isXrayRunning() const;
|
|
qint64 getProcessId() const;
|
|
QString getError() const;
|
|
|
|
private:
|
|
bool loadConfigFile(const QString& configPath, QString& configContent);
|
|
|
|
bool m_isRunning {false};
|
|
QString m_lastError;
|
|
};
|