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>
pull/8/head
Slávek Banko 2 years ago
parent a7d117f83a
commit b0aa8546df
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);
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);

Loading…
Cancel
Save