aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-08-30kconf_update: test the return value of QTemporaryFile::open() for good measureDavid Faure
2020-08-29Add standard shortcut for "Create Folder"Domenico Panella
2020-08-29API dox: consistently use version number without product name for @deprecatedFriedrich W. H. Kossebau
GIT_SILENT
2020-08-28Introduce method to query KConfigSkeletonItem default valueDavid Edmundson
5.64 added an isDefault method however this doesn't suffice for usage in KConfigDialogManager which compares a current value to the default. KConfigDialogManager currently uses a hack with side effects. Exposing the value directly solves that.
2020-08-25Remember window sizes on a per-screen-arrangement basisNate Graham
This is done for window positions, so it should also be done for window sizes. The combination of both should substantially improve the use case of maintaining a consistent window arrangement for multiple display setups (e.g. laptop and laptop + external screen).
2020-08-25Extract code to get list of connected screens into a re-usable functionNate Graham
Right now it's duplicated twice, and once we add per-screen-arrangement memory for window sizes as well, it will be duplicated four times unless we put it into a function.
2020-08-24Fix qt warning:Laurent Montel
"QtPrivate::DeprecatedRefClassBehavior::warn|?libKF5ConfigCore.so.5?|?libKF5ConfigCore.so.5? Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt." We try to access to an invalid index.
2020-08-12Categorize standard shortcutsDavid Redondo
We have a huge amount of standard shortcuts. By adding the ability to divide them into categories, they can be presented to the user in a way that enables them to easier find the shortcut that they want. Internally some shortcuts were already grouped but that seems to have stopped for the later additions. (The related standard actions from KConfigWidgets also seem to have this not exposed internal grouping.) See plasma-desktop!26
2020-08-10Add documentation for ParentInConstructor optionCyril Rossi
2020-08-02Add functions to save and restore window positions on non-Wayland platformsNate Graham
These functions allow an application to save and restore the positions of its windows. Positions are stored on a per-screen-arrangement basis. For example with a single screen connected, the config file would have entries like this in it: eDP-1 XPosition=140 eDP-1 YPosition=340 When a second screen is connected, the following gets saved: eDP-1 HDMI-1 XPosition=3878 eDP-1 HDMI-1 YPosition=29 This ensures that each separate screen arrangement can have its own saved window position, which is handy for the use case where you have a laptop that you plug into an external screen some of the time. It also allows the position to get restored to the correct screen when there are multiple screens. This is a necessary first step to getting KDE apps to save their window positions on X11 The next step would be calling the new functions from KXMLGui and Kirigami apps, and then porting all apps that manually invoke KWindowConfig::saveWindowSize() and KWindowConfig::restoreWindowSize() to also invoke KWindowConfig::saveWindowPosition() and KWindowConfig::restoreWindowPosition() in the same places. The functions only work on X11 or other non-Wayland platforms. On Wayland, the compositor has sole dominion over window positioning so a compositor-specific solution much be adopted instead, such as https://bugs.kde.org/show_bug.cgi?id=15329. CCBUG: 415150
2020-07-25Update sGlobalFileName when QStandardPaths TestMode is toggledAhmad Samir
When running unit tests, usually QStandardPaths TestMode is enabled so as not to mess up the config files in the home dir of the dev running the unit tests; sGlobalFileName, a global static, was defined only once, which meant that if KSharedConfig::openConfig() is called before the unit test has had a chance to call QStandardPaths::setTestModeEnabled(true), then sGlobalFileName will go on referring to the wrong kdeglobals file (as can be seen in dfaure's debugging of the issue at [1]). Change the code so as to detect QStandardPaths TestMode status and change sGlobalFileName as needed. All unit tests still pass. [1] https://invent.kde.org/frameworks/kio/-/merge_requests/77#note_74124
2020-07-25API dox: state explicitly expected encoding for KConfig key & group namesFriedrich W. H. Kossebau
While the API might have been once designed to allow random byte strings to be used as ids and only converted QString to UTF-8, the current implementation in many places assumes the byte strings passed via const char* or QByteArray are also in of UTF-8 encoding (or at least ASCII7-only). See e.g. KConfigGroup::entryMap() or KConfigGroup::name(). Stating the supported encoding explicitly should avoid any misassumptions.
2020-07-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"
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-22Also pass locationType to KConfigSkeleton when construction from groupArjen Hiemstra
locationType is used to determine where the config file should be saved. If it is not passed on to the KConfigSkeleton constructor, the default (GenericConfigLocation) will be used and any value the application had set will be ignored.
2020-06-19Make "Switch Application Language..." text more consistentNate Graham
This makes it follow the pattern of other "Configure X" style actions. See also the discussion in https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/4#note_60691
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-24Don't try to initalize deprecated SaveOptions enum valueDavid Redondo
It will assert.
2020-05-23Add KStandardShortcut::findByName(const QString&) and deprecate find(const ↵David Redondo
char*) KStandardShortcut::name returns a QString, this makes the api symmetric and more straightforward to use.
2020-05-22Fix KStandardShortcut::find(const char*)David Redondo
qstrcmp returns 0 if two strings are equal.
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-22kconfig_compiler : generate kconfig settings with subgroupCyril Rossi
Summary: Following D27059, add `parentGroupName` attribute to `group` element to generate kconfig settings with subgroups Reviewers: ervin, dfaure, #frameworks, meven Reviewed By: ervin, meven Subscribers: apol, meven, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27133
2020-04-21Fix some compiler warningsAhmad Samir
Summary: - Fix order of member initialisation (compiling with -Wreorder) - Use Q_UNUSED where needed - QAtomicInteger::loadRelaxed() has been available since Qt 5.14 Test Plan: make && ctest Reviewers: #frameworks, dfaure, apol Reviewed By: dfaure Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27158
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-04-13Add standard shortcut for "Show/Hide Hidden Files"Nate Graham
Summary: Add a standard shortcut for this action so it can be synchronized between different apps and the file dialog; see https://bugs.kde.org/show_bug.cgi?id=262551. The action in Dolphin also has F8 bound to this, but the definition here only accept two default shortcuts, and F8 seems kind of random. CCBUG: 262551 Test Plan: Apply D28803 to KIO and D28804 to Dolphin and test there Reviewers: dfaure, #frameworks Reviewed By: dfaure Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D28802
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-23[KConfigGui] Check font weight when clearing styleName propertyAhmad Samir
Summary: This is an addendum for commit a2774ff5b41987c3919a9e; making the check tighter. Test Plan: make && ctest Reviewers: #frameworks, dfaure, davidedmundson, cfeck, ervin, meven, bport Reviewed By: dfaure Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27811
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-03-03Make it compile against qt5.15. SkipEmptyParts is part of Qt::.Laurent Montel
2020-03-02[KConfigGui] Clear styleName font property for Regular font sytlesAhmad Samir
Summary: If the styleName property is set for a QFont, using setBold(true) would lead to Qt using an "emboldended"/synthetic font style instead of using the bold style provided by the font itself (usually as a standalone font file), the former looks ugly (IIUC, Freetype emboldens fonts as a last resort for fonts that don't provide a bold style at all). Accoring to upstream[1] the styleName property is useful for fonts with fancy style names, and also it shouldn't be set if it's not needed; and indeed using styleName with e.g. "Regular" doesn't make sense, as there is no "Regular Bold" style AFAICS. Checking for "Regular|Normal|Book|Roman" is based on examining the font styles provided by the font packages available on OpenSuse Tumbleweed ATM, (I didn't include some of the weird/non-common ones e.g. I've seen "Roma" and "Rounded"). Some statistics about the "Regular"-like font styles from my testing: Regular: 2486 Normal: 66 Book: 20 Roman: 13 For more details see: [1] https://bugreports.qt.io/browse/QTBUG-63792 https://bugs.kde.org/show_bug.cgi?id=378523 BUG: 378523 FIXED-IN: 5.68 Test Plan: All unit tests still pass. Changing the fonts via e.g. the fonts KCM doesn't append the font sytleName, to the relevant font config entry, if the "Regular" style or co. is used. A simple test, look at the current dir name in the Dolphin url bar with and without ",Regular" appended to the font= entry (assuming you're using Noto Sans or DejaVu Sans as the styleName varies from font to font). Reviewers: #frameworks, dfaure, davidedmundson, cfeck, ervin Reviewed By: dfaure Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27735
2020-02-28fix min/max entries with dpointerHenri Chain
Summary: D27497 was causing cases with dpointer + min/max to fail Specifically, this okular build: https://build.kde.org/job/Applications/job/okular/job/kf5-qt5 SUSEQt5.12/175/console Test Plan: Added min/max to dpointer autotest Reviewers: meven, ervin Subscribers: kde-frameworks-devel, aacid Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27717
2020-02-25Fix code generation for entries with min/maxHenri Chain
Summary: - When GenerateProperties and Mutators are activated, the generated code did not handle min/max properly - In the case of a parameterized entry, generated code also did not handle min/max BUG: 418146 Test Plan: - auto tests included Reviewers: meven, crossi, ervin, bport, tcanabrava Reviewed By: meven, ervin Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27497
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-19Fix is<PropertyName>Immutable generated propertyMéven Car
Summary: Relates to D26368 Test Plan: ctest Reviewers: hchain, ervin, bport, crossi, #frameworks Reviewed By: hchain, crossi Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27496
2020-02-14Make it compile against last qt5.15 without deprecated method. endl is ↵Laurent Montel
namespaced
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-02-08[KConfigLoader] Code cleanupAhmad Samir
Summary: - Drop redundant args to startElement()/endEelement() - Use range-for - Drop ConfigLoaderHandler methods that weren't used anywhere AFAICS and ConfigLoaderHandler is private API Test Plan: make && ctest Reviewers: #frameworks, apol, dfaure Reviewed By: dfaure Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D27157
2020-02-04Add an is<PropertyName>Immutable to know if a property is immutableMéven Car
Summary: Add a utility function is<Parameter>Immutable to access immutability quickly. Generated classes uses them internally to avoid code redundance. Sample: ``` /** Set blocked-by-default */ void setBlockedByDefault( bool v ) { if (v != mBlockedByDefault && !isBlockedByDefaultImmutable() ) { mBlockedByDefault = v; Q_EMIT blockedByDefaultChanged(); } } /** Is blocked-by-default Immutable */ bool isBlockedByDefaultImmutable() { return isImmutable( QStringLiteral( "blockedByDefault" ) ); } ``` ``` /** Set org.kde.ActivityManager.ResourceScoringEnabled */ void setResourceScoringEnabled( bool v ) { if (!isResourceScoringEnabledImmutable() ) mResourceScoringEnabled = v; } /** Is org.kde.ActivityManager.ResourceScoringEnabled Immutable */ bool isResourceScoringEnabledImmutable() { return isImmutable( QStringLiteral( "resourceScoringEnabled" ) ); } ``` Reviewers: ervin, #frameworks, dfaure Reviewed By: ervin Subscribers: dfaure, tcanabrava, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D26368
2020-01-27QXmlInputSource is deprecated in qt5.15. Port it to QXmlStreamReaderLaurent Montel
Summary: QXmlInputSource is deprecated in qt5.15 Test Plan: autotest ok Reviewers: dfaure, apol Reviewed By: apol Subscribers: apol, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D26890
2020-01-24Port endl to \n as it's qt namespaced.Laurent Montel
Port "dec"/"hex" as it's Qt namespaced too
2020-01-23Port endl to "\n" as it's qt namespaced. Use directlyLaurent Montel
std::cout/std::cerr Summary: Port endl to "\n" as it's qt namespaced Test Plan: autotest ok Reviewers: dfaure Reviewed By: dfaure Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D26860
2020-01-22Refactor KConfigXTTomaz Canabrava
Summary: The current KConfigXT compiler is in a sad state: It's a massive file with loads of global variables that handle state, the generator is done within the main() function and it seems to have grown organically. There are no classes to separate logic / state / generation, what exists is code that generates code from a xml / ini pair, but it's hard to even discover what a bit of code is doing. The code istyle is C++ / Java from the nineties, which is not bad per see but it also uses quite a few things that are going to be deprecated in Qt 6 so I'm also taking the time make the code more streamlined with newer code style (no iterators, lambdas, auto usage, etc). The code that generates the files simplly pushes strings to a text stream, and it's hard to figure out when something starts or something ends: for instance, the code that generates the Constructor has more than sixty lines of code englobing some nested if - for - if - for constructs. Currently the code is "done" - there's one bug that I still need to find & fix regarding Translations, but the rest seems sane. The current testcode generates incorrect *whitespaces* regarding the old code (there's some parts that I feel that it's important to fix before merging, but overall, the whitespace changes are not bad and easier to handle, old code had a hand-counted amount of spaces before each line, new code has a function whitespace() that adds the current-and-correct amount of whitespaces based on indentation level that you start by startScope() and ends with endScope(). rest of the code still needs to be ported to it. I plan to fix the testcases whitespace by manually adding them, I'v fougth with the code for a while and added a few hacks there but I don't want to make the code hackish again. New code is not perfect by any means, but is a good step in the right direction. This code tries to Separate the compiler code into many different files / classes to be more obvious what's happening, and each class also has many helper methods to minimize copypaste. - CodeGenerator: Has base code for the header and source files that can be shared - HeaderGenerator: Logic for generating the header file - SourceGenerator: Logic for generating the source file - KcfgParser: Logic for parsing the kcfg file and extracting the information from the Xml file - CommonStructs: a header that contains the structs that are currently used everywhere. - KConfigParameters: (was CfgConfig - ConfigConfig, wat) - Has information passed via the kcfgc file - kcfg_compiler - will be renamed to main - start the other classes and generates the files. This code here currently has the begining of this separation, with the CodeGenerator and the HeaderGenerator in a ~good~ state, but unfinished. Test Plan: - Run the test cases, - Compare the diffs generated by the testcases and fix in the code the errors / differences - Run and compare real kde source with the new and old generators to look for errors Reviewers: #frameworks, ervin, bport, dfaure Reviewed By: dfaure Subscribers: davidre, bcooksley, cgiboudeaux, kossebau, bport, ngraham, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D26202