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 b0aa8546df)
r14.0.x
Slávek Banko 3 years ago
parent ea4b637758
commit 2377c23838
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -413,6 +413,7 @@ void KcmGtk::save()
TQFile file(TQDir::homeDirPath() + "/" + GTK_RC_FILE); TQFile file(TQDir::homeDirPath() + "/" + GTK_RC_FILE);
file.open(IO_WriteOnly); file.open(IO_WriteOnly);
TQTextStream stream(&file); TQTextStream stream(&file);
stream.setEncoding(TQTextStream::Locale);
TQFont selectedFont(widget->fontKde->isChecked() ? TQApplication::font() : font); TQFont selectedFont(widget->fontKde->isChecked() ? TQApplication::font() : font);
TQString fontName = selectedFont.family() + " " + TQString fontName = selectedFont.family() + " " +
@ -509,9 +510,8 @@ void KcmGtk::save()
if (file.exists()) if (file.exists())
{ {
file.open(IO_ReadOnly); file.open(IO_ReadOnly);
TQTextStream fileDataStream = TQTextStream(&file); stream.setDevice(TQT_TQIODEVICE(&file));
fileDataStream.setEncoding(TQTextStream::Locale); TQString fileDataString = stream.read();
TQString fileDataString = fileDataStream.read();
file.close(); file.close();
TQString rcLine = "export GTK2_RC_FILES=$HOME/.gtkrc-2.0"; TQString rcLine = "export GTK2_RC_FILES=$HOME/.gtkrc-2.0";

Loading…
Cancel
Save