[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-frameworks-devel
Subject:    Re: changing icon sizes no longer emits signal
From:       David Faure <faure () kde ! org>
Date:       2020-04-26 12:24:27
Message-ID: 1667299.VLH7GnMWUR () asterix
[Download RAW message or body]

On Saturday, April 25, 2020 4:54:43 PM CEST Friedrich W. H. Kossebau wrote:
> Am Samstag, 25. April 2020, 15:10:37 CEST schrieb Martin Koller:
> > Hi,
> > 
> > in liquidshell I'm using
> > 
> >   connect(KIconLoader::global(), &KIconLoader::iconLoaderSettingsChanged,
> > 
> > this, &StartMenu::adjustIconSize);
> > 
> > to be informed whenever the icon sizes get changed in systemsettings.
> > I don't know since when but at least in version
> > 
> > Operating System: openSUSE Tumbleweed 20200419
> > KDE Plasma Version: 5.18.4
> > KDE Frameworks Version: 5.69.0
> > Qt Version: 5.14.1
> > 
> > I no longer receive this signal.
> 
> I can confirm that changing icon sizes in Plasma Systemsettings and clicking
> apply seems to have no effect also for all other places which would adapt
> to those values, like KXmlGui-driven toolbars (which also by a quick check
> seems to connect to that signal). The changed sizes are only picked up by
> newly started instances of programs.
> I am also on openSUSE TW with same versions. Also not sure when I saw this
> working the last time.
> 
> Given the API dox of KIconLoader does not note that signal is deprecated, I
> would assume this signal is still to be used (and main.cpp of the icon kcm
> seems to call KIconLoader::emitChange(...), which should trigger the signal
> via D-Bus in all client side, from a peek view at code path.

The call to KIconLoader::emitChange is deeply nested in KDE4 compat stuff, 
with possible exit paths before.

A patch like the one attached seems to help, but someone who knows the KCM 
better (or has time to dig) should make this conditional on the user actually 
changing icon sizes, and only emit for the groups that have changed.

-- 
David Faure, faure@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5

["kcm_icons.diff" (kcm_icons.diff)]

diff --git i/kcms/icons/main.cpp w/kcms/icons/main.cpp
index 172d9bc18..4ab2f5150 100644
--- i/kcms/icons/main.cpp
+++ w/kcms/icons/main.cpp
@@ -148,7 +148,10 @@ void IconModule::save()
 
     processPendingDeletions();
 
-    KIconLoader::global()->newIconLoader();
+    // TODO do this only for the group(s) where icon sizes have changed
+    for (int i = 0; i < KIconLoader::LastGroup; i++) {
+        KIconLoader::emitChange(KIconLoader::Group(i));
+    }
 }
 
 bool IconModule::isSaveNeeded() const
@@ -288,8 +291,6 @@ void IconModule::exportToKDE4()
 
         //message kde4 apps that icon theme is changed
         for (int i = 0; i < KIconLoader::LastGroup; i++) {
-            KIconLoader::emitChange(KIconLoader::Group(i));
-
             QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/KGlobalSettings"),
                                                               QStringLiteral("org.kde.KGlobalSettings"),
                                                               QStringLiteral("notifyChange"));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic