Age | Commit message (Collapse) | Author |
|
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.
|
|
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
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
NO_CHANGELOG
|
|
QStringView has some bits of API that were only added in 5.15.2, whereas KF
requires 5.15.0.
This reverts commit 1780fb2a237af80ddc1f9cfb70cb892b53b91990.
|
|
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
|
|
NO_CHANGELOG
|
|
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
|
|
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.
|
|
|
|
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
|
|
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.
|
|
- Use more range-for loops where appropriate
- Use auto instead of the usually-long iterator type names
- Use cbegin/cend(), to match the std:: containers, less confusion
- Use qDeleteAll instead of a for loop
- Make a QRE with a long-ish pattern static
NO_CHANGELOG
|
|
- Use QString::arg(Args...) instead of .arg().arg()
- Use QLatin1String for string comparisons, should be faster
- Use QLatin1String::arg() for better readability
- Add the comment dfaure suggested in the MR, to explain why it's '2%'
then '%1' in a QString().arg().arg()
NO_CHANGELOG
|
|
The implicit conversion fails in Qt6
|
|
NO_CHANGELOG
|
|
- 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
|
|
NO_CHANGELOG
|
|
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
|
|
Fix some clazy warnings, and some other minor code optimisations.
NO_CHANGELOG
|
|
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"
|
|
Frameworks will be Frameworks 6 at some point and there is no good reason to have the major version in the variable name.
Given this is purely internal we can to this now, making it a bit more future-proof
GIT_SILENT
NO_CHANGELOG
|
|
KDEWIN_LIBRARIES is never defined
|
|
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 C++20 there are new classes that have member functions named emit().
c.f.:
https://lists.qt-project.org/pipermail/development/2020-February/038812.html
https://en.cppreference.com/w/cpp/io/basic_osyncstream/emit
GIT_SILENT
|
|
Using QMutex in recursive mode is deprecated.
|
|
|
|
Forward declaring it breaks with Qt6
|
|
GIT_SILENT
|
|
See https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/4
(*) by me :-)
|
|
Without this, bNotify was not set on copies, making Notify a noop.
CCBUG: 428771
|
|
|
|
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"
|
|
config paths.
Since windows has some generic config paths that are parents of other generic config paths
e.g. c:/CraftRoot/build/_/<hash>/build/bin followed by c:/CraftRoot/build/_/<hash>/build/bin/data
we need to search for locations from the last location to the first.
|
|
GIT_SILENT
|
|
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.
|
|
"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.
|
|
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
|
|
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.
|
|
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"
|