-rw-r--r-- | pwmanager/pwmanager/blowfish.h | 11 | ||||
-rw-r--r-- | pwmanager/pwmanager/gpasmanfile.cpp | 16 | ||||
-rw-r--r-- | pwmanager/pwmanager/htmlgen.cpp | 2 | ||||
-rw-r--r-- | pwmanager/pwmanager/ipc.cpp | 7 | ||||
-rw-r--r-- | pwmanager/pwmanager/ipc.h | 5 | ||||
-rw-r--r-- | pwmanager/pwmanager/libgcryptif.h | 7 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 1 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmanager.pro | 2 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmdoc.cpp | 9 | ||||
-rw-r--r-- | pwmanager/pwmanager/spinforsignal.h | 2 |
10 files changed, 50 insertions, 12 deletions
diff --git a/pwmanager/pwmanager/blowfish.h b/pwmanager/pwmanager/blowfish.h index c05de77..5129eab 100644 --- a/pwmanager/pwmanager/blowfish.h +++ b/pwmanager/pwmanager/blowfish.h @@ -25,6 +25,9 @@ #include "pwmexception.h" - +#ifndef _WIN32_ #include <stdint.h> +#else + +#endif #include <string> using std::string; @@ -34,5 +37,11 @@ using std::string; #define CIPHER_ALGO_BLOWFISH 4 /* blowfish 128 bit key */ +#ifndef _WIN32_ typedef uint8_t byte; +#else +#define uint8_t Q_UINT8 +#define byte Q_UINT8 +#define uint32_t Q_UINT32 +#endif /** blowfish encryption algorithm. diff --git a/pwmanager/pwmanager/gpasmanfile.cpp b/pwmanager/pwmanager/gpasmanfile.cpp index f80bc13..ae34c83 100644 --- a/pwmanager/pwmanager/gpasmanfile.cpp +++ b/pwmanager/pwmanager/gpasmanfile.cpp @@ -45,5 +45,12 @@ #include <fcntl.h> #include <stdlib.h> +#ifndef _WIN32_ #include <unistd.h> +#else +#include <io.h> +#define S_IRUSR _S_IREAD +#define S_IWUSR _S_IWRITE +#define creat _creat +#endif #include <string.h> #include <errno.h> @@ -63,5 +70,5 @@ #undef GPASMANFILE_DEBUG - +#ifndef _WIN32_ #if defined(PWM_DEBUG) && defined(GPASMANFILE_DEBUG) # define DBG(msg,x...) do { fprintf(stderr, msg "\n" , ##x); } while (0) @@ -69,4 +76,7 @@ # define DBG(msg,x...) do { } while (0) #endif +#else +# define DBG +#endif #ifdef BIG_ENDIAN_HOST @@ -411,5 +421,5 @@ int GpasmanFile::check_file(const char *filename) return (-1); } - +#ifndef _WIN32_ if (!S_ISREG(naamstat.st_mode)) { lstat(filename, &naamstat); @@ -419,5 +429,5 @@ int GpasmanFile::check_file(const char *filename) } } - +#endif return (1); } diff --git a/pwmanager/pwmanager/htmlgen.cpp b/pwmanager/pwmanager/htmlgen.cpp index 166b987..bee8198 100644 --- a/pwmanager/pwmanager/htmlgen.cpp +++ b/pwmanager/pwmanager/htmlgen.cpp @@ -61,5 +61,5 @@ QString HtmlGen::escapeHtmlText(const QString &str) char c; for (i = 0; i < len; ++i) { - c = str[i]; + c = str.at(i); switch (c) { case '<': diff --git a/pwmanager/pwmanager/ipc.cpp b/pwmanager/pwmanager/ipc.cpp index b1d2c68..643b022 100644 --- a/pwmanager/pwmanager/ipc.cpp +++ b/pwmanager/pwmanager/ipc.cpp @@ -22,7 +22,7 @@ #include <qsocketnotifier.h> - +#ifndef _WIN32_ #include <sys/socket.h> - +#endif #ifndef PWM_EMBEDDED #include <sys/types.h> @@ -73,8 +73,9 @@ Ipc::Ipc() , rdBuf (0) { +#ifndef _WIN32_ if (socketpair(AF_LOCAL, SOCK_STREAM, 0, sock)) { qDebug("Ipc: socketpair() failed"); } - +#endif QSocket* qsock = new QSocket(); qsock->setSocket(sock[0]); diff --git a/pwmanager/pwmanager/ipc.h b/pwmanager/pwmanager/ipc.h index e5a496d..7bfca02 100644 --- a/pwmanager/pwmanager/ipc.h +++ b/pwmanager/pwmanager/ipc.h @@ -22,6 +22,9 @@ #include <qobject.h> +#ifndef _WIN32_ #include <unistd.h> - +#else +#include <io.h> +#endif #ifndef PWM_EMBEDDED #include <stdio.h> diff --git a/pwmanager/pwmanager/libgcryptif.h b/pwmanager/pwmanager/libgcryptif.h index dffd55b..1a7b658 100644 --- a/pwmanager/pwmanager/libgcryptif.h +++ b/pwmanager/pwmanager/libgcryptif.h @@ -32,6 +32,11 @@ #include <stddef.h> #include <sys/types.h> +#ifndef _WIN32_ #include <stdint.h> - +#else +#define uint8_t Q_UINT8 +#define byte Q_UINT8 +#define uint32_t Q_UINT32 +#endif #define STRING2KEY_SALTLEN 8 diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp index d92c90d..1ab2b71 100644 --- a/pwmanager/pwmanager/pwm.cpp +++ b/pwmanager/pwmanager/pwm.cpp @@ -1411,4 +1411,5 @@ void PwM::createAboutData_slot() QString version; #include <../version> +; QMessageBox::about( this, "About PwManager/Pi", "PwManager/Platform-independent\n" diff --git a/pwmanager/pwmanager/pwmanager.pro b/pwmanager/pwmanager/pwmanager.pro index 80b2519..fbc0554 100644 --- a/pwmanager/pwmanager/pwmanager.pro +++ b/pwmanager/pwmanager/pwmanager.pro @@ -5,5 +5,5 @@ TARGET = pwmpi include( ../../variables.pri ) -INCLUDEPATH += . ../../ ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils +INCLUDEPATH += . ../../ ../../libkdepim ../../microkde ../../microkde/kdecore ../../microkde/kdeui ../../microkde/kutils ../libcrypt/crypt ../libcrypt/error ../libcrypt/zlib DEFINES += PWM_EMBEDDED CONFIG_PWMANAGER_GCRY DESKTOP_VERSION diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp index 86b6273..129bf7b 100644 --- a/pwmanager/pwmanager/pwmdoc.cpp +++ b/pwmanager/pwmanager/pwmdoc.cpp @@ -56,7 +56,8 @@ #include <sys/types.h> #include <sys/stat.h> +#ifndef _WIN32_ #include <unistd.h> #include <stdint.h> - +#endif #ifdef PWM_EMBEDDED @@ -506,8 +507,10 @@ PwMerror PwMDoc::saveDoc(char compress, const QString *file) unsetDocStatFlag(DOC_STAT_DISK_DIRTY); f.close(); +#ifndef _WIN32_ if (chmod(filename.latin1(), conf()->confGlobFilePermissions())) { printWarn(string("chmod failed: ") + strerror(errno)); } +#endif openDocList.edit(this, getTitle().latin1()); if (wasDeepLocked) { @@ -2219,8 +2222,10 @@ bool PwMDoc::execLauncher(const QString &category, unsigned int entryIndex) bool PwMDoc::execLauncher(unsigned int category, unsigned int entryIndex) { +#ifndef _WIN32_ if (geteuid() == 0) { rootAlertMsgBox(); return false; } +#endif QString command(dti.dta[category].d[entryIndex].launcher.c_str()); bool wasLocked = isLocked(category, entryIndex); @@ -2271,8 +2276,10 @@ bool PwMDoc::goToURL(const QString &category, unsigned int entryIndex) bool PwMDoc::goToURL(unsigned int category, unsigned int entryIndex) { +#ifndef _WIN32_ if (geteuid() == 0) { rootAlertMsgBox(); return false; } +#endif QString url(dti.dta[category].d[entryIndex].url.c_str()); if (url.isEmpty()) diff --git a/pwmanager/pwmanager/spinforsignal.h b/pwmanager/pwmanager/spinforsignal.h index ec6103b..f3cabee 100644 --- a/pwmanager/pwmanager/spinforsignal.h +++ b/pwmanager/pwmanager/spinforsignal.h @@ -23,5 +23,7 @@ #include <qobject.h> +#ifndef _WIN32_ #include <stdint.h> +#endif #include <string> using std::string; |