refactor: fix deprecation up to Qt 6

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu
2022-05-02 21:34:55 +02:00
parent e58158c3cd
commit c363423718
22 changed files with 118 additions and 43 deletions

View File

@ -29,7 +29,7 @@ INIFile::INIFile()
QString INIFile::unescape(QString orig)
{
QString out;
QChar prev = 0;
QChar prev = QChar::Null;
for(auto c: orig)
{
if(prev == '\\')
@ -42,7 +42,7 @@ QString INIFile::unescape(QString orig)
out += '#';
else
out += c;
prev = 0;
prev = QChar::Null;
}
else
{
@ -52,7 +52,7 @@ QString INIFile::unescape(QString orig)
continue;
}
out += c;
prev = 0;
prev = QChar::Null;
}
}
return out;
@ -117,7 +117,9 @@ bool INIFile::loadFile(QString fileName)
bool INIFile::loadFile(QByteArray file)
{
QTextStream in(file);
#if QT_VERSION <= QT_VERSION_CHECK(6, 0, 0)
in.setCodec("UTF-8");
#endif
QStringList lines = in.readAll().split('\n');
for (int i = 0; i < lines.count(); i++)