Explorar el Código

Use a macro THEME_CLASS from CMakeLists.txt instead of ifdefs.

Klaas Freitag hace 13 años
padre
commit
a9c7b9304e
Se han modificado 3 ficheros con 7 adiciones y 5 borrados
  1. 1 0
      CMakeLists.txt
  2. 4 0
      config.h.in
  3. 2 5
      src/mirall/application.cpp

+ 1 - 0
CMakeLists.txt

@@ -37,6 +37,7 @@ find_package(INotify)
 
 set(WITH_CSYNC CSYNC_FOUND)
 set(USE_INOTIFY ${INOTIFY_FOUND})
+set(THEME_CLASS "ownCloudTheme")
 
 configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
 

+ 4 - 0
config.h.in

@@ -1,4 +1,8 @@
+#ifndef CONFIG_H
+#define CONFIG_H
 
 #cmakedefine USE_INOTIFY 1
 #cmakedefine WITH_CSYNC 1
 
+#cmakedefine THEME_CLASS @THEME_CLASS@
+#endif

+ 2 - 5
src/mirall/application.cpp

@@ -75,15 +75,12 @@ Application::Application(int &argc, char **argv) :
     _networkMgr(new QNetworkConfigurationManager(this)),
 #endif
     _contextMenu(0),
+    _theme(0),
     _updateDetector(0),
     _helpOnly(false)
 {
 
-#ifdef OWNCLOUD_CLIENT
-    _theme = new ownCloudTheme();
-#else
-    _theme = new mirallTheme();
-#endif
+    _theme = new THEME_CLASS;
     setApplicationName( _theme->appName() );
     setWindowIcon( _theme->applicationIcon() );