Diffstat (limited to 'noncore/apps/opie-reader/preferences.cpp') (more/less context) (ignore whitespace changes)
-rwxr-xr-x | noncore/apps/opie-reader/preferences.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/preferences.cpp b/noncore/apps/opie-reader/preferences.cpp index 0f59a22..67960ed 100755 --- a/noncore/apps/opie-reader/preferences.cpp +++ b/noncore/apps/opie-reader/preferences.cpp | |||
@@ -1,32 +1,33 @@ | |||
1 | |||
1 | #ifndef USEQPE | 2 | #ifndef USEQPE |
2 | 3 | ||
3 | #include "preferences.h" | 4 | #include "preferences.h" |
4 | 5 | ||
5 | #include <qfile.h> | 6 | #include <qfile.h> |
6 | #include <qtextstream.h> | 7 | #include <qtextstream.h> |
7 | 8 | ||
8 | Config::Config(const QString& _fn) : fname(_fn) | 9 | Config::Config(const QString& _fn) : fname(_fn) |
9 | { | 10 | { |
10 | // qDebug("Config::Config:%s", (const char*)fname); | 11 | // qDebug("Config::Config:%s", (const char*)fname); |
11 | QFile fl(fname); | 12 | QFile fl(fname); |
12 | if (fl.open(IO_ReadOnly)) | 13 | if (fl.open(IO_ReadOnly)) |
13 | { | 14 | { |
14 | QTextStream t(&fl); | 15 | QTextStream t(&fl); |
15 | QString key, value; | 16 | QString key, value; |
16 | while (!t.eof()) | 17 | while (!t.eof()) |
17 | { | 18 | { |
18 | QString data = t.readLine(); | 19 | QString data = t.readLine(); |
19 | int colon = data.find(':'); | 20 | int colon = data.find(':'); |
20 | if (colon > 0) | 21 | if (colon > 0) |
21 | { | 22 | { |
22 | QString key = data.left(colon); | 23 | QString key = data.left(colon); |
23 | QString value = data.right(data.length()-colon-1); | 24 | QString value = data.right(data.length()-colon-1); |
24 | values[key] = value; | 25 | values[key] = value; |
25 | } | 26 | } |
26 | } | 27 | } |
27 | fl.close(); | 28 | fl.close(); |
28 | } | 29 | } |
29 | // read entries into values | 30 | // read entries into values |
30 | } | 31 | } |
31 | Config::~Config() | 32 | Config::~Config() |
32 | { | 33 | { |