diff options
| -rwxr-xr-x | src/pvs.cpp | 7 | ||||
| -rwxr-xr-x | src/util/util.cpp | 8 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/pvs.cpp b/src/pvs.cpp index 20e9b3b..61df049 100755 --- a/src/pvs.cpp +++ b/src/pvs.cpp @@ -459,12 +459,13 @@ void PVS::setScriptPath(QString path) bool PVS::gotVNCScript() { - if (fileExists(_vncScriptPath)) + if (!_vncScriptPath.isEmpty() && fileExists(_vncScriptPath)) return true; - if (policyFileExists(_vncScriptName)) + + if (!_vncScriptName.isEmpty() && policyFileExists(_vncScriptName)) return true; - return false; + return false; } /** * setup password and port diff --git a/src/util/util.cpp b/src/util/util.cpp index 7463ae0..8b25b12 100755 --- a/src/util/util.cpp +++ b/src/util/util.cpp @@ -205,15 +205,11 @@ QString getUserName() //Unicode string needs to be converted username = QString::fromWCharArray(lpszSystemInfo); - #elif defined __WIN32__ + #else struct passwd* passUser = getpwuid(getuid()); - - if (passwd) - username = passwd->pw_name; if (passUser) - { username = QString(passUser->pw_name); - } + #endif //#ifdef __WIN32__ if (username.isEmpty()) { |
