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 /libemailfunctions/idmapper.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 'libemailfunctions/idmapper.cpp')
-rw-r--r-- | libemailfunctions/idmapper.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/libemailfunctions/idmapper.cpp b/libemailfunctions/idmapper.cpp index a44dc8c83..6250d41c0 100644 --- a/libemailfunctions/idmapper.cpp +++ b/libemailfunctions/idmapper.cpp @@ -25,7 +25,7 @@ #include <kstandarddirs.h> #include <kdebug.h> -#include <qfile.h> +#include <tqfile.h> using namespace KPIM; @@ -33,7 +33,7 @@ IdMapper::IdMapper() { } -IdMapper::IdMapper( const QString &path, const QString &identifier ) +IdMapper::IdMapper( const TQString &path, const TQString &identifier ) : mPath( path ), mIdentifier( identifier ) { } @@ -42,19 +42,19 @@ IdMapper::~IdMapper() { } -void IdMapper::setPath( const QString &path ) +void IdMapper::setPath( const TQString &path ) { mPath = path; } -void IdMapper::setIdentifier( const QString &identifier ) +void IdMapper::setIdentifier( const TQString &identifier ) { mIdentifier = identifier; } -QString IdMapper::filename() +TQString IdMapper::filename() { - QString file = mPath; + TQString file = mPath; if ( !file.endsWith( "/" ) ) file += "/"; file += mIdentifier; @@ -63,7 +63,7 @@ QString IdMapper::filename() bool IdMapper::load() { - QFile file( filename() ); + TQFile file( filename() ); if ( !file.open( IO_ReadOnly ) ) { kdError(5800) << "Can't read uid map file '" << filename() << "'" << endl; return false; @@ -71,11 +71,11 @@ bool IdMapper::load() clear(); - QString line; + TQString line; while ( file.readLine( line, 1024 ) != -1 ) { line.truncate( line.length() - 2 ); // strip newline - QStringList parts = QStringList::split( "\x02\x02", line, true ); + TQStringList parts = TQStringList::split( "\x02\x02", line, true ); mIdMap.insert( parts[ 0 ], parts[ 1 ] ); mFingerprintMap.insert( parts[ 0 ], parts[ 2 ] ); } @@ -87,17 +87,17 @@ bool IdMapper::load() bool IdMapper::save() { - QFile file( filename() ); + TQFile file( filename() ); if ( !file.open( IO_WriteOnly ) ) { kdError(5800) << "Can't write uid map file '" << filename() << "'" << endl; return false; } - QString content; + TQString content; - QMap<QString, QVariant>::Iterator it; + TQMap<TQString, TQVariant>::Iterator it; for ( it = mIdMap.begin(); it != mIdMap.end(); ++it ) { - QString fingerprint( "" ); + TQString fingerprint( "" ); if ( mFingerprintMap.contains( it.key() ) ) fingerprint = mFingerprintMap[ it.key() ]; content += it.key() + "\x02\x02" + it.data().toString() + "\x02\x02" + fingerprint + "\r\n"; @@ -115,14 +115,14 @@ void IdMapper::clear() mFingerprintMap.clear(); } -void IdMapper::setRemoteId( const QString &localId, const QString &remoteId ) +void IdMapper::setRemoteId( const TQString &localId, const TQString &remoteId ) { mIdMap.replace( localId, remoteId ); } -void IdMapper::removeRemoteId( const QString &remoteId ) +void IdMapper::removeRemoteId( const TQString &remoteId ) { - QMap<QString, QVariant>::Iterator it; + TQMap<TQString, TQVariant>::Iterator it; for ( it = mIdMap.begin(); it != mIdMap.end(); ++it ) if ( it.data().toString() == remoteId ) { mIdMap.remove( it ); @@ -131,34 +131,34 @@ void IdMapper::removeRemoteId( const QString &remoteId ) } } -QString IdMapper::remoteId( const QString &localId ) const +TQString IdMapper::remoteId( const TQString &localId ) const { - QMap<QString, QVariant>::ConstIterator it; + TQMap<TQString, TQVariant>::ConstIterator it; it = mIdMap.find( localId ); if ( it != mIdMap.end() ) return it.data().toString(); else - return QString::null; + return TQString::null; } -QString IdMapper::localId( const QString &remoteId ) const +TQString IdMapper::localId( const TQString &remoteId ) const { - QMap<QString, QVariant>::ConstIterator it; + TQMap<TQString, TQVariant>::ConstIterator it; for ( it = mIdMap.begin(); it != mIdMap.end(); ++it ) if ( it.data().toString() == remoteId ) return it.key(); - return QString::null; + return TQString::null; } -QString IdMapper::asString() const +TQString IdMapper::asString() const { - QString content; + TQString content; - QMap<QString, QVariant>::ConstIterator it; + TQMap<TQString, TQVariant>::ConstIterator it; for ( it = mIdMap.begin(); it != mIdMap.end(); ++it ) { - QString fp; + TQString fp; if ( mFingerprintMap.contains( it.key() ) ) fp = mFingerprintMap[ it.key() ]; content += it.key() + "\t" + it.data().toString() + "\t" + fp + "\r\n"; @@ -167,23 +167,23 @@ QString IdMapper::asString() const return content; } -void IdMapper::setFingerprint( const QString &localId, const QString &fingerprint ) +void IdMapper::setFingerprint( const TQString &localId, const TQString &fingerprint ) { mFingerprintMap.insert( localId, fingerprint ); } -const QString& IdMapper::fingerprint( const QString &localId ) const +const TQString& IdMapper::fingerprint( const TQString &localId ) const { if ( mFingerprintMap.contains( localId ) ) return mFingerprintMap[ localId ]; else - return QString::null; + return TQString::null; } -QMap<QString, QString> IdMapper::remoteIdMap() const +TQMap<TQString, TQString> IdMapper::remoteIdMap() const { - QMap<QString, QString> reverseMap; - QMap<QString, QVariant>::ConstIterator it; + TQMap<TQString, TQString> reverseMap; + TQMap<TQString, TQVariant>::ConstIterator it; for ( it = mIdMap.begin(); it != mIdMap.end(); ++it ) { reverseMap.insert( it.data().toString(), it.key() ); } |