summaryrefslogtreecommitdiffstats
path: root/depends/settings/src
diff options
context:
space:
mode:
Diffstat (limited to 'depends/settings/src')
-rw-r--r--depends/settings/src/inifile.cpp12
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');