From 2c47a7b11bd5f447a1421a6633af4cafe55f82c51edee394dabb35c37f9b99be Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Mon, 25 Feb 2019 08:14:23 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kcoreaddons?expand=0&rev=189 --- 0001-Do-not-use-functor-if-Qt-lt-5.10.patch | 68 +++++++++++++++++++++ kcoreaddons.changes | 7 +++ kcoreaddons.spec | 6 ++ 3 files changed, 81 insertions(+) create mode 100644 0001-Do-not-use-functor-if-Qt-lt-5.10.patch diff --git a/0001-Do-not-use-functor-if-Qt-lt-5.10.patch b/0001-Do-not-use-functor-if-Qt-lt-5.10.patch new file mode 100644 index 0000000..27f8368 --- /dev/null +++ b/0001-Do-not-use-functor-if-Qt-lt-5.10.patch @@ -0,0 +1,68 @@ +From 16e8cf1e6607ae496515edce00a771ad0153b348 Mon Sep 17 00:00:00 2001 +From: Milian Wolff +Date: Thu, 11 Jan 2018 15:39:35 +0100 +Subject: Optimize: use QMetaObject::invokeMethod with functor + +Summary: +When using this method with a string argument, the method would need +to be queried every time via QMetaObject::indexOfMethod. Using a +functor one can get rid of this, saving a few cycles which can +add up when handling many inotify events. + +Note that the benchmark timing does not really improve significantly. +Using a profiler like perf, we do see that less cycles are consumed +though. In my measurement, this reduces the cpu cyles by about 2%. + +Reviewers: dfaure + +Subscribers: #frameworks + +Tags: #frameworks + +Differential Revision: https://phabricator.kde.org/D9823 +--- + src/lib/io/kdirwatch.cpp | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +(limited to 'src/lib/io/kdirwatch.cpp') + +Rebased by Antonio Larrosa to recover this patch +which was later removed by +https://cgit.kde.org/kcoreaddons.git/commit/src/lib/io/kdirwatch.cpp?id=026bbfe17707b0f3999b8b461e24480a8a539226 + +diff --git a/src/lib/io/kdirwatch.cpp b/src/lib/io/kdirwatch.cpp +index eb8aeeb..7213ee6 100644 +--- a/src/lib/io/kdirwatch.cpp ++++ b/src/lib/io/kdirwatch.cpp +@@ -1405,16 +1405,28 @@ void KDirWatchPrivate::emitEvent(Entry *e, int event, const QString &fileName) + // Emit the signals delayed, to avoid unexpected re-entrance from the slots (#220153) + + if (event & Deleted) { ++#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) ++ QMetaObject::invokeMethod(c.instance, "setDeleted", Qt::QueuedConnection, Q_ARG(QString, path)); ++#else + QMetaObject::invokeMethod(c.instance, [c, path]() { c.instance->setDeleted(path); }, Qt::QueuedConnection); ++#endif + } + + if (event & Created) { ++#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) ++ QMetaObject::invokeMethod(c.instance, "setCreated", Qt::QueuedConnection, Q_ARG(QString, path)); ++#else + QMetaObject::invokeMethod(c.instance, [c, path]() { c.instance->setCreated(path); }, Qt::QueuedConnection); ++#endif + // possible emit Change event after creation + } + + if (event & Changed) { ++#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) ++ QMetaObject::invokeMethod(c.instance, "setDirty", Qt::QueuedConnection, Q_ARG(QString, path)); ++#else + QMetaObject::invokeMethod(c.instance, [c, path]() { c.instance->setDirty(path); }, Qt::QueuedConnection); ++#endif + } + } + } +-- +cgit v1.1 + diff --git a/kcoreaddons.changes b/kcoreaddons.changes index 64dfad3..09dd3c6 100644 --- a/kcoreaddons.changes +++ b/kcoreaddons.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Feb 15 09:17:36 UTC 2019 - alarrosa@suse.com + +- Add 0001-Do-not-use-functor-if-Qt-lt-5.10.patch to revert the removal of + support for Qt 5.9 +- Downgrade the Qt version requirement to build with 5.9 + ------------------------------------------------------------------- Sun Feb 10 22:03:03 UTC 2019 - lbeltrame@kde.org diff --git a/kcoreaddons.spec b/kcoreaddons.spec index 793afe8..ae0dcad 100644 --- a/kcoreaddons.spec +++ b/kcoreaddons.spec @@ -32,6 +32,8 @@ Group: System/GUI/KDE URL: https://www.kde.org Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz Source1: baselibs.conf +# PATCH-FIX-OPENSUSE +Patch0: 0001-Do-not-use-functor-if-Qt-lt-5.10.patch BuildRequires: cmake >= 3.0 BuildRequires: extra-cmake-modules >= %{_tar_path} BuildRequires: fdupes @@ -80,6 +82,10 @@ replacement, accessing user information and many more. Development files. %prep %setup -q +%autopatch -p1 +%if 0%{?suse_version} == 1500 +sed -i -e "s/^set *(REQUIRED_QT_VERSION 5.10.0)$/set(REQUIRED_QT_VERSION 5.9.0)/" CMakeLists.txt +%endif %build %cmake_kf5 -d build -- -Dlconvert_executable=%{_kf5_libdir}/qt5/bin/lconvert -DKDE4_DEFAULT_HOME=".kde4"