summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/kateconfig.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/tinykate/libkate/kateconfig.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/kateconfig.cpp29
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
@@ -15,29 +15,34 @@
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
+#define QTOPIA_INTERNAL_LANGLIST
+#include "kateconfig.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/global.h>
+
+/* QT */
#include <qdir.h>
#include <qmessagebox.h>
#if QT_VERSION <= 230 && defined(QT_NO_CODECS)
#include <qtextcodec.h>
#endif
#include <qtextstream.h>
+/* STD */
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
-#define QTOPIA_INTERNAL_LANGLIST
-#include "kateconfig.h"
-#include <qpe/global.h>
-
/*!
\internal
*/
QString KateConfig::configFilename(const QString& name, Domain d)
{
@@ -90,13 +95,13 @@ QString KateConfig::configFilename(const QString& name, Domain d)
In the File Domain, \a name is an absolute filename.
*/
KateConfig::KateConfig( const QString &name, Domain domain )
: filename( configFilename(name,domain) )
{
- qWarning("KateConfig constructor\n");
+ owarn << "KateConfig constructor\n" << oendl;
git = groups.end();
read();
QStringList l = Global::languageList();
lang = l[0];
glang = l[1];
}
@@ -115,13 +120,13 @@ KateConfig::KateConfig ( const QString &name, bool what )
/*!
Writes any changes to disk and destroys the in-memory object.
*/
KateConfig::~KateConfig()
{
- qWarning("KateConfig destructor\n");
+ owarn << "KateConfig destructor\n" << oendl;
if ( changed )
write();
}
/*!
Returns whether the current group has an entry called \a key.
@@ -169,13 +174,13 @@ void KateConfig::writeEntry( const QString &key, const char* value )
\sa readEntry()
*/
void KateConfig::writeEntry( const QString &key, const QString &value )
{
if ( git == groups.end() ) {
- qWarning( "no group set" );
+ owarn << "no group set" << oendl;
return;
}
if ( (*git)[key] != value ) {
( *git ).insert( key, value );
changed = TRUE;
}
@@ -229,13 +234,13 @@ static QString decipher(const QString& cipher)
\sa readEntry()
*/
void KateConfig::writeEntryCrypt( const QString &key, const QString &value )
{
if ( git == groups.end() ) {
- qWarning( "no group set" );
+ owarn << "no group set" << oendl;
return;
}
QString evalue = encipher(value);
if ( (*git)[key] != evalue ) {
( *git ).insert( key, evalue );
changed = TRUE;
@@ -318,13 +323,13 @@ void KateConfig::writeEntry( const QString &key, const QFont &val )
there is no such entry.
*/
void KateConfig::removeEntry( const QString &key )
{
if ( git == groups.end() ) {
- qWarning( "no group set" );
+ owarn << "no group set" << oendl;
return;
}
( *git ).remove( key );
changed = TRUE;
}
@@ -394,13 +399,13 @@ QString KateConfig::readEntryCrypt( const QString &key, const QString &deflt )
\internal
For compatibility, non-const version.
*/
QString KateConfig::readEntryDirect( const QString &key, const QString &deflt )
{
if ( git == groups.end() ) {
- //qWarning( "no group set" );
+ //owarn << "no group set" << oendl;
return deflt;
}
KateConfigGroup::ConstIterator it = ( *git ).find( key );
if ( it != ( *git ).end() )
return *it;
else
@@ -497,13 +502,13 @@ QValueList<int> KateConfig::readIntListEntry( const QString &key ) const
/*!
Removes all entries from the current group.
*/
void KateConfig::clearGroup()
{
if ( git == groups.end() ) {
- qWarning( "no group set" );
+ owarn << "no group set" << oendl;
return;
}
if ( !(*git).isEmpty() ) {
( *git ).clear();
changed = TRUE;
}
@@ -518,13 +523,13 @@ void KateConfig::write( const QString &fn )
if ( !fn.isEmpty() )
filename = fn;
strNewFile = filename + ".new";
QFile f( strNewFile );
if ( !f.open( IO_WriteOnly|IO_Raw ) ) {
- qWarning( "could not open for writing `%s'", strNewFile.latin1() );
+ owarn << "could not open for writing `" << strNewFile << "'" << oendl;
git = groups.end();
return;
}
QString str;
QCString cstr;