commit 8e0405441294b3550bab92a9d8070771fc4045c9
Author: David Nadlinger <david.nadlinger@gmail.com>
Date:   Wed Nov 19 21:00:35 2008 +0100

    Fixed a little bug (dropdowns on the general tab were not updated correctly); removed a few unneeded function calls and stale connects, cleaned up a bit.

diff --git a/kcmkwin/kwincompositing/main.cpp b/kcmkwin/kwincompositing/main.cpp
index fac67a5..a9ad806 100644
--- a/kcmkwin/kwincompositing/main.cpp
+++ b/kcmkwin/kwincompositing/main.cpp
@@ -88,8 +88,6 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList
     connect(ui.effectAnimations, SIGNAL(toggled(bool)), this, SLOT(changed()));
 
     connect(ui.effectSelector, SIGNAL(changed(bool)), this, SLOT(changed()));
-    connect(ui.effectSelector, SIGNAL(configCommitted(const QByteArray&)),
-            this, SLOT(reparseConfiguration(const QByteArray&)));
 
     connect(ui.windowSwitchingCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()));
     connect(ui.desktopSwitchingCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()));
@@ -98,7 +96,6 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList
     connect(ui.edges_monitor, SIGNAL(changed()), this, SLOT(changed()));
     connect(ui.edges_monitor, SIGNAL(edgeSelectionChanged(int,int)), this, SLOT(electricBorderSelectionChanged(int,int)));
 
-    connect(ui.compositingType, SIGNAL(currentIndexChanged(int)), this, SLOT(compositingModeChanged()));
     connect(ui.compositingType, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()));
     connect(ui.windowThumbnails, SIGNAL(activated(int)), this, SLOT(changed()));
     connect(ui.disableChecks, SIGNAL(toggled(bool)), this, SLOT(changed()));
@@ -228,14 +225,16 @@ void KWinCompositingConfig::currentTabChanged(int tab)
     // block signals to don't emit the changed()-signal by just switching the current tab
     blockSignals(true);
     // write possible changes done to synchronize effect checkboxes and selector
+    // TODO: This segment is prone to fail when the UI is changed;
+    // you'll most likely not think of the hard coded numbers here when just changing the order of the tabs.
     if (tab == 0)
     {
         // General tab was activated
         saveEffectsTab();
         loadGeneralTab();
-    }
-    else
-    {
+        }
+    else if ( tab == 2 )
+        {
         // Effects tab was activated
         saveGeneralTab();
         loadEffectsTab();
@@ -266,6 +265,8 @@ void KWinCompositingConfig::loadGeneralTab()
 #undef LOAD_EFFECT_CONFIG
 
     // window switching
+    // Set current option to "none" if no plugin is activated.
+    ui.windowSwitchingCombo->setCurrentIndex( 0 );
     if( effectEnabled( "boxswitch", effectconfig ))
         ui.windowSwitchingCombo->setCurrentIndex( 1 );
     if( effectEnabled( "coverswitch", effectconfig ))
@@ -277,14 +278,14 @@ void KWinCompositingConfig::loadGeneralTab()
         ui.windowSwitchingCombo->setCurrentIndex( 2 );
 
     // desktop switching
+    // Set current option to "none" if no plugin is activated.
+    ui.desktopSwitchingCombo->setCurrentIndex( 0 );
     if( effectEnabled( "slide", effectconfig ))
         ui.desktopSwitchingCombo->setCurrentIndex( 1 );
     KConfigGroup cubeconfig(mNewConfig, "Effect-Cube");
     if( effectEnabled( "cube", effectconfig ) && cubeconfig.readEntry("AnimateDesktopChange", false))
         ui.desktopSwitchingCombo->setCurrentIndex( 2 );
-
-    loadElectricBorders();
-}
+    }
 
 bool KWinCompositingConfig::effectEnabled( const QString& effect, const KConfigGroup& cfg ) const
 {
@@ -335,11 +336,12 @@ void KWinCompositingConfig::load()
     copyPluginsToTmpConfig();
 
     loadGeneralTab();
+    loadElectricBorders();
     loadEffectsTab();
     loadAdvancedTab();
 
     emit changed( false );
-}
+    }
 
 void KWinCompositingConfig::saveGeneralTab()
     {
@@ -423,9 +425,7 @@ void KWinCompositingConfig::saveGeneralTab()
         }
     KConfigGroup cubeconfig(mNewConfig, "Effect-Cube");
     cubeconfig.writeEntry("AnimateDesktopChange", cubeDesktopSwitching);
-
-    saveElectricBorders();
-}
+    }
 
 void KWinCompositingConfig::saveEffectsTab()
 {
diff --git a/workspace.cpp b/workspace.cpp
index fccf285..89e4d2c 100644
--- a/workspace.cpp
+++ b/workspace.cpp
@@ -972,19 +972,6 @@ void Workspace::reconfigure()
     reconfigureTimer.start( 200 );
     }
 
-// This DBUS call is used by the compositing kcm. Since the reconfigure()
-// DBUS call delays the actual reconfiguring, it is not possible to immediately
-// call compositingActive(). Therefore the kcm will instead call this to ensure
-// the reconfiguring has already happened.
-bool Workspace::waitForCompositingSetup()
-    {
-    if( !reconfigureTimer.isActive())
-        return false;
-    reconfigureTimer.stop();
-    slotReconfigure();
-    return compositingActive();
-    }
-
 void Workspace::slotSettingsChanged(int category)
     {
     kDebug(1212) << "Workspace::slotSettingsChanged()";
@@ -1065,7 +1052,6 @@ void Workspace::slotReconfigure()
         setupCompositing();
         if( effects ) // setupCompositing() may fail
             effects->reconfigure();
-        addRepaintFull();
     }
     else
         finishCompositing();
diff --git a/workspace.h b/workspace.h
index c710bfd..4bc78ff 100644
--- a/workspace.h
+++ b/workspace.h
@@ -262,8 +262,7 @@ class Workspace : public QObject, public KDecorationDefines
         void previousDesktop();
         void circulateDesktopApplications();
         bool compositingActive();
-        bool waitForCompositingSetup();
-        
+
         void setCurrentScreen( int new_screen );
 
         QString desktopName( int desk ) const;
