diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-05-02 21:34:55 +0200 |
---|---|---|
committer | Sefa Eyeoglu <contact@scrumplex.net> | 2022-07-10 12:19:15 +0200 |
commit | c36342371819a4983b5ac2b928acc6a78b857ed8 (patch) | |
tree | 925d5ef6756a205feddc40864c0717e0c6472d44 /launcher/settings/INIFile.cpp | |
parent | e58158c3cd629717a9742fe08da9b09ed39bc198 (diff) | |
download | PrismLauncher-c36342371819a4983b5ac2b928acc6a78b857ed8.tar.gz PrismLauncher-c36342371819a4983b5ac2b928acc6a78b857ed8.tar.bz2 PrismLauncher-c36342371819a4983b5ac2b928acc6a78b857ed8.zip |
refactor: fix deprecation up to Qt 6
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'launcher/settings/INIFile.cpp')
-rw-r--r-- | launcher/settings/INIFile.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/launcher/settings/INIFile.cpp b/launcher/settings/INIFile.cpp index 6a3c801d..450ddc3f 100644 --- a/launcher/settings/INIFile.cpp +++ b/launcher/settings/INIFile.cpp @@ -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++) |