diff --git a/kcm_gtk/kcmgtk.cpp b/kcm_gtk/kcmgtk.cpp index bd3ab79..7966803 100644 --- a/kcm_gtk/kcmgtk.cpp +++ b/kcm_gtk/kcmgtk.cpp @@ -413,6 +413,7 @@ void KcmGtk::save() TQFile file(TQDir::homeDirPath() + "/" + GTK_RC_FILE); file.open(IO_WriteOnly); TQTextStream stream(&file); + stream.setEncoding(TQTextStream::Locale); TQFont selectedFont(widget->fontKde->isChecked() ? TQApplication::font() : font); TQString fontName = selectedFont.family() + " " + @@ -509,11 +510,10 @@ void KcmGtk::save() if (file.exists()) { file.open(IO_ReadOnly); - TQTextStream fileDataStream = TQTextStream(&file); - fileDataStream.setEncoding(TQTextStream::Locale); - TQString fileDataString = fileDataStream.read(); + stream.setDevice(TQT_TQIODEVICE(&file)); + TQString fileDataString = stream.read(); file.close(); - + TQString rcLine = "export GTK2_RC_FILES=$HOME/.gtkrc-2.0"; fileDataString.replace("\n" + rcLine, "\n# (This is no longer needed from version 0.8 of the theme engine)\n# " + rcLine);