aboutsummaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2022-08-23Add KServiceAction as a friend of KConfigGroupNicolas Fella
KServicePrivate is already a friend to be able to access convertToQVariant KServiceAction needs to do the same
2022-08-19General code clean-upAhmad Samir
- use the strings in a QStringList directly - slightly better readability: less if-else-nesting, return early GIT_SILENT
2022-08-10KConfigWatcher: initialize d->m_config in constructorKamil Dudka
... also when built without -DKCONFIG_USE_DBUS Fixes: https://bugs.kde.org/457285
2022-07-17Don't inherit from containersAhmad Samir
Containers (both Qt and STL) don't have virtual destructors, which could be an issue when trying to delete an object of a derived class via a pointer to the base class.
2022-07-01SVN_SILENT made messages (.desktop file) - always resolve oursl10n daemon script
In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-06-22KDesktopFile: add API docs for desktopGroup()Ahmad Samir
GIT_SILENT
2022-06-13SVN_SILENT made messages (.desktop file) - always resolve oursl10n daemon script
In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-05-28SVN_SILENT made messages (.desktop file) - always resolve oursl10n daemon script
In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-05-04KConfigGroup: fix writePathEntry/readPathEntry roundtrip for symlinksDavid Faure
If $HOME isn't canonical (e.g. on FreeBSD it's /home/user while the canonical path is /usr/home/user), replacing the canonical version of $HOME with $HOME means that we'll read back a different value than we wrote in. It might seem "equivalent" but it leads to surprises like KRecentDocuments showing duplicates because /usr/home/user became /home/user in the KConfig roundtrip (but not in the XBEL roundtrip). This commit loses the replacement of /usr/home/user with $HOME on FreeBSD, but I think an exact roundtrip is what we expect, rather than stuff being modified under our feet. The alternative would be to canonicalize everything in KRecentDocuments but users don't want to see the /usr in front, I assume (so we would have to use a cache of canonicalized path, for the removal of duplicates, awful performance wise).
2022-04-18Support storing QUuidJan Blackquill
2022-03-29SVN_SILENT made messages (.desktop file) - always resolve oursl10n daemon script
In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2022-03-13Make KConfig::mainConfigName() public.Ayush Singh
2022-02-25Remove broken Python bindings generationFriedrich W. H. Kossebau
pyqt broke sip4 compatibility in 5.15.6, and there is no more maintainer of the KF Python bindings to fix things. Future support might need different code, so no advantage in keeping the old code around.
2022-02-22Remove warning from kauthorized.hIlya Pominov
Macros Q_NAMESPACE_EXPORT should be used without semicolon https://doc.qt.io/qt-5/qobject.html#Q_NAMESPACE_EXPORT This generates warning: extra ‘;’ [-Wpedantic]
2022-02-18Use our deprecation macros rather than Q_DECL_DEPRECATED directlyVolker Krause
This fixes the build with Qt6 on Android.
2022-02-15QMake pri files: fix missing new path to version headerFriedrich W. H. Kossebau
2022-02-11API dox: fix class name & CC include of KConfigCompilerSignallingItemFriedrich W. H. Kossebau
NO_CHANGELOG
2022-02-09API dox: brush over KCoreConfigSkeleton & KConfigSkeleton docsFriedrich W. H. Kossebau
NO_CHANGELOG
2022-01-15Add KF*/KConfig to the interface include directoriesAhmad Samir
So that #include <kconfig_version.h> still works after changing its location in the previous commit. NO_CHANGELOG
2022-01-03Use KDE_INSTALL_FULL_LIBEXECDIR_KFLaurent Montel
2022-01-02Extract isNonDeletedKey() helper functionIgor Kushnir
The eliminated duplication of the composite condition was error-prone and less readable.
2022-01-02Look for entries with common group prefix in entryMap's subrangeIgor Kushnir
entryMap is ordered by the group name first. So there is no need to iterate over the entire map to process entries whose group names start with some prefix. Find the group name prefix's lower bound and iterate over the proper subrange instead. This should be much faster, especially if the subrange's size is much less than the entryMap's size. Adjust isGroupOrSubGroupMatch() helper function to assert the extracted startsWith() condition instead of rechecking it. Pass KEntryMapConstIterator in place of the group name to this function in order to simplify its callers' code. Reuse this helper function in KConfigPrivate::copyGroup().
2022-01-02Improve the documentation of KConfigPrivate::allSubGroups()Igor Kushnir
2022-01-02KConfigPrivate::copyGroup: remove redundant entryMap lookupIgor Kushnir
2022-01-02groupList: convert each group name from UTF-8 onceIgor Kushnir
Usually multiple key entries belong to each group. Before this commit every key entry's group name was converted from UTF-8 to UTF-16 and then inserted into a set. With this commit every key entry's group name is inserted as a std::string_view into a set, and only unique group names are converted to UTF-16 in the end. This should improve performance.
2022-01-02Exclude deleted groups from groupList()Igor Kushnir
This commit is an alternative to the earlier incorrect and reverted b3dc879e8b108c26c929bfbe551bcdf77f140e94. That commit contained several mistakes and an algorithmic complexity increase: 1) the added conditions were inverted: should have been `hasNonDeletedEntries` (without `!`); 2) KConfigPrivate::groupList() passed group instead of key.mGroup to hasNonDeletedEntries(); 3) The complexity of hasNonDeletedEntries() is O(entryMap.size()). Calls to this function were added into loops that iterated entryMap.size() times. So the overall complexity of groupList() increased from linear to quadratic. This fix collects `mGroup`s of non-deleted key entries instead of `mGroup`s of group entries. The number of key entries can be much greater than the number of group entries, so this fix hurts performance. But at least the algorithmic complexity of groupList() stays linear. Future commits can optimize the loops and make them almost as fast or even faster than before this fix. The `!key.mKey.isNull() && !entryMapIt->bDeleted` checks added in this commit are consistent with the check in KConfigPrivate::hasNonDeletedEntries(). KConfig::hasGroupImpl() forwards its argument to hasNonDeletedEntries() with the following comment: // No need to look for the actual group entry anymore, or for subgroups: // a group exists if it contains any non-deleted entry. BUG: 384039 FIXED-IN: 5.90
2022-01-02groupList: don't copy unnecessarily; add constIgor Kushnir
2021-12-18Complete fixing the Windows CIAhmad Samir
2021-12-17Fix build on WindowsAhmad Samir
Both GCC and Clang don't require a const integral value to be captured explicitly to be used in a lambda, but of course one compiler thinks otherwise... Thanks to Ömer Fadıl Usta for the heads up. GIT_SILENT
2021-12-16WIP: Change the build system to enable building with Qt 6Ahmad Samir
This was built with: -DQT_MAJOR_VERSION=6 \ -DEXCLUDE_DEPRECATED_BEFORE_AND_AT=5.90.0 \ -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055a00 Move the include(KDEInstallDirs) call before the first find_package(Qt*, the former is what auto-detects the Qt version, and defaults to 5. This is needed to be able to build against Qt5 by default. All unit tests still pass.
2021-12-15Minor code clean upAhmad Samir
NO_CHANGELOG
2021-12-15SVN_SILENT made messages (.desktop file) - always resolve oursl10n daemon script
In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-11-29SVN_SILENT made messages (.desktop file) - always resolve oursl10n daemon script
In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-11-28SVN_SILENT made messages (.desktop file) - always resolve oursl10n daemon script
In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-11-26KDesktopFile: deprecate resource()Ahmad Samir
It is redundant since the parent class, KConfig, has locationType(). Add some API docs for fileName(), even though one could use KConfig::name() from the parent class, I think this would be confusing given a .desktop file has a Name= entry, so fileName() is less ambiguous. These seem to be leftovers from a previous refactor that happened a long time ago.
2021-11-14Avoid some allocations by QString/QByteArray's toLower()Friedrich W. H. Kossebau
NO_CHANGELOG
2021-11-02GIT_SILENT: add missing overrideLaurent Montel
2021-10-20GIT_SILENT Remove a bit of dead codeAlexander Lohnau
2021-10-15Exclude new enum-overload from python bindings buildAlexander Lohnau
2021-10-13Enforce KAuthorized enums being not 0Alexander Lohnau
This will output a warning if an invalid value is requested. The goal is to avoid implicit conversion which might result in a zero-int value.
2021-10-13Create enum to to authorize common keysAlexander Lohnau
By using an enum we have a central place to provide docs for the most common actions/restrictions. Also consumers can pass in type-safe enum values instead of potentially undocumented strings that might contain typos. Also it is better documents is a value is supposed to be authorized using KAuthorized::authorize or KAuthorized::authorizeAction, in the case of "shell_access" this was mixed up from time to time. Considering that we do not want the parameter for the methods to become too long I have deliberately decided against using `enum class`. Also we don't have and usecases for the binary operators in combination with the newly added enums. Task: https://phabricator.kde.org/T11948
2021-10-11Create utility method for moving entries from one group to anotherAlexander Lohnau
This will become especially useful when moving state data from the config file to a dedicated state data file. Task: https://phabricator.kde.org/T12549
2021-10-01SVN_SILENT made messages (.desktop file) - always resolve oursl10n daemon script
In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-09-29Android: Fix writing to config if path is a content:// UriSharaf Zaman
KConfigIniBackend relies on QLockFile which changes the content Uri and this is bound to fail because we don't have permission. So, for these Uris we use Android's Internal cache directory to save the .lock files.
2021-09-25Fix one typo in API docsAhmad Samir
GIT_SILENT
2021-09-19kconfigini: Only open the file once to writeAleix Pol
We were calling open(), then fopen(), then QFile::open(). This patch removes the fopen() call that does not seem to do anything.
2021-08-28GIT_SILENT: we can use std::as_const directlyLaurent Montel
2021-08-26KDesktopFile::isAuthorizedDesktopFile: reduce warning to info a logMéven Car
2021-08-18Port to QStrinViewAhmad Samir
Now that KF requires Qt 5.15.2; this basically reverts commit 2e8742e64fc0 with some trivial changes. NO_CHANGELOG
2021-08-13clang-tidy: one declaration per line; braces around statementsAhmad Samir
clang-tidy checks: readability-isolate-declaration and readability-braces-around-statements KF task: https://phabricator.kde.org/T14729 GIT_SILENT