forcemerge 296657 314802 tags 296657 patch -- I've created a patch which uses $GTK2_RC_FILES on startup of kde to point to a special gtkrc-2.0-kde file. This will a) lead to independent configurations of the themes in KDE and GNOME and b) leave users .bashrc alone.
The patch is attached below (if you want to test) and sent to upstream. Cheers, Bastian -- Bastian Venthur http://venthur.de
diff -ruN /home/beechen/debian/gtk-qt-engine/gtk-qt-engine-0.7/kcm_gtk/kcmgtk.cpp ./kcm_gtk/kcmgtk.cpp --- /home/beechen/debian/gtk-qt-engine/gtk-qt-engine-0.7/kcm_gtk/kcmgtk.cpp 2006-06-25 01:58:55.000000000 +0200 +++ ./kcm_gtk/kcmgtk.cpp 2006-08-18 17:13:40.000000000 +0200 @@ -49,6 +49,12 @@ #include "kcmgtk.h" #include "mozillaprofile.h" + +// Define some constants +const QString KcmGtk::GTK_RC_FILE(".gtkrc-2.0-kde"); +const QString KcmGtk::KDE_RC_DIR(".kde/env/"); +const QString KcmGtk::GTK_QT_RC_FILE("gtk-qt-engine.rc.sh"); + /*typedef KGenericFactory<KcmGtk, QWidget> KcmGtkFactory; K_EXPORT_COMPONENT_FACTORY( kcm_gtk, KcmGtkFactory("gtk"))*/ @@ -213,7 +219,7 @@ void KcmGtk::load() { - parser.parse(QDir::homeDirPath() + "/.gtkrc-2.0"); + parser.parse(QDir::homeDirPath() + "/"+GTK_RC_FILE); bool usingQtEngine = false; if (!parser.style.isEmpty()) @@ -277,7 +283,7 @@ void KcmGtk::save() { // First write out the gtkrc file - QFile file(QDir::homeDirPath() + "/.gtkrc-2.0"); + QFile file(QDir::homeDirPath() + "/"+GTK_RC_FILE); file.open(IO_WriteOnly); QTextStream stream(&file); @@ -304,7 +310,13 @@ file.close(); // Now we check if that file is actually being loaded. - file.setName(QDir::homeDirPath() + "/.bashrc"); + QDir kdeRcDir; + if (!kdeRcDir.exists(QDir::homeDirPath() +"/"+ KDE_RC_DIR)) + { + // make sure KDE's rc dir exists (which does not by default on Debian) + kdeRcDir.mkdir(QDir::homeDirPath() +"/"+ KDE_RC_DIR); + } + file.setName(QDir::homeDirPath() +"/"+ KDE_RC_DIR +"/"+ GTK_QT_RC_FILE); file.open(IO_ReadWrite); stream.setDevice(&file); bool found = false; @@ -314,7 +326,7 @@ if (line.isNull()) break; - if (line.stripWhiteSpace().startsWith("export GTK2_RC_FILES=$HOME/.gtkrc-2.0")) + if (line.stripWhiteSpace().startsWith("export GTK2_RC_FILES=$HOME/"+GTK_RC_FILE)) { found = true; break; @@ -326,7 +338,7 @@ stream << "\n"; stream << "# This line was appended by KDE\n"; stream << "# Make sure our customised gtkrc file is loaded.\n"; - stream << "export GTK2_RC_FILES=$HOME/.gtkrc-2.0\n"; + stream << "export GTK2_RC_FILES=$HOME/"+GTK_RC_FILE+"\n"; } file.close(); diff -ruN /home/beechen/debian/gtk-qt-engine/gtk-qt-engine-0.7/kcm_gtk/kcmgtk.h ./kcm_gtk/kcmgtk.h --- /home/beechen/debian/gtk-qt-engine/gtk-qt-engine-0.7/kcm_gtk/kcmgtk.h 2006-06-25 01:58:55.000000000 +0200 +++ ./kcm_gtk/kcmgtk.h 2006-08-18 16:37:21.000000000 +0200 @@ -43,6 +43,13 @@ { Q_OBJECT + // How to name the kde-specific gtk-rc-file + static const QString GTK_RC_FILE; + // Where to search for KDE's config files + static const QString KDE_RC_DIR; + // How to name qtk-qt-engines rc-file + static const QString GTK_QT_RC_FILE; + public: KcmGtk( QWidget *parent=0, const char *name=0, const QStringList& = QStringList() ); ~KcmGtk();