summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2022-01-27 17:06:49 +0100
committerSlávek Banko <slavek.banko@axis.cz>2022-01-27 17:08:07 +0100
commitb0aa8546df9e1c31e9b8e8aeae630d24e78a1d7f (patch)
treef99a5c3b4e9c67f00fe5e7ccb16b2b301e6d89d2
parenta7d117f83a8077173ad95e28e3ba05ccf75eab70 (diff)
downloadgtk-qt-engine-b0aa8546df9e1c31e9b8e8aeae630d24e78a1d7f.tar.gz
gtk-qt-engine-b0aa8546df9e1c31e9b8e8aeae630d24e78a1d7f.zip
KCM: Use an existing `stream` when write configuration files
instead of defining a new `fileDataStream`. This also resolves FTBFS from prior commit. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--kcm_gtk/kcmgtk.cpp8
1 files 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);