diff options
author | Mavridis Philippe <[email protected]> | 2022-01-27 16:27:54 +0200 |
---|---|---|
committer | Mavridis Philippe <[email protected]> | 2022-01-27 17:28:56 +0200 |
commit | ea4b637758ea3c50b06c9b6e34607eed1c8afd1c (patch) | |
tree | f161e58b83de043f246ccd37c1aa55b334787d15 /kcm_gtk | |
parent | 70b0d4bf82b1a4f3502b09a35024c7821d834485 (diff) | |
download | gtk-qt-engine-ea4b637758ea3c50b06c9b6e34607eed1c8afd1c.tar.gz gtk-qt-engine-ea4b637758ea3c50b06c9b6e34607eed1c8afd1c.zip |
KCM: Make sure Unicode is used for editing bashrc
This resolves issue #6.
Signed-off-by: Mavridis Philippe <[email protected]>
(cherry picked from commit a7d117f83a8077173ad95e28e3ba05ccf75eab70)
Diffstat (limited to 'kcm_gtk')
-rw-r--r-- | kcm_gtk/kcmgtk.cpp | 7 |
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; |