Only use QTextStream::setCodec() with Qt < 6
This commit is contained in:
@@ -61,7 +61,9 @@ void ScrobblerCache::ReadCache() {
|
|||||||
if (!result) return;
|
if (!result) return;
|
||||||
|
|
||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
stream.setCodec("UTF-8");
|
stream.setCodec("UTF-8");
|
||||||
|
#endif
|
||||||
QString data = stream.readAll();
|
QString data = stream.readAll();
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
@@ -179,7 +181,9 @@ void ScrobblerCache::WriteCache() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
stream.setCodec("UTF-8");
|
stream.setCodec("UTF-8");
|
||||||
|
#endif
|
||||||
stream << doc.toJson();
|
stream << doc.toJson();
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user