summaryrefslogtreecommitdiff
path: root/noncore/apps/zsafe/qsettings.cpp
Unidiff
Diffstat (limited to 'noncore/apps/zsafe/qsettings.cpp') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/apps/zsafe/qsettings.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/apps/zsafe/qsettings.cpp b/noncore/apps/zsafe/qsettings.cpp
index 62a9947..ee55339 100755
--- a/noncore/apps/zsafe/qsettings.cpp
+++ b/noncore/apps/zsafe/qsettings.cpp
@@ -1,30 +1,29 @@
1/* 1/*
2** $Id$ 2** $Id$
3*/ 3*/
4 4
5#include "qsettings.h" 5#include "qsettings.h"
6#include <qstringlist.h>
7#include <stdio.h> 6#include <stdio.h>
8#include <qfile.h> 7#include <qfile.h>
9#include <qtextstream.h> 8#include <qtextstream.h>
10 9
11 10
12QSettings::QSettings(const QString &_fn) 11QSettings::QSettings(const QString &_fn)
13{ 12{
14 // read the prefs from the file 13 // read the prefs from the file
15 fn = _fn; 14 fn = _fn;
16 15
17 QFile f(_fn); 16 QFile f(_fn);
18 if ( f.open(IO_ReadOnly) ) { // file opened successfully 17 if ( f.open(IO_ReadOnly) ) { // file opened successfully
19 QTextStream t( &f ); // use a text stream 18 QTextStream t( &f ); // use a text stream
20 QString s; 19 QString s;
21 while ( !t.eof() ) { // until end of file... 20 while ( !t.eof() ) { // until end of file...
22 s = t.readLine(); // line of text excluding '\n' 21 s = t.readLine(); // line of text excluding '\n'
23 char buf[256]; 22 char buf[256];
24 sprintf (buf, "%s", (const char *) s); 23 sprintf (buf, "%s", (const char *) s);
25 int pos = s.find (" = "); 24 int pos = s.find (" = ");
26 QString key = s.left (pos); 25 QString key = s.left (pos);
27 QString val = s.right (s.length() - pos - 3); 26 QString val = s.right (s.length() - pos - 3);
28 writeEntry (key, val); 27 writeEntry (key, val);
29 28
30 sprintf (buf, "%s|%s", (const char *)key, (const char *)val); 29 sprintf (buf, "%s|%s", (const char *)key, (const char *)val);