From 6eb967faf189ac53e6efa746730b7c44805328c0 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Tue, 19 Aug 2014 22:05:20 +0200 Subject: [PATCH] fix 'recursion' crash when running againts kde4 --- kstyle/breezestyle.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index 121bd7a0..0b8baba3 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -320,13 +320,24 @@ namespace Breeze break; default: - icon = ParentStyleClass::standardIcon( standardPixmap, option, widget ); break; } - const_cast(&_iconCache)->insert( standardPixmap, icon ); - return icon; + if( icon.isNull() ) + { + + // do not cache parent style icon, since it may change at runtime + #if QT_VERSION >= 0x050000 + return ParentStyleClass::standardIcon( standardPixmap, option, widget ); + #else + return ParentStyleClass::standardIconImplementation( standardPixmap, option, widget ); + #endif + + } else { + const_cast(&_iconCache)->insert( standardPixmap, icon ); + return icon; + } }