diff --git a/CMakeLists.txt b/CMakeLists.txt index ba7c9f4..d2efb7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,12 @@ set(PROJECT_VERSION "5.17.80") set(QT_MIN_VERSION "5.12.0") set(KF5_MIN_VERSION "5.62.0") +set(SDDM_CONFIG_FILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf" CACHE PATH "Path of the sddm config file") +set(SDDM_CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf.d" CACHE PATH "Path of the sddm config directory") +set(SDDM_SYSTEM_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/sddm/sddm.conf.d" CACHE PATH "Path of the system sddm config directory") +set(XSESSIONS_DIR "${CMAKE_INSTALL_PREFIX}/share/xsessions" CACHE PATH "Path of the xsessions") +set(WAYLAND_SESSIONS_DIR "${CMAKE_INSTALL_PREFIX}/share/wayland-sessions" CACHE PATH "Path of the wayland sessions") + find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) include(ECMInstallIcons) @@ -32,6 +38,8 @@ if (EXISTS "${CMAKE_SOURCE_DIR}/.git") add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000) endif() +configure_file(config.h.in config.h IMMEDIATE @ONLY) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_definitions(-DTRANSLATION_DOMAIN=\"kcm_sddm\") add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT) diff --git a/sddmauthhelper.cpp b/sddmauthhelper.cpp index c8682ee..b8bb5b2 100644 --- a/sddmauthhelper.cpp +++ b/sddmauthhelper.cpp @@ -36,6 +36,8 @@ #include #include +#include "config.h" + static QSharedPointer openConfig(const QString &filePath) { QFile file(filePath); @@ -212,8 +214,8 @@ ActionReply SddmAuthHelper::reset(const QVariantMap &args) ActionReply SddmAuthHelper::save(const QVariantMap &args) { ActionReply reply = ActionReply::HelperErrorReply(); - QSharedPointer sddmConfig = openConfig(args[QStringLiteral("kde_settings.conf")].toString()); - QSharedPointer sddmOldConfig = openConfig(args[QStringLiteral("sddm.conf")].toString()); + QSharedPointer sddmConfig = openConfig(QStringLiteral(SDDM_CONFIG_DIR "/kde.conf")); + QSharedPointer sddmOldConfig = openConfig(QStringLiteral(SDDM_CONFIG_FILE)); QSharedPointer themeConfig; QString themeConfigFile = args[QStringLiteral("theme.conf.user")].toString(); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6ba125d..dfb53de 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,12 +1,3 @@ -set(SDDM_CONFIG_FILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf" CACHE PATH "Path of the sddm config file") -set(SDDM_CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf.d" CACHE PATH "Path of the sddm config directory") -set(SDDM_SYSTEM_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/sddm/sddm.conf.d" CACHE PATH "Path of the system sddm config directory") -set(XSESSIONS_DIR "${CMAKE_INSTALL_PREFIX}/share/xsessions" CACHE PATH "Path of the xsessions") -set(WAYLAND_SESSIONS_DIR "${CMAKE_INSTALL_PREFIX}/share/wayland-sessions" CACHE PATH "Path of the wayland sessions") - -configure_file(config.h.in config.h IMMEDIATE @ONLY) -# add_subdirectory(configwidgets) - include_directories(configwidgets) set(SDDM_KCM_SRCS diff --git a/src/config.h.in b/src/config.h.in deleted file mode 100644 index 6180bd1..0000000 --- a/src/config.h.in +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#define SDDM_CONFIG_FILE "@SDDM_CONFIG_FILE@" -#define SDDM_CONFIG_DIR "@SDDM_CONFIG_DIR@" -#define SDDM_SYSTEM_CONFIG_DIR "@SDDM_SYSTEM_CONFIG_DIR@" -#define XSESSIONS_DIR "@XSESSIONS_DIR@" -#define WAYLAND_SESSIONS_DIR "@WAYLAND_SESSIONS_DIR@" - -#endif //CONFIG_H