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/tests/testdistrlist.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/tests/testdistrlist.cpp')
-rw-r--r-- | libkdepim/tests/testdistrlist.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/libkdepim/tests/testdistrlist.cpp b/libkdepim/tests/testdistrlist.cpp index 281c5835b..b446a5a39 100644 --- a/libkdepim/tests/testdistrlist.cpp +++ b/libkdepim/tests/testdistrlist.cpp @@ -31,8 +31,8 @@ using KPIM::DistributionList; #include <kdebug.h> #include <kcmdlineargs.h> -#include <qdir.h> -#include <qfileinfo.h> +#include <tqdir.h> +#include <tqfileinfo.h> #include <stdio.h> #include <stdlib.h> @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) { // Use another directory than the real one, just to keep things clean // KDEHOME needs to be writable though, for a ksycoca database - setenv( "KDEHOME", QFile::encodeName( QDir::homeDirPath() + "/.kde-testdistrlist" ), true ); + setenv( "KDEHOME", TQFile::encodeName( TQDir::homeDirPath() + "/.kde-testdistrlist" ), true ); setenv( "KDE_FORK_SLAVES", "yes", true ); // simpler, for the final cleanup KApplication::disableAutoDcopRegistration(); @@ -94,12 +94,12 @@ void TestDistrList::runAll() testDeleteList(); } -bool TestDistrList::check(const QString& txt, QString a, QString b) +bool TestDistrList::check(const TQString& txt, TQString a, TQString b) { if (a.isEmpty()) - a = QString::null; + a = TQString::null; if (b.isEmpty()) - b = QString::null; + b = TQString::null; if (a == b) { kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl; } @@ -114,18 +114,18 @@ bool TestDistrList::check(const QString& txt, QString a, QString b) // taken from KMail #include <sys/types.h> #include <dirent.h> -static bool removeDirAndContentsRecursively( const QString & path ) +static bool removeDirAndContentsRecursively( const TQString & path ) { kdDebug() << k_funcinfo << path << endl; bool success = true; - QDir d; + TQDir d; d.setPath( path ); - d.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden ); + d.setFilter( TQDir::Files | TQDir::Dirs | TQDir::Hidden ); const QFileInfoList *list = d.entryInfoList(); QFileInfoListIterator it( *list ); - QFileInfo *fi; + TQFileInfo *fi; while ( (fi = it.current()) != 0 ) { if( fi->isDir() && !fi->isSymLink() ) { @@ -150,7 +150,7 @@ void TestDistrList::cleanup() ab->clear(); KABC::StdAddressBook::close(); - QString kdehome = QFile::decodeName( getenv("KDEHOME") ); + TQString kdehome = TQFile::decodeName( getenv("KDEHOME") ); KURL urlkdehome; urlkdehome.setPath( kdehome ); // don't use KIO::NetAccess here since it needs X // KIO::NetAccess::del( urlkdehome, 0 )i; @@ -225,16 +225,16 @@ void TestDistrList::testInsertEntry() // Test entries() DistributionList::Entry::List entries = dl.entries( ab ); - check( "entries count", QString::number( entries.count() ), "3" ); + check( "entries count", TQString::number( entries.count() ), "3" ); check( "first entry", entries[0].addressee.name(), "addr1" ); - check( "first entry", entries[0].email, QString::null ); + check( "first entry", entries[0].email, TQString::null ); check( "second entry", entries[1].addressee.name(), "addr2" ); check( "second entry", entries[1].email, "addr2-alternate@kde.org" ); check( "third entry", entries[2].addressee.name(), "addr2" ); check( "third entry", entries[2].email, "addr2@kde.org" ); // Test emails() - QStringList emails = dl.emails( ab ); + TQStringList emails = dl.emails( ab ); kdDebug() << emails << endl; assert( emails.count() == 3 ); check( "first email", emails[0], "addr1 <addr1@kde.org>" ); @@ -252,22 +252,22 @@ void TestDistrList::testRemoveEntry() DistributionList dl = DistributionList::findByName( ab, "foo" ); assert( !dl.isEmpty() ); DistributionList::Entry::List entries = dl.entries( ab ); - check( "entries count before removeEntry", QString::number( entries.count() ), "3" ); + check( "entries count before removeEntry", TQString::number( entries.count() ), "3" ); // Removing an empty entry shouldn't do anything dl.removeEntry( KABC::Addressee() ); - check( "entries count after removing empty entry", QString::number( dl.entries(ab).count() ), "3" ); + check( "entries count after removing empty entry", TQString::number( dl.entries(ab).count() ), "3" ); KABC::Addressee addr1 = ab->findByName( "addr1" ).first(); assert( !addr1.isEmpty() ); // Removing an entry with the wrong email passed, shouldn't do anything dl.removeEntry( addr1, "foo@foobar.com" ); - check( "entries count after removing entry with invalid email", QString::number( dl.entries(ab).count() ), "3" ); + check( "entries count after removing entry with invalid email", TQString::number( dl.entries(ab).count() ), "3" ); // Now remove entry correctly dl.removeEntry( addr1 ); - check( "removeEntry(addr1) worked", QString::number( dl.entries(ab).count() ), "2" ); - QStringList emails = dl.emails( ab ); + check( "removeEntry(addr1) worked", TQString::number( dl.entries(ab).count() ), "2" ); + TQStringList emails = dl.emails( ab ); assert( emails.count() == 2 ); check( "first email", emails[0], "addr2 <addr2-alternate@kde.org>" ); @@ -275,13 +275,13 @@ void TestDistrList::testRemoveEntry() KABC::Addressee addr2 = ab->findByName( "addr2" ).first(); assert( !addr2.isEmpty() ); dl.removeEntry( addr2 ); - check( "entries count after removing entry with no email", QString::number( dl.entries(ab).count() ), "2" ); + check( "entries count after removing entry with no email", TQString::number( dl.entries(ab).count() ), "2" ); // Now remove addr2 correctly dl.removeEntry( addr2, "addr2@kde.org" ); - check( "entries count after removing addr2", QString::number( dl.entries(ab).count() ), "1" ); + check( "entries count after removing addr2", TQString::number( dl.entries(ab).count() ), "1" ); dl.removeEntry( addr2, "addr2-alternate@kde.org" ); - check( "entries count after removing alternate addr2", QString::number( dl.entries(ab).count() ), "0" ); + check( "entries count after removing alternate addr2", TQString::number( dl.entries(ab).count() ), "0" ); assert( dl.entries(ab).isEmpty() ); assert( dl.emails(ab).isEmpty() ); assert( DistributionList::isDistributionList( dl ) ); |