From 1ff94e86bddf872caa49d82ebd81077964491ec7 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 30 Jul 2012 17:08:42 +0300 Subject: [PATCH] Fix build with UNICODE under windows, fix USE_INOTIFY initialization. --- CMakeLists.txt | 4 +++- src/mirall/mirallconfigfile.cpp | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91b23eb10..90edd8239 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ find_package(Csync) find_package(INotify) set(WITH_CSYNC CSYNC_FOUND) -set(USE_INOTIFY INOTIFY_FOUND) +set(USE_INOTIFY ${INOTIFY_FOUND}) configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) @@ -69,6 +69,8 @@ enable_testing() # but if that fails because cmake is too old, uncomment this here if you want to build # owncloud. # add_definitions(-DOWNCLOUD_CLIENT) +add_definitions(-DUNICODE) +add_definitions(-D_UNICODE) # Handle Translations, pick all mirall_* files from trans directory. file( GLOB TRANS_FILES ${CMAKE_SOURCE_DIR}/translations/mirall_*.ts) diff --git a/src/mirall/mirallconfigfile.cpp b/src/mirall/mirallconfigfile.cpp index ba698b7ad..44ba854ed 100644 --- a/src/mirall/mirallconfigfile.cpp +++ b/src/mirall/mirallconfigfile.cpp @@ -69,12 +69,12 @@ QString MirallConfigFile::excludeFile() const // Check alternative places... #ifdef Q_OS_WIN32 /* For win32, try to copy the conf file from the directory from where the app was started. */ - char buf[MAX_PATH+1]; + TCHAR buf[MAX_PATH+1]; int len = 0; /* Get the path from where the application was started */ - len = GetModuleFileName(NULL, buf, MAX_PATH); - QString exePath = QString::fromLocal8Bit(buf); + len = GetModuleFileNameW(NULL, buf, MAX_PATH); + QString exePath = QString::fromUtf16((ushort*)buf); exePath.remove("owncloud.exe"); fi.setFile(exePath, exclFile ); #endif