diff options
author | Alexander Hoppe | 2010-08-03 18:23:24 +0200 |
---|---|---|
committer | Alexander Hoppe | 2010-08-03 18:23:24 +0200 |
commit | 19316e9142c5ab4a4e1603715fbbf555aac97826 (patch) | |
tree | 9090d55685878f0cb82708d6733abf59de8f5499 /src/pvs.cpp | |
parent | Compiler optimizations for "Release" changed (diff) | |
download | pvs-19316e9142c5ab4a4e1603715fbbf555aac97826.tar.gz pvs-19316e9142c5ab4a4e1603715fbbf555aac97826.tar.xz pvs-19316e9142c5ab4a4e1603715fbbf555aac97826.zip |
Anpassungen fuer Win32-build.
Aufspaltung der ClientGUIUtils in 2 Versionen
Anpassungen des HomeDir
Alle Aenderungen sollten unschaedlich fuer den Linux-build-Prozess sein.
Diffstat (limited to 'src/pvs.cpp')
-rwxr-xr-x[-rw-r--r--] | src/pvs.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/pvs.cpp b/src/pvs.cpp index d09d407..1c08be5 100644..100755 --- a/src/pvs.cpp +++ b/src/pvs.cpp @@ -36,12 +36,14 @@ PVS::PVS() : _vncRequested = false; readPolicyFiles(); loadCommands(); - _blankScreen = NULL; + /*#ifndef __WIN32__*/ + _blankScreen = NULL; + /*#endif*/ _vncPort = -1; // add a notify to the allow file, so we get informed when the file is changed - QString watchPath("/home/"); - watchPath.append(getUserName().append(QString("/.pvs/.allow"))); + QString watchPath(getPolicyDir()); + watchPath.append(QString(".allow")); _notify = new QFileSystemWatcher(this); _notify->addPath(QString(watchPath.toUtf8().data())); @@ -64,6 +66,7 @@ PVS::PVS() : _timerLockTest = 0; _timerLockDelay = 0; + #ifndef __WIN32__ //add signalhandling for sigterm signals struct sigaction act; act.sa_handler = &PVS::signalHandler; @@ -75,7 +78,7 @@ PVS::PVS() : sigaction(SIGHUP, &act, 0); sigaction(SIGINT, &act, 0); sigaction(SIGQUIT, &act, 0); - + #endif /*__WIN32__*/ } PVS::~PVS() @@ -498,14 +501,19 @@ int PVS::startVNCScript(int port, QString pass, QString rwpass) commandLine.append(rwpass); if (!system(NULL)) ConsoleLog writeError("No Command processor available"); - int result = system(commandLine.toUtf8().data()); + #ifndef __WIN32__ +//TODO Win32 result = WEXITSTATUS(result); if (result != 0) ConsoleLog writeError(QString("VNC-Server is not running, code: ") + int2String(result)); else ConsoleLog writeLine("VNC-Server should be running"); return result; + #else + /*Code fuer VNC-Aufruf unter Windows einfuegen*/ + return 0; + #endif /*__WIN32__*/ } else { @@ -521,6 +529,7 @@ int PVS::stopVNCScript() { if (gotVNCScript()) { + #ifndef __WIN32__ ConsoleLog writeLine("Stopping VNC-Script"); QString commandLine(_vncScriptPath); commandLine.append(" "); @@ -532,6 +541,10 @@ int PVS::stopVNCScript() ConsoleLog writeLine("VNC-Server should be stopped"); int result = system(commandLine.toUtf8().data()); return WEXITSTATUS(result); + #else + /*Code fuer VNC-Server stoppen unter Windows einfuegen*/ + return 0; + #endif /*__WIN32__*/ } else { @@ -608,6 +621,7 @@ QString PVS::getIpByNick(QString nick) void PVS::signalHandler(int signal) { ConsoleLog writeLine(QString("Received Signal ").append (int2String(signal))); + #ifndef __WIN32__ switch (signal) { case SIGHUP: mainClient->quit(); @@ -622,6 +636,9 @@ void PVS::signalHandler(int signal) mainClient->quit(); break; } + #else + ConsoleLog writeLine("Abfang nicht definiert fuer Windows"); + #endif /*__WIN32__*/ } |