KConfig merge requests
https://invent.kde.org/frameworks/kconfig/-/merge_requests
2024-03-23T15:34:27Z
https://invent.kde.org/frameworks/kconfig/-/merge_requests/285
Guard header with an ifndef and include moc generates sources in the cpp file
2024-03-23T15:34:27Z
ivan tkachenko
Guard header with an ifndef and include moc generates sources in the cpp file
ivan tkachenko
ivan tkachenko
https://invent.kde.org/frameworks/kconfig/-/merge_requests/284
Reapply "don't create root-only readable files in /etc/xdg"
2024-03-20T21:24:42Z
Harald Sitter
Reapply "don't create root-only readable files in /etc/xdg"
This reverts commit f92f091dad477718e3f486626215008bad5ab11d. (landed by accident without review)
This reverts commit f92f091dad477718e3f486626215008bad5ab11d. (landed by accident without review)
Harald Sitter
Harald Sitter
https://invent.kde.org/frameworks/kconfig/-/merge_requests/281
avoid allocations while parsing int/float lists
2024-03-24T11:09:22Z
Waqar Ahmed
avoid allocations while parsing int/float lists
https://invent.kde.org/frameworks/kconfig/-/merge_requests/280
Read defaults from Windows registry
2024-02-23T13:03:24Z
Tobias Fella
Read defaults from Windows registry
<del>Draft: Not entirely tested yet. Immutability, cascading, subgroups, etc. might still be a bit broken.</del>
Replaces !146. In the current iteration, the registry key is not configurable. That can be changed, if desired.
This allow...
<del>Draft: Not entirely tested yet. Immutability, cascading, subgroups, etc. might still be a bit broken.</del>
Replaces !146. In the current iteration, the registry key is not configurable. That can be changed, if desired.
This allows KConfig-based Software to be configured under Windows through Group
Policies.
The KConfig values are stored under `[HKLM,HKCU]\Software\<OrganizationName>\<ConfigFileName>` ("regKey")
Keys below this key are treated as configuration
groups. Arbitrary subgroup hierarchies are supported. Values below a registry key corresponding to a certain (sub)group are treated as values in that KConfig group. Values below the regKey key (of this config file) are treated as values of the default group.
To add a key to a (sub)group create a subkey under regKey or an existing (sub)group and
add the value in this group with type REG_SZ or REG_EXPAND_SZ.
Immutable groups or values can be suffixed with [$i].
The values are read from `HKLM` and `HKCU` and treated as defaults. This means that writing back to the registry through KConfig is not intended or suppported.
Tobias Fella
Tobias Fella
https://invent.kde.org/frameworks/kconfig/-/merge_requests/277
ksharedconfig: move statercs to state dir
2024-03-05T13:18:54Z
Harald Sitter
ksharedconfig: move statercs to state dir
KF6
Harald Sitter
Harald Sitter
https://invent.kde.org/frameworks/kconfig/-/merge_requests/273
KDesktopFile::noDisplay: Decide based on XDG_CURRENT_DESKTOP variable
2024-03-21T08:34:53Z
Andrew Shark
KDesktopFile::noDisplay: Decide based on XDG_CURRENT_DESKTOP variable
The check for not showing the desktop file was previously incorrect (only checked against "KDE" string) and was removed in 96c6a371.
This MR implements it correctly, based on `XDG_CURRENT_DESKTOP` environment variable. The similar code ...
The check for not showing the desktop file was previously incorrect (only checked against "KDE" string) and was removed in 96c6a371.
This MR implements it correctly, based on `XDG_CURRENT_DESKTOP` environment variable. The similar code can be found in `KService::noDisplay()`.
https://invent.kde.org/frameworks/kconfig/-/merge_requests/260
kconf_update: print error messages, and more debug in testMode
2023-11-26T16:22:51Z
Méven Car
kconf_update: print error messages, and more debug in testMode
So that I can have errors printed when the script fails and standard output in testMode and allow to load script from local path in testMode.
```
$ ~/kde6/build/kconfig/bin/kconf_update --testmode --debug ./directorycount-enum.upd
Auto...
So that I can have errors printed when the script fails and standard output in testMode and allow to load script from local path in testMode.
```
$ ~/kde6/build/kconfig/bin/kconf_update --testmode --debug ./directorycount-enum.upd
Automatically enabled the debug logging category kf.config.kconf_update
kf.config.kconf_update: Checking update-file "./directorycount-enum.upd" for new updates
kf.config.kconf_update: "directorycount-enum.upd" : Found new update "\"directorycount-enum\""
kf.config.kconf_update: "directorycount-enum.upd" : 3 :' "Script=directorycount-enum.py,python3" ': Loading local script "directorycount-enum.py" should be installed to "/home/meven/kde6/usr/lib/x86_64-linux-gnu/kconf_update_bin/directorycount-enum.py"
kf.config.kconf_update: "directorycount-enum.upd" : Running script "directorycount-enum.py"
kf.config.kconf_update: "About to run /usr/bin/python3 directorycount-enum.py"
kf.config.kconf_update: Script contents is:
#!/usr/bin/env python
import os
import shutil
from tempfile import mkstemp
home = os.environ['HOME']
dolphin_config_file = home + "/.config/dolphinrc"
fd, name = mkstemp()
fout = open(name, 'w')
with open(dolphin_config_file, 'r', encoding='utf-8') as dolphinrc:
for line in dolphinrc.readlines():
if line.startswith("DirectorySizeCount=true"):
fout.write("DirectorySizeCount=DirectorySizeOneOneLevel\n")
elif line.startswith("DirectorySizeCount=false"):
fout.write("DirectorySizeCount=DirectorySizeRecursive\n")
else:
fout.write(line)
shutil.move(name, dolphin_config_file)
kf.config.kconf_update: Successfully ran "/usr/bin/python3"
```
https://invent.kde.org/frameworks/kconfig/-/merge_requests/245
Draft: KConfigPrivate: use QByteArray key API, for no double conversion w/ QS...
2023-10-25T21:25:38Z
Friedrich W. H. Kossebau
Draft: KConfigPrivate: use QByteArray key API, for no double conversion w/ QString
KConfigGroup supports both QString & const char* types for key.
The QString API has been implemented in terms of the const char* one.
KConfigPrivate was taking those pointers, to create new QByteArray
instances with deep copies from them...
KConfigGroup supports both QString & const char* types for key.
The QString API has been implemented in terms of the const char* one.
KConfigPrivate was taking those pointers, to create new QByteArray
instances with deep copies from them when calling into the KEntryMap API.
That resulted in double deep QByteArray instance creation with
KConfigGroup's QString key API:
QString -> toUtf8(), from which the const char* data pointer was taken,
passed to KConfigPrivate which then ignored the just created QByteArray,
to generate another one.
This patch changes the KConfigPrivate API to take QByteArray references
instead, and have KConfigGroup's const char* API already create the
QByteArray instances, parallel to the QString ones,
This does not change anything effectively for the const char* code path,
but allows to pass one the UTF-8 QByteArray created from QStrings,
saving another memalloc on every call.
State: first rough version, where things build and tests pass as before.
Further notes: until there is some view-based API, it might make sense to change KConfig API to use QByteArray where currently const char* is used. That allows all the places which currently do not pass some pointer to some literals, but actually taken one from a QByteArray to actually pass that one, saving the deep copy otherwise happening.
To allow convenience code, there could be some template overload taking char[] array and forwarding with a QByteArrayLiteral created in the template code, if that works,
https://invent.kde.org/frameworks/kconfig/-/merge_requests/244
KStandardShortcut::findByName(name): use QAnyStringView arg type
2024-03-10T18:16:01Z
Friedrich W. H. Kossebau
KStandardShortcut::findByName(name): use QAnyStringView arg type
((Build on top of !243, only last commit is this very MR))
Actually only a few users of findByName() currently by what lxr reports, but those have different string types.
Given internally nothing requires a certain string instance type...
((Build on top of !243, only last commit is this very MR))
Actually only a few users of findByName() currently by what lxr reports, but those have different string types.
Given internally nothing requires a certain string instance type, this seems a valid candidate for using QAnyStringView.
Already spares runtime memalloc conversion in lib's own StandardShortcutWatcher.
https://invent.kde.org/frameworks/kconfig/-/merge_requests/235
Add a CMake function to add a kcfg file without kcfgc
2024-03-14T10:19:31Z
Arjen Hiemstra
Add a CMake function to add a kcfg file without kcfgc
kcfgc files are basically a list of arguments for how to genenerate the
config class. Rather than having to create a kcfgc file manually every
time, we can have CMake take care of generating the kcfgc file from
arguments passed to a func...
kcfgc files are basically a list of arguments for how to genenerate the
config class. Rather than having to create a kcfgc file manually every
time, we can have CMake take care of generating the kcfgc file from
arguments passed to a function. This removes a step of indirection that
always felt awkward to me.
Right now it just allows all possible values from the kcfgc files,
though a few where that are "true/false/list of values" are currently
just boolean flags. We may want to consider how many of these are still
actually useful though.
Arjen Hiemstra
Arjen Hiemstra
https://invent.kde.org/frameworks/kconfig/-/merge_requests/205
Draft: More Docs
2023-07-17T22:17:59Z
Thiago Sueto
herzenschein@gmail.com
Draft: More Docs
This MR:
* adds docs to classes that were lacking like KAuthorized, KDestopFile and KEmailSettings
* clarifies docs on the use of KConfig/KConfigGroup/KSharedConfig
* exposes classes and especially enums that weren't exposed before
* li...
This MR:
* adds docs to classes that were lacking like KAuthorized, KDestopFile and KEmailSettings
* clarifies docs on the use of KConfig/KConfigGroup/KSharedConfig
* exposes classes and especially enums that weren't exposed before
* links things, removes links to techbase
* reformats some lines to 80 chars
It's still missing:
- [ ] Mainpage.dox and README changes
- [ ] KConfigGroup which is massive
Thiago Sueto
herzenschein@gmail.com
Thiago Sueto
herzenschein@gmail.com
https://invent.kde.org/frameworks/kconfig/-/merge_requests/189
Fix: In some cases, the mutex needs to be unlocked
2023-05-18T12:54:02Z
zhang shoucheng
Fix: In some cases, the mutex needs to be unlocked
In some cases, QLockFile::lock() may not block, nor will the lock succeed. For example: the disk space is full, the user lacks permissions on the directory, etc.
For example: When the disk space is full, there are two threads accessing,...
In some cases, QLockFile::lock() may not block, nor will the lock succeed. For example: the disk space is full, the user lacks permissions on the directory, etc.
For example: When the disk space is full, there are two threads accessing, the first thread will cause the mutex to be locked, QFileLock::lock() will not block, nor will it be successfully locked. At this point the second thread will be blocked because the mutex is not unlocked
Signed-off-by: Shoucheng Zhang zhangshoucheng@kylinos.cn
https://invent.kde.org/frameworks/kconfig/-/merge_requests/188
Draft: Added KConfig::ConfigAssociation flag for config files, and deprecated...
2023-03-11T07:27:55Z
feature engineer
Draft: Added KConfig::ConfigAssociation flag for config files, and deprecated the...
Fixes issue [422529](https://bugs.kde.org/show_bug.cgi?id=422529):
The problem with the current situation is that KDE configuration files are all written to the base of the standard config path, and it makes it difficult to determine wh...
Fixes issue [422529](https://bugs.kde.org/show_bug.cgi?id=422529):
The problem with the current situation is that KDE configuration files are all written to the base of the standard config path, and it makes it difficult to determine which ones are in need of backing up \ purging if we want to clean plasma settings independently of KDE app settings, or KDE settings independently of other app settings.
The suggested fix is to require users of KConfig to specify the association of their app - is it a kde application, a plasma component, or "other".
I've added a KConfig::ConfigAssociation enum, which determines where this config belongs.
Currently, there are 3 associations:
1. NoAssociation retains the current behaviour, where the config file is written directly under the standard config path.
2. Plasma indicates this is a plasma component and should be saved under a sub-directory called plasma
3. KdeApp indicates this is a KDE application, and should be saved under a sub-directory called kde-app
The bulk of the logic resides in KConfig.cpp, under the new functions makeNewFileNameAndMigrate and getPrefix.
KSharedConfig.cpp also got refactored to share code between the deprecated and new openConfig function.
The only non-trivial decision I've made so far was to decide that state config should be saved with no association, as they don't require backing up or restoring. But we may want to create a "state" prefix for these.
There are several open issues:
1. How do we want to associate keyboard shortcut settings? Do we keep them outside, in kde-app, in plasma, or should we have a third category?
2. Will KConfigGui be exclusively used by kde applications, so we can write it to kde-app? or do we need to also deprecate its default constructor and require association?
3. Do you agree the KEmailSettings should be save to kde-app?
4. Where do we want kconf_updaterc to reside? (used by KonfUpdate (also, this name seems like a spelling error, it should probably have been KConfUpdate...)
5. There are also kreadconfig and kwriteconfig command line utilities which should probably get additional optional flag for association, and default to no association.
6. I wasn't able to fix all the tests to use the new interface, since I'm not familiar with the autotests framework.
I thought this is a big enough change to begin a merge, and take care of the other issues in a different pull request to make this one easier to follow, since it doesn't break anything yet except producing deprecation warnings, but I'm open to iteratively fix the above issues in this PR as well.
https://invent.kde.org/frameworks/kconfig/-/merge_requests/155
Use QFINDTESTDATA to find kconf_update executable
2023-01-11T13:11:44Z
Nicolas Fella
Use QFINDTESTDATA to find kconf_update executable
Instead of configuring a header to pass in the location
The cmake-based approach fails with multi-config generators
Instead of configuring a header to pass in the location
The cmake-based approach fails with multi-config generators
https://invent.kde.org/frameworks/kconfig/-/merge_requests/146
Read defaults from Windows registry
2024-02-20T16:14:50Z
Andre Heinecke
Read defaults from Windows registry
This optionally enables an application to define a Windows
registry key in which defaults are looked up. This allows
KDE Software to be configured under Windows through Group
Policies.
Keys below this key are treated as configuration
gr...
This optionally enables an application to define a Windows
registry key in which defaults are looked up. This allows
KDE Software to be configured under Windows through Group
Policies.
Keys below this key are treated as configuration
groups. Values below this key are treated as values
of the default group.
To add a key to a group create a subkey under regKey and
add the value in this group with type REG_SZ or REG_EXPAND_SZ.
Immutable groups or values can be suffixed with [$i].
The values are read from HKLM and HKCU and treated as defaults.
https://invent.kde.org/frameworks/kconfig/-/merge_requests/144
Fix kwindowstatesavertest on Wayland
2022-10-06T17:33:40Z
Elvis Angelaccio
Fix kwindowstatesavertest on Wayland
It seems that on Wayland a QWindow might return a different screen() after a resize.
(disclaimer: I haven't checked on other wayland compositors, so this
behavior might be a bug in kwin_wayland).
On my Wayland setup with two DisplayPort...
It seems that on Wayland a QWindow might return a different screen() after a resize.
(disclaimer: I haven't checked on other wayland compositors, so this
behavior might be a bug in kwin_wayland).
On my Wayland setup with two DisplayPort monitors, the QWindow of
the QFontDialog widget in kwindowstatesavertest reports "DP-1"
as its screen() after the first show() in testTopLevelDialog(),
and reports "DP-2" after the following resize().
This breaks the keys used by KWindowConfig::restoreWindowSize(). As
workaround for this behavior, if we fail to find the key for
window->screen(), we try all the screens reported by Qt.
I also had to increase a bit the qWait()s in the test itself, otherwise
the test would randomly fail even *after* this fix. Now instead it passes
every time reliably.
https://invent.kde.org/frameworks/kconfig/-/merge_requests/119
Make kcfg testfiles valid wrt kcfg.xsd
2022-02-25T20:22:32Z
Jos van den Oever
Make kcfg testfiles valid wrt kcfg.xsd
The kcfg format is defined by the file kcfg.xsd that is also in this
repository. A number of files did not pass validation against
kcfg.xsd.
I added a dummy entry to `test_emptyentries.kcfg` which might not be the best option.
Validity...
The kcfg format is defined by the file kcfg.xsd that is also in this
repository. A number of files did not pass validation against
kcfg.xsd.
I added a dummy entry to `test_emptyentries.kcfg` which might not be the best option.
Validity can be checked with:
```bash
xmlstarlet val -e -s ./src/kconfig_compiler/kcfg.xsd autotests/kconfig_compiler/*.kcfg
```
https://invent.kde.org/frameworks/kconfig/-/merge_requests/94
Add QML plugin with ability to save window state declaratively
2024-03-17T14:14:38Z
Jan Blackquill
Add QML plugin with ability to save window state declaratively
This introduces an org.kde.kconfig import exposing a QML plugin
with currently just one type: WindowStateSaver. It saves the state
of the provided window under a given name. This makes relying on this
functionality in QML more convenient...
This introduces an org.kde.kconfig import exposing a QML plugin
with currently just one type: WindowStateSaver. It saves the state
of the provided window under a given name. This makes relying on this
functionality in QML more convenient and easier to conditionalise based
on platform.
Jan Blackquill
Jan Blackquill
https://invent.kde.org/frameworks/kconfig/-/merge_requests/74
Remove traces of the old backend system
2022-08-15T14:51:16Z
Nicolas Fella
Remove traces of the old backend system
KConfig used to support multiple backends, but hasn't for the entire KF5
lifetime.
Since I don't see multiple backends coming back any time soon we might
as well simplify the internals.
This removes the superclass from KConfigIniBacken...
KConfig used to support multiple backends, but hasn't for the entire KF5
lifetime.
Since I don't see multiple backends coming back any time soon we might
as well simplify the internals.
This removes the superclass from KConfigIniBackend, renames it to
KConfigIni and makes KConfig use that directly.
It also cleanes up some now unneeded stuff and deprecates the ctor that
takes a backend.