aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
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-26README.dox: GENERATE_MOC is required for signalsDawid Wróbel
2021-11-23Use innerVarStr instead of varStr for choicesTomaz Canabrava
2021-11-23Add missing changesTomaz Canabrava
2021-11-22Copy ConfigPropertyMap from KDeclarative to new KConfig QML moduleAlexander Lohnau
This way consumers which want to use the ConfigPropertyMap don't have to pull in KDeclarative's entire dependency tree. Also we can remove the automatic saving of the config, previously this was opt-out - which makes is difficult to deprecate anything. This way the API design is also more clear, since the object only takes care of exposing the data to QML. The writing has to be done manually, which makes more sense anyways when we have the notify opt-in. As discussed on the KF6 weekly thread, an optional QML submodule is seen as the best way to handle the QML dependency. Task: https://phabricator.kde.org/T12131 Relates to https://phabricator.kde.org/T12126, after his change the KDeclarative stuff can be deprecated. Because we don't register the property map in any QML plugin, there is no conflict in duplicating and modifying it now.
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-09-19Allow KConfigXT to use KSharedConfig::openStateConfigAlexander Lohnau
Otherwise we force consumers to use the config location for state data, which is what we are trying to avoid. Task: https://phabricator.kde.org/T12549
2021-08-29Add Ctrl+Alt+Comma shortcut for "Configure Keyboard Shortcuts"empyreal one
BUG: 441537 FIXED-IN: 5.86
2021-08-29Make enum value visible to QML when using GlobalEnum modeCarl Schwan
Now generate Q_ENUM(<enum-name>)
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
2021-08-03KConfig: sort keys in keyListImpl() so unittests can rely on itDavid Faure
The code was using a QSet (hash-based), use a std::set instead for unicity, it gives us sorting for free. We probably want to do the same in groupList(), but that's separate.
2021-08-03KConfig: fix deletion of an entry that is also in kdeglobalsDavid Faure
This is the case where we expected to see Key[$d] in the config file, and it was somehow broken. When saving, the key was omitted, so when reloading the kdeglobals key was present again. Detected when trying to write a unittest for a different patch... I had to reshuffle the unittest a bit because testThreads calls testSimple which didn't expect that the "[AAA]" group would actually be deleted now.
2021-07-13Fix typos found by codespellChristophe Giboudeaux
GIT_SILENT
2021-07-12Update kconfig_compiler documentation with translation optionsCyril Rossi
2021-07-05Do not create a vector and a QByteArray just to discard it immediatelyAleix Pol
2021-07-05Only query for existing config file when it's necessaryAleix Pol
We are only interested in whether the file doesn't exist when it fails to open. This saves a stat on every successful config file parse.
2021-07-05Use specific API to compare QByteArraysAleix Pol
At the moment we are taking a bit of a detour by converting to char*. Not a bit deal but reads better and ends up being less calls.
2021-07-04Cache global config filesAleix Pol
Whenever we read a config file, we are first parsing kdeglobalsrc. This caches the parsed entries so that they can be reused as long as it hasn't changed. This reduces the parseConfig calls (which is mostly prominent at early process startup) from 18 to 12 (33%) ksmserver-logout-greeter. This also means there's better cache locality as well as less memory allocated as a lot of objects are shared but I have not measured this.
2021-05-27Use more target-centric cmake codeFriedrich W. H. Kossebau
NO_CHANGELOG
2021-05-25Revert "fix deleted group is in listGroups"Nate Graham
This reverts commit b3dc879e8b108c26c929bfbe551bcdf77f140e94. This change breaks plasmashell startup and possible other apps as well. Reverting so the root cause can be investigated without time pressure.
2021-05-25fix deleted group is in listGroupsLieven Hey
calling deleteGroup only deletes all entries but the group does still exists in listGroups this is somewhat irritating since calling exists on that group will return false with this patch the group does no longer exists in listGroup
2021-05-11Docs: make a complete reference to reparseConfiguration() from KSharedConfigAdriaan de Groot
NO_CHANGELOG
2021-05-09Revert QStringView portAhmad Samir
QStringView has some bits of API that were only added in 5.15.2, whereas KF requires 5.15.0. This reverts commit 1780fb2a237af80ddc1f9cfb70cb892b53b91990.
2021-05-07Order macro for attribute for symbol export before that for deprecatedFriedrich W. H. Kossebau
The symbol export/visibility attribute is not standardized so far and needs to be set by language extension attribute declaration at least with clang & MSVC, who both support that when it appears before the standard attribute declaration. NO_CHANGELOG
2021-05-04Don't write position data for maximized windowsNate Graham
A window that is maximized does not really have a position on screen other then the fact that it's maximized, and writing out position data in this case anyway will only serve to mis-position the window once da-maximized, should KWin ever stop remembering de-maximized window positions internally. CCBUG: 434116
2021-05-02Port away from ECMSetupVersion's deprecated *_VERSION_STRING CMake variableFriedrich W. H. Kossebau
NO_CHANGELOG
2021-05-02Minor code refactoringAhmad Samir
Some methods in ConfigLoaderHandler always returned true, change them to return void instead. Also port them to take a QStringView instead of QStringRef, this doesn't require a lot of changes because a QStringView can be constructed from a QStringRef. QXmlStreamAttribute methods like value() and name() return QStringRef in Qt5 and QStringView in Qt6, "fix" the issue by using auto keyword, which works in both cases. QStringView::toInt() isn't efficient in Qt5 so make the build conditional. NO_CHANGELOG
2021-04-28Make the docs state that KConfig::reparseConfiguration() calls sync() if neededAhmad Samir
This matches the method actually does, and makes it clearer that you don't need to do config->sync() followed by config()->reparseConfiguration(), the latter should suffice.
2021-04-26Use new version-controlled enumerator deprecation warning macrosFriedrich W. H. Kossebau
2021-04-18Deprecate KDesktopFile::readDevice()Ahmad Samir
Since the FSDevice .desktop template hasn't been installed for a long time, this method in KDesktopFile hasn't been useful. The whole FSDesktop concept seems to be redundant nowadays, since CDRom and Floppy drives have been replaced by USB sticks. See this KF6 taks for more details: https://phabricator.kde.org/T14295#253759
2021-04-15KConfig: rename kconfigdata.h to kconfigdata_p.hDavid Faure
It's internal, the symbols are not exported, the header is not installed. The _p.h naming makes this more obvious, when grepping for stuff in public API.
2021-04-10Relicense to LGPL-2.0-or-laterAndreas Cord-Landwehr
All named authors from copyright statements confirmed this change (confirmations at sysadmins' longterm archive). From the git history check, relicensecheck tells: - lgplv2+: mdawson pandom79@gmail.com mdawson ( 6 LOC): 0005ba7 pandom79@gmail.com ( 4 LOC): eeb2bbe Whereas pandom79 does not posses a KDE contributor account but also confirmed via private mail (confirmation mail also in sysadmins' archive). Change 0005ba7 is a syntactical replacement of QT_TRANSLATE_NOOP with QT_TRANSLATE_NOOP3 and thus can be assumed to not by copyrightable.
2021-04-10Relicense to LGPL-2.0-or-laterAndreas Cord-Landwehr
All named authors from copyright statements confirmed this change (confirmations at sysadmins' longterm archive). From the git history check, relicensecheck tells: - lgplv2+: pandom79@gmail.com pandom79@gmail.com ( 7 LOC): eeb2bbe Whereas pandom79 does not posses a KDE contributor account but also confirmed via private mail (confirmation mail also in sysadmins' archive).
2021-04-05kconfig_compiler: add override to generated destructorsDavid Faure
This fixes the clang warning globalsettings_kmail.h:58:5: warning: '~GlobalSettingsBase' overrides a destructor but is not marked 'override' [-Wsuggest-destructor-override]
2021-03-22[kconfig_compiler] Explicitly open input file for readingNicolas Fella
In Qt6 QDomDocument does not open the file itself any more
2021-03-16Remove old contact data from src/kconfig_compiler_README.doxDavid Hurka
2021-03-06Improve code readability by using QLatin1String::arg()Ahmad Samir
NO_CHANGELOG