aboutsummaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2020-07-13Use KF-standardized Qt logging categoriesFriedrich W. H. Kossebau
See https://community.kde.org/Frameworks/Frameworks_Logging_Policy
2020-07-07Use camelcase include. (scripted)Laurent Montel
2020-06-18SVN_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"
2020-06-17SVN_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"
2020-05-31SVN_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"
2020-05-08Adjust name of internally-exported method as suggested in D29347David Faure
2020-05-03GIT_SILENT add commentDavid Faure
2020-05-03KAuthorized: export method to reload restrictionsDavid Faure
Summary: This is useful for unittests. Example: ``` KCONFIGCORE_EXPORT void reloadUrlActionRestrictions(); void someTestMethod() { KConfigGroup cg(KSharedConfig::openConfig(), "KDE URL Restrictions"); cg.writeEntry("rule_count", 1); cg.writeEntry("rule_1", QStringList{"open", {}, {}, {}, "file", "", "", "false"}); cg.sync(); reloadUrlActionRestrictions(); // Some test for code that uses KUrlAuthorized cg.deleteEntry("rule_1"); cg.deleteEntry("rule_count"); cg.sync(); reloadUrlActionRestrictions(); } ``` This is consistent with the fact that other functions used by KUrlAuthorized are defined here and exported internally. Test Plan: Used this in a KIO unittest I'm writing for the future OpenUrlJob Reviewers: aacid, apol, mdawson Reviewed By: aacid Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D29347
2020-04-20API dox: document Q_DECLARE_FLAGS-based flagsFriedrich W. H. Kossebau
Summary: KApiDox & ECMAddQch have been just teached about Q_DECLARE_FLAGS, so the underlying typedefs are no longer skipped by doxygen, but can be documented now, allowing links to be generated for these types e.g. when used as arguments. The "#" prefix to the enum name in the description text of all the Q_DECLARE_FLAGS docs seems needed to properly trigger doxygen autolinks. GIT_SILENT
2020-04-17Add force save behavior to KEntryMapBenjamin Port
Summary: Fix the following bug, if an entry is set on HOME/.config/kdeglobals and on a specific config file like kcmfonts When you hit restore defaults button and apply, value will be not wrote on the specific file, but then the value is the one from kdeglobals This patch ensure we write the key to the specific configuration file on those case with an empty value. KConfig will take default value automatically Test Plan: Added a test to ensure flag is working Tested using some KCM to ensure all is working fine Reviewers: ervin, dfaure, meven, crossi, hchain Reviewed By: ervin, dfaure, meven Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D28128
2020-03-30QAtomicInteger::loadRelaxed/storeRelaxed() are available since Qt 5.14Ahmad Samir
A similar patch was approved in https://phabricator.kde.org/D26102
2020-03-22KConfig: Convert to SPDX license statementsAndreas Cord-Landwehr
Summary: Convert license headers to SPDX statements and add license files as required by REUSE specification. Reviewers: cgiboudeaux Reviewed By: cgiboudeaux Subscribers: ognarb, cgiboudeaux, kde-frameworks-devel Tags: #frameworks Maniphest Tasks: T11550 Differential Revision: https://phabricator.kde.org/D27601
2020-03-08KconfigXT: Add a value attribute to Enum field choicesMéven Car
Summary: Allow to write choices such as : ``` <choices> <choice name="enum_name" value="I can't containt (anything)"></choice> <choice name="normal_choice"></choice> </choices> ``` Test Plan: ctest Reviewers: ervin, bport, crossi, #frameworks Reviewed By: ervin Subscribers: ngraham, davidre, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27463
2020-02-24KConfigSkeletonItem : allow to set a KconfigGroup to read and write items in ↵Cyril Rossi
nested groups Summary: Currently KConfgiSkeleton cannot manage item entry in subgroup, like ``` [General][Colors] MyItem=foo ``` Example of use ``` // Generated Class with KConfig compiler, inherits KConfigSkeleton KConfigGroup generalGroup( &config, "General" ); KConfigGroup colorsGroup = config.group( "Colors" ) myItem->setGroup(cg); // Now can take a KConfigGroup addItem(myItem, "MyItem"); ``` Evolution of kconfig compiler will follow to consider this. Reviewers: ervin, dfaure, #frameworks, mdawson Reviewed By: ervin, dfaure Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27059
2020-02-12Use ecm_qt_install_logging_categories over manual categories fileFriedrich W. H. Kossebau
2020-02-12Add setNotifyFunction to KPropertySkeletonItemBenjamin Port
Summary: This function will be called when the property value change Reviewers: ervin, meven, crossi Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27342
2020-01-07Fix API doc, usrSave is called from save not deprecated writeConfigBenjamin Port
Reviewers: ervin Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D26495
2020-01-05Add KSharedConfig::openStateConfig for storing state informationNicolas Fella
Summary: A common complaint is that our apps store 'state' information such as recent files or window sizes in their configuration files, making it ugly to store them in version control systems. Therefore we should not store such information in XDG_CONFIG_DIR but instead use XDG_DATA_DIR for this. This patch adds a utility method that creates a KSharedConfig backed by a file in such a suitable location. For e.g. dolphin the file .local/share/dolphin/dolphinstaterc would be created. See T12246 for some context Reviewers: #frameworks, dfaure Reviewed By: dfaure Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D26440
2020-01-05Port QRegExp to QRegularExpressionAhmad Samir
Summary: Port QRegExp::exactMatch() by using QRegularExpression::anchoredPattern() to match the entire subject string. Remove filenameOnly(), it's been broken for a long time (QStringLiteral("[/\\]") is not a valid QRegExp pattern); besides it's not needed as QFileInfo::fileName() is used to get the filename. Test Plan: make && ctest Reviewers: #frameworks, dfaure, ervin, apol Reviewed By: dfaure, ervin Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D26177
2020-01-03Remove endl at the end of qdebugLaurent Montel
2019-12-19Port deprecated methodsLaurent Montel
2019-12-11kconfig EBN transport protocol cleanupJohn Hayes
Summary: Change and test transport protocol from http to https while correcting dead link Reviewers: apol Reviewed By: apol Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D25829
2019-12-10update @sinceDavid Edmundson
2019-12-10Expose getter to KConfigWatcher's configDavid Edmundson
Summary: It can help save users having to member variables for the config and the watcher. Reviewers: broulik Reviewed By: broulik Subscribers: broulik, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D25833
2019-12-10Fix writeFlags with KConfigCompilerSignallingItemDavid Edmundson
Summary: KConfigCompilerSignallingItem both inherits KConfigSkeletonItem and internally is powered by a separate KConfigSkeletonItem The generated code calls setWriteFlags on the outer KConfigCompilerSignallingItem instance, but the real writing is performed by the internal version. We need to set the flags in the right place. Ideally we would do this in an overload of KConfigSkeletonItem, but given we can't, I've shadowed the method. This isn't pretty, but given the docs say it should generally only be used from auto generated code, should be fine. Test Plan: Used in workspace KCM Reviewers: ervin Reviewed By: ervin Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D25791
2019-12-04Don't use nullptr as flag. Make it compile against qt5.15Laurent Montel
2019-11-12Add KPropertySkeletonItemKevin Ottens
Summary: This new item allows to use a QObject property as a source for a setting. This is especially convenient for using with KCMs present in systemsettings which tend to store information outside of KConfig (for interfacing deeper with the system). Reviewers: #frameworks, dfaure, davidedmundson, bport, crossi Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D25211
2019-11-12Prepare KConfigSkeletonItem to allow inheriting its private classKevin Ottens
Reviewers: #frameworks, dfaure, davidedmundson, bport, crossi Subscribers: vkrause, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D25210
2019-10-31These methods were adding in qt5.15Laurent Montel
2019-10-30Make it compile against qt5.15 without deprecated methodLaurent Montel
2019-10-20Enable KF_* group deprecation macrosFriedrich W. H. Kossebau
GIT_SILENT
2019-10-18Use ECMGenerateExportHeader to manage deprecated API betterFriedrich W. H. Kossebau
Summary: Allows * projects linking to KConfigCore/Gui to hide deprecated API up to a given version or silence deprecation warnings after a given version, using * -DKCONFIGCORE_DISABLE_DEPRECATED_BEFORE_AND_AT * -DKCONFIGCORE_NO_DEPRECATED * -DKCONFIGCORE_DEPRECATED_WARNINGS_SINCE * -DKCONFIGCORE_NO_DEPRECATED_WARNINGS * -DKCONFIGGUI_DISABLE_DEPRECATED_BEFORE_AND_AT * -DKCONFIGGUI_NO_DEPRECATED * -DKCONFIGGUI_DEPRECATED_WARNINGS_SINCE * -DKCONFIGGUI_NO_DEPRECATED_WARNINGS or * -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT * -DKF_NO_DEPRECATED * -DKF_DEPRECATED_WARNINGS_SINCE * -DKF_NO_DEPRECATED_WARNINGS * to build KConfigCore/Gui optionally with deprecated API excluded from the build, using "EXCLUDE_DEPRECATED_BEFORE_AND_AT" cmake argument. Test Plan: Builds with EXCLUDE_DEPRECATED_BEFORE_AND_AT set to 0, 4.0.0, 5.0.0, 5.11.0, 5.24.0, 5.39.0, 5.42.0, CURRENT. Reviewers: #frameworks, mlaurent Reviewed By: mlaurent Subscribers: mlaurent, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D24496
2019-10-16Expose isImmutable to introspection (e.g. QML)Kevin Ottens
Reviewers: #plasma, #frameworks, mart, dfaure Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D24697
2019-10-10Add convenience for defaults/dirty states to KCoreConfigSkeletonKevin Ottens
Summary: It allows to verify if all the items of the skeleton are in their default values or if they hold any value deviating from the latest loaded values from KConfig. We didn't really need this during the KCModule/QtWidgets time since we could write KConfigDialogManager just fine without it. But for use with QML and aiming at having similar magic in KQuickAddons::ConfigModule such convenience functions will be needed. Reviewers: #plasma, #frameworks, dfaure, mart Subscribers: apol, kossebau, davidedmundson, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D24494
2019-09-30Small performance enhacementsAlbert Astals Cid
Summary: suggested by clang-tidy Reviewers: davidedmundson Reviewed By: davidedmundson Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D24312
2019-09-17[KConfig] port away from deprecated methods in Qt 5.14David Faure
Summary: In kconf_update, the ctime usage used to be about metadata change time (buff.st_ctime, before it got ported to the misnamed created()). I ported it to birthTime, because I think date of birth is a more useful way to identify a file than date of permission change which doesn't really matter to us. But in practice, I can't help but wonder if mtime alone wouldn't be enough. For the QStringLiteral("%%1").arg(i) bit, I tested it in tst_qstring, the first % is left untouched. Test Plan: make && ctest Reviewers: mdawson, arichardson, vkrause Reviewed By: vkrause Subscribers: pino, arojas, mlaurent, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D23815
2019-09-16Use new INCLUDE_DIRS with ecm_add_qch, to have doxygen see more includesFriedrich W. H. Kossebau
GIT_SILENT
2019-08-28GIT_SILENT: use QLatin1StringLaurent Montel
2019-08-25String code optimization: use s.remove(0. x) instead of s = s.mid(x)Friedrich W. H. Kossebau
GIT_SILENT
2019-08-25String code optimization: use s.chop(x) instead of s.truncate(s.size()-x)Friedrich W. H. Kossebau
GIT_SILENT
2019-08-25Use more initializer listsFriedrich W. H. Kossebau
GIT_SILENT
2019-08-24String code optimization: use QLatin1String/QChar overload for string concatFriedrich W. H. Kossebau
GIT_SILENT
2019-08-24String code optimization: use QLatin1String overload for == & !=Friedrich W. H. Kossebau
GIT_SILENT
2019-08-24String code optimization: use QLatin1String overload for QString::replaceFriedrich W. H. Kossebau
GIT_SILENT
2019-08-22Fix memory leak in KConfigWatcherDaniel Vrátil
Reviewers: davidedmundson Reviewed By: davidedmundson Subscribers: davidedmundson, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D23340
2019-08-14Add a logging category for logs warningsMéven Car
Summary: Disable logs unless the logging category kf5.kconfig.core is enabled Test Plan: ctest Reviewers: #frameworks, apol, cgiboudeaux Reviewed By: cgiboudeaux Subscribers: cgiboudeaux, mikeroyal, apol, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D22061
2019-08-14SVN_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"
2019-08-07Security: remove support for $(...) in config keys with [$e] marker.David Faure
Summary: It is very unclear at this point what a valid use case for this feature would possibly be. The old documentation only mentions $(hostname) as an example, which can be done with $HOSTNAME instead. Note that $(...) is still supported in Exec lines of desktop files, this does not require [$e] anyway (and actually works better without it, otherwise the $ signs need to be doubled to obey kconfig $e escaping rules...). Test Plan: ctest passes; various testcases with $(...) in desktop files, directory files, and config files, no longer execute commands. Reviewers: mdawson, aacid, broulik, davidedmundson, kossebau, apol, sitter, security-team Reviewed By: mdawson, davidedmundson Subscribers: ZaWertun, rikmills, fvogt, ngraham, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D22979
2019-07-20Include definition for class used in headerDavid Edmundson
2019-05-10Replace qVariantFromValue with QVariant::fromValueNicolas Fella
Summary: qVariantFromValue is obsolete (https://doc.qt.io/qt-5/qvariant-obsolete.html#qVariantFromValue-1) and causes build failure in KActivities and KEmoticons with current Qt dev Test Plan: KActivities and KEmoticons build again with current Qt dev Reviewers: #frameworks, dfaure, apol Reviewed By: apol Subscribers: apol, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D21107