From 9003f36ba25426aa28db505384cc50b426e6505b Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Mon, 25 Jul 2022 13:30:27 +0200
Subject: Tidy up GSettings
---
CMakeLists.txt | 6 ++++--
config.h.in | 1 +
share/logdiag.gschema.xml | 16 ++++++++++++++++
share/org.logdiag.gschema.xml | 17 -----------------
src/ld-window-main.c | 2 +-
src/logdiag.c | 8 ++++----
6 files changed, 26 insertions(+), 24 deletions(-)
create mode 100644 share/logdiag.gschema.xml
delete mode 100644 share/org.logdiag.gschema.xml
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3518f5e..a09368b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,7 @@ option (OPTION_GTKDOC "For developers only--enable use of gtk-doc" OFF)
option (BUILD_TESTING "Build tests" OFF)
# Project information
+set (project_ID "name.janouch.${PROJECT_NAME}")
set (project_URL "https://git.janouch.name/p/logdiag")
# For custom modules
@@ -245,7 +246,7 @@ if (NOT GLIB_COMPILE_SCHEMAS_EXECUTABLE)
endif ()
set (GSETTINGS_DIR "${PROJECT_SOURCE_DIR}/share")
-set (GSETTINGS_SCHEMAS "${GSETTINGS_DIR}/org.logdiag.gschema.xml")
+set (GSETTINGS_SCHEMAS "${GSETTINGS_DIR}/${PROJECT_NAME}.gschema.xml")
if (OPTION_NOINSTALL)
set (GSETTINGS_COMPILED_SCHEMA "${PROJECT_BINARY_DIR}/gschemas.compiled")
@@ -391,7 +392,8 @@ endif ()
install (DIRECTORY docs/user-guide DESTINATION share/doc/${PROJECT_NAME})
install (DIRECTORY share/library DESTINATION share/${PROJECT_NAME})
-install (FILES ${GSETTINGS_SCHEMAS} DESTINATION share/glib-2.0/schemas)
+install (FILES ${GSETTINGS_SCHEMAS} DESTINATION share/glib-2.0/schemas
+ RENAME "${project_ID}.gschema.xml")
install (CODE " # DESTDIR is not in use on Windows (WIN32 is only native here!)
if (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")
execute_process (COMMAND \"${GLIB_COMPILE_SCHEMAS_EXECUTABLE}\"
diff --git a/config.h.in b/config.h.in
index e7c7e5d..3f1214a 100644
--- a/config.h.in
+++ b/config.h.in
@@ -10,6 +10,7 @@
#define PROJECT_NAME "${PROJECT_NAME}"
#define PROJECT_VERSION "${PROJECT_VERSION}"
+#define PROJECT_ID "${project_ID}"
#define PROJECT_URL "${project_URL}"
#cmakedefine OPTION_NOINSTALL
diff --git a/share/logdiag.gschema.xml b/share/logdiag.gschema.xml
new file mode 100644
index 0000000..0020369
--- /dev/null
+++ b/share/logdiag.gschema.xml
@@ -0,0 +1,16 @@
+