Qt ro refact
This commit is contained in:
parent
b2392c1943
commit
b6571d99de
14 changed files with 157 additions and 36 deletions
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue