-rw-r--r-- | microkde/kconfig.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp index 737b3f2..4cbec94 100644 --- a/microkde/kconfig.cpp +++ b/microkde/kconfig.cpp @@ -9,31 +9,43 @@ #include "kconfig.h" QString KConfig::mGroup = ""; //QString KConfig::mGroup = "General"; KConfig::KConfig( const QString &fileName ) : mFileName( fileName ), mDirty( false ) { - kdDebug() << "KConfig::KConfig(): '" << fileName << "'" << endl; - + + mTempGroup = ""; load(); } KConfig::~KConfig() { sync(); } +// we need the temp group for plugins on windows +void KConfig::setTempGroup( const QString &group ) +{ + mTempGroup = group; + + if ( mTempGroup.right( 1 ) != "/" ) mTempGroup += "/"; +} + + +QString KConfig::tempGroup() const { + return mTempGroup; +} void KConfig::setGroup( const QString &group ) { - kdDebug() << "KConfig::setGroup(): '" << group << "'" << endl; + mGroup = group; if ( mGroup.right( 1 ) != "/" ) mGroup += "/"; } //US QString KConfig::group() const { @@ -64,17 +76,17 @@ QValueList<int> KConfig::readIntListEntry( const QString & key) if (ok == false) { qDebug("KConfig::readIntListEntry str=%s , int=%n:", (*sit).latin1(), &val); ok2 = false; } } if (ok2 == false) { - kdDebug() << "KConfig::readIntListEntry: error while reading one of the intvalues." << endl; + qDebug("KConfig::readIntListEntry: error while reading one of the intvalues."); } return result; } int KConfig::readNumEntry( const QString & key, int def ) { @@ -222,17 +234,17 @@ void KConfig::writeEntry( const QString & e , const QFont & f ) void KConfig::writeEntry( const QString &key, const QDateTime &dt ) { mDateTimeMap.insert( mGroup + key, dt ); } void KConfig::load() { - kdDebug() << "KConfig::load(): " << mFileName << endl; + QFile f( mFileName ); if ( !f.open( IO_ReadOnly ) ) { qDebug("KConfig: could not open file %s ",mFileName.latin1() ); return; } mBoolMap.clear(); |