summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2022-01-27 16:27:54 +0200
committerMavridis Philippe <mavridisf@gmail.com>2022-01-27 17:28:56 +0200
commitea4b637758ea3c50b06c9b6e34607eed1c8afd1c (patch)
treef161e58b83de043f246ccd37c1aa55b334787d15
parent70b0d4bf82b1a4f3502b09a35024c7821d834485 (diff)
downloadgtk-qt-engine-ea4b6377.tar.gz
gtk-qt-engine-ea4b6377.zip
KCM: Make sure Unicode is used for editing bashrc
This resolves issue #6. Signed-off-by: Mavridis Philippe <mavridisf@gmail.com> (cherry picked from commit a7d117f83a8077173ad95e28e3ba05ccf75eab70)
-rw-r--r--kcm_gtk/kcmgtk.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/kcm_gtk/kcmgtk.cpp b/kcm_gtk/kcmgtk.cpp
index 0667731..bd3ab79 100644
--- a/kcm_gtk/kcmgtk.cpp
+++ b/kcm_gtk/kcmgtk.cpp
@@ -509,13 +509,14 @@ void KcmGtk::save()
if (file.exists())
{
file.open(IO_ReadOnly);
- TQByteArray fileData = file.readAll();
+ TQTextStream fileDataStream = TQTextStream(&file);
+ fileDataStream.setEncoding(TQTextStream::Locale);
+ TQString fileDataString = fileDataStream.read();
file.close();
TQString rcLine = "export GTK2_RC_FILES=$HOME/.gtkrc-2.0";
- TQString fileDataString(fileData);
fileDataString.replace("\n" + rcLine, "\n# (This is no longer needed from version 0.8 of the theme engine)\n# " + rcLine);
-
+
file.open(IO_WriteOnly);
stream.setDevice(TQT_TQIODEVICE(&file));
stream << fileDataString;