kde-frameworks/qqc2-desktop-style: Move dbus connection in singleton

"Substantially improves the speed and responsiveness of large and complicated
QML-based apps."

Upstream commit f8e56a22721057107bccdf319da36ff82ca2a804

Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2020-09-29 14:23:07 +02:00
parent 50fe5cd824
commit 0265fd381f
2 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
From f8e56a22721057107bccdf319da36ff82ca2a804 Mon Sep 17 00:00:00 2001
From: Marco Martin <notmart@gmail.com>
Date: Mon, 7 Sep 2020 09:52:57 +0000
Subject: [PATCH] move the dbus connection in the singleton
connecting to dbus is expensive, do it only once in the singleton
the theme instance will only connecto to the signal forwarded by
the singleton
---
.../plasmadesktoptheme.cpp | 20 +++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/kirigami-plasmadesktop-integration/plasmadesktoptheme.cpp b/kirigami-plasmadesktop-integration/plasmadesktoptheme.cpp
index babb433..ff046eb 100644
--- a/kirigami-plasmadesktop-integration/plasmadesktoptheme.cpp
+++ b/kirigami-plasmadesktop-integration/plasmadesktoptheme.cpp
@@ -45,6 +45,14 @@ public:
{
connect(qGuiApp, &QGuiApplication::paletteChanged,
this, &StyleSingleton::refresh);
+
+ // Use DBus in order to listen for kdeglobals changes directly, as the
+ // QApplication doesn't expose the font variants we're looking for,
+ // namely smallFont.
+ QDBusConnection::sessionBus().connect( QString(),
+ QStringLiteral( "/KGlobalSettings" ),
+ QStringLiteral( "org.kde.KGlobalSettings" ),
+ QStringLiteral( "notifyChange" ), this, SIGNAL(configurationChanged()));
}
void refresh()
@@ -125,6 +133,7 @@ public:
KColorScheme viewScheme;
Q_SIGNALS:
+ void configurationChanged();
void paletteChanged();
private:
@@ -161,14 +170,6 @@ PlasmaDesktopTheme::PlasmaDesktopTheme(QObject *parent)
});
}
- // Use DBus in order to listen for kdeglobals changes directly, as the
- // QApplication doesn't expose the font variants we're looking for,
- // namely smallFont.
- QDBusConnection::sessionBus().connect( QString(),
- QStringLiteral( "/KGlobalSettings" ),
- QStringLiteral( "org.kde.KGlobalSettings" ),
- QStringLiteral( "notifyChange" ), this, SLOT(configurationChanged()));
-
//TODO: correct? depends from https://codereview.qt-project.org/206889
connect(qGuiApp, &QGuiApplication::fontDatabaseChanged, this, [this]() {setDefaultFont(qApp->font());});
configurationChanged();
@@ -181,6 +182,9 @@ PlasmaDesktopTheme::PlasmaDesktopTheme(QObject *parent)
connect(s_style->data(), &StyleSingleton::paletteChanged,
this, &PlasmaDesktopTheme::syncColors);
+ connect(s_style->data(), &StyleSingleton::configurationChanged,
+ this, &PlasmaDesktopTheme::configurationChanged);
+
syncColors();
}
--
GitLab

View File

@@ -0,0 +1,30 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
ECM_QTHELP="false"
PVCUT=$(ver_cut 1-2)
QTMIN=5.14.2
inherit ecm kde.org
DESCRIPTION="Style for QtQuickControls 2 that uses QWidget's QStyle for painting"
LICENSE="|| ( GPL-2+ LGPL-3+ )"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
IUSE=""
DEPEND="
>=dev-qt/qtdeclarative-${QTMIN}:5=
>=dev-qt/qtgui-${QTMIN}:5
>=dev-qt/qtwidgets-${QTMIN}:5
=kde-frameworks/kconfigwidgets-${PVCUT}*:5
=kde-frameworks/kiconthemes-${PVCUT}*:5
=kde-frameworks/kirigami-${PVCUT}*:5
"
RDEPEND="${DEPEND}
>=dev-qt/qtgraphicaleffects-${QTMIN}:5
>=dev-qt/qtquickcontrols2-${QTMIN}:5
"
PATCHES=( "${FILESDIR}"/${P}-move-dbus-connection-in-singleton.patch )