File dont-touch-bashrc.diff of Package kcm_gtk
--- kcm_gtk/kcmgtk.cpp 2007/08/28 15:28:57 1.1
+++ kcm_gtk/kcmgtk.cpp 2007/08/28 15:29:34
@@ -343,7 +343,7 @@
QString themeName = widget->styleKde->isChecked() ? themes["Qt"] : themes[widget->styleBox->currentText()];
QString themeNameShort = widget->styleKde->isChecked() ? QString("Qt") : 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";
@@ -375,33 +375,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);
@@ -417,7 +390,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();
}