diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-08-27 22:32:41 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-08-27 22:32:41 +0200 |
commit | fcd05ca2f6b7a76063c98e2720be758be1f67980 (patch) | |
tree | 29638132d6f5365a6db0ec0d42a3d3ff1caf9c3e /depends/settings/src/inifile.cpp | |
parent | a266e5d0ccafe1585bafd471d7a71181358ceb59 (diff) | |
download | MultiMC-fcd05ca2f6b7a76063c98e2720be758be1f67980.tar MultiMC-fcd05ca2f6b7a76063c98e2720be758be1f67980.tar.gz MultiMC-fcd05ca2f6b7a76063c98e2720be758be1f67980.tar.lz MultiMC-fcd05ca2f6b7a76063c98e2720be758be1f67980.tar.xz MultiMC-fcd05ca2f6b7a76063c98e2720be758be1f67980.zip |
Read mod files to get versions... and stuff.
Diffstat (limited to 'depends/settings/src/inifile.cpp')
-rw-r--r-- | depends/settings/src/inifile.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/depends/settings/src/inifile.cpp b/depends/settings/src/inifile.cpp index b3ee3a90..1eae5609 100644 --- a/depends/settings/src/inifile.cpp +++ b/depends/settings/src/inifile.cpp @@ -60,10 +60,16 @@ bool INIFile::saveFile(QString fileName) bool INIFile::loadFile(QString fileName) { - // TODO Handle errors. QFile file(fileName); - file.open(QIODevice::ReadOnly); - QTextStream in(&file); + if(!file.open(QIODevice::ReadOnly)) + return false; + bool success = loadFile(file.readAll()); + file.close(); + return success; +} +bool INIFile::loadFile( QByteArray file ) +{ + QTextStream in(file); in.setCodec("UTF-8"); QStringList lines = in.readAll().split('\n'); |