From 3a81753dc8d590cbd512b60ef9969f7d94bb877d Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sat, 15 Jan 2022 15:32:03 +0100 Subject: [PATCH] [kstyle] Use application attribute instead of reading config file to check whether to draw menu icons The current code creates a KSharedConfig for every invokation, which is wasteful There is an application attribute that we can use to check what we want plasma-integration sets that attribute based on the same setting we are reading here This way the config is only read when needed There is one behavior change: plasma-integration only checks kdeglobals, not the app's config file, so overriding the behavior for one app only is no longer possible. However that's not something we expose in any UI anyway --- kstyle/breezestyle.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index 567d21bc..448d6111 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -7482,8 +7482,7 @@ namespace Breeze //____________________________________________________________________ bool Style::showIconsInMenuItems() const { - const KConfigGroup g(KSharedConfig::openConfig(), "KDE"); - return g.readEntry("ShowIconsInMenuItems", true); + return !QApplication::testAttribute(Qt::AA_DontShowIconsInMenus); } //____________________________________________________________________ -- GitLab