aboutsummaryrefslogtreecommitdiff
path: root/src/kconf_update/kconf_update.cpp
AgeCommit message (Collapse)Author
2022-03-06kconf_update: Fix checking for changes of update filesIlya Pominov
We save time of last modification in seconds, so compare only seconds. The incorrect comparison was introduced by a6e83f97d255023a76c8e8c83a5363f949c6d346 in monolithic kdelibs.
2021-11-14Avoid some allocations by QString/QByteArray's toLower()Friedrich W. H. Kossebau
NO_CHANGELOG
2021-10-20GIT_SILENT Remove a bit of dead codeAlexander Lohnau
2021-08-28GIT_SILENT: we can use std::as_const directlyLaurent Montel
2021-08-13clang-tidy: one declaration per line; braces around statementsAhmad Samir
clang-tidy checks: readability-isolate-declaration and readability-braces-around-statements KF task: https://phabricator.kde.org/T14729 GIT_SILENT
2021-03-06Minor code optimisationAhmad Samir
- 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
2021-02-22Fix formatting in a couple of places after running clang-formatAhmad Samir
NO_CHANGELOG
2021-02-22Run clang-format on all cpp/h filesAhmad Samir
NO_CHANGELOG
2021-02-06Less implicit cast from ASCIIAhmad Samir
NO_CHANGELOG
2021-02-06Preincerment/predecrement operator where the post ones aren't neededAhmad Samir
NO_CHANGELOG
2021-01-17Adapt to Qt6 text codec changesNicolas Fella
In Qt6 QTextCodec/QTextStream::setCodec is replaced with QTextStream::setEncoding(QStringConverter::Encoding) Also UTF-8 is the new default for QTextStream.
2020-10-16kconf_update: Allow repeated tests in --testmode by ignoring kconf_updatercDavid Hurka
https://techbase.kde.org/Development/Tools/Using_kconf_update#Debugging_and_testing describes how to run repeated tests of kconf_update scripts in --testmode. It is necessary to delete update group flags from kconf_updaterc, which is inconvenient. With this patch, kconf_update will not use kconf_updaterc when in --testmode, so this step is no longer necessary. Additionally, running all installed update scripts automatically is no longer possible in --testmode, since that is probably only useful if you have your home directory in ~/.qttest/config/. I don’t expect problems, since this affects only --testmode, and the update group flags are still present in the modified config files themselves.
2020-08-30autotests: stop polluting /tmp with kconf_update.* temp filesDavid Faure
2020-08-30kconf_update: test the return value of QTemporaryFile::open() for good measureDavid Faure
2020-07-07Use camelcase include. (scripted)Laurent Montel
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-01-03Remove endl at the end of qdebugLaurent Montel
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-08-24String code optimization: use QLatin1String/QChar overload for string concatFriedrich W. H. Kossebau
GIT_SILENT
2019-03-12[kconf_update] move from custom logging tech to qCDebugHarald Sitter
Summary: the previous logging tech got kind of defunct in 2014 (to the point where it was basically qCDebug). seeing as no one really complained it seems reasonable to just move to qCDebug instead and make use of category filters and other qdebug goodness (such as system logging facilities for the various platforms) - new logging category kf5.kconfig.update; at info level by default (i.e. unless otherwise configured kconf_update is now silent) - --debug cmdline option now also attempts to force-enable the debug mode on that category (and debugs that attempt in of itself, so we don't get confused by categories magically getting enabled). - all log() calls are now qCDebug calls - all logFileErorr() calls (which was context-sensitive to the .upd file parsing) have been changed to qCDebugFile - qCDebugFile is a new *macro* wrapping around qCDebug to give it file context - everything is now qCDebug instead of qDebug - arguments updated to drop excess quoting and spaces to reduce "noise" https://markmail.org/thread/ofaeqcabguxyohyb Test Plan: updater still works and debugs when debug is enabled Reviewers: apol, aacid, #frameworks Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D19508
2019-03-03[Kconfig] Compile without foreachLaurent Montel
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
2019-01-09KonfUpdate: delete copy constructor and assignment operatorAlbert Astals Cid
they are unused, but if anyone would use them things would go wrong, so protect us from it
2018-03-11Remove not necessary QtCore and coLaurent Montel
2017-01-16Prefer nullptr over Q_NULLPTRKevin Funk
2015-12-29Ensure KonfUpdate's fields are all initialized.Matthew Dawson
These fields should all be written to before they are read during normal operation, but this ensures they have a sensible default in case they are not. Coverity issue 1291513.
2015-12-23Fix some Clazy warningsImran Tatriev
2015-10-05Minor optimizationsAlbert Astals Cid
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
2015-08-05finish the port to QCommandLineParser (it has addPositionalArgument now)David Faure
2015-08-05test_kconf_update: use QStandardPaths test modeDavid Faure
to avoid touching the user's real files
2015-05-02Fix kconf_update for spaces in pathsDavid Faure
(CI says it happens on OSX) Unittest it on Linux by exporting XDG_DATA_HOME with a space in it. CCMAIL: kde-mac@kde.org
2015-02-14Revert "Revert the SIC in commit 915976c1238be811f169eab1b02f7e8dad6410e0."Matthew Dawson
This reverts commit 9eee15917e01a89d937d1cba2eebbe9d65daeb72. As agreed with David Faure, we are going to leave this change in place for 5.7 and see what happens. CCMAIL: faure@kde.org CHANGELOG: Reverts previous commit, both can be left out of the changelog.
2015-02-14Revert the SIC in commit 915976c1238be811f169eab1b02f7e8dad6410e0.Matthew Dawson
On further reflection, introducing a SIC to fix the bug is not ideal. I'm working on something that will address the underlying bug, but I didn't have it in time for 5.7. The versioning behaviour is left, as I do want it to exist for the future. This only reverts the mandatory versioning of files to avoid the compatibility break. CHANGELOG: Undo 915976c123, which never saw a release, enough to avoid the SIC.
2015-01-06Don't upgrate config file with upd file from kde4.Montel Laurent
This patch is necessary because: When we use kf5 + kde4 application, kconf_update which launchs at the start when we launch kde. But it will migrate some config file, for example it will show that we need to migrate konversation so it will create a konversationrc in .config/ But when we launch konversation there is a kdelibs4migrator which wants to migrate settings and config in .config but it shows a konversationrc in .config so it will never migrate and we will lose all settings. So we can force to remove all .upd in kf5 but it will not fix problem during migration or when we have kde4 application install in same directory as kf5. So now I force for each upd file to have a "Version=5" so kconf_update (kf5) will migrate just kf5 upd file and it will fix my bugs. REVIEW: 121797 CHANGELOG: Now kconf_update doesn't process upd file from kde4. We need to add "Version=5" in top of the upd file otherwise it will be skipped.
2014-06-12Simple CleanupsThomas Braxton
- use Q_NULLPTR instead of 0 or NULL - simplify some foreach loops - use QStringLiteral in a few places - added a few consts REVIEW: 118666
2014-05-23Fix searching of paths in kconf_updateDavid Edmundson
Previous code said if we found an executable in kconf_update_bin try to find a different executable in the normal path Reviewed-by: Rohan Garg
2014-05-07Fix kconf_update test on WindowsAlex Richardson
We get a CMake warning for reading the LOCATION property, but I don't see how else to do it (generator expressions don't seem to work)
2014-05-07Use QProcess in kconf_updateAlex Richardson
This allows removing some custom WIN32 API code and is also nicer than directly calling system()
2014-03-24Remove unhelpful commentsAlex Merry
These lines of code do not really require any justification. REVIEW: 116962
2013-12-18Code reformatted using kde-dev-scripts/astyle-kdelibs.David Faure
Use git blame -w 867e7a5 to show authorship as it was before this commit.
2013-12-18Move kconfig code to the root directory.Jenkins CI