File work-by-default.diff of Package kcm_gtk

Subject: Make the selected style work by default
From: Lubos Lunak
Patch-upstream: no
Relates: kcm_gtk.suse.sh, gtkrc-2.0-kde4.template

In order to make the selected Gtk theme work by default we have system-wide kcm_gtk.suse.sh
instead of using kcm_gtk's gtk-qt-engine.rc.sh that kcm_gtk would otherwise install
after first configuration save. Our script creates ~/.gtkrc-2.0-kde4 with proper defaults
if not existing and does the Gtk theming setup that used to be in startkde.suse.sh.

--- kcm_gtk/kcmgtk.cpp.sav	2008-03-11 02:30:19.000000000 +0100
+++ kcm_gtk/kcmgtk.cpp	2010-04-30 14:45:28.520928763 +0200
@@ -115,6 +115,9 @@ void KcmGtk::save()
 	// Write ~/.gtkrc-2.0-kde4
 	m_gtkRc->save();
 	
+	if( !QFile::exists( "/usr/share/kde4/env/kcm_gtk.suse.sh"))
+	{
+
 	// Write ~/.kde/env/gtk-qt-engine.rc.sh
 	bool envFileDidNotExist = !QFile::exists(k_envFileName);
 	
@@ -137,6 +140,8 @@ void KcmGtk::save()
 	if (envFileDidNotExist)
 		QMessageBox::information(this, "Restart KDE", "Your changes have been saved, but you will have to restart KDE for them to take effect.", QMessageBox::Ok);
 	
+	} // end of /usr/share/kde4/env/...
+
 	// Write the KDE paths to a config file that gets picked up by the theme engine
 	// It used to popen kde-config, but that broke sometimes and seemed ugly
 	QSettings settings("gtk-qt-engine", "gtk-qt-engine");
openSUSE Build Service is sponsored by