Age | Commit message (Collapse) | Author |
|
- use the strings in a QStringList directly
- slightly better readability: less if-else-nesting, return early
GIT_SILENT
|
|
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.
|
|
We were calling open(), then fopen(), then QFile::open(). This patch
removes the fopen() call that does not seem to do anything.
|
|
|
|
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.
|
|
|
|
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.
|
|
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
|
|
NO_CHANGELOG
|
|
NO_CHANGELOG
|
|
NO_CHANGELOG
|
|
|
|
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
|
|
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
|
|
|
|
|
|
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
|
|
Summary: According to clazy since KConfigIniBackend::BufferFragment is very small it's faster to just copy it
Reviewers: apol
Reviewed By: apol
Subscribers: apol, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D19666
|
|
Summary: compile without foreach
Test Plan: Unittest Ok as previously
Reviewers: dfaure
Reviewed By: dfaure
Subscribers: kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D19326
|
|
Summary:
commit 6a18528 introduced escaping of bytes >= 127 to ensure that
KConfig files are valid UTF8.
The simplistic approach with a cutoff results in many escaped bytes
where it is not required. Especially non-western configuration files
would have many escapes.
This commit fixes that by only escaping bytes that are not valid UTF8.
BUG: 403557
FIXED-IN: 5.56
Test Plan: ninja && ninja test
Reviewers: dfaure, arichardson, apol, #frameworks, thiago
Subscribers: rapiteanu, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D19107
|
|
Summary:
When /home is a symlink, for instance (as is often the case on FreeBSD),
group deletion would fail because KConfig was comparing non-canonical
paths with canonical-paths:
QDEBUG : KConfigTest::testDelete() Comparing "/home/adridg/.qttest/config/
kconfigtest_subdir/kconfigtest" and "/usr/home/adridg/.qttest/config/
kconfigtest_subdir/kconfigtest"
Test Plan:
mkdir /tmp/derp; ln -s /tmp/derp /tmp/drop
HOME=/tmp/derp bin/kconfigtest testDelete # Success
HOME=/tmp/drop bin/kconfigtest testDelete # Fail
Reviewers: adridg, arichardson, apol
Reviewed By: apol
Subscribers: kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D14927
|
|
Summary:
Bytes from 'Strings' of type GroupString and KeyString should not be
escaped because they are valid UTF-8. Only instances of ValueString
should be escaped.
This fixes the failing test KConfigTest::testEncoding
Test Plan: Ran `ninja test` and found no errors.
Reviewers: dfaure, arichardson, apol, aacid, ngraham
Reviewed By: apol
Subscribers: kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D17856
|
|
Summary:
UserBase tells me that KDE configuration files are encoded in UTF-8.
https://userbase.kde.org/KDE_System_Administration/Configuration_Files
In practice some *rc files have bytes outside that encoding. In my home directory I found two files that are not valid UTF-8.
I searched with
find ~/.config/ -name '*rc' -exec file {} +
which gives these exceptions:
akonadiconsolerc: Non-ISO extended-ASCII text, with very long lines
kmail2rc: Non-ISO extended-ASCII text, with very long lines
In kmail2rc, the offending fields are
[AttachmentView]/State
[CollectionFolderView]/HeaderState
Both are QByteArray values saved from QHeaderView::saveState().
In the instance I found, the offending bytes were 0x81 and 0x84.
akonadiconsolerc had way more of these values. All seem related to saving widget state and hence probably QByteArrays.
The written QByteArray values look very strange. The bytes in the non-printable ASCII range are written as \xXX but the values above 127 are written literally.
The encoding is done by KConfigIniBackend::stringToPrintable. It does not currently escape bytes that are larger than or equal to 127.
Reviewers: dfaure, arichardson, apol
Reviewed By: apol
Subscribers: apol, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D17651
|
|
Summary: They were not being split properly.
Test Plan: Tests pass, including the new one.
Reviewers: #frameworks, dfaure
Reviewed By: dfaure
Subscribers: dfaure, anthonyfieroni, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D14162
|
|
As per the Desktop Entry spec, we strip trailing whitespace from the key
when we split an entry into a key/value pair at the '='. Now we also
strip leading whitespace from the resulting value like we should.
CCBUG:310674
Differential Revision: https://phabricator.kde.org/D7169
|
|
Spotted because it leads to race conditions due to tzset
(surely a Qt bug, but anyway no point in finding out lastModified
for nothing).
While at it, remove the unused size field as well.
|
|
clarity.
|
|
Differential Revision: https://phabricator.kde.org/D4941
|
|
|
|
Differential Revision: https://phabricator.kde.org/D3987
|
|
Differential Revision: https://phabricator.kde.org/D990
|
|
Ran the clazy tool (http://www.kdab.com/use-static-analysis-improve-performance/)
Mostly QStringLiteral/QLatin1String additions
A few const & additions to non public methods
Compiles, test pass
REVIEW: 125106
|
|
Previously the warning "Invalid escape sequence "\;"." would appear and
"\;" was replaced with just the backslash as is done for all
unrecognized escape sequences. Keep both characters so that
readXdgListEntry() works with values containing semicolons
REVIEW: 119074
|
|
|
|
This fixes a regression introduced in
988f09bb051dca0437ecec431ee44ed5b4a560d8.
The mentioned commit ensures that if the locale is e.g. "de_DE" the
entry "de" will be used. But this breaks if there is a translation
for another country. E.g. for "de_CH" it would also pick the "de"
entry.
This change now operates on both just the language code and the locale.
If an entry with the language code is present it will be picked. If
another entry with the exact locale is found it will be overwritten.
Modifiers are not supported as this is currently missing in QLocale.
REVIEW: 118692
|
|
Yet another awesome application of the Qt implicit sharing trick.
Since config files often contain only few different keys and even
value strings, we can share them. This reduces memory consumption
and also speeds up parsing, as we do not have to allocate the
duplicated strings, but can simply reuse the previous values.
The most extreme case for this of my knowledge, is KatePart:
katesyntaxhighlightingrc has more than 20k lines which triggered
nearly 30k allocations on startup. With this patch applied, this
value goes down dramatically. I added a simple static counter for
the cache hit/miss ratio, which resulted in 5442 cache misses compared
to 43624 cache hits across all KConfig files parsed by kwrite.
REVIEW: 118587
This is a forward-port of b8aaeff128233cfaecf67899168887572589dde8.
|
|
- use Q_NULLPTR instead of 0 or NULL
- simplify some foreach loops
- use QStringLiteral in a few places
- added a few consts
REVIEW: 118666
|
|
This reverts commit c15e319455b7e93439eb445e2e2670ec3122e697.
The real fix is in Qt, let's go back to using lock() here, as intended
by QLockFile.
|
|
Use git blame -w 867e7a5 to show authorship as it was before this commit.
|
|
|