File dont-touch-bashrc.diff of Package kde3-kcm_gtk

--- kcm_gtk/kcmgtk.cpp	2009/12/06 15:35:27	1.1
+++ kcm_gtk/kcmgtk.cpp	2009/12/06 15:35:30
@@ -334,7 +334,7 @@
 	QString themeName = themes[widget->styleBox->currentText()];
 	QString themeNameShort = widget->styleBox->currentText();
 	
-	stream << "# This file was written by KDE\n";
+	stream << "# This file was written by kcm_gtk\n";
 	stream << "# You can edit it in the KDE control center, under \"GTK Styles and Fonts\"\n";
 	stream << "\n";
 	stream << "include \"" << themeName << "\"\n";
@@ -366,33 +366,6 @@
 	
 	bool envFileDidNotExist = (!file.exists());
 	
-	file.open(IO_ReadWrite);
-	stream.setDevice(&file);
-	bool found = false;
-	for (;;)
-	{
-		QString line = stream.readLine();
-		if (line.isNull())
-			break;
-		
-		if (line.stripWhiteSpace().startsWith("export GTK2_RC_FILES=$HOME/" + GTK_RC_FILE))
-		{
-			found = true;
-			break;
-		}
-	}
-	if (!found)
-	{
-		stream << "#!/bin/bash\n\n";
-		stream << "# Make sure our customised gtkrc file is loaded.\n";
-		stream << "export GTK2_RC_FILES=$HOME/" + GTK_RC_FILE + "\n";
-	}
-	file.close();
-	
-	// Make it executable
-	if (!found)
-		chmod(file.name().utf8(), 0755);
-	
 	// Tell the user to restart KDE if the environment file was created this time
 	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);
@@ -408,7 +381,7 @@
 		file.readLine(firstLine, 50);
 		file.close();
 		
-		if (firstLine == "# This file was written by KDE")
+		if (firstLine == "# This file was written by kcm_gtk")
 			file.remove();
 	}
 	
openSUSE Build Service is sponsored by