Settings: Add "homemade" XDG_CONFIG_DIRS support

The LXQt::Settings uses the Qt's QSettings which doesn't support the
xdg spec regarding th XDG_CONFIG_DIRS ->
https://bugreports.qt.io/browse/QTBUG-34919.

This commit adds a workaround by searching the directories for
system wide configuration file and if found, all keys from it are
copied into the user configuration file.
This commit is contained in:
Palo Kisa 2016-08-23 22:46:10 +02:00
parent 177ffdecde
commit 524a6062b3
1 changed files with 7 additions and 0 deletions

View File

@ -124,6 +124,7 @@ list(APPEND CMAKE_MODULE_PATH
)
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
option(WITH_XDG_DIRS_FALLBACK "Use our XDG_CONFIG_DIRS fallback" ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@ -325,6 +326,12 @@ target_compile_definitions(${LXQT_LIBRARY_NAME}
PRIVATE "$<$<CONFIG:Release>:QT_NO_WARNING_OUTPUT>"
)
if (WITH_XDG_DIRS_FALLBACK)
target_compile_definitions(${LXQT_LIBRARY_NAME}
PRIVATE "WITH_XDG_DIRS_FALLBACK"
)
endif ()
target_include_directories(${LXQT_LIBRARY_NAME}
INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${LXQT_LIBRARY_NAME}>"
INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${LXQT_LIBRARY_NAME}/LXQt>"