refactor: fix deprecation up to Qt 6
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
@ -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++)
|
||||
|
Reference in New Issue
Block a user