Hello community, here is the log from the commit of package kconfig for openSUSE:Factory checked in at 2017-04-30 21:16:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kconfig (Old) and /work/SRC/openSUSE:Factory/.kconfig.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kconfig" Sun Apr 30 21:16:24 2017 rev:42 rq:492047 version:5.33.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kconfig/kconfig.changes 2017-03-28 15:09:01.349749303 +0200 +++ /work/SRC/openSUSE:Factory/.kconfig.new/kconfig.changes 2017-04-30 21:17:50.679909326 +0200 @@ -1,0 +2,22 @@ +Wed Apr 26 14:34:36 UTC 2017 - [email protected] + +- Add fix-locateLocal.patch to fix saving changes to submenus in + kmenuedit (kde#345100) + +------------------------------------------------------------------- +Sat Apr 15 10:11:45 CEST 2017 - [email protected] + +- Update to 5.33.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.33.0.php +- Changes since 5.32.0: + * Upgrade ECM and KF5 version requirements for 5.33.0 release. + * explicitly set NO_CMAKE_FIND_ROOT_PATH + * Remove unused QDateTime in KConfigBackend. + * Now that kconfigbackend.h isn't installed anymore, rename it to _p.h for clarity. + * Upgrade KF5 version to 5.33.0. + * Sanitize shortcut list on read/write from kdeglobals + * avoid useless reallocs by removing squeeze call on temporary buffer + +------------------------------------------------------------------- Old: ---- kconfig-5.32.0.tar.xz New: ---- fix-locateLocal.patch kconfig-5.33.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kconfig.spec ++++++ --- /var/tmp/diff_new_pack.x5Joii/_old 2017-04-30 21:17:51.351814589 +0200 +++ /var/tmp/diff_new_pack.x5Joii/_new 2017-04-30 21:17:51.355814024 +0200 @@ -18,9 +18,9 @@ %bcond_without lang %define sonum 5 -%define _tar_path 5.32 +%define _tar_path 5.33 Name: kconfig -Version: 5.32.0 +Version: 5.33.0 Release: 0 BuildRequires: cmake >= 3.0 BuildRequires: extra-cmake-modules >= %{_tar_path} @@ -40,6 +40,8 @@ Source1: baselibs.conf # PATCH-FEATURE-OPENSUSE Patch: kconfig-desktop-translations.patch +# PATCH-FIX-UPSTREAM +Patch1: fix-locateLocal.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -124,6 +126,7 @@ %prep %setup -q %patch -p1 +%patch1 -p1 %build %cmake_kf5 -d build -- -Dlconvert_executable=%{_kf5_libdir}/qt5/bin/lconvert ++++++ fix-locateLocal.patch ++++++ >From 3ad00c4e56eb9fe6ea7386f8ca1db6e15c26ac11 Mon Sep 17 00:00:00 2001 From: Wolfgang Bauer <[email protected]> Date: Tue, 25 Apr 2017 23:37:11 +0200 Subject: Fix relativePath calculation in KDesktopFile::locateLocal() The "dir" and "path" variables were obviously swapped here by mistake. This resulted in the relativePath always being empty, and made the function return "~/.local/share/" (or "~/.config/") instead of the correct path. BUG: 345100 FIXED-IN: 5.34.0 Differential Revision: https://phabricator.kde.org/D5502 --- autotests/kdesktopfiletest.cpp | 31 +++++++++++++++++++++++++++++++ autotests/kdesktopfiletest.h | 2 ++ src/core/kdesktopfile.cpp | 4 ++-- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/autotests/kdesktopfiletest.cpp b/autotests/kdesktopfiletest.cpp index 393a6a0..a046196 100644 --- a/autotests/kdesktopfiletest.cpp +++ b/autotests/kdesktopfiletest.cpp @@ -255,3 +255,34 @@ void KDesktopFileTest::testTryExecWithAuthorizeAction() QVERIFY(!desktopFile.tryExec()); } } + +void KDesktopFileTest::testLocateLocal_data() +{ + QString systemConfigLocation = QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation).last(); + QString writableConfigLocation = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); + QString systemDataLocation = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).last(); + QString writableDataLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); + + QTest::addColumn<QString>("path"); + QTest::addColumn<QString>("result"); + + QTest::newRow("configLocation, system-wide") << systemConfigLocation + "/test.desktop" << writableConfigLocation + "/test.desktop"; + QTest::newRow("autostart, system-wide") << systemConfigLocation + "/autostart/test.desktop" << writableConfigLocation + "/autostart/test.desktop"; + QTest::newRow("dataLocation, system-wide") << systemDataLocation + "/test.desktop" << writableDataLocation + "/test.desktop"; + QTest::newRow("applications, system-wide") << systemDataLocation + "/applications/test.desktop" << writableDataLocation + "/applications/test.desktop"; + QTest::newRow("desktop-directories, system-wide") << systemDataLocation + "/desktop-directories/test.directory" << writableDataLocation + "/desktop-directories/test.directory"; + QTest::newRow("configLocation, writable") << writableConfigLocation + "/test.desktop" << writableConfigLocation + "/test.desktop"; + QTest::newRow("autostart, writable") << writableConfigLocation + "/autostart/test.desktop" << writableConfigLocation + "/autostart/test.desktop"; + QTest::newRow("dataLocation, writable") << writableDataLocation + "/test.desktop" << writableDataLocation + "/test.desktop"; + QTest::newRow("applications, writable") << writableDataLocation + "/applications/test.desktop" << writableDataLocation + "/applications/test.desktop"; + QTest::newRow("desktop-directories, writable") << writableDataLocation + "/desktop-directories/test.directory" << writableDataLocation + "/desktop-directories/test.directory"; + QTest::newRow("unknown location") << "/test.desktop" << writableDataLocation + "/test.desktop"; +} + +void KDesktopFileTest::testLocateLocal() +{ + QFETCH(QString, path); + QFETCH(QString, result); + + QCOMPARE(KDesktopFile::locateLocal(path), result); +} diff --git a/autotests/kdesktopfiletest.h b/autotests/kdesktopfiletest.h index eb0bd1d..ed6679a 100644 --- a/autotests/kdesktopfiletest.h +++ b/autotests/kdesktopfiletest.h @@ -34,6 +34,8 @@ private Q_SLOTS: void testActionGroup(); void testIsAuthorizedDesktopFile(); void testTryExecWithAuthorizeAction(); + void testLocateLocal_data(); + void testLocateLocal(); }; diff --git a/src/core/kdesktopfile.cpp b/src/core/kdesktopfile.cpp index 4a55030..52a97ec 100644 --- a/src/core/kdesktopfile.cpp +++ b/src/core/kdesktopfile.cpp @@ -83,14 +83,14 @@ QString KDesktopFile::locateLocal(const QString &path) // Relative to config? (e.g. for autostart) Q_FOREACH (const QString &dir, QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation)) { if (path.startsWith(dir + plus)) { - relativePath = dir.mid(path.length() + 1); + relativePath = path.mid(dir.length() + 1); return QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + relativePath; } } // Relative to xdg data dir? (much more common) Q_FOREACH (const QString &dir, QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation)) { if (path.startsWith(dir + plus)) { - relativePath = dir.mid(path.length() + 1); + relativePath = path.mid(dir.length() + 1); } } if (relativePath.isEmpty()) { -- cgit v0.11.2 ++++++ kconfig-5.32.0.tar.xz -> kconfig-5.33.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/CMakeLists.txt new/kconfig-5.33.0/CMakeLists.txt --- old/kconfig-5.32.0/CMakeLists.txt 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/CMakeLists.txt 2017-04-01 21:29:57.000000000 +0200 @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.0) -set(KF5_VERSION "5.32.0") # handled by release scripts +set(KF5_VERSION "5.33.0") # handled by release scripts project(KConfig VERSION ${KF5_VERSION}) include(FeatureSummary) -find_package(ECM 5.32.0 NO_MODULE) +find_package(ECM 5.33.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/KF5ConfigConfig.cmake.in new/kconfig-5.33.0/KF5ConfigConfig.cmake.in --- old/kconfig-5.32.0/KF5ConfigConfig.cmake.in 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/KF5ConfigConfig.cmake.in 2017-04-01 21:29:57.000000000 +0200 @@ -8,7 +8,10 @@ find_dependency(Qt5Xml "@REQUIRED_QT_VERSION@") if(CMAKE_CROSSCOMPILING AND KF5_HOST_TOOLING) - find_file(KCONFIGCOMPILER_PATH KF5Config/KF5ConfigCompilerTargets.cmake PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH) + find_file(KCONFIGCOMPILER_PATH KF5Config/KF5ConfigCompilerTargets.cmake + PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} + NO_DEFAULT_PATH + NO_CMAKE_FIND_ROOT_PATH) include("${KCONFIGCOMPILER_PATH}") else() include("${CMAKE_CURRENT_LIST_DIR}/KF5ConfigCompilerTargets.cmake") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/po/cs/kconfig5_qt.po new/kconfig-5.33.0/po/cs/kconfig5_qt.po --- old/kconfig-5.32.0/po/cs/kconfig5_qt.po 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/po/cs/kconfig5_qt.po 2017-04-01 21:29:57.000000000 +0200 @@ -1,10 +1,10 @@ -# Vít Pelčák <[email protected]>, 2014, 2016. +# Vít Pelčák <[email protected]>, 2014, 2016, 2017. msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2014-04-11 02:17+0000\n" -"PO-Revision-Date: 2016-08-17 09:56+0100\n" +"PO-Revision-Date: 2017-03-08 10:13+0100\n" "Last-Translator: Vít Pelčák <[email protected]>\n" "Language-Team: Czech <[email protected]>\n" "Language: cs\n" @@ -469,7 +469,7 @@ #: kconf_update/kconf_update.cpp:958 msgctxt "main|" msgid "File(s) to read update instructions from" -msgstr "" +msgstr "Soubor(y) obsahující instrukce pro aktualizaci" #: kconfig_compiler/kconfig_compiler.cpp:1572 msgctxt "main|" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/po/gl/kconfig5_qt.po new/kconfig-5.33.0/po/gl/kconfig5_qt.po --- old/kconfig-5.32.0/po/gl/kconfig5_qt.po 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/po/gl/kconfig5_qt.po 2017-04-01 21:29:57.000000000 +0200 @@ -11,7 +11,7 @@ "Project-Id-Version: kwriteconfig\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2014-04-11 02:17+0000\n" -"PO-Revision-Date: 2017-01-28 17:13+0100\n" +"PO-Revision-Date: 2017-03-15 21:50+0100\n" "Last-Translator: Adrián Chaves Fernández (Gallaecio) <adriyetichaves@gmail." "com>\n" "Language-Team: Galician <[email protected]>\n" @@ -331,7 +331,7 @@ #: gui/kstandardshortcut.cpp:146 msgctxt "KStandardShortcut|@action" msgid "Fit To Width" -msgstr "Axustar ao ancho da páxina" +msgstr "Axustar á anchura da páxina" #: gui/kstandardshortcut.cpp:147 msgctxt "KStandardShortcut|@action" @@ -356,7 +356,7 @@ #: gui/kstandardshortcut.cpp:151 msgctxt "KStandardShortcut|@action" msgid "Document Back" -msgstr "Recuar no documento" +msgstr "Retroceder no documento" #: gui/kstandardshortcut.cpp:152 msgctxt "KStandardShortcut|@action" @@ -426,12 +426,12 @@ #: gui/kstandardshortcut.cpp:165 msgctxt "KStandardShortcut|@action" msgid "About Application" -msgstr "Acerca do aplicativo" +msgstr "Sobre o aplicativo" #: gui/kstandardshortcut.cpp:166 msgctxt "KStandardShortcut|@action" msgid "About KDE" -msgstr "Acerca de KDE" +msgstr "Sobre KDE" #: gui/kstandardshortcut.cpp:167 msgctxt "KStandardShortcut|@action" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/po/tr/kconfig5_qt.po new/kconfig-5.33.0/po/tr/kconfig5_qt.po --- old/kconfig-5.32.0/po/tr/kconfig5_qt.po 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/po/tr/kconfig5_qt.po 2017-04-01 21:29:57.000000000 +0200 @@ -4,22 +4,22 @@ # # Görkem Çetin <[email protected]>, 2003. # Serdar Soytetir <[email protected]>, 2008. -# Volkan Gezer <[email protected]>, 2014. +# Volkan Gezer <[email protected]>, 2014, 2017. # Kaan Ozdincer <[email protected]>, 2014. msgid "" msgstr "" "Project-Id-Version: kwriteconfig\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2014-04-11 02:17+0000\n" -"PO-Revision-Date: 2015-08-10 15:07+0000\n" -"Last-Translator: Kaan <[email protected]>\n" +"PO-Revision-Date: 2017-03-14 14:51+0100\n" +"Last-Translator: Volkan Gezer <[email protected]>\n" "Language-Team: Turkish <[email protected]>\n" "Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Lokalize 1.4\n" +"X-Generator: Lokalize 2.0\n" "X-Qt-Contexts: true\n" #: core/kconfig.cpp:909 @@ -432,22 +432,22 @@ #: gui/kstandardshortcut.cpp:167 msgctxt "KStandardShortcut|@action" msgid "Delete File" -msgstr "" +msgstr "Dosyayı Sil" #: gui/kstandardshortcut.cpp:168 msgctxt "KStandardShortcut|@action" msgid "Rename File" -msgstr "" +msgstr "Dosyayı Adlandır" #: gui/kstandardshortcut.cpp:169 msgctxt "KStandardShortcut|@action" msgid "Move to Trash" -msgstr "" +msgstr "Çöpe Taşı" #: gui/kstandardshortcut.cpp:170 msgctxt "KStandardShortcut|@action" msgid "Donate" -msgstr "" +msgstr "Bağış Yap" #: kconf_update/kconf_update.cpp:953 msgctxt "main|" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/src/core/kconfig.cpp new/kconfig-5.33.0/src/core/kconfig.cpp --- old/kconfig-5.32.0/src/core/kconfig.cpp 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/src/core/kconfig.cpp 2017-04-01 21:29:57.000000000 +0200 @@ -39,7 +39,7 @@ #include <unistd.h> #endif -#include "kconfigbackend.h" +#include "kconfigbackend_p.h" #include "kconfiggroup.h" #include <qcoreapplication.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/src/core/kconfig_p.h new/kconfig-5.33.0/src/core/kconfig_p.h --- old/kconfig-5.32.0/src/core/kconfig_p.h 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/src/core/kconfig_p.h 2017-04-01 21:29:57.000000000 +0200 @@ -25,7 +25,7 @@ #define KCONFIG_P_H #include "kconfigdata.h" -#include "kconfigbackend.h" +#include "kconfigbackend_p.h" #include "kconfiggroup.h" #include <QtCore/QStringList> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/src/core/kconfigbackend.cpp new/kconfig-5.33.0/src/core/kconfigbackend.cpp --- old/kconfig-5.32.0/src/core/kconfigbackend.cpp 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/src/core/kconfigbackend.cpp 2017-04-01 21:29:57.000000000 +0200 @@ -20,7 +20,7 @@ Boston, MA 02110-1301, USA. */ -#include "kconfigbackend.h" +#include "kconfigbackend_p.h" #include <QtCore/QDateTime> #include <QtCore/QStringList> @@ -38,8 +38,6 @@ class KConfigBackendPrivate { public: - qint64 size; - QDateTime lastModified; QString localFileName; static QString whatSystem(const QString & /*fileName*/) @@ -93,26 +91,6 @@ delete d; } -QDateTime KConfigBackend::lastModified() const -{ - return d->lastModified; -} - -void KConfigBackend::setLastModified(const QDateTime &dt) -{ - d->lastModified = dt; -} - -qint64 KConfigBackend::size() const -{ - return d->size; -} - -void KConfigBackend::setSize(qint64 sz) -{ - d->size = sz; -} - QString KConfigBackend::filePath() const { return d->localFileName; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/src/core/kconfigbackend.h new/kconfig-5.33.0/src/core/kconfigbackend.h --- old/kconfig-5.32.0/src/core/kconfigbackend.h 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/src/core/kconfigbackend.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,214 +0,0 @@ -/* - This file is part of the KDE libraries - Copyright (c) 2006, 2007 Thomas Braxton <[email protected]> - Copyright (c) 1999 Preston Brown <[email protected]> - Portions copyright (c) 1997 Matthias Kalle Dalheimer <[email protected]> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KCONFIGBACKEND_H -#define KCONFIGBACKEND_H - -#include <QtCore/QObject> -#include <QtCore/QString> -#include <QExplicitlySharedDataPointer> - -#include <kconfigcore_export.h> -#include <kconfigbase.h> -class KConfigBackendPrivate; - -class KEntryMap; -class QFile; -class QByteArray; -class QDateTime; - -/** - * \class KConfigBackend kconfigbackend.h <KConfigBackend> - * - * Provides the implementation for accessing configuration sources. - * - * KConfig only provides an INI backend, but this class can be used - * to create plugins that allow access to other file formats and - * configuration systems. - * - * \internal - */ -class KConfigBackend : public QObject, public QSharedData -{ - Q_OBJECT - -public: - /** - * Creates a new KConfig backend. - * - * If no @p system is given, or the given @p system is unknown, this method tries - * to determine the correct backend to use. - * - * @param fileName the absolute file name of the configuration file - * @param system the configuration system to use - * @return a KConfigBackend object to be used with KConfig - */ - static QExplicitlySharedDataPointer<KConfigBackend> create(const QString &fileName = QString(), - const QString &system = QString()); - - /** - * Registers mappings from directories/files to configuration systems - * - * Allows you to tell KConfigBackend that create() should use a particular - * backend for a particular file or directory. - * - * @warning currently does nothing - * - * @param entryMap the KEntryMap to build the mappings from - */ - static void registerMappings(const KEntryMap &entryMap); - - /** Destroys the backend */ - virtual ~KConfigBackend(); - - /** Allows the behaviour of parseConfig() to be tuned */ - enum ParseOption { - ParseGlobal = 1, /// entries should be marked as @em global - ParseDefaults = 2, /// entries should be marked as @em default - ParseExpansions = 4 /// entries are allowed to be marked as @em expandable - }; - Q_FLAG(ParseOption) - /// @typedef typedef QFlags<ParseOption> ParseOptions - Q_DECLARE_FLAGS(ParseOptions, ParseOption) - - /** Allows the behaviour of writeConfig() to be tuned */ - enum WriteOption { - WriteGlobal = 1 /// only write entries marked as "global" - }; - Q_FLAG(WriteOption) - /// @typedef typedef QFlags<WriteOption> WriteOptions - Q_DECLARE_FLAGS(WriteOptions, WriteOption) - - /** Return value from parseConfig() */ - enum ParseInfo { - ParseOk, /// the configuration was opened read/write - ParseImmutable, /// the configuration is @em immutable - ParseOpenError /// the configuration could not be opened - }; - - /** - * Read persistent storage - * - * @param locale the locale to read entries for (if the backend supports localized entries) - * @param pWriteBackMap the KEntryMap where the entries are placed - * @param options See ParseOptions - * @return See ParseInfo - */ - virtual ParseInfo parseConfig(const QByteArray &locale, - KEntryMap &pWriteBackMap, - ParseOptions options = ParseOptions()) = 0; - - /** - * Write the @em dirty entries to permanent storage - * - * @param locale the locale to write entries for (if the backend supports localized entries) - * @param entryMap the KEntryMap containing the config object's entries. - * @param options See WriteOptions - * - * @return @c true if the write was successful, @c false if writing the configuration failed - */ - virtual bool writeConfig(const QByteArray &locale, KEntryMap &entryMap, - WriteOptions options) = 0; - - /** - * If isWritable() returns false, writeConfig() will always fail. - * - * @return @c true if the configuration is writable, @c false if it is immutable - */ - virtual bool isWritable() const = 0; - /** - * When isWritable() returns @c false, return an error message to - * explain to the user why saving configuration will not work. - * - * The return value when isWritable() returns @c true is undefined. - * - * @returns a translated user-visible explanation for the configuration - * object not being writable - */ - virtual QString nonWritableErrorMessage() const = 0; - /** - * @return the read/write status of the configuration object - * - * @see KConfigBase::AccessMode - */ - virtual KConfigBase::AccessMode accessMode() const = 0; - /** - * Create the enclosing object of the configuration object - * - * For example, if the configuration object is a file, this should create - * the parent directory. - */ - virtual void createEnclosing() = 0; - - /** - * Set the file path. - * - * @note @p path @b MUST be @em absolute. - * - * @param path the absolute file path - */ - virtual void setFilePath(const QString &path) = 0; - - /** - * Lock the file - */ - virtual bool lock() = 0; - /** - * Release the lock on the file - */ - virtual void unlock() = 0; - /** - * @return @c true if the file is locked, @c false if it is not locked - */ - virtual bool isLocked() const = 0; - - /** - * @return the date and time when the object was last modified - */ - QDateTime lastModified() const; - /** @return the absolute path to the object */ - QString filePath() const; - /** @return the size of the object */ - qint64 size() const; - -protected: - KConfigBackend(); - void setLastModified(const QDateTime &dt); - void setSize(qint64 sz); - void setLocalFilePath(const QString &file); - -private: - KConfigBackendPrivate *const d; -}; - -Q_DECLARE_OPERATORS_FOR_FLAGS(KConfigBackend::ParseOptions) -Q_DECLARE_OPERATORS_FOR_FLAGS(KConfigBackend::WriteOptions) - -#if 0 // TODO re-enable if the plugin loading code is re-enabled -/** - * Register a KConfig backend when it is contained in a loadable module - */ -#define K_EXPORT_KCONFIGBACKEND(libname, classname) \ - K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) -#endif - -#endif // KCONFIGBACKEND_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/src/core/kconfigbackend_p.h new/kconfig-5.33.0/src/core/kconfigbackend_p.h --- old/kconfig-5.32.0/src/core/kconfigbackend_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/kconfig-5.33.0/src/core/kconfigbackend_p.h 2017-04-01 21:29:57.000000000 +0200 @@ -0,0 +1,205 @@ +/* + This file is part of the KDE libraries + Copyright (c) 2006, 2007 Thomas Braxton <[email protected]> + Copyright (c) 1999 Preston Brown <[email protected]> + Portions copyright (c) 1997 Matthias Kalle Dalheimer <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KCONFIGBACKEND_H +#define KCONFIGBACKEND_H + +#include <QtCore/QObject> +#include <QtCore/QString> +#include <QExplicitlySharedDataPointer> + +#include <kconfigcore_export.h> +#include <kconfigbase.h> +class KConfigBackendPrivate; + +class KEntryMap; +class QFile; +class QByteArray; + +/** + * \class KConfigBackend kconfigbackend_p.h <KConfigBackend> + * + * Provides the implementation for accessing configuration sources. + * + * KConfig only provides an INI backend, but this class can be used + * to create plugins that allow access to other file formats and + * configuration systems. + * + * \internal + */ +class KConfigBackend : public QObject, public QSharedData +{ + Q_OBJECT + +public: + /** + * Creates a new KConfig backend. + * + * If no @p system is given, or the given @p system is unknown, this method tries + * to determine the correct backend to use. + * + * @param fileName the absolute file name of the configuration file + * @param system the configuration system to use + * @return a KConfigBackend object to be used with KConfig + */ + static QExplicitlySharedDataPointer<KConfigBackend> create(const QString &fileName = QString(), + const QString &system = QString()); + + /** + * Registers mappings from directories/files to configuration systems + * + * Allows you to tell KConfigBackend that create() should use a particular + * backend for a particular file or directory. + * + * @warning currently does nothing + * + * @param entryMap the KEntryMap to build the mappings from + */ + static void registerMappings(const KEntryMap &entryMap); + + /** Destroys the backend */ + virtual ~KConfigBackend(); + + /** Allows the behaviour of parseConfig() to be tuned */ + enum ParseOption { + ParseGlobal = 1, /// entries should be marked as @em global + ParseDefaults = 2, /// entries should be marked as @em default + ParseExpansions = 4 /// entries are allowed to be marked as @em expandable + }; + Q_FLAG(ParseOption) + /// @typedef typedef QFlags<ParseOption> ParseOptions + Q_DECLARE_FLAGS(ParseOptions, ParseOption) + + /** Allows the behaviour of writeConfig() to be tuned */ + enum WriteOption { + WriteGlobal = 1 /// only write entries marked as "global" + }; + Q_FLAG(WriteOption) + /// @typedef typedef QFlags<WriteOption> WriteOptions + Q_DECLARE_FLAGS(WriteOptions, WriteOption) + + /** Return value from parseConfig() */ + enum ParseInfo { + ParseOk, /// the configuration was opened read/write + ParseImmutable, /// the configuration is @em immutable + ParseOpenError /// the configuration could not be opened + }; + + /** + * Read persistent storage + * + * @param locale the locale to read entries for (if the backend supports localized entries) + * @param pWriteBackMap the KEntryMap where the entries are placed + * @param options See ParseOptions + * @return See ParseInfo + */ + virtual ParseInfo parseConfig(const QByteArray &locale, + KEntryMap &pWriteBackMap, + ParseOptions options = ParseOptions()) = 0; + + /** + * Write the @em dirty entries to permanent storage + * + * @param locale the locale to write entries for (if the backend supports localized entries) + * @param entryMap the KEntryMap containing the config object's entries. + * @param options See WriteOptions + * + * @return @c true if the write was successful, @c false if writing the configuration failed + */ + virtual bool writeConfig(const QByteArray &locale, KEntryMap &entryMap, + WriteOptions options) = 0; + + /** + * If isWritable() returns false, writeConfig() will always fail. + * + * @return @c true if the configuration is writable, @c false if it is immutable + */ + virtual bool isWritable() const = 0; + /** + * When isWritable() returns @c false, return an error message to + * explain to the user why saving configuration will not work. + * + * The return value when isWritable() returns @c true is undefined. + * + * @returns a translated user-visible explanation for the configuration + * object not being writable + */ + virtual QString nonWritableErrorMessage() const = 0; + /** + * @return the read/write status of the configuration object + * + * @see KConfigBase::AccessMode + */ + virtual KConfigBase::AccessMode accessMode() const = 0; + /** + * Create the enclosing object of the configuration object + * + * For example, if the configuration object is a file, this should create + * the parent directory. + */ + virtual void createEnclosing() = 0; + + /** + * Set the file path. + * + * @note @p path @b MUST be @em absolute. + * + * @param path the absolute file path + */ + virtual void setFilePath(const QString &path) = 0; + + /** + * Lock the file + */ + virtual bool lock() = 0; + /** + * Release the lock on the file + */ + virtual void unlock() = 0; + /** + * @return @c true if the file is locked, @c false if it is not locked + */ + virtual bool isLocked() const = 0; + + /** @return the absolute path to the object */ + QString filePath() const; + +protected: + KConfigBackend(); + void setLocalFilePath(const QString &file); + +private: + KConfigBackendPrivate *const d; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(KConfigBackend::ParseOptions) +Q_DECLARE_OPERATORS_FOR_FLAGS(KConfigBackend::WriteOptions) + +#if 0 // TODO re-enable if the plugin loading code is re-enabled +/** + * Register a KConfig backend when it is contained in a loadable module + */ +#define K_EXPORT_KCONFIGBACKEND(libname, classname) \ + K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) +#endif + +#endif // KCONFIGBACKEND_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/src/core/kconfigini.cpp new/kconfig-5.33.0/src/core/kconfigini.cpp --- old/kconfig-5.32.0/src/core/kconfigini.cpp 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/src/core/kconfigini.cpp 2017-04-01 21:29:57.000000000 +0200 @@ -23,7 +23,7 @@ #include "kconfigini_p.h" #include "kconfig.h" -#include "kconfigbackend.h" +#include "kconfigbackend_p.h" #include "bufferfragment_p.h" #include "kconfigdata.h" @@ -600,14 +600,8 @@ const QFileInfo info(file); if (info.exists()) { setLocalFilePath(info.canonicalFilePath()); - setLastModified(info.lastModified()); - setSize(info.size()); } else { setLocalFilePath(file); - setSize(0); - QDateTime dummy; - dummy.setTime_t(0); - setLastModified(dummy); } } @@ -727,7 +721,6 @@ if (result.endsWith(' ') && type != GroupString) { result.replace(result.length() - 1, 1, "\\s"); } - result.squeeze(); return result; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/src/core/kconfigini_p.h new/kconfig-5.33.0/src/core/kconfigini_p.h --- old/kconfig-5.32.0/src/core/kconfigini_p.h 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/src/core/kconfigini_p.h 2017-04-01 21:29:57.000000000 +0200 @@ -24,7 +24,7 @@ #define KCONFIGINI_P_H #include <kconfigcore_export.h> -#include <kconfigbackend.h> +#include <kconfigbackend_p.h> class QLockFile; class QIODevice; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/src/core/ksharedconfig.cpp new/kconfig-5.33.0/src/core/ksharedconfig.cpp --- old/kconfig-5.32.0/src/core/ksharedconfig.cpp 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/src/core/ksharedconfig.cpp 2017-04-01 21:29:57.000000000 +0200 @@ -20,7 +20,7 @@ */ #include "ksharedconfig.h" -#include "kconfigbackend.h" +#include "kconfigbackend_p.h" #include "kconfiggroup.h" #include "kconfig_p.h" #include <QCoreApplication> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kconfig-5.32.0/src/gui/kstandardshortcut.cpp new/kconfig-5.33.0/src/gui/kstandardshortcut.cpp --- old/kconfig-5.32.0/src/gui/kstandardshortcut.cpp 2017-03-04 17:08:53.000000000 +0100 +++ new/kconfig-5.33.0/src/gui/kstandardshortcut.cpp 2017-04-01 21:29:57.000000000 +0200 @@ -187,6 +187,24 @@ } } + +// Sanitize the list for duplicates. For some reason some +// people have kdeglobals entries like +// Close=Ctrl+W; Ctrl+Esc; Ctrl+W; Ctrl+Esc; +// having the same shortcut more than once in the shortcut +// declaration is clearly bogus so fix it +static void sanitizeShortcutList(QList<QKeySequence> *list) +{ + for (int i = 0; i < list->size(); ++i) { + const QKeySequence &ks = list->at(i); + int other = list->indexOf(ks, i + 1); + while (other != -1) { + list->removeAt(other); + other = list->indexOf(ks, other); + } + } +} + /** Initialize the accelerator @p id by checking if it is overridden in the configuration file (and if it isn't, use the default). On X11, if QApplication was initialized with GUI disabled, @@ -209,6 +227,7 @@ QString s = cg.readEntry(info->name); if (s != QLatin1String("none")) { info->cut = QKeySequence::listFromString(s); + sanitizeShortcutList(&info->cut); } else { info->cut = QList<QKeySequence>(); } @@ -244,6 +263,7 @@ } // Write the changed shortcut to kdeglobals + sanitizeShortcutList(&info->cut); cg.writeEntry(info->name, QKeySequence::listToString(info->cut), KConfig::Global | KConfig::Persistent); }
