Qt ro refact

This commit is contained in:
pokamest 2021-02-03 15:42:36 +03:00
parent b2392c1943
commit b6571d99de
14 changed files with 157 additions and 36 deletions

View file

@ -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