diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/protocols/groupwise/libgroupwise/client.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/groupwise/libgroupwise/client.cpp')
-rw-r--r-- | kopete/protocols/groupwise/libgroupwise/client.cpp | 182 |
1 files changed, 91 insertions, 91 deletions
diff --git a/kopete/protocols/groupwise/libgroupwise/client.cpp b/kopete/protocols/groupwise/libgroupwise/client.cpp index 274a9ea8..1a88fbc3 100644 --- a/kopete/protocols/groupwise/libgroupwise/client.cpp +++ b/kopete/protocols/groupwise/libgroupwise/client.cpp @@ -19,8 +19,8 @@ ************************************************************************* */ -#include <qapplication.h> -#include <qtimer.h> +#include <tqapplication.h> +#include <tqtimer.h> #include "chatroommanager.h" #include "gwclientstream.h" @@ -53,8 +53,8 @@ public: ClientStream *stream; int id_seed; Task *root; - QString host, user, userDN, pass; - QString osname, tzname, clientName, clientVersion; + TQString host, user, userDN, pass; + TQString osname, tzname, clientName, clientVersion; uint port; /* int tzoffset;*/ bool active; @@ -63,12 +63,12 @@ public: UserDetailsManager * userDetailsMgr; PrivacyManager * privacyMgr; uint protocolVersion; - QValueList<GroupWise::CustomStatus> customStatuses; - QTimer * keepAliveTimer; + TQValueList<GroupWise::CustomStatus> customStatuses; + TQTimer * keepAliveTimer; }; -Client::Client(QObject *par, uint protocolVersion ) -:QObject(par, "groupwiseclient") +Client::Client(TQObject *par, uint protocolVersion ) +:TQObject(par, "groupwiseclient") { d = new ClientPrivate; /* d->tzoffset = 0;*/ @@ -85,8 +85,8 @@ Client::Client(QObject *par, uint protocolVersion ) d->stream = 0; d->protocolVersion = protocolVersion; // Sends regular keepalives so the server knows we are still running - d->keepAliveTimer = new QTimer( this ); - connect( d->keepAliveTimer, SIGNAL( timeout() ), SLOT( sendKeepAlive() ) ); + d->keepAliveTimer = new TQTimer( this ); + connect( d->keepAliveTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( sendKeepAlive() ) ); } Client::~Client() @@ -100,32 +100,32 @@ Client::~Client() void Client::connectToServer( ClientStream *s, const NovellDN &server, bool auth ) { d->stream = s; - //connect(d->stream, SIGNAL(connected()), SLOT(streamConnected())); - //connect(d->stream, SIGNAL(handshaken()), SLOT(streamHandshaken())); - connect(d->stream, SIGNAL(error(int)), SLOT(streamError(int))); - //connect(d->stream, SIGNAL(sslCertificateReady(const QSSLCert &)), SLOT(streamSSLCertificateReady(const QSSLCert &))); - connect(d->stream, SIGNAL(readyRead()), SLOT(streamReadyRead())); - //connect(d->stream, SIGNAL(closeFinished()), SLOT(streamCloseFinished())); + //connect(d->stream, TQT_SIGNAL(connected()), TQT_SLOT(streamConnected())); + //connect(d->stream, TQT_SIGNAL(handshaken()), TQT_SLOT(streamHandshaken())); + connect(d->stream, TQT_SIGNAL(error(int)), TQT_SLOT(streamError(int))); + //connect(d->stream, TQT_SIGNAL(sslCertificateReady(const QSSLCert &)), TQT_SLOT(streamSSLCertificateReady(const QSSLCert &))); + connect(d->stream, TQT_SIGNAL(readyRead()), TQT_SLOT(streamReadyRead())); + //connect(d->stream, TQT_SIGNAL(closeFinished()), TQT_SLOT(streamCloseFinished())); d->stream->connectToServer(server, auth); } -void Client::setOSName(const QString &name) +void Client::setOSName(const TQString &name) { d->osname = name; } -void Client::setClientName(const QString &s) +void Client::setClientName(const TQString &s) { d->clientName = s; } -void Client::setClientVersion(const QString &s) +void Client::setClientVersion(const TQString &s) { d->clientVersion = s; } -void Client::start( const QString &host, const uint port, const QString &userId, const QString &pass ) +void Client::start( const TQString &host, const uint port, const TQString &userId, const TQString &pass ) { d->host = host; d->port = port; @@ -136,27 +136,27 @@ void Client::start( const QString &host, const uint port, const QString &userId, LoginTask * login = new LoginTask( d->root ); - connect( login, SIGNAL( gotMyself( const GroupWise::ContactDetails & ) ), - this, SIGNAL( accountDetailsReceived( const GroupWise::ContactDetails & ) ) ); + connect( login, TQT_SIGNAL( gotMyself( const GroupWise::ContactDetails & ) ), + this, TQT_SIGNAL( accountDetailsReceived( const GroupWise::ContactDetails & ) ) ); - connect( login, SIGNAL( gotFolder( const FolderItem & ) ), - this, SIGNAL( folderReceived( const FolderItem & ) ) ); + connect( login, TQT_SIGNAL( gotFolder( const FolderItem & ) ), + this, TQT_SIGNAL( folderReceived( const FolderItem & ) ) ); - connect( login, SIGNAL( gotContact( const ContactItem & ) ), - this, SIGNAL( contactReceived( const ContactItem & ) ) ); + connect( login, TQT_SIGNAL( gotContact( const ContactItem & ) ), + this, TQT_SIGNAL( contactReceived( const ContactItem & ) ) ); - connect( login, SIGNAL( gotContactUserDetails( const GroupWise::ContactDetails & ) ), - this, SIGNAL( contactUserDetailsReceived( const GroupWise::ContactDetails & ) ) ) ; + connect( login, TQT_SIGNAL( gotContactUserDetails( const GroupWise::ContactDetails & ) ), + this, TQT_SIGNAL( contactUserDetailsReceived( const GroupWise::ContactDetails & ) ) ) ; - connect( login, SIGNAL( gotPrivacySettings( bool, bool, const QStringList &, const QStringList & ) ), - privacyManager(), SLOT( slotGotPrivacySettings( bool, bool, const QStringList &, const QStringList & ) ) ); + connect( login, TQT_SIGNAL( gotPrivacySettings( bool, bool, const TQStringList &, const TQStringList & ) ), + privacyManager(), TQT_SLOT( slotGotPrivacySettings( bool, bool, const TQStringList &, const TQStringList & ) ) ); - connect( login, SIGNAL( gotCustomStatus( const GroupWise::CustomStatus & ) ), - SLOT( lt_gotCustomStatus( const GroupWise::CustomStatus & ) ) ); + connect( login, TQT_SIGNAL( gotCustomStatus( const GroupWise::CustomStatus & ) ), + TQT_SLOT( lt_gotCustomStatus( const GroupWise::CustomStatus & ) ) ); - connect( login, SIGNAL( gotKeepalivePeriod( int ) ), SLOT( lt_gotKeepalivePeriod( int ) ) ); + connect( login, TQT_SIGNAL( gotKeepalivePeriod( int ) ), TQT_SLOT( lt_gotKeepalivePeriod( int ) ) ); - connect( login, SIGNAL( finished() ), this, SLOT( lt_loginFinished() ) ); + connect( login, TQT_SIGNAL( finished() ), this, TQT_SLOT( lt_loginFinished() ) ); login->initialise(); login->go( true ); @@ -175,7 +175,7 @@ void Client::close() } } -QString Client::host() +TQString Client::host() { return d->host; } @@ -185,7 +185,7 @@ int Client::port() return d->port; } -QValueList<GroupWise::CustomStatus> Client::customStatuses() +TQValueList<GroupWise::CustomStatus> Client::customStatuses() { return d->customStatuses; } @@ -194,51 +194,51 @@ void Client::initialiseEventTasks() { // The StatusTask handles incoming status changes StatusTask * st = new StatusTask( d->root ); // FIXME - add an additional EventRoot? - connect( st, SIGNAL( gotStatus( const QString &, Q_UINT16, const QString & ) ), SIGNAL( statusReceived( const QString &, Q_UINT16, const QString & ) ) ); + connect( st, TQT_SIGNAL( gotStatus( const TQString &, Q_UINT16, const TQString & ) ), TQT_SIGNAL( statusReceived( const TQString &, Q_UINT16, const TQString & ) ) ); // The ConferenceTask handles incoming conference events, messages, joins, leaves, etc ConferenceTask * ct = new ConferenceTask( d->root ); - connect( ct, SIGNAL( message( const ConferenceEvent & ) ), SLOT( ct_messageReceived( const ConferenceEvent & ) ) ); - connect( ct, SIGNAL( typing( const ConferenceEvent & ) ), SIGNAL( contactTyping( const ConferenceEvent & ) ) ); - connect( ct, SIGNAL( notTyping( const ConferenceEvent & ) ), SIGNAL( contactNotTyping( const ConferenceEvent & ) ) ); - connect( ct, SIGNAL( joined( const ConferenceEvent & ) ), SIGNAL( conferenceJoinNotifyReceived( const ConferenceEvent & ) ) ); - connect( ct, SIGNAL( left( const ConferenceEvent & ) ), SIGNAL( conferenceLeft( const ConferenceEvent & ) ) ); - connect( ct, SIGNAL( invited( const ConferenceEvent & ) ), SIGNAL( invitationReceived( const ConferenceEvent & ) ) ); - connect( ct, SIGNAL( otherInvited( const ConferenceEvent & ) ), SIGNAL( inviteNotifyReceived( const ConferenceEvent & ) ) ); - connect( ct, SIGNAL( invitationDeclined( const ConferenceEvent & ) ), SIGNAL( invitationDeclined( const ConferenceEvent & ) ) ); - connect( ct, SIGNAL( closed( const ConferenceEvent & ) ), SIGNAL( conferenceClosed( const ConferenceEvent & ) ) ); - connect( ct, SIGNAL( autoReply( const ConferenceEvent & ) ), SIGNAL( autoReplyReceived( const ConferenceEvent & ) ) ); - connect( ct, SIGNAL( broadcast( const ConferenceEvent & ) ), SIGNAL( broadcastReceived( const ConferenceEvent & ) ) ); - connect( ct, SIGNAL( systemBroadcast( const ConferenceEvent & ) ), SIGNAL( systemBroadcastReceived( const ConferenceEvent & ) ) ); + connect( ct, TQT_SIGNAL( message( const ConferenceEvent & ) ), TQT_SLOT( ct_messageReceived( const ConferenceEvent & ) ) ); + connect( ct, TQT_SIGNAL( typing( const ConferenceEvent & ) ), TQT_SIGNAL( contactTyping( const ConferenceEvent & ) ) ); + connect( ct, TQT_SIGNAL( notTyping( const ConferenceEvent & ) ), TQT_SIGNAL( contactNotTyping( const ConferenceEvent & ) ) ); + connect( ct, TQT_SIGNAL( joined( const ConferenceEvent & ) ), TQT_SIGNAL( conferenceJoinNotifyReceived( const ConferenceEvent & ) ) ); + connect( ct, TQT_SIGNAL( left( const ConferenceEvent & ) ), TQT_SIGNAL( conferenceLeft( const ConferenceEvent & ) ) ); + connect( ct, TQT_SIGNAL( invited( const ConferenceEvent & ) ), TQT_SIGNAL( invitationReceived( const ConferenceEvent & ) ) ); + connect( ct, TQT_SIGNAL( otherInvited( const ConferenceEvent & ) ), TQT_SIGNAL( inviteNotifyReceived( const ConferenceEvent & ) ) ); + connect( ct, TQT_SIGNAL( invitationDeclined( const ConferenceEvent & ) ), TQT_SIGNAL( invitationDeclined( const ConferenceEvent & ) ) ); + connect( ct, TQT_SIGNAL( closed( const ConferenceEvent & ) ), TQT_SIGNAL( conferenceClosed( const ConferenceEvent & ) ) ); + connect( ct, TQT_SIGNAL( autoReply( const ConferenceEvent & ) ), TQT_SIGNAL( autoReplyReceived( const ConferenceEvent & ) ) ); + connect( ct, TQT_SIGNAL( broadcast( const ConferenceEvent & ) ), TQT_SIGNAL( broadcastReceived( const ConferenceEvent & ) ) ); + connect( ct, TQT_SIGNAL( systemBroadcast( const ConferenceEvent & ) ), TQT_SIGNAL( systemBroadcastReceived( const ConferenceEvent & ) ) ); // The ConnectionTask handles incoming connection events ConnectionTask* cont = new ConnectionTask( d->root ); - connect( cont, SIGNAL( connectedElsewhere() ), SIGNAL( connectedElsewhere() ) ); + connect( cont, TQT_SIGNAL( connectedElsewhere() ), TQT_SIGNAL( connectedElsewhere() ) ); } -void Client::setStatus( GroupWise::Status status, const QString & reason, const QString & autoReply ) +void Client::setStatus( GroupWise::Status status, const TQString & reason, const TQString & autoReply ) { - debug( QString("Setting status to %1").arg( status ) );; + debug( TQString("Setting status to %1").arg( status ) );; SetStatusTask * sst = new SetStatusTask( d->root ); sst->status( status, reason, autoReply ); - connect( sst, SIGNAL( finished() ), this, SLOT( sst_statusChanged() ) ); + connect( sst, TQT_SIGNAL( finished() ), this, TQT_SLOT( sst_statusChanged() ) ); sst->go( true ); // TODO: set status change in progress flag } -void Client::requestStatus( const QString & userDN ) +void Client::requestStatus( const TQString & userDN ) { GetStatusTask * gst = new GetStatusTask( d->root ); gst->userDN( userDN ); - connect( gst, SIGNAL( gotStatus( const QString &, Q_UINT16, const QString & ) ), SIGNAL( statusReceived( const QString &, Q_UINT16, const QString & ) ) ); + connect( gst, TQT_SIGNAL( gotStatus( const TQString &, Q_UINT16, const TQString & ) ), TQT_SIGNAL( statusReceived( const TQString &, Q_UINT16, const TQString & ) ) ); gst->go( true ); } -void Client::sendMessage( const QStringList & addresseeDNs, const OutgoingMessage & message ) +void Client::sendMessage( const TQStringList & addresseeDNs, const OutgoingMessage & message ) { SendMessageTask * smt = new SendMessageTask( d->root ); smt->message( addresseeDNs, message ); - connect( smt, SIGNAL( finished() ), SLOT( smt_messageSent() ) ); + connect( smt, TQT_SIGNAL( finished() ), TQT_SLOT( smt_messageSent() ) ); smt->go( true ); } @@ -251,23 +251,23 @@ void Client::sendTyping( const GroupWise::ConferenceGuid & conferenceGuid, bool void Client::createConference( const int clientId ) { - QStringList dummy; + TQStringList dummy; createConference( clientId, dummy ); } -void Client::createConference( const int clientId, const QStringList & participants ) +void Client::createConference( const int clientId, const TQStringList & participants ) { CreateConferenceTask * cct = new CreateConferenceTask( d->root ); cct->conference( clientId, participants ); - connect( cct, SIGNAL( finished() ), SLOT( cct_conferenceCreated() ) ); + connect( cct, TQT_SIGNAL( finished() ), TQT_SLOT( cct_conferenceCreated() ) ); cct->go( true ); } -void Client::requestDetails( const QStringList & userDNs ) +void Client::requestDetails( const TQStringList & userDNs ) { GetDetailsTask * gdt = new GetDetailsTask( d->root ); gdt->userDNs( userDNs ); - connect( gdt, SIGNAL( gotContactUserDetails( const GroupWise::ContactDetails & ) ), - this, SIGNAL( contactUserDetailsReceived( const GroupWise::ContactDetails & ) ) ); + connect( gdt, TQT_SIGNAL( gotContactUserDetails( const GroupWise::ContactDetails & ) ), + this, TQT_SIGNAL( contactUserDetailsReceived( const GroupWise::ContactDetails & ) ) ); gdt->go( true ); } @@ -275,7 +275,7 @@ void Client::joinConference( const GroupWise::ConferenceGuid & guid ) { JoinConferenceTask * jct = new JoinConferenceTask( d->root ); jct->join( guid ); - connect( jct, SIGNAL( finished() ), SLOT( jct_joinConfCompleted() ) ); + connect( jct, TQT_SIGNAL( finished() ), TQT_SLOT( jct_joinConfCompleted() ) ); jct->go( true ); } @@ -291,14 +291,14 @@ void Client::leaveConference( const GroupWise::ConferenceGuid & guid ) { LeaveConferenceTask * lct = new LeaveConferenceTask( d->root ); lct->leave( guid ); - //connect( lct, SIGNAL( finished() ), SLOT( lct_leftConference() ) ); + //connect( lct, TQT_SIGNAL( finished() ), TQT_SLOT( lct_leftConference() ) ); lct->go( true ); } -void Client::sendInvitation( const GroupWise::ConferenceGuid & guid, const QString & dn, const GroupWise::OutgoingMessage & message ) +void Client::sendInvitation( const GroupWise::ConferenceGuid & guid, const TQString & dn, const GroupWise::OutgoingMessage & message ) { SendInviteTask * sit = new SendInviteTask( d->root ); - QStringList invitees( dn ); + TQStringList invitees( dn ); sit->invite( guid, dn, message ); sit->go( true ); } @@ -306,7 +306,7 @@ void Client::sendInvitation( const GroupWise::ConferenceGuid & guid, const QStri // SLOTS // void Client::streamError( int error ) { - debug( QString( "CLIENT ERROR (Error %1)" ).arg( error ) ); + debug( TQString( "CLIENT ERROR (Error %1)" ).arg( error ) ); } void Client::streamReadyRead() @@ -326,7 +326,7 @@ void Client::lt_loginFinished() debug( "Client::lt_loginFinished() LOGIN SUCCEEDED" ); // set our initial status SetStatusTask * sst = new SetStatusTask( d->root ); - sst->status( GroupWise::Available, QString::null, QString::null ); + sst->status( GroupWise::Available, TQString::null, TQString::null ); sst->go( true ); emit loggedIn(); // fetch details for any privacy list items that aren't in our contact list. @@ -357,17 +357,17 @@ void Client::ct_messageReceived( const ConferenceEvent & messageEvent ) debug( "parsing received message's RTF" ); ConferenceEvent transformedEvent = messageEvent; RTF2HTML parser; - QString rtf = messageEvent.message; + TQString rtf = messageEvent.message; if ( !rtf.isEmpty() ) transformedEvent.message = parser.Parse( rtf.latin1(), "" ); // fixes for RTF to HTML conversion problems // we can drop these once the server reenables the sending of unformatted text // redundant linebreak at the end of the message - QRegExp rx(" </span> </span> </span><br>$"); + TQRegExp rx(" </span> </span> </span><br>$"); transformedEvent.message.replace( rx, "</span></span></span>" ); // missing linebreak after first line of an encrypted message - QRegExp ry("-----BEGIN PGP MESSAGE----- </span> </span> </span>"); + TQRegExp ry("-----BEGIN PGP MESSAGE----- </span> </span> </span>"); transformedEvent.message.replace( ry, "-----BEGIN PGP MESSAGE-----</span></span></span><br/>" ); emit messageReceived( transformedEvent ); @@ -390,14 +390,14 @@ void Client::jct_joinConfCompleted() { const JoinConferenceTask * jct = ( JoinConferenceTask * )sender(); #ifdef LIBGW_DEBUG - debug( QString( "Joined conference %1, participants are: " ).arg( jct->guid() ) ); - QStringList parts = jct->participants(); - for ( QStringList::Iterator it = parts.begin(); it != parts.end(); ++it ) - debug( QString( " - %1" ).arg(*it) ); + debug( TQString( "Joined conference %1, participants are: " ).arg( jct->guid() ) ); + TQStringList parts = jct->participants(); + for ( TQStringList::Iterator it = parts.begin(); it != parts.end(); ++it ) + debug( TQString( " - %1" ).arg(*it) ); debug( "invitees are: " ); - QStringList invitees = jct->invitees(); - for ( QStringList::Iterator it = invitees.begin(); it != invitees.end(); ++it ) - debug( QString( " - %1" ).arg(*it) ); + TQStringList invitees = jct->invitees(); + for ( TQStringList::Iterator it = invitees.begin(); it != invitees.end(); ++it ) + debug( TQString( " - %1" ).arg(*it) ); #endif emit conferenceJoined( jct->guid(), jct->participants(), jct->invitees() ); } @@ -409,32 +409,32 @@ void Client::lt_gotCustomStatus( const GroupWise::CustomStatus & custom ) // INTERNALS // -QString Client::userId() +TQString Client::userId() { return d->user; } -void Client::setUserDN( const QString & userDN ) +void Client::setUserDN( const TQString & userDN ) { d->userDN = userDN; } -QString Client::userDN() +TQString Client::userDN() { return d->userDN; } -QString Client::password() +TQString Client::password() { return d->pass; } -QString Client::userAgent() +TQString Client::userAgent() { - return QString::fromLatin1( "%1/%2 (%3)" ).arg( d->clientName, d->clientVersion, d->osname ); + return TQString::fromLatin1( "%1/%2 (%3)" ).arg( d->clientName, d->clientVersion, d->osname ); } -QCString Client::ipAddress() +TQCString Client::ipAddress() { // TODO: remove hardcoding return "10.10.11.103"; @@ -456,14 +456,14 @@ void Client::send( Request * request ) debug( "CLIENT - NO STREAM TO SEND ON!"); return; } -// QString out = request.toString(); -// debug(QString("Client: outgoing: [\n%1]\n").arg(out)); +// TQString out = request.toString(); +// debug(TQString("Client: outgoing: [\n%1]\n").arg(out)); // xmlOutgoing(out); d->stream->write( request ); } -void Client::debug( const QString &str ) +void Client::debug( const TQString &str ) { #ifdef LIBGW_USE_KDEBUG kdDebug( GROUPWISE_DEBUG_LIBGW ) << "debug: " << str << endl; @@ -472,9 +472,9 @@ void Client::debug( const QString &str ) #endif } -QString Client::genUniqueId() +TQString Client::genUniqueId() { - QString s; + TQString s; s.sprintf("a%x", d->id_seed); d->id_seed += 0x10; return s; |