SHA256
1
0
forked from pool/kcoreaddons
Luca Beltrame 2019-02-25 08:14:23 +00:00 committed by Git OBS Bridge
parent 8abb56c78f
commit 2c47a7b11b
3 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,68 @@
From 16e8cf1e6607ae496515edce00a771ad0153b348 Mon Sep 17 00:00:00 2001
From: Milian Wolff <mail@milianw.de>
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 <alarrosa@suse.com> 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

View File

@ -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

View File

@ -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"