forked from deepin-community/kf6-kconfig
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configuration settings framework for Qt Issue: deepin-community/sig-deepin-sysdev-team#558 Log: update repo
- Loading branch information
Showing
439 changed files
with
148,318 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#clang-format/tidy | ||
8bed00ab34e31f2b9c70026d418d923913325798 | ||
48c132be8aa983165126b0641a083848dd5c6620 | ||
06ca3b8c62989f59ca348606dfd4eda9e3ee3ec0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# SPDX-FileCopyrightText: 2020 Volker Krause <[email protected]> | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
include: | ||
- project: sysadmin/ci-utilities | ||
file: | ||
- /gitlab-templates/linux-qt6.yml | ||
- /gitlab-templates/linux-qt6-static.yml | ||
- /gitlab-templates/android-qt6.yml | ||
- /gitlab-templates/freebsd-qt6.yml | ||
- /gitlab-templates/windows-qt6.yml | ||
- /gitlab-templates/alpine-qt6.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Dependencies: | ||
- 'on': ['@all'] | ||
'require': | ||
'frameworks/extra-cmake-modules': '@same' | ||
|
||
Options: | ||
test-before-installing: True | ||
require-passing-tests-on: [ 'Linux', 'FreeBSD', 'Windows' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
set(KF_VERSION "6.8.0") # handled by release scripts | ||
project(KConfig VERSION ${KF_VERSION}) | ||
|
||
include(FeatureSummary) | ||
find_package(ECM 6.8.0 NO_MODULE) | ||
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") | ||
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) | ||
|
||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) | ||
|
||
include(KDEInstallDirs) | ||
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) | ||
include(KDECMakeSettings) | ||
include(KDEGitCommitHooks) | ||
|
||
include(ECMGenerateExportHeader) | ||
include(ECMSetupVersion) | ||
include(ECMGenerateHeaders) | ||
include(ECMMarkNonGuiExecutable) | ||
include(ECMPoQmTools) | ||
include(ECMAddQch) | ||
include(ECMQtDeclareLoggingCategory) | ||
include(ECMDeprecationSettings) | ||
|
||
set(REQUIRED_QT_VERSION 6.5.0) | ||
|
||
find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Xml) | ||
option(KCONFIG_USE_GUI "Build components using Qt6Gui" ON) | ||
if(KCONFIG_USE_GUI) | ||
find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Gui) | ||
endif() | ||
|
||
option(KCONFIG_USE_QML "Build components using Qt6Qml" ON) | ||
|
||
if(KCONFIG_USE_QML) | ||
include(ECMQmlModule) | ||
find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Qml Quick) | ||
endif() | ||
|
||
# shall we use DBus? | ||
# enabled per default on Linux & BSD systems | ||
set(USE_DBUS_DEFAULT OFF) | ||
if(UNIX AND NOT APPLE AND NOT ANDROID AND NOT HAIKU) | ||
set(USE_DBUS_DEFAULT ON) | ||
endif() | ||
option(USE_DBUS "Build components using DBus" ${USE_DBUS_DEFAULT}) | ||
if(USE_DBUS) | ||
find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED DBus) | ||
set(KCONFIG_USE_DBUS ON) | ||
endif() | ||
|
||
set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].") | ||
|
||
option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) | ||
add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") | ||
|
||
set(kconfig_version_header "${CMAKE_CURRENT_BINARY_DIR}/src/core/kconfig_version.h") | ||
ecm_setup_version(PROJECT VARIABLE_PREFIX KCONFIG | ||
VERSION_HEADER "${kconfig_version_header}" | ||
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6ConfigConfigVersion.cmake" | ||
SOVERSION 6) | ||
|
||
ecm_set_disabled_deprecation_versions( | ||
QT 6.5 | ||
) | ||
|
||
add_subdirectory(src) | ||
if(BUILD_TESTING) | ||
add_subdirectory(autotests) | ||
endif() | ||
|
||
include (ECMPoQmTools) | ||
ecm_install_po_files_as_qm(poqm) | ||
|
||
|
||
# create a Config.cmake and a ConfigVersion.cmake file and install them | ||
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6Config") | ||
|
||
if(BUILD_QCH) | ||
ecm_install_qch_export( | ||
TARGETS KF6Config_QCH | ||
FILE KF6ConfigQchTargets.cmake | ||
DESTINATION "${CMAKECONFIG_INSTALL_DIR}" | ||
COMPONENT Devel | ||
) | ||
set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6ConfigQchTargets.cmake\")") | ||
endif() | ||
|
||
include(CMakePackageConfigHelpers) | ||
|
||
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KF6ConfigConfig.cmake.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/KF6ConfigConfig.cmake" | ||
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} | ||
) | ||
|
||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KF6ConfigConfig.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/KF6ConfigConfigVersion.cmake" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/KF6ConfigMacros.cmake" | ||
DESTINATION "${CMAKECONFIG_INSTALL_DIR}" | ||
COMPONENT Devel ) | ||
|
||
|
||
install(EXPORT KF6ConfigTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" | ||
FILE KF6ConfigTargets.cmake NAMESPACE KF6:: COMPONENT Devel) | ||
|
||
|
||
install(EXPORT KF6ConfigCompilerTargets DESTINATION "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6Config" | ||
FILE KF6ConfigCompilerTargets.cmake NAMESPACE KF6:: COMPONENT Devel) | ||
|
||
install(FILES ${kconfig_version_header} | ||
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KConfig COMPONENT Devel) | ||
|
||
|
||
include(ECMFeatureSummary) | ||
ecm_feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) | ||
|
||
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
If you add a major new feature, suggest using it in | ||
http://techbase.kde.org/Development/Tutorials/KConfig | ||
|
||
kconfigdata_p.h contains definitions of the data formats used by kconfig. | ||
|
||
Configuration entries are stored as "KEntry". They are indexed with "KEntryKey". | ||
The primary store is a "KEntryMap" which is defined as a std::map from "KEntryKey" | ||
to "KEntry" | ||
|
||
KEntry's are stored in order in the KEntryMap. The most significant sort | ||
criteria is mGroup. This means that all entries who belong in the same group, | ||
are grouped in the std::map as well. | ||
|
||
The start of a group is indicated with a KEntryKey with an empty mKey and a | ||
dummy KEntry. This allows us to search for the start of the group and then to | ||
iterate until we end up in another group. That way we will find all entries | ||
of a certain group. | ||
|
||
Entries that are localised with the _current_ locale are stored with bLocal | ||
set to true. Entries that are localised with another locale are either not | ||
stored at all (default), or with the localization as part of the key and bRaw | ||
set to true (when reading a file in order to merge it). | ||
|
||
Entries that are being read from a location other than the location to | ||
which is written back are marked as "default" and will be added both as | ||
normal entry as well as an entry with the key marked as default. | ||
|
||
When the configuration is synced to disk, the current on-disk state is re-read | ||
into a temporary map, updated with dirty (modified) entries from the | ||
current config object's entry map and then written back. | ||
|
||
|
||
Note that there is a subtle difference between revertToDefault() and deleteEntry(). | ||
revertToDefault() will change the entry to the default value set by the system | ||
administrator (Via e.g. $KDEDIR/share/config) or, if no such default was set, | ||
non-existent. | ||
deleteEntry() will make the entry non-existent. If if the system administrator | ||
has specified a default value, the local entry is marked with [$d]. | ||
|
||
Entries are marked "immutable" if the key is followed by [$i] (e.g. 'key[$i]=value'); | ||
groups are marked "immutable" if the group is followed by [$i] (.e.g '[GroupName][$i]'). | ||
An "immutable" entry/group cannot be overriden by the user. | ||
|
||
For more details see docs/options.md. | ||
|
||
|
||
------------------------------------------------------------------------------ | ||
|
||
KConfig XT | ||
========== | ||
|
||
My buzzword picker offered KConfig XT ("eXtended Technology") and KConfig NG | ||
("Next Generation"). Since the planned changes are meant to be evolutionary | ||
rather than revolutionary, KConfig NG was dropped. | ||
|
||
Goals | ||
===== | ||
|
||
* Have the default value for config entries defined in 1 place. Currently it is | ||
not uncommon to have them defined in three places: | ||
1) In the application that reads the setting in order to use it | ||
2) In the settings dialog when reading the setting | ||
3) In the settings dialog when selecting "Use defaults". | ||
|
||
* Provide type-information about config entries to facilate "KConfEdit" like | ||
tools. Ideally type-information also includes range-information; this is even | ||
mandatory if enums become an explicit type. | ||
|
||
* Facilitate the documentation of config entries. | ||
|
||
KCoreConfigSkeleton | ||
| | ||
v | ||
KConfigSkeleton /--< myapp.kcfg | ||
| / | ||
|*---------------< | ||
|kconfig_compiler \ | ||
| \--< myconfig.kcfgc | ||
v | ||
MyConfig <-----KConfigDialogManager----> MyConfigWidget *---< myconfigwidget.ui | ||
uic | ||
|
||
KCoreConfigSkeleton/ base class for deriving classes that store application | ||
KConfigSkeleton: specific options providing type-safety and single-point | ||
defaults. | ||
|
||
MyConfig: An application specific class that offers configuration options | ||
to the applications via variables or accessor functions and that | ||
handles type-safety and defaults. MyConfig is just an example | ||
name, the application developer choses the actual name. | ||
|
||
myapp.kcfg: File describing the configuration options used by a specific | ||
application. myapp.kcfg is just an example name, the application | ||
developer choses the actual name. | ||
|
||
myconfig.kcfgc: Implementation specific code generation instructions | ||
for the MyConfig class. myconfig.kcfgc is | ||
just an example name, the application developer | ||
choses the actual name. | ||
|
||
KConfigDialogManager: Class that links widgets in a dialog up with their | ||
corresponding configuration options in a configuration | ||
object derived from KConfigSkeleton. | ||
|
||
MyConfigWidget: Dialog generated from a .ui description file. Widget names | ||
in the dialog that start with "kcfg_" refer to configuration | ||
options. | ||
|
||
See http://techbase.kde.org/Development/Tutorials/Using_KConfig_XT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@PACKAGE_INIT@ | ||
|
||
# Any changes in this ".cmake" file will be overwritten by CMake, the source is the ".cmake.in" file. | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/KF6ConfigTargets.cmake") | ||
@PACKAGE_INCLUDE_QCHTARGETS@ | ||
|
||
include(CMakeFindDependencyMacro) | ||
|
||
if(NOT @BUILD_SHARED_LIBS@) | ||
find_dependency(Qt6Xml @REQUIRED_QT_VERSION@) | ||
endif() | ||
|
||
if(@KCONFIG_USE_DBUS@) | ||
find_dependency(Qt6DBus "@REQUIRED_QT_VERSION@") | ||
endif() | ||
|
||
if(@KCONFIG_USE_QML@) | ||
find_dependency(Qt6Qml "@REQUIRED_QT_VERSION@") | ||
endif() | ||
|
||
if(CMAKE_CROSSCOMPILING AND KF6_HOST_TOOLING) | ||
find_file(KCONFIGCOMPILER_PATH KF6Config/KF6ConfigCompilerTargets.cmake | ||
PATHS ${KF6_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} | ||
NO_DEFAULT_PATH | ||
NO_CMAKE_FIND_ROOT_PATH) | ||
include("${KCONFIGCOMPILER_PATH}") | ||
else() | ||
include("${CMAKE_CURRENT_LIST_DIR}/KF6ConfigCompilerTargets.cmake") | ||
endif() | ||
include("${CMAKE_CURRENT_LIST_DIR}/KF6ConfigMacros.cmake") |
Oops, something went wrong.