forked from Securepoint/openvpn-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appfunc.cpp
39 lines (35 loc) · 976 Bytes
/
appfunc.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "appfunc.h"
#include "settings.h"
AppFunc::AppFunc()
{
}
bool AppFunc::isAppPortable() {
// Die Dienstanwendung darf nur als Setupversion sein.
// Wegen dem Dienst, könnte eine Portabel Verwirrung
// beim dem Benutzer stiften ;)
return Settings::getInstance()->getIsPortableClient();
}
QString AppFunc::getOS() {
#ifdef Q_OS_WIN32
return QLatin1String("WIN");
#elif Q_OS_Unix
return "UNIX";
#elif Q_OS_Mac
return "MAC";
#endif
}
QString AppFunc::getAppSavePath() {
// Gibt das Configverzeichnis zurück
// Dieses ist standardmäßig in User/Appdata/
QString retVal (QLatin1String(getenv("APPDATA")) + QLatin1String("/Securepoint SSL VPN"));
#ifdef Q_OS_WIN32
if (isAppPortable())
retVal = QApplication::applicationDirPath();
#elif Q_OS_Unix
// Unix Code
#elif Q_OS_Mac
// Mac code
#endif
retVal.replace("\\", "/");
return retVal;
}