From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libkdepim/tests/test_kregexp.cpp | 4 ++-- libkdepim/tests/testdateedit.cpp | 14 ++++++------ libkdepim/tests/testdateedit.h | 6 ++--- libkdepim/tests/testdistrlist.cpp | 44 ++++++++++++++++++------------------ libkdepim/tests/testdistrlist.h | 4 ++-- libkdepim/tests/testlinklocator.cpp | 44 ++++++++++++++++++------------------ libkdepim/tests/testutf7decoder.cpp | 12 +++++----- libkdepim/tests/testutf7encoder.cpp | 8 +++---- libkdepim/tests/testutf7encoder2.cpp | 16 ++++++------- libkdepim/tests/testwizard.cpp | 16 ++++++------- 10 files changed, 84 insertions(+), 84 deletions(-) (limited to 'libkdepim/tests') diff --git a/libkdepim/tests/test_kregexp.cpp b/libkdepim/tests/test_kregexp.cpp index 96bfc54c6..a44e3be0f 100644 --- a/libkdepim/tests/test_kregexp.cpp +++ b/libkdepim/tests/test_kregexp.cpp @@ -9,8 +9,8 @@ main() // test for http://bugs.kde.org/show_bug.cgi?id=54886 KRegExp3 reg("^"); - QString res = reg.replace(QString::fromLatin1("Fun stuff"), - QString::fromLatin1("[fun] ")); + TQString res = reg.replace(TQString::fromLatin1("Fun stuff"), + TQString::fromLatin1("[fun] ")); kdDebug() << res << endl; } diff --git a/libkdepim/tests/testdateedit.cpp b/libkdepim/tests/testdateedit.cpp index bc244f13f..993967cb6 100644 --- a/libkdepim/tests/testdateedit.cpp +++ b/libkdepim/tests/testdateedit.cpp @@ -19,7 +19,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include #include @@ -31,19 +31,19 @@ #include "testdateedit.h" -DateEdit::DateEdit( QWidget *parent, const char *name ) - : QWidget( parent, name ) +DateEdit::DateEdit( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { - QVBoxLayout *layout = new QVBoxLayout( this ); + TQVBoxLayout *layout = new TQVBoxLayout( this ); KDateEdit *edit = new KDateEdit( this ); layout->addWidget( edit ); - connect( edit, SIGNAL( dateChanged( const QDate& ) ), - this, SLOT( dateChanged( const QDate& ) ) ); + connect( edit, TQT_SIGNAL( dateChanged( const TQDate& ) ), + this, TQT_SLOT( dateChanged( const TQDate& ) ) ); } -void DateEdit::dateChanged( const QDate &date ) +void DateEdit::dateChanged( const TQDate &date ) { if ( date.isValid() ) qDebug( "%s", date.toString().latin1() ); diff --git a/libkdepim/tests/testdateedit.h b/libkdepim/tests/testdateedit.h index d6eb14cd0..86a9ea4e8 100644 --- a/libkdepim/tests/testdateedit.h +++ b/libkdepim/tests/testdateedit.h @@ -22,17 +22,17 @@ #ifndef TESTDATEEDIT_H #define TESTDATEEDIT_H -#include +#include class DateEdit : public QWidget { Q_OBJECT public: - DateEdit( QWidget *parent = 0, const char *name = 0 ); + DateEdit( TQWidget *parent = 0, const char *name = 0 ); public slots: - void dateChanged( const QDate& ); + void dateChanged( const TQDate& ); }; #endif 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 #include -#include -#include +#include +#include #include #include @@ -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 #include -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 " ); @@ -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 " ); @@ -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 ) ); diff --git a/libkdepim/tests/testdistrlist.h b/libkdepim/tests/testdistrlist.h index 0b2a055d2..782c3ec5f 100644 --- a/libkdepim/tests/testdistrlist.h +++ b/libkdepim/tests/testdistrlist.h @@ -19,7 +19,7 @@ #ifndef TESTDISTRLIST_H #define TESTDISTRLIST_H -#include +#include class TestDistrList : public QObject { @@ -40,7 +40,7 @@ public: void testDeleteList(); private: - bool check(const QString& txt, QString a, QString b); + bool check(const TQString& txt, TQString a, TQString b); }; #endif diff --git a/libkdepim/tests/testlinklocator.cpp b/libkdepim/tests/testlinklocator.cpp index b5678fe14..39383d9d1 100644 --- a/libkdepim/tests/testlinklocator.cpp +++ b/libkdepim/tests/testlinklocator.cpp @@ -28,7 +28,7 @@ #include #include -static bool check(const QString& txt, const QString& a, const QString& b) +static bool check(const TQString& txt, const TQString& a, const TQString& b) { if (a == b) { kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl; @@ -40,9 +40,9 @@ static bool check(const QString& txt, const QString& a, const QString& b) return true; } -static bool checkGetEmailAddress( const QString & input, +static bool checkGetEmailAddress( const TQString & input, int atPos, - const QString & expRetVal, + const TQString & expRetVal, bool allowBadAtPos = false ) { if ( !allowBadAtPos && ( input[atPos] != '@' ) ) { @@ -51,8 +51,8 @@ static bool checkGetEmailAddress( const QString & input, exit(1); } LinkLocator ll( input, atPos ); - const QString retVal = ll.getEmailAddress(); - check( "getEmailAddress() \"" + input + "\", " + QString::number( atPos ), + const TQString retVal = ll.getEmailAddress(); + check( "getEmailAddress() \"" + input + "\", " + TQString::number( atPos ), retVal, expRetVal ); return true; } @@ -64,38 +64,38 @@ int main(int argc, char *argv[]) KApplication app( false, false ); // empty input - checkGetEmailAddress( QString(), 0, QString(), true ); + checkGetEmailAddress( TQString(), 0, TQString(), true ); // no '@' at scan position - checkGetEmailAddress( "foo@bar.baz", 0, QString(), true ); + checkGetEmailAddress( "foo@bar.baz", 0, TQString(), true ); // '@' in local part - checkGetEmailAddress( "foo@bar@bar.baz", 7, QString() ); + checkGetEmailAddress( "foo@bar@bar.baz", 7, TQString() ); // empty local part - checkGetEmailAddress( "@bar.baz", 0, QString() ); - checkGetEmailAddress( ".@bar.baz", 1, QString() ); - checkGetEmailAddress( " @bar.baz", 1, QString() ); - checkGetEmailAddress( ".!#$%&'*+-/=?^_`{|}~@bar.baz", strlen(".!#$%&'*+-/=?^_`{|}~"), QString() ); + checkGetEmailAddress( "@bar.baz", 0, TQString() ); + checkGetEmailAddress( ".@bar.baz", 1, TQString() ); + checkGetEmailAddress( " @bar.baz", 1, TQString() ); + checkGetEmailAddress( ".!#$%&'*+-/=?^_`{|}~@bar.baz", strlen(".!#$%&'*+-/=?^_`{|}~"), TQString() ); // allowed special chars in local part of address checkGetEmailAddress( "a.!#$%&'*+-/=?^_`{|}~@bar.baz", strlen("a.!#$%&'*+-/=?^_`{|}~"), "a.!#$%&'*+-/=?^_`{|}~@bar.baz" ); // '@' in domain part - checkGetEmailAddress( "foo@bar@bar.baz", 3, QString() ); + checkGetEmailAddress( "foo@bar@bar.baz", 3, TQString() ); // domain part without dot - checkGetEmailAddress( "foo@bar", 3, QString() ); - checkGetEmailAddress( "foo@bar.", 3, QString() ); - checkGetEmailAddress( ".foo@bar", 4, QString() ); - checkGetEmailAddress( "foo@bar ", 3, QString() ); - checkGetEmailAddress( " foo@bar", 4, QString() ); - checkGetEmailAddress( "foo@bar-bar", 3, QString() ); + checkGetEmailAddress( "foo@bar", 3, TQString() ); + checkGetEmailAddress( "foo@bar.", 3, TQString() ); + checkGetEmailAddress( ".foo@bar", 4, TQString() ); + checkGetEmailAddress( "foo@bar ", 3, TQString() ); + checkGetEmailAddress( " foo@bar", 4, TQString() ); + checkGetEmailAddress( "foo@bar-bar", 3, TQString() ); // empty domain part - checkGetEmailAddress( "foo@", 3, QString() ); - checkGetEmailAddress( "foo@.", 3, QString() ); - checkGetEmailAddress( "foo@-", 3, QString() ); + checkGetEmailAddress( "foo@", 3, TQString() ); + checkGetEmailAddress( "foo@.", 3, TQString() ); + checkGetEmailAddress( "foo@-", 3, TQString() ); // simple address checkGetEmailAddress( "foo@bar.baz", 3, "foo@bar.baz" ); diff --git a/libkdepim/tests/testutf7decoder.cpp b/libkdepim/tests/testutf7decoder.cpp index 39ded9201..f6b8f4ada 100644 --- a/libkdepim/tests/testutf7decoder.cpp +++ b/libkdepim/tests/testutf7decoder.cpp @@ -1,6 +1,6 @@ #include "qutf7codec.h" #include "qutf7codec.cpp" -#include +#include #include #include @@ -8,19 +8,19 @@ int main( int argc, char * argv[] ) { if ( argc == 1 ) { (void)new QUtf7Codec; - QTextCodec * codec = QTextCodec::codecForName("utf-7"); + TQTextCodec * codec = TQTextCodec::codecForName("utf-7"); assert(codec); - QTextIStream my_cin(stdin); + TQTextIStream my_cin(stdin); my_cin.setCodec(codec); - QTextOStream my_cout(stdout); + TQTextOStream my_cout(stdout); - QString buffer = my_cin.read(); + TQString buffer = my_cin.read(); my_cout << buffer; } else { qWarning("usage: testutf7decoder string_to_decode\n"); } - QTextCodec::deleteAllCodecs(); + TQTextCodec::deleteAllCodecs(); } diff --git a/libkdepim/tests/testutf7encoder.cpp b/libkdepim/tests/testutf7encoder.cpp index 2d635744e..925bab21e 100644 --- a/libkdepim/tests/testutf7encoder.cpp +++ b/libkdepim/tests/testutf7encoder.cpp @@ -7,9 +7,9 @@ void main( int argc, char * argv[] ) { if ( argc == 2 ) { QUtf7Codec * codec = new QUtf7Codec; - QTextEncoder * enc; + TQTextEncoder * enc; - QString arg = QString::fromLatin1( argv[1] ); + TQString arg = TQString::fromLatin1( argv[1] ); int len; cout << "Original string:\n" @@ -31,7 +31,7 @@ void main( int argc, char * argv[] ) { for ( int i = 0 ; i < arg.length() ; i++ ) { len = 1; - cout << (enc->fromUnicode( QString(arg[i]), len )).data(); + cout << (enc->fromUnicode( TQString(arg[i]), len )).data(); } cout << "\n" << endl; @@ -79,7 +79,7 @@ void main( int argc, char * argv[] ) { for ( int i = 0 ; i < arg.length() ; i++ ) { len = 1; - cout << (enc->fromUnicode( QString(arg[i]), len )).data(); + cout << (enc->fromUnicode( TQString(arg[i]), len )).data(); } cout << "\n" << endl; diff --git a/libkdepim/tests/testutf7encoder2.cpp b/libkdepim/tests/testutf7encoder2.cpp index 0661d63c1..57c195662 100644 --- a/libkdepim/tests/testutf7encoder2.cpp +++ b/libkdepim/tests/testutf7encoder2.cpp @@ -1,6 +1,6 @@ #include "qutf7codec.h" #include "qutf7codec.cpp" -#include +#include #include #include #include @@ -9,27 +9,27 @@ int main( int argc, char * argv[] ) { if ( argc == 1 ) { (void)new QUtf7Codec; - QTextCodec * codec = QTextCodec::codecForName("utf-7"); + TQTextCodec * codec = TQTextCodec::codecForName("utf-7"); assert(codec); - QTextIStream my_cin(stdin); + TQTextIStream my_cin(stdin); - QTextOStream my_cout(stdout); + TQTextOStream my_cout(stdout); my_cout.setCodec(codec); - QString buffer = my_cin.read(); + TQString buffer = my_cin.read(); // qDebug("buffer == " + buffer); #ifdef USE_STREAM my_cout << buffer << endl; #else - QTextEncoder * enc = codec->makeEncoder(); + TQTextEncoder * enc = codec->makeEncoder(); #ifdef CHAR_WISE int len; for ( int i = 0 ; i < buffer.length() ; i++ ) { len = 1; - cout << (enc->fromUnicode(QString(buffer[i]),len)).data(); + cout << (enc->fromUnicode(TQString(buffer[i]),len)).data(); } cout << endl; #else @@ -41,5 +41,5 @@ int main( int argc, char * argv[] ) { } else { qWarning("usage: testutf7encoder2 < infile > outfile\n"); } - QTextCodec::deleteAllCodecs(); + TQTextCodec::deleteAllCodecs(); } diff --git a/libkdepim/tests/testwizard.cpp b/libkdepim/tests/testwizard.cpp index ce4038909..8db1dd42d 100644 --- a/libkdepim/tests/testwizard.cpp +++ b/libkdepim/tests/testwizard.cpp @@ -29,8 +29,8 @@ #include #include -#include -#include +#include +#include class TestConfigWizard : public KConfigWizard { @@ -39,15 +39,15 @@ class TestConfigWizard : public KConfigWizard KConfigWizard( new KConfigPropagator( MyConfig::self(), "propagator_test.kcfg" ) ) { - QFrame *page = createWizardPage( "My Wizard Page" ); - QBoxLayout *topLayout = new QVBoxLayout( page ); + TQFrame *page = createWizardPage( "My Wizard Page" ); + TQBoxLayout *topLayout = new TQVBoxLayout( page ); - mFixKMailCheckBox = new QCheckBox( i18n("Fix KMail"), page ); + mFixKMailCheckBox = new TQCheckBox( i18n("Fix KMail"), page ); topLayout->addWidget( mFixKMailCheckBox ); mFixKMailCheckBox->setChecked( MyConfig::fixKMail() ); - mBreakKMailCheckBox = new QCheckBox( i18n("Break KMail"), page ); + mBreakKMailCheckBox = new TQCheckBox( i18n("Break KMail"), page ); topLayout->addWidget( mBreakKMailCheckBox ); mBreakKMailCheckBox->setChecked( MyConfig::breakKMail() ); @@ -71,8 +71,8 @@ class TestConfigWizard : public KConfigWizard } private: - QCheckBox *mFixKMailCheckBox; - QCheckBox *mBreakKMailCheckBox; + TQCheckBox *mFixKMailCheckBox; + TQCheckBox *mBreakKMailCheckBox; }; static const KCmdLineOptions options[] = -- cgit v1.2.1