Diffstat (limited to 'noncore/apps/tinykate/libkate/kateconfig.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/tinykate/libkate/kateconfig.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/noncore/apps/tinykate/libkate/kateconfig.cpp b/noncore/apps/tinykate/libkate/kateconfig.cpp index 96f91fb..782b629 100644 --- a/noncore/apps/tinykate/libkate/kateconfig.cpp +++ b/noncore/apps/tinykate/libkate/kateconfig.cpp | |||
@@ -18,6 +18,14 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_LANGLIST | ||
22 | #include "kateconfig.h" | ||
23 | |||
24 | /* OPIE */ | ||
25 | #include <opie2/odebug.h> | ||
26 | #include <qpe/global.h> | ||
27 | |||
28 | /* QT */ | ||
21 | #include <qdir.h> | 29 | #include <qdir.h> |
22 | #include <qmessagebox.h> | 30 | #include <qmessagebox.h> |
23 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) | 31 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) |
@@ -25,16 +33,13 @@ | |||
25 | #endif | 33 | #endif |
26 | #include <qtextstream.h> | 34 | #include <qtextstream.h> |
27 | 35 | ||
36 | /* STD */ | ||
28 | #include <sys/stat.h> | 37 | #include <sys/stat.h> |
29 | #include <sys/types.h> | 38 | #include <sys/types.h> |
30 | #include <fcntl.h> | 39 | #include <fcntl.h> |
31 | #include <stdlib.h> | 40 | #include <stdlib.h> |
32 | #include <unistd.h> | 41 | #include <unistd.h> |
33 | 42 | ||
34 | #define QTOPIA_INTERNAL_LANGLIST | ||
35 | #include "kateconfig.h" | ||
36 | #include <qpe/global.h> | ||
37 | |||
38 | 43 | ||
39 | /*! | 44 | /*! |
40 | \internal | 45 | \internal |
@@ -93,7 +98,7 @@ QString KateConfig::configFilename(const QString& name, Domain d) | |||
93 | KateConfig::KateConfig( const QString &name, Domain domain ) | 98 | KateConfig::KateConfig( const QString &name, Domain domain ) |
94 | : filename( configFilename(name,domain) ) | 99 | : filename( configFilename(name,domain) ) |
95 | { | 100 | { |
96 | qWarning("KateConfig constructor\n"); | 101 | owarn << "KateConfig constructor\n" << oendl; |
97 | git = groups.end(); | 102 | git = groups.end(); |
98 | read(); | 103 | read(); |
99 | QStringList l = Global::languageList(); | 104 | QStringList l = Global::languageList(); |
@@ -118,7 +123,7 @@ KateConfig::KateConfig ( const QString &name, bool what ) | |||
118 | */ | 123 | */ |
119 | KateConfig::~KateConfig() | 124 | KateConfig::~KateConfig() |
120 | { | 125 | { |
121 | qWarning("KateConfig destructor\n"); | 126 | owarn << "KateConfig destructor\n" << oendl; |
122 | if ( changed ) | 127 | if ( changed ) |
123 | write(); | 128 | write(); |
124 | } | 129 | } |
@@ -172,7 +177,7 @@ void KateConfig::writeEntry( const QString &key, const char* value ) | |||
172 | void KateConfig::writeEntry( const QString &key, const QString &value ) | 177 | void KateConfig::writeEntry( const QString &key, const QString &value ) |
173 | { | 178 | { |
174 | if ( git == groups.end() ) { | 179 | if ( git == groups.end() ) { |
175 | qWarning( "no group set" ); | 180 | owarn << "no group set" << oendl; |
176 | return; | 181 | return; |
177 | } | 182 | } |
178 | if ( (*git)[key] != value ) { | 183 | if ( (*git)[key] != value ) { |
@@ -232,7 +237,7 @@ static QString decipher(const QString& cipher) | |||
232 | void KateConfig::writeEntryCrypt( const QString &key, const QString &value ) | 237 | void KateConfig::writeEntryCrypt( const QString &key, const QString &value ) |
233 | { | 238 | { |
234 | if ( git == groups.end() ) { | 239 | if ( git == groups.end() ) { |
235 | qWarning( "no group set" ); | 240 | owarn << "no group set" << oendl; |
236 | return; | 241 | return; |
237 | } | 242 | } |
238 | QString evalue = encipher(value); | 243 | QString evalue = encipher(value); |
@@ -321,7 +326,7 @@ void KateConfig::writeEntry( const QString &key, const QFont &val ) | |||
321 | void KateConfig::removeEntry( const QString &key ) | 326 | void KateConfig::removeEntry( const QString &key ) |
322 | { | 327 | { |
323 | if ( git == groups.end() ) { | 328 | if ( git == groups.end() ) { |
324 | qWarning( "no group set" ); | 329 | owarn << "no group set" << oendl; |
325 | return; | 330 | return; |
326 | } | 331 | } |
327 | ( *git ).remove( key ); | 332 | ( *git ).remove( key ); |
@@ -397,7 +402,7 @@ QString KateConfig::readEntryCrypt( const QString &key, const QString &deflt ) | |||
397 | QString KateConfig::readEntryDirect( const QString &key, const QString &deflt ) | 402 | QString KateConfig::readEntryDirect( const QString &key, const QString &deflt ) |
398 | { | 403 | { |
399 | if ( git == groups.end() ) { | 404 | if ( git == groups.end() ) { |
400 | //qWarning( "no group set" ); | 405 | //owarn << "no group set" << oendl; |
401 | return deflt; | 406 | return deflt; |
402 | } | 407 | } |
403 | KateConfigGroup::ConstIterator it = ( *git ).find( key ); | 408 | KateConfigGroup::ConstIterator it = ( *git ).find( key ); |
@@ -500,7 +505,7 @@ QValueList<int> KateConfig::readIntListEntry( const QString &key ) const | |||
500 | void KateConfig::clearGroup() | 505 | void KateConfig::clearGroup() |
501 | { | 506 | { |
502 | if ( git == groups.end() ) { | 507 | if ( git == groups.end() ) { |
503 | qWarning( "no group set" ); | 508 | owarn << "no group set" << oendl; |
504 | return; | 509 | return; |
505 | } | 510 | } |
506 | if ( !(*git).isEmpty() ) { | 511 | if ( !(*git).isEmpty() ) { |
@@ -521,7 +526,7 @@ void KateConfig::write( const QString &fn ) | |||
521 | 526 | ||
522 | QFile f( strNewFile ); | 527 | QFile f( strNewFile ); |
523 | if ( !f.open( IO_WriteOnly|IO_Raw ) ) { | 528 | if ( !f.open( IO_WriteOnly|IO_Raw ) ) { |
524 | qWarning( "could not open for writing `%s'", strNewFile.latin1() ); | 529 | owarn << "could not open for writing `" << strNewFile << "'" << oendl; |
525 | git = groups.end(); | 530 | git = groups.end(); |
526 | return; | 531 | return; |
527 | } | 532 | } |