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:20:02 +0100
commit2377c2383804a42e1f2d167d3de23d0da8fdd80b (patch)
tree8d8519ba75110481d604892d4856f39661d4c54d
parentea4b637758ea3c50b06c9b6e34607eed1c8afd1c (diff)
downloadgtk-qt-engine-2377c2383804a42e1f2d167d3de23d0da8fdd80b.tar.gz
gtk-qt-engine-2377c2383804a42e1f2d167d3de23d0da8fdd80b.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> (cherry picked from commit b0aa8546df9e1c31e9b8e8aeae630d24e78a1d7f)
-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);