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 /kresources/kolab/shared/kolabbase.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 'kresources/kolab/shared/kolabbase.cpp')
-rw-r--r-- | kresources/kolab/shared/kolabbase.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/kresources/kolab/shared/kolabbase.cpp b/kresources/kolab/shared/kolabbase.cpp index 44c44ead2..9a4a17f7c 100644 --- a/kresources/kolab/shared/kolabbase.cpp +++ b/kresources/kolab/shared/kolabbase.cpp @@ -37,14 +37,14 @@ #include <libkcal/journal.h> #include <libkdepim/kpimprefs.h> #include <kdebug.h> -#include <qfile.h> +#include <tqfile.h> using namespace Kolab; -KolabBase::KolabBase( const QString& tz ) - : mCreationDate( QDateTime::currentDateTime() ), - mLastModified( QDateTime::currentDateTime() ), +KolabBase::KolabBase( const TQString& tz ) + : mCreationDate( TQDateTime::currentDateTime() ), + mLastModified( TQDateTime::currentDateTime() ), mSensitivity( Public ), mTimeZoneId( tz ), mHasPilotSyncId( false ), mHasPilotSyncStatus( false ) { @@ -89,20 +89,20 @@ void KolabBase::setFields( const KABC::Addressee* addressee ) setCategories( addressee->categories().join( "," ) ); // Set creation-time and last-modification-time - const QString creationString = addressee->custom( "KOLAB", "CreationDate" ); + const TQString creationString = addressee->custom( "KOLAB", "CreationDate" ); kdDebug(5006) << "Creation time string: " << creationString << endl; - QDateTime creationDate; + TQDateTime creationDate; if ( creationString.isEmpty() ) { - creationDate = QDateTime::currentDateTime(); + creationDate = TQDateTime::currentDateTime(); kdDebug(5006) << "Creation date set to current time\n"; } else { creationDate = stringToDateTime( creationString ); kdDebug(5006) << "Creation date loaded\n"; } - QDateTime modified = addressee->revision(); + TQDateTime modified = addressee->revision(); if ( !modified.isValid() ) - modified = QDateTime::currentDateTime(); + modified = TQDateTime::currentDateTime(); setLastModified( modified ); if ( modified < creationDate ) { // It's not possible that the modification date is earlier than creation @@ -110,7 +110,7 @@ void KolabBase::setFields( const KABC::Addressee* addressee ) kdDebug(5006) << "Creation date set to modification date\n"; } setCreationDate( creationDate ); - const QString newCreationDate = dateTimeToString( creationDate ); + const TQString newCreationDate = dateTimeToString( creationDate ); if ( creationString != newCreationDate ) { // We modified the creation date, so store it for future reference const_cast<KABC::Addressee*>( addressee ) @@ -136,7 +136,7 @@ void KolabBase::saveTo( KABC::Addressee* addressee ) const { addressee->setUid( uid() ); addressee->setNote( body() ); - addressee->setCategories( QStringList::split( ',', categories() ) ); + addressee->setCategories( TQStringList::split( ',', categories() ) ); addressee->setRevision( lastModified() ); addressee->insertCustom( "KOLAB", "CreationDate", dateTimeToString( creationDate() ) ); @@ -156,52 +156,52 @@ void KolabBase::saveTo( KABC::Addressee* addressee ) const // TODO: Attachments } -void KolabBase::setUid( const QString& uid ) +void KolabBase::setUid( const TQString& uid ) { mUid = uid; } -QString KolabBase::uid() const +TQString KolabBase::uid() const { return mUid; } -void KolabBase::setBody( const QString& body ) +void KolabBase::setBody( const TQString& body ) { mBody = body; } -QString KolabBase::body() const +TQString KolabBase::body() const { return mBody; } -void KolabBase::setCategories( const QString& categories ) +void KolabBase::setCategories( const TQString& categories ) { mCategories = categories; } -QString KolabBase::categories() const +TQString KolabBase::categories() const { return mCategories; } -void KolabBase::setCreationDate( const QDateTime& date ) +void KolabBase::setCreationDate( const TQDateTime& date ) { mCreationDate = date; } -QDateTime KolabBase::creationDate() const +TQDateTime KolabBase::creationDate() const { return mCreationDate; } -void KolabBase::setLastModified( const QDateTime& date ) +void KolabBase::setLastModified( const TQDateTime& date ) { mLastModified = date; } -QDateTime KolabBase::lastModified() const +TQDateTime KolabBase::lastModified() const { return mLastModified; } @@ -248,14 +248,14 @@ int KolabBase::pilotSyncStatus() const return mPilotSyncStatus; } -bool KolabBase::loadEmailAttribute( QDomElement& element, Email& email ) +bool KolabBase::loadEmailAttribute( TQDomElement& element, Email& email ) { - for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { + for ( TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) { if ( n.isComment() ) continue; if ( n.isElement() ) { - QDomElement e = n.toElement(); - const QString tagName = e.tagName(); + TQDomElement e = n.toElement(); + const TQString tagName = e.tagName(); if ( tagName == "display-name" ) email.displayName = e.text(); @@ -271,18 +271,18 @@ bool KolabBase::loadEmailAttribute( QDomElement& element, Email& email ) return true; } -void KolabBase::saveEmailAttribute( QDomElement& element, const Email& email, - const QString& tagName ) const +void KolabBase::saveEmailAttribute( TQDomElement& element, const Email& email, + const TQString& tagName ) const { - QDomElement e = element.ownerDocument().createElement( tagName ); + TQDomElement e = element.ownerDocument().createElement( tagName ); element.appendChild( e ); writeString( e, "display-name", email.displayName ); writeString( e, "smtp-address", email.smtpAddress ); } -bool KolabBase::loadAttribute( QDomElement& element ) +bool KolabBase::loadAttribute( TQDomElement& element ) { - const QString tagName = element.tagName(); + const TQString tagName = element.tagName(); switch ( tagName[0].latin1() ) { case 'u': if ( tagName == "uid" ) { @@ -336,7 +336,7 @@ bool KolabBase::loadAttribute( QDomElement& element ) return false; } -bool KolabBase::saveAttributes( QDomElement& element ) const +bool KolabBase::saveAttributes( TQDomElement& element ) const { writeString( element, "product-id", productID() ); writeString( element, "uid", uid() ); @@ -347,17 +347,17 @@ bool KolabBase::saveAttributes( QDomElement& element ) const dateTimeToString( lastModified() ) ); writeString( element, "sensitivity", sensitivityToString( sensitivity() ) ); if ( hasPilotSyncId() ) - writeString( element, "pilot-sync-id", QString::number( pilotSyncId() ) ); + writeString( element, "pilot-sync-id", TQString::number( pilotSyncId() ) ); if ( hasPilotSyncStatus() ) - writeString( element, "pilot-sync-status", QString::number( pilotSyncStatus() ) ); + writeString( element, "pilot-sync-status", TQString::number( pilotSyncStatus() ) ); return true; } -bool KolabBase::load( const QString& xml ) +bool KolabBase::load( const TQString& xml ) { - QString errorMsg; + TQString errorMsg; int errorLine, errorColumn; - QDomDocument document; + TQDomDocument document; bool ok = document.setContent( xml, &errorMsg, &errorLine, &errorColumn ); if ( !ok ) { @@ -370,11 +370,11 @@ bool KolabBase::load( const QString& xml ) return loadXML( document ); } -bool KolabBase::load( QFile& xml ) +bool KolabBase::load( TQFile& xml ) { - QString errorMsg; + TQString errorMsg; int errorLine, errorColumn; - QDomDocument document; + TQDomDocument document; bool ok = document.setContent( &xml, &errorMsg, &errorLine, &errorColumn ); if ( !ok ) { @@ -387,41 +387,41 @@ bool KolabBase::load( QFile& xml ) return loadXML( document ); } -QDomDocument KolabBase::domTree() +TQDomDocument KolabBase::domTree() { - QDomDocument document; + TQDomDocument document; - QString p = "version=\"1.0\" encoding=\"UTF-8\""; + TQString p = "version=\"1.0\" encoding=\"UTF-8\""; document.appendChild(document.createProcessingInstruction( "xml", p ) ); return document; } -QString KolabBase::dateTimeToString( const QDateTime& time ) +TQString KolabBase::dateTimeToString( const TQDateTime& time ) { return time.toString( Qt::ISODate ) + 'Z'; } -QString KolabBase::dateToString( const QDate& date ) +TQString KolabBase::dateToString( const TQDate& date ) { return date.toString( Qt::ISODate ); } -QDateTime KolabBase::stringToDateTime( const QString& _date ) +TQDateTime KolabBase::stringToDateTime( const TQString& _date ) { - QString date( _date ); + TQString date( _date ); if ( date.endsWith( "Z" ) ) date.truncate( date.length() - 1 ); - return QDateTime::fromString( date, Qt::ISODate ); + return TQDateTime::fromString( date, Qt::ISODate ); } -QDate KolabBase::stringToDate( const QString& date ) +TQDate KolabBase::stringToDate( const TQString& date ) { - return QDate::fromString( date, Qt::ISODate ); + return TQDate::fromString( date, Qt::ISODate ); } -QString KolabBase::sensitivityToString( Sensitivity s ) +TQString KolabBase::sensitivityToString( Sensitivity s ) { switch( s ) { case Private: return "private"; @@ -432,7 +432,7 @@ QString KolabBase::sensitivityToString( Sensitivity s ) return "What what what???"; } -KolabBase::Sensitivity KolabBase::stringToSensitivity( const QString& s ) +KolabBase::Sensitivity KolabBase::stringToSensitivity( const TQString& s ) { if ( s == "private" ) return Private; @@ -441,34 +441,34 @@ KolabBase::Sensitivity KolabBase::stringToSensitivity( const QString& s ) return Public; } -QString KolabBase::colorToString( const QColor& color ) +TQString KolabBase::colorToString( const TQColor& color ) { // Color is in the format "#RRGGBB" return color.name(); } -QColor KolabBase::stringToColor( const QString& s ) +TQColor KolabBase::stringToColor( const TQString& s ) { - return QColor( s ); + return TQColor( s ); } -void KolabBase::writeString( QDomElement& element, const QString& tag, - const QString& tagString ) +void KolabBase::writeString( TQDomElement& element, const TQString& tag, + const TQString& tagString ) { if ( !tagString.isEmpty() ) { - QDomElement e = element.ownerDocument().createElement( tag ); - QDomText t = element.ownerDocument().createTextNode( tagString ); + TQDomElement e = element.ownerDocument().createElement( tag ); + TQDomText t = element.ownerDocument().createTextNode( tagString ); e.appendChild( t ); element.appendChild( e ); } } -QDateTime KolabBase::localToUTC( const QDateTime& time ) const +TQDateTime KolabBase::localToUTC( const TQDateTime& time ) const { return KPimPrefs::localTimeToUtc( time, mTimeZoneId ); } -QDateTime KolabBase::utcToLocal( const QDateTime& time ) const +TQDateTime KolabBase::utcToLocal( const TQDateTime& time ) const { return KPimPrefs::utcToLocalTime( time, mTimeZoneId ); } |