From b0aa8546df9e1c31e9b8e8aeae630d24e78a1d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 27 Jan 2022 17:06:49 +0100 Subject: [PATCH] KCM: Use an existing `stream` when write configuration files instead of defining a new `fileDataStream`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also resolves FTBFS from prior commit. Signed-off-by: Slávek Banko --- kcm_gtk/kcmgtk.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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);