summaryrefslogtreecommitdiffabout
path: root/microkde
authorzautrix <zautrix>2005-07-02 16:10:28 (UTC)
committer zautrix <zautrix>2005-07-02 16:10:28 (UTC)
commit20c9e9cb71ad64aebfa27157bb152ece4e34c00a (patch) (side-by-side diff)
tree6ecd2ce2136875d974d5d361f611b39f5ad86a00 /microkde
parent7b7c582bbb9908ec65c778b70baa6b2c2aa457fc (diff)
downloadkdepimpi-20c9e9cb71ad64aebfa27157bb152ece4e34c00a.zip
kdepimpi-20c9e9cb71ad64aebfa27157bb152ece4e34c00a.tar.gz
kdepimpi-20c9e9cb71ad64aebfa27157bb152ece4e34c00a.tar.bz2
fixxxx
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kconfig.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp
index e0b6e99..821e386 100644
--- a/microkde/kconfig.cpp
+++ b/microkde/kconfig.cpp
@@ -44,49 +44,49 @@ void KConfig::setGroup( const QString &group )
mGroup = group;
if ( mGroup.right( 1 ) != "/" ) mGroup += "/";
}
//US
QString KConfig::group() const {
return mGroup;
}
//US added method
QValueList<int> KConfig::readIntListEntry( const QString & key)
{
// qDebug("KConfig::readIntListEntry key=%s:", key.latin1());
QValueList<int> result;
QMap<QString,QString>::ConstIterator mit = mStringMap.find( mGroup + key );
if ( mit == mStringMap.end() ) {
return result;
}
- QStringList valuesAsStrings = QStringList::split(":", *mit );
+ QStringList valuesAsStrings = QStringList::split(":@:", *mit );
bool ok = false;
bool ok2 = true;
int val;
for ( QStringList::Iterator sit = valuesAsStrings.begin(); sit != valuesAsStrings.end(); ++sit ) {
val = (*sit).toInt(&ok);
result << val;
if (ok == false) {
//qDebug("KConfig::readIntListEntry str=%s , int=%n:", (*sit).latin1(), &val);
ok2 = false;
}
}
if (ok2 == false)
{
qDebug("KConfig::readIntListEntry: error while reading one of the intvalues.");
}
return result;
}
int KConfig::readNumEntry( const QString & key, int def )
{
@@ -114,49 +114,52 @@ QSize KConfig::readSizeEntry( const QString &key, QSize* def )
QValueList<int> intlist = readIntListEntry(key);
if (intlist.count() < 2)
{
if (def)
return *def;
else
return QSize();
}
QSize ret;
ret.setWidth(intlist[0]);
ret.setHeight(intlist[1]);
return ret;
}
QStringList KConfig::readListEntry( const QString &key )
{
QMap<QString,QString>::ConstIterator it = mStringMap.find( mGroup + key );
if ( it == mStringMap.end() ) {
return QStringList();
}
- return QStringList::split(":", QString::fromUtf8((*it).latin1()));
+ QStringList temp = QStringList::split(":@:", QString::fromUtf8((*it).latin1()));
+ if ( temp.count() == 1 )
+ return QStringList::split(":", QString::fromUtf8((*it).latin1()));
+ return temp;
}
bool KConfig::readBoolEntry( const QString &key, bool def )
{
QMap<QString,bool>::ConstIterator it = mBoolMap.find( mGroup + key );
if ( it == mBoolMap.end() ) {
return def;
}
return *it;
}
QColor KConfig::readColorEntry( const QString & e, QColor *def )
{
QStringList l;
l = readListEntry( e.utf8() );
if (l.count() != 3 ) {
if ( def )
return *def;
else
return QColor();
@@ -199,49 +202,49 @@ void KConfig::writeEntry( const QString &key, const QValueList<int> &value)
for( it = value.begin(); it != value.end(); ++it )
{
valuesAsStrings << QString::number(*it);
}
mStringMap.insert( mGroup + key, valuesAsStrings.join(":") );
mDirty = true;
}
void KConfig::writeEntry( const QString & key , int num )
{
writeEntry( key, QString::number ( num ) );
}
void KConfig::writeEntry( const QString &key, const QString &value )
{
mStringMap.insert( mGroup + key, value.utf8() );
mDirty = true;
}
void KConfig::writeEntry( const QString &key, const QStringList &value )
{
- mStringMap.insert( mGroup + key, value.join(":").utf8() );
+ mStringMap.insert( mGroup + key, value.join(":@:").utf8() );
mDirty = true;
}
void KConfig::writeEntry( const QString &key, bool value)
{
mBoolMap.insert( mGroup + key, value );
mDirty = true;
}
void KConfig::writeEntry( const QString & e, const QColor & c )
{
QStringList l;
l.append( QString::number ( c.red() ) );
l.append( QString::number ( c.green() ) );
l.append( QString::number ( c.blue() ) );
writeEntry( e.utf8(), l );
}
void KConfig::writeEntry( const QString & e, const QSize & s )
{
QValueList<int> intlist;
intlist << s.width() << s.height();