Переглянути джерело

Renamed some files and extended the use of the helper id variable

Malte Veerman 6 роки тому
батько
коміт
b23a49e877

+ 1 - 1
CMakeLists.txt

@@ -15,7 +15,7 @@ option(INSTALL_POLKIT "Install polkit files and rules" OFF)
 #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")
-set(STANDARD_HELPER_ID "fancontrol.gui.helper" CACHE STRING "The standard id for the KAuth helper")
+set(STANDARD_HELPER_ID "org.kde.fancontrol.gui.helper" CACHE STRING "The standard id for the KAuth helper")
 set(POLKIT_GROUP_NAME "fancontrol" CACHE STRING "The group which is granted elevated permissions by polkit to manipulate fancontrol")
 add_definitions(-DSTANDARD_SERVICE_NAME="${STANDARD_SERVICE_NAME}")
 add_definitions(-DSTANDARD_CONFIG_FILE="${STANDARD_CONFIG_FILE}")

+ 9 - 5
helper/CMakeLists.txt

@@ -14,9 +14,13 @@ endif(NOT NO_SYSTEMD)
 
 find_package(KF5Auth REQUIRED)
 
-add_executable(fancontrol-gui-helper src/helper.cpp)
-target_link_libraries(fancontrol-gui-helper ${LIBRARIES})
-install(TARGETS fancontrol-gui-helper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
+add_executable(fancontrol_gui-helper src/helper.cpp)
+target_link_libraries(fancontrol_gui-helper ${LIBRARIES})
+install(TARGETS fancontrol_gui-helper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
 
-kauth_install_helper_files(fancontrol-gui-helper fancontrol.gui.helper root)
-kauth_install_actions(fancontrol.gui.helper fancontrol_gui.actions)
+configure_file(helper.actions.in helper.actions @ONLY)
+configure_file(helper.conf.in ${STANDARD_HELPER_ID}.conf @ONLY)
+configure_file(helper.service.in ${STANDARD_HELPER_ID}.service @ONLY)
+
+kauth_install_helper_files(fancontrol_gui-helper ${STANDARD_HELPER_ID} root)
+kauth_install_actions(${STANDARD_HELPER_ID} ${CMAKE_CURRENT_BINARY_DIR}/helper.actions)

+ 0 - 4
helper/fancontrol.gui.helper.service

@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=fancontrol.gui.helper
-Exec=/usr/lib/kauth/fancontrol-gui-helper
-User=root

+ 1 - 1
helper/fancontrol_gui.actions → helper/helper.actions.in

@@ -2,7 +2,7 @@
 Name=Fancontrol-GUI
 URL=http://github.com/maldela/fancontrol-gui
 
-[fancontrol.gui.helper.action]
+[@STANDARD_HELPER_ID@.action]
 Name=Action with su rights
 Description=This action requires superuser rights.
 Policy=auth_admin

+ 1 - 1
helper/fancontrol.gui.helper.conf → helper/helper.conf.in

@@ -5,7 +5,7 @@
 
   <!-- Only user root can own the foo helper -->
   <policy user="root">
-    <allow own="fancontrol.gui.helper"/>
+    <allow own="@STANDARD_HELPER_ID@"/>
   </policy>
 
 </busconfig>

+ 4 - 0
helper/helper.service.in

@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=@STANDARD_HELPER_ID@
+Exec=/usr/lib/kauth/fancontrol_gui-helper
+User=root

+ 1 - 1
helper/src/helper.cpp

@@ -34,7 +34,7 @@
 
 
 #ifndef STANDARD_HELPER_ID
-#define STANDARD_HELPER_ID "fancontrol.gui.helper"
+#define STANDARD_HELPER_ID "org.kde.fancontrol.gui.helper"
 #endif
 
 

+ 2 - 2
kcm/CMakeLists.txt

@@ -12,8 +12,8 @@ add_library(kcm_fancontrol MODULE src/fancontrolkcm.cpp)
 target_link_libraries(kcm_fancontrol ${LIBRARIES})
 
 install(TARGETS kcm_fancontrol DESTINATION "${KDE_INSTALL_QTPLUGINDIR}/kcms")
-install(PROGRAMS fancontrol-kcm.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
+install(PROGRAMS kcm_fancontrol.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
 
 kpackage_install_package(package org.kde.fancontrol.kcm kcms)
 
-kcoreaddons_desktop_to_json(kcm_fancontrol "fancontrol-kcm.desktop" SERVICE_TYPES kcmodule.desktop)
+kcoreaddons_desktop_to_json(kcm_fancontrol "kcm_fancontrol.desktop" SERVICE_TYPES kcmodule.desktop)

+ 0 - 0
kcm/fancontrol-kcm.desktop → kcm/kcm_fancontrol.desktop


+ 1 - 0
kcm/package/metadata.desktop

@@ -6,6 +6,7 @@ Icon=org.kde.fancontrol.gui
 Encoding=UTF-8
 Keywords=
 Type=Service
+
 X-KDE-PluginInfo-Author=Malte Veerman
 X-KDE-PluginInfo-Email=malte.veerman@gmail.com
 X-KDE-PluginInfo-License=GPL

+ 1 - 1
kcm/src/fancontrolkcm.cpp

@@ -26,7 +26,7 @@
 #include <KI18n/KLocalizedString>
 
 
-K_PLUGIN_FACTORY_WITH_JSON(FancontrolKCMFactory, "fancontrol-kcm.json", registerPlugin<FancontrolKCM>();)
+K_PLUGIN_FACTORY_WITH_JSON(FancontrolKCMFactory, "kcm_fancontrol.json", registerPlugin<FancontrolKCM>();)
 
 
 FancontrolKCM::FancontrolKCM(QObject *parent, const QVariantList& args)

+ 1 - 0
plasmoid/package/metadata.desktop

@@ -4,6 +4,7 @@ Name=Fancontrol
 Name[hu]=Ventilátorvezérlés
 Comment=Plasmoid to observe and control fan speeds.
 Comment[hu]=Plasmoid a ventilátorok megfigyelésére és sebességük vezérlésre.
+Icon=org.kde.fancontrol.gui
 Type=Service
 
 X-KDE-PluginInfo-Author=Malte Veerman

+ 2 - 2
polkit/CMakeLists.txt

@@ -1,3 +1,3 @@
-configure_file(org.kde.fancontrol.rules.in org.kde.fancontrol.rules @ONLY)
+configure_file(rules.in ${STANDARD_HELPER_ID}.rules @ONLY)
 
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.kde.fancontrol.rules" DESTINATION "/etc/polkit-1/rules.d")
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${STANDARD_HELPER_ID}.rules DESTINATION /etc/polkit-1/rules.d)

+ 0 - 0
polkit/org.kde.fancontrol.rules.in → polkit/rules.in