diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /libkdepim/kconfigpropagator.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/kconfigpropagator.cpp')
-rw-r--r-- | libkdepim/kconfigpropagator.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/libkdepim/kconfigpropagator.cpp b/libkdepim/kconfigpropagator.cpp index 81615b06e..0f59c2a00 100644 --- a/libkdepim/kconfigpropagator.cpp +++ b/libkdepim/kconfigpropagator.cpp @@ -28,8 +28,8 @@ #include <kstringhandler.h> #include <klocale.h> -#include <qfile.h> -#include <qstringlist.h> +#include <tqfile.h> +#include <tqstringlist.h> KConfigPropagator::Change::~Change() { @@ -41,12 +41,12 @@ KConfigPropagator::ChangeConfig::ChangeConfig() { } -QString KConfigPropagator::ChangeConfig::arg1() const +TQString KConfigPropagator::ChangeConfig::arg1() const { return file + "/" + group + "/" + name; } -QString KConfigPropagator::ChangeConfig::arg2() const +TQString KConfigPropagator::ChangeConfig::arg2() const { if ( hideValue ) return "*"; else return value; @@ -68,7 +68,7 @@ KConfigPropagator::KConfigPropagator() } KConfigPropagator::KConfigPropagator( KConfigSkeleton *skeleton, - const QString &kcfgFile ) + const TQString &kcfgFile ) : mSkeleton( skeleton ), mKcfgFile( kcfgFile ) { init(); @@ -83,15 +83,15 @@ void KConfigPropagator::init() void KConfigPropagator::readKcfgFile() { - QString filename = locate( "kcfg", mKcfgFile ); + TQString filename = locate( "kcfg", mKcfgFile ); if ( filename.isEmpty() ) { kdError() << "Unable to find kcfg file '" << mKcfgFile << "'" << endl; return; } - QFile input( filename ); - QDomDocument doc; - QString errorMsg; + TQFile input( filename ); + TQDomDocument doc; + TQString errorMsg; int errorRow; int errorCol; if ( !doc.setContent( &input, &errorMsg, &errorRow, &errorCol ) ) { @@ -99,7 +99,7 @@ void KConfigPropagator::readKcfgFile() return; } - QDomElement cfgElement = doc.documentElement(); + TQDomElement cfgElement = doc.documentElement(); if ( cfgElement.isNull() ) { kdError() << "No document in kcfg file" << endl; @@ -108,20 +108,20 @@ void KConfigPropagator::readKcfgFile() mRules.clear(); - QDomNode n; + TQDomNode n; for ( n = cfgElement.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); - QString tag = e.tagName(); + TQString tag = e.tagName(); if ( tag == "propagation" ) { Rule rule = parsePropagation( e ); mRules.append( rule ); } else if ( tag == "condition" ) { Condition condition = parseCondition( e ); - QDomNode n2; + TQDomNode n2; for( n2 = e.firstChild(); !n2.isNull(); n2 = n2.nextSibling() ) { - QDomElement e2 = n2.toElement(); + TQDomElement e2 = n2.toElement(); if ( e2.tagName() == "propagation" ) { Rule rule = parsePropagation( e2 ); rule.condition = condition; @@ -134,14 +134,14 @@ void KConfigPropagator::readKcfgFile() } } -KConfigPropagator::Rule KConfigPropagator::parsePropagation( const QDomElement &e ) +KConfigPropagator::Rule KConfigPropagator::parsePropagation( const TQDomElement &e ) { Rule r; - QString source = e.attribute( "source" ); + TQString source = e.attribute( "source" ); parseConfigEntryPath( source, r.sourceFile, r.sourceGroup, r.sourceEntry ); - QString target = e.attribute( "target" ); + TQString target = e.attribute( "target" ); parseConfigEntryPath( target, r.targetFile, r.targetGroup, r.targetEntry ); r.hideValue = e.hasAttribute( "hidevalue" ) && @@ -150,18 +150,18 @@ KConfigPropagator::Rule KConfigPropagator::parsePropagation( const QDomElement & return r; } -void KConfigPropagator::parseConfigEntryPath( const QString &path, - QString &file, - QString &group, - QString &entry ) +void KConfigPropagator::parseConfigEntryPath( const TQString &path, + TQString &file, + TQString &group, + TQString &entry ) { - QStringList p = QStringList::split( "/", path ); + TQStringList p = TQStringList::split( "/", path ); if ( p.count() != 3 ) { kdError() << "Path has to be of form file/group/entry" << endl; - file = QString::null; - group = QString::null; - entry = QString::null; + file = TQString::null; + group = TQString::null; + entry = TQString::null; return; } @@ -172,11 +172,11 @@ void KConfigPropagator::parseConfigEntryPath( const QString &path, return; } -KConfigPropagator::Condition KConfigPropagator::parseCondition( const QDomElement &e ) +KConfigPropagator::Condition KConfigPropagator::parseCondition( const TQDomElement &e ) { Condition c; - QString key = e.attribute( "key" ); + TQString key = e.attribute( "key" ); parseConfigEntryPath( key, c.file, c.group, c.key ); @@ -197,8 +197,8 @@ void KConfigPropagator::commit() } } -KConfigSkeletonItem *KConfigPropagator::findItem( const QString &group, - const QString &name ) +KConfigSkeletonItem *KConfigPropagator::findItem( const TQString &group, + const TQString &name ) { // kdDebug() << "KConfigPropagator::findItem()" << endl; @@ -217,11 +217,11 @@ KConfigSkeletonItem *KConfigPropagator::findItem( const QString &group, else return *it; } -QString KConfigPropagator::itemValueAsString( KConfigSkeletonItem *item ) +TQString KConfigPropagator::itemValueAsString( KConfigSkeletonItem *item ) { - QVariant p = item->property(); + TQVariant p = item->property(); - if ( p.type() == QVariant::Bool ) { + if ( p.type() == TQVariant::Bool ) { if ( p.toBool() ) return "true"; else return "false"; } @@ -243,7 +243,7 @@ void KConfigPropagator::updateChanges() if ( !item ) { kdError() << " Item not found." << endl; } else { - QString value = itemValueAsString( item ); + TQString value = itemValueAsString( item ); kdDebug() << " Value: " << value << endl; if ( value != c.value ) { continue; @@ -257,11 +257,11 @@ void KConfigPropagator::updateChanges() << " not found." << endl; continue; } - QString value = itemValueAsString( item ); + TQString value = itemValueAsString( item ); KConfig target( r.targetFile ); target.setGroup( r.targetGroup ); - QString targetValue = target.readEntry( r.targetEntry ); + TQString targetValue = target.readEntry( r.targetEntry ); if ( r.hideValue ) targetValue = KStringHandler::obscure( targetValue ); if ( targetValue != value ) { ChangeConfig *change = new ChangeConfig(); |