Only use QTextStream::setCodec() with Qt < 6

This commit is contained in:
Jonas Kvinge 2020-07-18 04:27:21 +02:00
parent 3927b3bf27
commit aeb32783d6
1 changed files with 4 additions and 0 deletions

View File

@ -61,7 +61,9 @@ void ScrobblerCache::ReadCache() {
if (!result) return;
QTextStream stream(&file);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
stream.setCodec("UTF-8");
#endif
QString data = stream.readAll();
file.close();
@ -179,7 +181,9 @@ void ScrobblerCache::WriteCache() {
return;
}
QTextStream stream(&file);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
stream.setCodec("UTF-8");
#endif
stream << doc.toJson();
file.close();