Age | Commit message (Collapse) | Author |
|
|
|
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).
|
|
This is a followup to commit 3c861a6c3860d516
|
|
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.
|
|
This is basically the C++ counter-part to
https://invent.kde.org/frameworks/kconfig/-/merge_requests/94
and allows to easily retrofit window size persistence on existing windows/
dialogs, replacing e.g. code like
https://invent.kde.org/pim/pimcommon/-/blob/master/src/pimcommon/widgets/kpimprintpreviewdialog.cpp.
This is a bit more complicated than one might expect, as KWindowConfig
works with QWindows, but that's something freshly created QWidget windows/
dialogs don't have yet. Additionally, we are in a library here that doesn't
depend on Qt::Widgets. To overcome this we move the widget-dependent code
(basically just a call to QWidget::windowHandle()) to inline template code
(and thus into the consumer), use std::function's type erasure to pass it
into the library code, and an event filter on the widget to wait for the
QWindow to become available.
|
|
|
|
Since we are not building the library but the source files we
don't want the macro to expand to __declspec(dllimport).
|
|
It will trigger side effects like triggering the dbus signal
which depending on the timing may be delivered only in the next
test case causing an unexpected change signal emission.
|
|
Currently an application needs to be restarted before it can see
any changes made to the standard shortcut configuration. To notify
about changes a new class is introduced that looks for those
changes using KConfigWatcher and also updates the global map.
CCBUG:426656
|
|
In Qt6 the Q_GLOBAL_STATIC will already report to be null while it is in
the process of being deleted, we therefore cannot access it anymore from
destruction code path as we did before.
This problem is hit for example by the Breeze style, making all 6 based
widgets applications crash on exit without this.
|
|
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
|
|
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.
|
|
|
|
Making sure that it runs and not segfaults
|
|
|
|
|
|
|
|
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
|
|
clang-tidy checks:
readability-isolate-declaration and readability-braces-around-statements
KF task: https://phabricator.kde.org/T14729
GIT_SILENT
|
|
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.
|
|
GIT_SILENT
|
|
No impact on the rest of the test, but I was wondering if it might
break anything, better restore it just in case.
|
|
NO_CHANGELOG
|
|
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.
|
|
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
|
|
|
|
"Policy CMP0115 is not set: Source file extensions must be explicit. Run
"cmake --help-policy CMP0115" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
"
We need to add file extension
|
|
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.
|
|
This fixes the clang warning
globalsettings_kmail.h:58:5: warning: '~GlobalSettingsBase' overrides a destructor but is not marked 'override' [-Wsuggest-destructor-override]
|
|
|
|
Relicense approved by relicensecheck except:
- lgplv2+: a.volkov@rusbitech.ru
a.volkov@rusbitech.ru ( 1 LOC): d328dd6
Which is a non-copyrightible trivial change.
|
|
Now it creates C++ code that uses QString::arg(Args...) instead of
arg().arg().
AFAICS, the type of the "Args" is QString, so this should work.
|
|
- This has the same logic as QMap::constFind(); less detaching and now we
can use auto keyword when creating iterators and always get a const_iterator
even when calling constFindEntry() on a non-const map.
- Use QCOMPARE() where appropriate in the unit tests.
|
|
NO_CHANGELOG
|
|
GIT_SILENT
|
|
It's a QByteArray not a QString.
GIT_SILENT
|
|
I didn't consider the '#ifdef Q_OS_WIN' code paths (since that compiles
just fine locally).
GIT_SILENT
|
|
- Use a global var for a QString that's used many times
- Break up long-all-cap variable names, it makes it harder to read (and
I've fixed one typo in one of those ALLCAPS)
- Fix some clazy warnings, make global QString objects in unit tests
static (so that the compiler doesn't create symbols for them, it doesn't
matter in a unit test but KF code acts as a reference sometimes that
others copy from, tip from dfaure)
- Add TODO note about changing kconfig_compiler to generate C++ code that
uses multi-arg QString::arg(QString, QString, QString) instead of
QString::arg().arg()
- More const; more QString::at() instead of operator[] where appropriate
- Use a ternary where it makes the code more readable (and uses less lines :))
NO_CHANGELOG
|
|
NO_CHANGELOG
|
|
NO_CHANGELOG
|
|
NO_CHANGELOG
|
|
NO_CHANGELOG
|
|
Fix some clazy warnings, and some other minor code optimisations.
NO_CHANGELOG
|
|
I stored a file's lastModified() into KConfig, to compare with it
again on next start, and the loss of milliseconds made the code think
the timestamps didn't match, even when they did.
|
|
In Qt6 QTextCodec/QTextStream::setCodec is replaced with
QTextStream::setEncoding(QStringConverter::Encoding)
Also UTF-8 is the new default for QTextStream.
|