diff options
author | Johann Latocha | 2011-03-02 02:08:42 +0100 |
---|---|---|
committer | Johann Latocha | 2011-03-02 02:08:42 +0100 |
commit | 3b7320ef4e2bd9f24b6dce72a8e8bf94c3695796 (patch) | |
tree | 99fdd6aa4c0073e747902486e703e1d738da8369 /src/util | |
parent | fix cmake paths (diff) | |
download | pvs-3b7320ef4e2bd9f24b6dce72a8e8bf94c3695796.tar.gz pvs-3b7320ef4e2bd9f24b6dce72a8e8bf94c3695796.tar.xz pvs-3b7320ef4e2bd9f24b6dce72a8e8bf94c3695796.zip |
Win32 clean out
Diffstat (limited to 'src/util')
-rwxr-xr-x | src/util/clientGUIUtils.h | 2 | ||||
-rwxr-xr-x | src/util/clientGUIUtils_Win32.cpp | 46 | ||||
-rwxr-xr-x | src/util/util.cpp | 50 | ||||
-rwxr-xr-x | src/util/util.h | 9 |
4 files changed, 14 insertions, 93 deletions
diff --git a/src/util/clientGUIUtils.h b/src/util/clientGUIUtils.h index 7f7ea47..e797ea0 100755 --- a/src/util/clientGUIUtils.h +++ b/src/util/clientGUIUtils.h @@ -25,7 +25,6 @@ private: BlankScreen_Sysdep* _sysdep; }; -#ifndef __WIN32__ # include <X11/Xlib.h> class X11Info @@ -33,6 +32,5 @@ class X11Info public: static Display* display(); }; -#endif /* !__WIN32__ */ #endif diff --git a/src/util/clientGUIUtils_Win32.cpp b/src/util/clientGUIUtils_Win32.cpp deleted file mode 100755 index 1b4d2ae..0000000 --- a/src/util/clientGUIUtils_Win32.cpp +++ /dev/null @@ -1,46 +0,0 @@ -
-#include "clientGUIUtils.h"
-#include <qwidget.h>
-
-struct BlankScreen_Sysdep {
-
- bool locked;
- QWidget* blankwin;
-
- QString lockMsg;
- int blackColor, whiteColor;
- int offX, offY;
-};
-
-BlankScreen::BlankScreen()
-{
- _sysdep = new BlankScreen_Sysdep;
- _sysdep->blankwin = new QWidget(0, Qt::X11BypassWindowManagerHint | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
- _sysdep->blankwin->setWindowState(Qt::WindowFullScreen);
- _sysdep->blankwin->show();
-}
-
-BlankScreen::~BlankScreen()
-{
- delete _sysdep;
-}
-
-void BlankScreen::draw(bool force)
-{
-
-}
-
-bool BlankScreen::lock()
-{
- return true;
-}
-
-bool BlankScreen::lock_inputs()
-{
- return true;
-}
-
-bool BlankScreen::unlock()
-{
- return true;
-}
diff --git a/src/util/util.cpp b/src/util/util.cpp index 05a209f..0fcfa84 100755 --- a/src/util/util.cpp +++ b/src/util/util.cpp @@ -7,10 +7,6 @@ #include <QStringList> #include <iostream> #include <QDir> -#ifdef __WIN32__ - #include <windows.h> - #include <Lmcons.h> -#endif //__WIN32__ PVSServerEntry::PVSServerEntry(QString name) { @@ -49,11 +45,7 @@ int getRandom(int min, int max) if (init) { init = false; - #ifndef __WIN32__ srand ( time(NULL) + getpid() ); - #else - srand ( time(NULL) ); /*might be solved by another random factor*/ - #endif } if (min >= max) return rand(); return rand() % (max-min+1) + min; @@ -193,24 +185,10 @@ QString colonSplitter(QString line, bool first) QString getUserName() { QString username; - #ifdef __WIN32__ - WCHAR* lpszSystemInfo; // pointer to system information - DWORD cchBuff = 256; // size of user name - WCHAR tchBuffer[UNLEN + 1]; // buffer for expanded string + struct passwd* passUser = getpwuid(getuid()); + if (passUser) + username = QString(passUser->pw_name); - lpszSystemInfo = tchBuffer; - - // Get and display the user name. - GetUserNameW(lpszSystemInfo, &cchBuff); - - //Unicode string needs to be converted - username = QString::fromWCharArray(lpszSystemInfo); - #else - struct passwd* passUser = getpwuid(getuid()); - if (passUser) - username = QString(passUser->pw_name); - - #endif //#ifdef __WIN32__ if (username.isEmpty()) { qDebug("USERNAME COULDNT BE RETRIEVED!"); @@ -223,21 +201,19 @@ QString getUserName() QString getFullUsername() { QString fullname = getUserName(); - #ifndef __WIN32__ - struct passwd *pd; + struct passwd *pd; - if (NULL == (pd = getpwuid(getuid()))) - {ConsoleLog writeError("getpwuid() error.");} - else + if (NULL == (pd = getpwuid(getuid()))) + {ConsoleLog writeError("getpwuid() error.");} + else + { + QString tmp = pd->pw_gecos; + QStringList userData = tmp.split(","); + if(userData[0].length() > 0 ) { - QString tmp = pd->pw_gecos; - QStringList userData = tmp.split(","); - if(userData[0].length() > 0 ) - { - fullname = userData[0]; - } + fullname = userData[0]; } - #endif //__WIN32__ //might be completed some time to a full solution for WIN32 + } return fullname; } diff --git a/src/util/util.h b/src/util/util.h index 4f2d0ee..0fab33f 100755 --- a/src/util/util.h +++ b/src/util/util.h @@ -1,19 +1,12 @@ #include <QString> #include <cstdio> -//#include <cstring> #include <list> #include <fstream> #include <iostream> -#ifndef __WIN32__ - #include <pwd.h> -#else - /*#include "pwd_win32.h"*/ -#endif /*__WIN32*/ +#include <pwd.h> #include <sys/types.h> #include <sys/stat.h> - - #ifndef _PVSSERVERENTRY_H_ #define _PVSSERVERENTRY_H_ class PVSServerEntry |