mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
Qt ro refact
This commit is contained in:
20
ipc/ipc.h
20
ipc/ipc.h
@@ -1,12 +1,30 @@
|
||||
#ifndef IPC_H
|
||||
#define IPC_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#define IPC_SERVICE_URL "local:AmneziaVpnIpcInterface"
|
||||
|
||||
namespace amnezia {
|
||||
inline QString getIpcProcessUrl(int pid) { return QString("%1_%2").arg(IPC_SERVICE_URL).arg(pid); }
|
||||
|
||||
inline QString getIpcServiceUrl() {
|
||||
#ifdef Q_OS_WIN
|
||||
return IPC_SERVICE_URL;
|
||||
#else
|
||||
return QString("/tmp/%1").arg(IPC_SERVICE_URL);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline QString getIpcProcessUrl(int pid) {
|
||||
#ifdef Q_OS_WIN
|
||||
return QString("%1_%2").arg(IPC_SERVICE_URL).arg(pid);
|
||||
#else
|
||||
return QString("/tmp/%1_%2").arg(IPC_SERVICE_URL).arg(pid);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
} // namespace amnezia
|
||||
|
||||
#endif // IPC_H
|
||||
|
||||
Reference in New Issue
Block a user