Bug 95925

Summary: "Switching" to the same style that currently previewed triggers preview refresh
Product: kcontrol Reporter: Marcin Orlowski <carlos-spam>
Component: kcmstyleAssignee: Cristian Tibirna <tibirna>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Marcin Orlowski 2004-12-28 14:19:42 UTC
Version:            (using KDE 3.3.1,  (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-3)
OS:                Linux (i686) release 2.6.9

Switching styles with Widget Style slelection gadget triggers preview refresh no matter if user really changed previewed style say from "A" to "B" or just picked "A" again while "A" being previously selected. This causes unnecesary preview refresh and may also badly flicker on slower machines
Comment 1 Cristian Tibirna 2005-02-22 00:57:14 UTC
CVS commit by tibirna: 

CT: don't flicker style preview if same style chosen in the combobox.
    This patch was checked and fixed by Maksim Orlovich. Thank you.

BUGS:95925


  M +4 -0      kcmstyle.cpp   1.83


--- kdebase/kcontrol/style/kcmstyle.cpp  #1.82:1.83
@@ -838,4 +838,8 @@ void KCMStyle::styleChanged()
 void KCMStyle::switchStyle(const QString& styleName)
 {
+    // Don't flicker the preview if the same style is chosen in the cb
+    if (appliedStyle && appliedStyle->name() == styleName) 
+        return;
+
         // Create an instance of the new style...
         QStyle* style = QStyleFactory::create(styleName);