summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/preferences.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/preferences.cpp') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/apps/opie-reader/preferences.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/preferences.cpp b/noncore/apps/opie-reader/preferences.cpp
index b9397cf..0f59a22 100755
--- a/noncore/apps/opie-reader/preferences.cpp
+++ b/noncore/apps/opie-reader/preferences.cpp
@@ -1,49 +1,48 @@
1#include "useqpe.h"
2#ifndef USEQPE 1#ifndef USEQPE
3 2
4#include "preferences.h" 3#include "preferences.h"
5 4
6#include <qfile.h> 5#include <qfile.h>
7#include <qtextstream.h> 6#include <qtextstream.h>
8 7
9Config::Config(const QString& _fn) : fname(_fn) 8Config::Config(const QString& _fn) : fname(_fn)
10{ 9{
11// qDebug("Config::Config:%s", (const char*)fname); 10// qDebug("Config::Config:%s", (const char*)fname);
12 QFile fl(fname); 11 QFile fl(fname);
13 if (fl.open(IO_ReadOnly)) 12 if (fl.open(IO_ReadOnly))
14 { 13 {
15 QTextStream t(&fl); 14 QTextStream t(&fl);
16 QString key, value; 15 QString key, value;
17 while (!t.eof()) 16 while (!t.eof())
18 { 17 {
19 QString data = t.readLine(); 18 QString data = t.readLine();
20 int colon = data.find(':'); 19 int colon = data.find(':');
21 if (colon > 0) 20 if (colon > 0)
22 { 21 {
23 QString key = data.left(colon); 22 QString key = data.left(colon);
24 QString value = data.right(data.length()-colon-1); 23 QString value = data.right(data.length()-colon-1);
25 values[key] = value; 24 values[key] = value;
26 } 25 }
27 } 26 }
28 fl.close(); 27 fl.close();
29 } 28 }
30// read entries into values 29// read entries into values
31} 30}
32Config::~Config() 31Config::~Config()
33{ 32{
34// qDebug("Config::~Config:%s", (const char*)fname); 33// qDebug("Config::~Config:%s", (const char*)fname);
35 QFile fl(fname); 34 QFile fl(fname);
36 if (fl.open(IO_WriteOnly)) 35 if (fl.open(IO_WriteOnly))
37 { 36 {
38 QTextStream t(&fl); 37 QTextStream t(&fl);
39 for (QMap<QString,QString>::Iterator iter = values.begin(); 38 for (QMap<QString,QString>::Iterator iter = values.begin();
40 iter != values.end(); 39 iter != values.end();
41 iter++) 40 iter++)
42 { 41 {
43 t << iter.key() << ':' << iter.data() << '\n'; 42 t << iter.key() << ':' << iter.data() << '\n';
44 } 43 }
45 fl.close(); 44 fl.close();
46 } 45 }
47} 46}
48QString Config::readEntry(const QString& key, const QString& deflt) 47QString Config::readEntry(const QString& key, const QString& deflt)
49{ 48{