Bläddra i källkod

added cmake option for the predefined location of the fancontrol config file

Malte Veerman 9 år sedan
förälder
incheckning
47df9fdc85
2 ändrade filer med 7 tillägg och 1 borttagningar
  1. 2 0
      CMakeLists.txt
  2. 5 1
      lib/src/loader.cpp

+ 2 - 0
CMakeLists.txt

@@ -12,7 +12,9 @@ option(INSTALL_HELPER "Install the KHelper" ON)
 
 #variables
 set(STANDARD_SERVICE_NAME "fancontrol" CACHE STRING "The name of the systemd service for the fancontrol script")
+set(STANDARD_CONFIG_FILE "/etc/fancontrol" CACHE STRING "The location of the standard config file for the fancontrol script")
 add_definitions(-DSTANDARD_SERVICE_NAME="${STANDARD_SERVICE_NAME}")
+add_definitions(-DSTANDARD_CONFIG_FILE="${STANDARD_CONFIG_FILE}")
 
 
 #KCM can't be build without systemd support

+ 5 - 1
lib/src/loader.cpp

@@ -34,13 +34,17 @@
 
 #define HWMON_PATH "/sys/class/hwmon"
 
+#ifndef STANDARD_CONFIG_FILE
+#define STANDARD_CONFIG_FILE "/etc/fancontrol"
+#endif
+
 
 namespace Fancontrol
 {
 
 Loader::Loader(QObject *parent) : QObject(parent),
     m_interval(10),
-    m_configUrl(QUrl::fromLocalFile("/etc/fancontrol")),
+    m_configUrl(QUrl::fromLocalFile(STANDARD_CONFIG_FILE)),
     m_error(""),
     m_timer(new QTimer(this))
 {