Jelajahi Sumber

Linux: fix build with -DLINUX_X11POWER=on

This was pointed out by a user. Oops.

The changes in PowerComponent.cpp are not strictly necessary and could
be considered an unrelated cleanup.
Vincent Lang 7 tahun lalu
induk
melakukan
a4694b221f
2 mengubah file dengan 6 tambahan dan 6 penghapusan
  1. 2 2
      src/power/CMakeLists.txt
  2. 4 4
      src/power/PowerComponent.cpp

+ 2 - 2
src/power/CMakeLists.txt

@@ -4,9 +4,9 @@ if(APPLE)
   add_sources(PowerComponentMac.cpp PowerComponentMac.h)
 endif(APPLE)
 
-if(USE_X11POWER)
+if(LINUX_X11POWER)
   add_sources(PowerComponentX11.cpp PowerComponentX11.h)
-endif(USE_X11POWER)
+endif(LINUX_X11POWER)
 
 if(LINUX_DBUS)
   add_sources(PowerComponentDBus.cpp PowerComponentDBus.h)

+ 4 - 4
src/power/PowerComponent.cpp

@@ -8,9 +8,9 @@
 
 #ifdef Q_OS_MAC
 #include "PowerComponentMac.h"
-#elif LINUX_DBUS
+#elif defined(LINUX_DBUS)
 #include "PowerComponentDBus.h"
-#elif USE_X11POWER
+#elif defined(USE_X11POWER)
 #include "PowerComponentX11.h"
 #elif defined(Q_OS_WIN32)
 #include "PowerComponentWin.h"
@@ -22,10 +22,10 @@ PowerComponent& PowerComponent::Get()
 #ifdef Q_OS_MAC
   static PowerComponentMac instance;
   return instance;
-#elif LINUX_DBUS
+#elif defined(LINUX_DBUS)
   static PowerComponentDBus instance;
   return instance;
-#elif USE_X11POWER
+#elif defined(USE_X11POWER)
   static PowerComponentX11 instance;
   return instance;
 #elif defined(Q_OS_WIN32)