Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/preferences/configobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ template <class ValueType> bool ConfigObject<ValueType>::parse() {
int group = 0;
QString groupStr, line;
QTextStream text(&configfile);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
DEBUG_ASSERT(text.encoding() == QStringConverter::Utf8);
#else
text.setCodec("UTF-8");
#endif

while (!text.atEnd()) {
line = text.readLine().trimmed();
Expand Down Expand Up @@ -213,7 +217,12 @@ bool ConfigObject<ValueType>::save() {
return false;
}
QTextStream stream(&tmpFile);
// UTF-8 is the default in Qt6.
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
DEBUG_ASSERT(stream.encoding() == QStringConverter::Utf8);
#else
stream.setCodec("UTF-8");
Comment thread
Be-ing marked this conversation as resolved.
#endif

QString group = "";

Expand Down