summaryrefslogtreecommitdiffstats
path: root/kabc/tests
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
commitffe8a83e053396df448e9413828527613ca3bd46 (patch)
treea73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kabc/tests
parent682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff)
downloadtdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz
tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kabc/tests')
-rw-r--r--kabc/tests/bigwrite.cpp4
-rw-r--r--kabc/tests/kabcargl.cpp22
-rw-r--r--kabc/tests/testaddresslineedit.cpp2
-rw-r--r--kabc/tests/testdistlist.cpp6
-rw-r--r--kabc/tests/testkabc.cpp10
-rw-r--r--kabc/tests/testkabcdlg.cpp2
-rw-r--r--kabc/tests/testldapclient.cpp50
-rw-r--r--kabc/tests/testldapclient.h6
-rw-r--r--kabc/tests/testlock.cpp64
-rw-r--r--kabc/tests/testlock.h8
10 files changed, 87 insertions, 87 deletions
diff --git a/kabc/tests/bigwrite.cpp b/kabc/tests/bigwrite.cpp
index 90013a157..0dd6a7a05 100644
--- a/kabc/tests/bigwrite.cpp
+++ b/kabc/tests/bigwrite.cpp
@@ -25,9 +25,9 @@ int main(int argc,char **argv)
for( int i = 0; i < 5000; ++i ) {
Addressee a;
- a.setGivenName( "number" + QString::number( i ) );
+ a.setGivenName( "number" + TQString::number( i ) );
a.setFamilyName( "Name" );
- a.insertEmail( QString::number( i ) + "@domain" );
+ a.insertEmail( TQString::number( i ) + "@domain" );
ab.insertAddressee( a );
}
diff --git a/kabc/tests/kabcargl.cpp b/kabc/tests/kabcargl.cpp
index 32251303b..b57724c15 100644
--- a/kabc/tests/kabcargl.cpp
+++ b/kabc/tests/kabcargl.cpp
@@ -18,9 +18,9 @@
Boston, MA 02110-1301, USA.
*/
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qregexp.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqregexp.h>
#include <kaboutdata.h>
#include <kapplication.h>
@@ -42,20 +42,20 @@ int main(int argc,char **argv)
KApplication app;
- QString filename = StdAddressBook::fileName();
+ TQString filename = StdAddressBook::fileName();
- QFile f( filename );
+ TQFile f( filename );
if ( !f.open( IO_ReadOnly ) ) {
kdDebug() << "Error opening file '" << filename << "' for reading." << endl;
return 1;
}
- QTextStream t( &f );
- t.setEncoding(QTextStream::UnicodeUTF8);
- QString text = t.read();
+ TQTextStream t( &f );
+ t.setEncoding(TQTextStream::UnicodeUTF8);
+ TQString text = t.read();
f.close();
- text = QString::fromUtf8( text.local8Bit() );
+ text = TQString::fromUtf8( text.local8Bit() );
text.replace( "\n", "\r\n" );
if ( !f.open( IO_WriteOnly ) ) {
@@ -63,8 +63,8 @@ int main(int argc,char **argv)
return 1;
}
- QTextStream t2( &f );
- t2.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream t2( &f );
+ t2.setEncoding(TQTextStream::UnicodeUTF8);
t2 << text;
f.close();
}
diff --git a/kabc/tests/testaddresslineedit.cpp b/kabc/tests/testaddresslineedit.cpp
index 70c07b446..0dea6f742 100644
--- a/kabc/tests/testaddresslineedit.cpp
+++ b/kabc/tests/testaddresslineedit.cpp
@@ -21,7 +21,7 @@ int main( int argc,char **argv )
lineEdit->show();
app.setMainWidget( lineEdit );
- QObject::connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
+ TQObject::connect( &app, TQT_SIGNAL( lastWindowClosed() ), &app, TQT_SLOT( quit() ) );
app.exec();
diff --git a/kabc/tests/testdistlist.cpp b/kabc/tests/testdistlist.cpp
index a81f8c0dc..abf551ace 100644
--- a/kabc/tests/testdistlist.cpp
+++ b/kabc/tests/testdistlist.cpp
@@ -1,4 +1,4 @@
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kaboutdata.h>
#include <kapplication.h>
@@ -30,7 +30,7 @@ int main(int argc,char **argv)
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if (args->isSet("list")) {
- QString name = args->getOption("list");
+ TQString name = args->getOption("list");
DistributionListManager *manager =
new DistributionListManager( StdAddressBook::self() );
@@ -51,7 +51,7 @@ int main(int argc,char **argv)
editor->show();
app.setMainWidget(editor);
- QObject::connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
+ TQObject::connect( &app, TQT_SIGNAL( lastWindowClosed() ), &app, TQT_SLOT( quit() ) );
app.exec();
diff --git a/kabc/tests/testkabc.cpp b/kabc/tests/testkabc.cpp
index 15fa11c44..c5d2d12e4 100644
--- a/kabc/tests/testkabc.cpp
+++ b/kabc/tests/testkabc.cpp
@@ -5,8 +5,8 @@
#include <kcmdlineargs.h>
#include <kstandarddirs.h>
-#include <qfile.h>
-#include <qimage.h>
+#include <tqfile.h>
+#include <tqimage.h>
#include "geo.h"
#include "secrecy.h"
@@ -31,7 +31,7 @@ int main(int argc,char **argv)
#ifdef READ
AddressBook::Iterator it;
for ( it = ab->begin(); it != ab->end(); ++it ) {
- QString vcard;
+ TQString vcard;
VCardConverter converter;
converter.addresseeToVCard( *it, vcard );
kdDebug() << "card=" << vcard << endl;
@@ -44,11 +44,11 @@ int main(int argc,char **argv)
Picture pic;
- QImage img;
+ TQImage img;
img.load("/home/tobias/test.png");
/*
pic.setData(img);
- pic.setType(QImage::imageFormat("/home/tobias/test.png"));
+ pic.setType(TQImage::imageFormat("/home/tobias/test.png"));
*/
pic.setUrl("http://www.mypict.de");
addr.setLogo( pic );
diff --git a/kabc/tests/testkabcdlg.cpp b/kabc/tests/testkabcdlg.cpp
index c497a9ead..3c9a23792 100644
--- a/kabc/tests/testkabcdlg.cpp
+++ b/kabc/tests/testkabcdlg.cpp
@@ -1,4 +1,4 @@
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kaboutdata.h>
#include <kapplication.h>
diff --git a/kabc/tests/testldapclient.cpp b/kabc/tests/testldapclient.cpp
index f4616d16c..2fa6a1c72 100644
--- a/kabc/tests/testldapclient.cpp
+++ b/kabc/tests/testldapclient.cpp
@@ -22,7 +22,7 @@
#include <kdebug.h>
#include <kcmdlineargs.h>
-#include <qeventloop.h>
+#include <tqeventloop.h>
#include <assert.h>
#include <stdlib.h>
@@ -50,12 +50,12 @@ void TestLDAPClient::runAll()
testIntevation();
}
-bool TestLDAPClient::check(const QString& txt, QString a, QString b)
+bool TestLDAPClient::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;
}
@@ -82,50 +82,50 @@ void TestLDAPClient::testIntevation()
mClient->setBase( "o=Intevation GmbH,c=de" );
// Same list as in kaddressbook's ldapsearchdialog
- QStringList attrs;
+ TQStringList attrs;
attrs << "l" << "Company" << "co" << "department" << "description" << "mail" << "facsimileTelephoneNumber" << "cn" << "homePhone" << "mobile" << "o" << "pager" << "postalAddress" << "st" << "street" << "title" << "uid" << "telephoneNumber" << "postalCode" << "objectClass";
// the list from ldapclient.cpp
//attrs << "cn" << "mail" << "givenname" << "sn" << "objectClass";
mClient->setAttrs( attrs );
// Taken from LdapSearch
- //QString mSearchText = QString::fromUtf8( "Till" );
- //QString filter = QString( "&(|(objectclass=person)(objectclass=groupOfNames)(mail=*))(|(cn=%1*)(mail=%2*)(givenName=%3*)(sn=%4*))" )
+ //TQString mSearchText = TQString::fromUtf8( "Till" );
+ //TQString filter = TQString( "&(|(objectclass=person)(objectclass=groupOfNames)(mail=*))(|(cn=%1*)(mail=%2*)(givenName=%3*)(sn=%4*))" )
// .arg( mSearchText ).arg( mSearchText ).arg( mSearchText ).arg( mSearchText );
// For some reason a fromUtf8 broke the search for me (no results).
// But this certainly looks fishy, it might break on non-utf8 systems.
- QString filter = "&(|(objectclass=person)(objectclass=groupofnames)(mail=*))(|(cn=*Ägypten MDK*)(sn=*Ägypten MDK*))";
-
- connect( mClient, SIGNAL( result( const KABC::LdapObject& ) ),
- this, SLOT( slotLDAPResult( const KABC::LdapObject& ) ) );
- connect( mClient, SIGNAL( done() ),
- this, SLOT( slotLDAPDone() ) );
- connect( mClient, SIGNAL( error( const QString& ) ),
- this, SLOT( slotLDAPError( const QString& ) ) );
+ TQString filter = "&(|(objectclass=person)(objectclass=groupofnames)(mail=*))(|(cn=*Ägypten MDK*)(sn=*Ägypten MDK*))";
+
+ connect( mClient, TQT_SIGNAL( result( const KABC::LdapObject& ) ),
+ this, TQT_SLOT( slotLDAPResult( const KABC::LdapObject& ) ) );
+ connect( mClient, TQT_SIGNAL( done() ),
+ this, TQT_SLOT( slotLDAPDone() ) );
+ connect( mClient, TQT_SIGNAL( error( const TQString& ) ),
+ this, TQT_SLOT( slotLDAPError( const TQString& ) ) );
mClient->startQuery( filter );
kapp->eventLoop()->enterLoop();
delete mClient; mClient = 0;
}
// from kaddressbook... ugly though...
-static QString asUtf8( const QByteArray &val )
+static TQString asUtf8( const TQByteArray &val )
{
if ( val.isEmpty() )
- return QString::null;
+ return TQString::null;
const char *data = val.data();
- //QString::fromUtf8() bug workaround
+ //TQString::fromUtf8() bug workaround
if ( data[ val.size() - 1 ] == '\0' )
- return QString::fromUtf8( data, val.size() - 1 );
+ return TQString::fromUtf8( data, val.size() - 1 );
else
- return QString::fromUtf8( data, val.size() );
+ return TQString::fromUtf8( data, val.size() );
}
-static QString join( const KABC::LdapAttrValue& lst, const QString& sep )
+static TQString join( const KABC::LdapAttrValue& lst, const TQString& sep )
{
- QString res;
+ TQString res;
bool already = false;
for ( KABC::LdapAttrValue::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
if ( already )
@@ -138,15 +138,15 @@ static QString join( const KABC::LdapAttrValue& lst, const QString& sep )
void TestLDAPClient::slotLDAPResult( const KABC::LdapObject& obj )
{
- QString cn = join( obj.attrs[ "cn" ], ", " );
+ TQString cn = join( obj.attrs[ "cn" ], ", " );
kdDebug() << " cn:" << cn << endl;
assert( !obj.attrs[ "mail" ].isEmpty() );
- QString mail = join( obj.attrs[ "mail" ], ", " );
+ TQString mail = join( obj.attrs[ "mail" ], ", " );
kdDebug() << " mail:" << mail << endl;
assert( mail.contains( '@' ) );
}
-void TestLDAPClient::slotLDAPError( const QString& err )
+void TestLDAPClient::slotLDAPError( const TQString& err )
{
kdDebug() << k_funcinfo << err << endl;
::exit( 1 );
diff --git a/kabc/tests/testldapclient.h b/kabc/tests/testldapclient.h
index 583ead073..ea1293b51 100644
--- a/kabc/tests/testldapclient.h
+++ b/kabc/tests/testldapclient.h
@@ -19,7 +19,7 @@
#ifndef TESTLDAPCLIENT_H
#define TESTLDAPCLIENT_H
-#include <qobject.h>
+#include <tqobject.h>
#include "../ldapclient.h"
typedef KABC::LdapClient LdapClient;
@@ -39,11 +39,11 @@ public:
private slots:
void slotLDAPResult( const KABC::LdapObject& );
- void slotLDAPError( const QString& );
+ void slotLDAPError( const TQString& );
void slotLDAPDone();
private:
- bool check(const QString& txt, QString a, QString b);
+ bool check(const TQString& txt, TQString a, TQString b);
LdapClient* mClient;
};
diff --git a/kabc/tests/testlock.cpp b/kabc/tests/testlock.cpp
index c922c7a7e..4674606e0 100644
--- a/kabc/tests/testlock.cpp
+++ b/kabc/tests/testlock.cpp
@@ -33,12 +33,12 @@
#include <kmessagebox.h>
#include <kdialog.h>
-#include <qwidget.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qlistview.h>
-#include <qdir.h>
+#include <tqwidget.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
+#include <tqlistview.h>
+#include <tqdir.h>
#include <iostream>
@@ -47,9 +47,9 @@
using namespace KABC;
-LockWidget::LockWidget( const QString &identifier )
+LockWidget::LockWidget( const TQString &identifier )
{
- QVBoxLayout *topLayout = new QVBoxLayout( this );
+ TQVBoxLayout *topLayout = new TQVBoxLayout( this );
topLayout->setMargin( KDialog::marginHint() );
topLayout->setSpacing( KDialog::spacingHint() );
@@ -60,31 +60,31 @@ LockWidget::LockWidget( const QString &identifier )
int pid = getpid();
- QLabel *pidLabel = new QLabel( "Process ID: " + QString::number( pid ),
+ TQLabel *pidLabel = new TQLabel( "Process ID: " + TQString::number( pid ),
this );
topLayout->addWidget( pidLabel );
- QHBoxLayout *identifierLayout = new QHBoxLayout( topLayout );
+ TQHBoxLayout *identifierLayout = new TQHBoxLayout( topLayout );
- QLabel *resourceLabel = new QLabel( "Identifier:", this );
+ TQLabel *resourceLabel = new TQLabel( "Identifier:", this );
identifierLayout->addWidget( resourceLabel );
- QLabel *resourceIdentifier = new QLabel( identifier, this );
+ TQLabel *resourceIdentifier = new TQLabel( identifier, this );
identifierLayout->addWidget( resourceIdentifier );
- mStatus = new QLabel( "Status: Unlocked", this );
+ mStatus = new TQLabel( "Status: Unlocked", this );
topLayout->addWidget( mStatus );
- QPushButton *button = new QPushButton( "Lock", this );
+ TQPushButton *button = new TQPushButton( "Lock", this );
topLayout->addWidget( button );
- connect( button, SIGNAL( clicked() ), SLOT( lock() ) );
+ connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( lock() ) );
- button = new QPushButton( "Unlock", this );
+ button = new TQPushButton( "Unlock", this );
topLayout->addWidget( button );
- connect( button, SIGNAL( clicked() ), SLOT( unlock() ) );
+ connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( unlock() ) );
}
- mLockView = new QListView( this );
+ mLockView = new TQListView( this );
topLayout->addWidget( mLockView );
mLockView->addColumn( "Lock File" );
mLockView->addColumn( "PID" );
@@ -92,17 +92,17 @@ LockWidget::LockWidget( const QString &identifier )
updateLockView();
- QPushButton *quitButton = new QPushButton( "Quit", this );
+ TQPushButton *quitButton = new TQPushButton( "Quit", this );
topLayout->addWidget( quitButton );
- connect( quitButton, SIGNAL( clicked() ), SLOT( close() ) );
+ connect( quitButton, TQT_SIGNAL( clicked() ), TQT_SLOT( close() ) );
KDirWatch *watch = KDirWatch::self();
- connect( watch, SIGNAL( dirty( const QString & ) ),
- SLOT( updateLockView() ) );
- connect( watch, SIGNAL( created( const QString & ) ),
- SLOT( updateLockView() ) );
- connect( watch, SIGNAL( deleted( const QString & ) ),
- SLOT( updateLockView() ) );
+ connect( watch, TQT_SIGNAL( dirty( const TQString & ) ),
+ TQT_SLOT( updateLockView() ) );
+ connect( watch, TQT_SIGNAL( created( const TQString & ) ),
+ TQT_SLOT( updateLockView() ) );
+ connect( watch, TQT_SIGNAL( deleted( const TQString & ) ),
+ TQT_SLOT( updateLockView() ) );
watch->addDir( Lock::locksDir() );
watch->startScan();
}
@@ -116,20 +116,20 @@ void LockWidget::updateLockView()
{
mLockView->clear();
- QDir dir( Lock::locksDir() );
+ TQDir dir( Lock::locksDir() );
- QStringList files = dir.entryList( "*.lock" );
+ TQStringList files = dir.entryList( "*.lock" );
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for( it = files.begin(); it != files.end(); ++it ) {
if ( *it == "." || *it == ".." ) continue;
- QString app;
+ TQString app;
int pid;
if ( !Lock::readLockFile( dir.filePath( *it ), pid, app ) ) {
kdWarning() << "Unable to open lock file '" << *it << "'" << endl;
} else {
- new QListViewItem( mLockView, *it, QString::number( pid ), app );
+ new TQListViewItem( mLockView, *it, TQString::number( pid ), app );
}
}
}
@@ -171,7 +171,7 @@ int main(int argc,char **argv)
KApplication app;
- QString identifier;
+ TQString identifier;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if ( args->count() == 1 ) {
diff --git a/kabc/tests/testlock.h b/kabc/tests/testlock.h
index 16c128bf1..bd59d2f5e 100644
--- a/kabc/tests/testlock.h
+++ b/kabc/tests/testlock.h
@@ -23,7 +23,7 @@
#include "lock.h"
-#include <qwidget.h>
+#include <tqwidget.h>
class QLabel;
class QListView;
@@ -32,7 +32,7 @@ class KABC_EXPORT LockWidget : public QWidget
{
Q_OBJECT
public:
- LockWidget( const QString &identifier );
+ LockWidget( const TQString &identifier );
~LockWidget();
protected slots:
@@ -44,8 +44,8 @@ class KABC_EXPORT LockWidget : public QWidget
private:
KABC::Lock *mLock;
- QLabel *mStatus;
- QListView *mLockView;
+ TQLabel *mStatus;
+ TQListView *mLockView;
};
#endif