summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/oscar/icq/icqcontact.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/protocols/oscar/icq/icqcontact.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-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/oscar/icq/icqcontact.cpp')
-rw-r--r--kopete/protocols/oscar/icq/icqcontact.cpp154
1 files changed, 77 insertions, 77 deletions
diff --git a/kopete/protocols/oscar/icq/icqcontact.cpp b/kopete/protocols/oscar/icq/icqcontact.cpp
index 8ba8d195..90204bdf 100644
--- a/kopete/protocols/oscar/icq/icqcontact.cpp
+++ b/kopete/protocols/oscar/icq/icqcontact.cpp
@@ -17,9 +17,9 @@
#include "icqcontact.h"
-#include <qtimer.h>
-#include <qimage.h>
-#include <qfile.h>
+#include <tqtimer.h>
+#include <tqimage.h>
+#include <tqfile.h>
#include <kaction.h>
#include <kactionclasses.h>
@@ -51,8 +51,8 @@
#include "oscarencodingselectiondialog.h"
#include "ssimanager.h"
-ICQContact::ICQContact( ICQAccount *account, const QString &name, Kopete::MetaContact *parent,
- const QString& icon, const Oscar::SSI& ssiItem )
+ICQContact::ICQContact( ICQAccount *account, const TQString &name, Kopete::MetaContact *parent,
+ const TQString& icon, const Oscar::SSI& ssiItem )
: OscarContact( account, name, parent, icon, ssiItem )
{
mProtocol = static_cast<ICQProtocol *>(protocol());
@@ -66,28 +66,28 @@ ICQContact::ICQContact( ICQAccount *account, const QString &name, Kopete::MetaCo
else
setOnlineStatus( ICQ::Presence( ICQ::Presence::Offline, ICQ::Presence::Visible ).toOnlineStatus() );
- QObject::connect( mAccount->engine(), SIGNAL( loggedIn() ), this, SLOT( loggedIn() ) );
- //QObject::connect( mAccount->engine(), SIGNAL( userIsOnline( const QString& ) ), this, SLOT( userOnline( const QString&, UserDetails ) ) );
- QObject::connect( mAccount->engine(), SIGNAL( userIsOffline( const QString& ) ), this, SLOT( userOffline( const QString& ) ) );
- QObject::connect( mAccount->engine(), SIGNAL( authRequestReceived( const QString&, const QString& ) ),
- this, SLOT( slotGotAuthRequest( const QString&, const QString& ) ) );
- QObject::connect( mAccount->engine(), SIGNAL( authReplyReceived( const QString&, const QString&, bool ) ),
- this, SLOT( slotGotAuthReply(const QString&, const QString&, bool ) ) );
- QObject::connect( mAccount->engine(), SIGNAL( receivedIcqShortInfo( const QString& ) ),
- this, SLOT( receivedShortInfo( const QString& ) ) );
- QObject::connect( mAccount->engine(), SIGNAL( receivedIcqLongInfo( const QString& ) ),
- this, SLOT( receivedLongInfo( const QString& ) ) );
- QObject::connect( mAccount->engine(), SIGNAL( receivedUserInfo( const QString&, const UserDetails& ) ),
- this, SLOT( userInfoUpdated( const QString&, const UserDetails& ) ) );
- QObject::connect( mAccount->engine(), SIGNAL( receivedAwayMessage( const QString&, const QString& ) ),
- this, SLOT( receivedStatusMessage( const QString&, const QString& ) ) );
- QObject::connect( mAccount->engine(), SIGNAL( receivedAwayMessage( const Oscar::Message& ) ),
- this, SLOT( receivedStatusMessage( const Oscar::Message& ) ) );
- QObject::connect( this, SIGNAL( featuresUpdated() ), this, SLOT( updateFeatures() ) );
- QObject::connect( mAccount->engine(), SIGNAL( iconServerConnected() ),
- this, SLOT( requestBuddyIcon() ) );
- QObject::connect( mAccount->engine(), SIGNAL( haveIconForContact( const QString&, QByteArray ) ),
- this, SLOT( haveIcon( const QString&, QByteArray ) ) );
+ TQObject::connect( mAccount->engine(), TQT_SIGNAL( loggedIn() ), this, TQT_SLOT( loggedIn() ) );
+ //TQObject::connect( mAccount->engine(), TQT_SIGNAL( userIsOnline( const TQString& ) ), this, TQT_SLOT( userOnline( const TQString&, UserDetails ) ) );
+ TQObject::connect( mAccount->engine(), TQT_SIGNAL( userIsOffline( const TQString& ) ), this, TQT_SLOT( userOffline( const TQString& ) ) );
+ TQObject::connect( mAccount->engine(), TQT_SIGNAL( authRequestReceived( const TQString&, const TQString& ) ),
+ this, TQT_SLOT( slotGotAuthRequest( const TQString&, const TQString& ) ) );
+ TQObject::connect( mAccount->engine(), TQT_SIGNAL( authReplyReceived( const TQString&, const TQString&, bool ) ),
+ this, TQT_SLOT( slotGotAuthReply(const TQString&, const TQString&, bool ) ) );
+ TQObject::connect( mAccount->engine(), TQT_SIGNAL( receivedIcqShortInfo( const TQString& ) ),
+ this, TQT_SLOT( receivedShortInfo( const TQString& ) ) );
+ TQObject::connect( mAccount->engine(), TQT_SIGNAL( receivedIcqLongInfo( const TQString& ) ),
+ this, TQT_SLOT( receivedLongInfo( const TQString& ) ) );
+ TQObject::connect( mAccount->engine(), TQT_SIGNAL( receivedUserInfo( const TQString&, const UserDetails& ) ),
+ this, TQT_SLOT( userInfoUpdated( const TQString&, const UserDetails& ) ) );
+ TQObject::connect( mAccount->engine(), TQT_SIGNAL( receivedAwayMessage( const TQString&, const TQString& ) ),
+ this, TQT_SLOT( receivedStatusMessage( const TQString&, const TQString& ) ) );
+ TQObject::connect( mAccount->engine(), TQT_SIGNAL( receivedAwayMessage( const Oscar::Message& ) ),
+ this, TQT_SLOT( receivedStatusMessage( const Oscar::Message& ) ) );
+ TQObject::connect( this, TQT_SIGNAL( featuresUpdated() ), this, TQT_SLOT( updateFeatures() ) );
+ TQObject::connect( mAccount->engine(), TQT_SIGNAL( iconServerConnected() ),
+ this, TQT_SLOT( requestBuddyIcon() ) );
+ TQObject::connect( mAccount->engine(), TQT_SIGNAL( haveIconForContact( const TQString&, TQByteArray ) ),
+ this, TQT_SLOT( haveIcon( const TQString&, TQByteArray ) ) );
}
@@ -111,7 +111,7 @@ void ICQContact::updateSSIItem()
}
-void ICQContact::userInfoUpdated( const QString& contact, const UserDetails& details )
+void ICQContact::userInfoUpdated( const TQString& contact, const UserDetails& details )
{
//kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << contact << contactId() << endl;
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) )
@@ -193,7 +193,7 @@ void ICQContact::userInfoUpdated( const QString& contact, const UserDetails& det
int time = ( KApplication::random() % 10 ) * 1000;
kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << "updating buddy icon in "
<< time/1000 << " seconds" << endl;
- QTimer::singleShot( time, this, SLOT( requestBuddyIcon() ) );
+ TQTimer::singleShot( time, this, TQT_SLOT( requestBuddyIcon() ) );
}
}
}
@@ -201,7 +201,7 @@ void ICQContact::userInfoUpdated( const QString& contact, const UserDetails& det
OscarContact::userInfoUpdated( contact, details );
}
-void ICQContact::userOnline( const QString& userId )
+void ICQContact::userOnline( const TQString& userId )
{
if ( Oscar::normalize( userId ) != Oscar::normalize( contactId() ) )
return;
@@ -211,7 +211,7 @@ void ICQContact::userOnline( const QString& userId )
//mAccount->engine()->requestStatusInfo( contactId() );
}
-void ICQContact::userOffline( const QString& userId )
+void ICQContact::userOffline( const TQString& userId )
{
if ( Oscar::normalize( userId ) != Oscar::normalize( contactId() ) )
return;
@@ -237,7 +237,7 @@ void ICQContact::loggedIn()
m_requestingNickname = true;
int time = ( KApplication::random() % 20 ) * 1000;
kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << "updating nickname in " << time/1000 << " seconds" << endl;
- QTimer::singleShot( time, this, SLOT( requestShortInfo() ) );
+ TQTimer::singleShot( time, this, TQT_SLOT( requestShortInfo() ) );
}
}
@@ -250,7 +250,7 @@ void ICQContact::requestShortInfo()
void ICQContact::slotRequestAuth()
{
- QString reason = KInputDialog::getText( i18n("Request Authorization"),
+ TQString reason = KInputDialog::getText( i18n("Request Authorization"),
i18n("Reason for requesting authorization:") );
if ( !reason.isNull() )
mAccount->engine()->requestAuth( contactId(), reason );
@@ -266,13 +266,13 @@ void ICQContact::slotSendAuth()
mAccount->engine()->sendAuth( contactId(), replyDialog.reason(), replyDialog.grantAuth() );
}
-void ICQContact::slotGotAuthReply( const QString& contact, const QString& reason, bool granted )
+void ICQContact::slotGotAuthReply( const TQString& contact, const TQString& reason, bool granted )
{
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) )
return;
kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << endl;
- QString message;
+ TQString message;
if( granted )
{
message = i18n( "User %1 has granted your authorization request.\nReason: %2" )
@@ -291,14 +291,14 @@ void ICQContact::slotGotAuthReply( const QString& contact, const QString& reason
KNotifyClient::event( Kopete::UI::Global::sysTrayWId(), "icq_authorization", message );
}
-void ICQContact::slotGotAuthRequest( const QString& contact, const QString& reason )
+void ICQContact::slotGotAuthRequest( const TQString& contact, const TQString& reason )
{
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) )
return;
ICQAuthReplyDialog *replyDialog = new ICQAuthReplyDialog();
- connect( replyDialog, SIGNAL( okClicked() ), this, SLOT( slotAuthReplyDialogOkClicked() ) );
+ connect( replyDialog, TQT_SIGNAL( okClicked() ), this, TQT_SLOT( slotAuthReplyDialogOkClicked() ) );
replyDialog->setUser( property( Kopete::Global::Properties::self()->nickName() ).value().toString() );
replyDialog->setRequestReason( reason );
replyDialog->setModal( TRUE );
@@ -314,7 +314,7 @@ void ICQContact::slotAuthReplyDialogOkClicked()
mAccount->engine()->sendAuth( contactId(), replyDialog->reason(), replyDialog->grantAuth() );
}
-void ICQContact::receivedLongInfo( const QString& contact )
+void ICQContact::receivedLongInfo( const TQString& contact )
{
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) )
{
@@ -323,7 +323,7 @@ void ICQContact::receivedLongInfo( const QString& contact )
return;
}
- QTextCodec* codec = contactCodec();
+ TQTextCodec* codec = contactCodec();
kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << "received long info from engine" << endl;
@@ -343,12 +343,12 @@ void ICQContact::receivedLongInfo( const QString& contact )
}
-void ICQContact::receivedShortInfo( const QString& contact )
+void ICQContact::receivedShortInfo( const TQString& contact )
{
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) )
return;
- QTextCodec* codec = contactCodec();
+ TQTextCodec* codec = contactCodec();
m_requestingNickname = false; //done requesting nickname
ICQShortInfo shortInfo = mAccount->engine()->getShortInfo( contact );
@@ -372,7 +372,7 @@ void ICQContact::receivedShortInfo( const QString& contact )
}
-void ICQContact::receivedStatusMessage( const QString &contact, const QString &message )
+void ICQContact::receivedStatusMessage( const TQString &contact, const TQString &message )
{
if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) )
return;
@@ -389,9 +389,9 @@ void ICQContact::receivedStatusMessage( const Oscar::Message &message )
return;
//decode message
- QTextCodec* codec = contactCodec();
+ TQTextCodec* codec = contactCodec();
- QString realText = message.text(codec);
+ TQString realText = message.text(codec);
if ( !realText.isEmpty() )
setProperty( mProtocol->awayMessage, realText );
@@ -404,7 +404,7 @@ void ICQContact::slotSendMsg( Kopete::Message& msg, Kopete::ChatSession* session
//Why is this unused?
Q_UNUSED( session );
- QTextCodec* codec = contactCodec();
+ TQTextCodec* codec = contactCodec();
int messageChannel = 0x01;
Oscar::Message::Encoding messageEncoding;
@@ -414,14 +414,14 @@ void ICQContact::slotSendMsg( Kopete::Message& msg, Kopete::ChatSession* session
else
messageEncoding = Oscar::Message::UserDefined;
- QString msgText( msg.plainBody() );
+ TQString msgText( msg.plainBody() );
// TODO: More intelligent handling of message length.
uint chunk_length = !isOnline() ? 450 : 4096;
uint msgPosition = 0;
do
{
- QString msgChunk( msgText.mid( msgPosition, chunk_length ) );
+ TQString msgChunk( msgText.mid( msgPosition, chunk_length ) );
// Try to split on space if needed
if ( msgChunk.length() == chunk_length )
{
@@ -460,7 +460,7 @@ void ICQContact::requestBuddyIcon()
}
}
-void ICQContact::haveIcon( const QString& user, QByteArray icon )
+void ICQContact::haveIcon( const TQString& user, TQByteArray icon )
{
if ( Oscar::normalize( user ) != Oscar::normalize( contactId() ) )
return;
@@ -470,9 +470,9 @@ void ICQContact::haveIcon( const QString& user, QByteArray icon )
KMD5 buddyIconHash( icon );
if ( memcmp( buddyIconHash.rawDigest(), m_details.buddyIconHash().data(), 16 ) == 0 )
{
- QString iconLocation( locateLocal( "appdata", "oscarpictures/"+ contactId() ) );
+ TQString iconLocation( locateLocal( "appdata", "oscarpictures/"+ contactId() ) );
- QFile iconFile( iconLocation );
+ TQFile iconFile( iconLocation );
if ( !iconFile.open( IO_WriteOnly ) )
{
kdDebug(14153) << k_funcinfo << "Cannot open file"
@@ -483,7 +483,7 @@ void ICQContact::haveIcon( const QString& user, QByteArray icon )
iconFile.writeBlock( icon );
iconFile.close();
- setProperty( Kopete::Global::Properties::self()->photo(), QString::null );
+ setProperty( Kopete::Global::Properties::self()->photo(), TQString::null );
setProperty( Kopete::Global::Properties::self()->photo(), iconLocation );
m_buddyIconDirty = false;
}
@@ -494,11 +494,11 @@ void ICQContact::haveIcon( const QString& user, QByteArray icon )
}
}
-bool ICQContact::cachedBuddyIcon( QByteArray hash )
+bool ICQContact::cachedBuddyIcon( TQByteArray hash )
{
- QString iconLocation( locateLocal( "appdata", "oscarpictures/"+ contactId() ) );
+ TQString iconLocation( locateLocal( "appdata", "oscarpictures/"+ contactId() ) );
- QFile iconFile( iconLocation );
+ TQFile iconFile( iconLocation );
if ( !iconFile.open( IO_ReadOnly ) )
return false;
@@ -510,7 +510,7 @@ bool ICQContact::cachedBuddyIcon( QByteArray hash )
{
kdDebug(OSCAR_ICQ_DEBUG) << k_funcinfo << "Updating icon for "
<< contactId() << " from local cache" << endl;
- setProperty( Kopete::Global::Properties::self()->photo(), QString::null );
+ setProperty( Kopete::Global::Properties::self()->photo(), TQString::null );
setProperty( Kopete::Global::Properties::self()->photo(), iconLocation );
m_buddyIconDirty = false;
return true;
@@ -532,7 +532,7 @@ void ICQContact::slotContactChanged(const UserInfo &u)
/*kdDebug(14190) << k_funcinfo << "Called for '"
<< displayName() << "', contactName()=" << contactName() << endl;*/
- QStringList capList;
+ TQStringList capList;
// Append client name and version in case we found one
if (!mInfo.clientName.isEmpty())
{
@@ -595,7 +595,7 @@ void ICQContact::slotContactChanged(const UserInfo &u)
setStatus(newStatus);
}
-void ICQContact::slotOffgoingBuddy(QString sender)
+void ICQContact::slotOffgoingBuddy(TQString sender)
{
if(sender != contactName())
return;
@@ -605,7 +605,7 @@ void ICQContact::slotOffgoingBuddy(QString sender)
setOnlineStatus(mProtocol->statusOffline);
}
-void ICQContact::gotIM(OscarSocket::OscarMessageType /*type*/, const QString &message)
+void ICQContact::gotIM(OscarSocket::OscarMessageType /*type*/, const TQString &message)
{
// Build a Kopete::Message and set the body as Rich Text
Kopete::ContactPtrList tmpList;
@@ -649,12 +649,12 @@ bool ICQContact::isReachable()
return account()->isConnected();
}
-QPtrList<KAction> *ICQContact::customContextMenuActions()
+TQPtrList<KAction> *ICQContact::customContextMenuActions()
{
- QPtrList<KAction> *actionCollection = new QPtrList<KAction>();
+ TQPtrList<KAction> *actionCollection = new TQPtrList<KAction>();
/*
- QString awTxt;
- QString awIcn;
+ TQString awTxt;
+ TQString awIcn;
unsigned int status = onlineStatus().internalStatus();
if (status >= 15)
status -= 15; // get rid of invis addon
@@ -685,12 +685,12 @@ QPtrList<KAction> *ICQContact::customContextMenuActions()
if(actionReadAwayMessage==0)
{
actionReadAwayMessage = new KAction(awTxt, awIcn, 0,
- this, SLOT(slotReadAwayMessage()), this, "actionReadAwayMessage");
+ this, TQT_SLOT(slotReadAwayMessage()), this, "actionReadAwayMessage");
*/
actionRequestAuth = new KAction(i18n("&Request Authorization"), "mail_reply", 0,
- this, SLOT(slotRequestAuth()), this, "actionRequestAuth");
+ this, TQT_SLOT(slotRequestAuth()), this, "actionRequestAuth");
actionSendAuth = new KAction(i18n("&Grant Authorization"), "mail_forward", 0,
- this, SLOT(slotSendAuth()), this, "actionSendAuth");
+ this, TQT_SLOT(slotSendAuth()), this, "actionSendAuth");
/*
}
else
@@ -701,11 +701,11 @@ QPtrList<KAction> *ICQContact::customContextMenuActions()
*/
m_actionIgnore = new KToggleAction(i18n("&Ignore"), "", 0,
- this, SLOT(slotIgnore()), this, "actionIgnore");
+ this, TQT_SLOT(slotIgnore()), this, "actionIgnore");
m_actionVisibleTo = new KToggleAction(i18n("Always &Visible To"), "", 0,
- this, SLOT(slotVisibleTo()), this, "actionVisibleTo");
+ this, TQT_SLOT(slotVisibleTo()), this, "actionVisibleTo");
m_actionInvisibleTo = new KToggleAction(i18n("Always &Invisible To"), "", 0,
- this, SLOT(slotInvisibleTo()), this, "actionInvisibleTo");
+ this, TQT_SLOT(slotInvisibleTo()), this, "actionInvisibleTo");
bool on = account()->isConnected();
if ( m_ssiItem.waitingAuth() )
@@ -717,7 +717,7 @@ QPtrList<KAction> *ICQContact::customContextMenuActions()
m_selectEncoding = new KAction( i18n( "Select Encoding..." ), "charset", 0,
- this, SLOT( changeContactEncoding() ), this, "changeEncoding" );
+ this, TQT_SLOT( changeContactEncoding() ), this, "changeEncoding" );
/*
actionReadAwayMessage->setEnabled(status != OSCAR_OFFLINE && status != OSCAR_ONLINE);
@@ -748,7 +748,7 @@ QPtrList<KAction> *ICQContact::customContextMenuActions()
void ICQContact::slotUserInfo()
{
m_infoWidget = new ICQUserInfoWidget( Kopete::UI::Global::mainWidget(), "icq info" );
- QObject::connect( m_infoWidget, SIGNAL( finished() ), this, SLOT( closeUserInfoDialog() ) );
+ TQObject::connect( m_infoWidget, TQT_SIGNAL( finished() ), this, TQT_SLOT( closeUserInfoDialog() ) );
m_infoWidget->setContact( this );
m_infoWidget->show();
if ( account()->isConnected() )
@@ -757,7 +757,7 @@ void ICQContact::slotUserInfo()
void ICQContact::closeUserInfoDialog()
{
- QObject::disconnect( this, 0, m_infoWidget, 0 );
+ TQObject::disconnect( this, 0, m_infoWidget, 0 );
m_infoWidget->delayedDestruct();
m_infoWidget = 0L;
}
@@ -768,14 +768,14 @@ void ICQContact::changeContactEncoding()
return;
m_oesd = new OscarEncodingSelectionDialog( Kopete::UI::Global::mainWidget(), property(mProtocol->contactEncoding).value().toInt() );
- connect( m_oesd, SIGNAL( closing( int ) ),
- this, SLOT( changeEncodingDialogClosed( int ) ) );
+ connect( m_oesd, TQT_SIGNAL( closing( int ) ),
+ this, TQT_SLOT( changeEncodingDialogClosed( int ) ) );
m_oesd->show();
}
void ICQContact::changeEncodingDialogClosed( int result )
{
- if ( result == QDialog::Accepted )
+ if ( result == TQDialog::Accepted )
{
int mib = m_oesd->selectedEncoding();
if ( mib != 0 )
@@ -827,7 +827,7 @@ void ICQContact::slotReadAwayMessage()
awayMessageDialog = new ICQReadAway(this, 0L, "awayMessageDialog");
if(!awayMessageDialog)
return;
- QObject::connect(awayMessageDialog, SIGNAL(closing()), this, SLOT(slotCloseAwayMessageDialog()));
+ TQObject::connect(awayMessageDialog, TQT_SIGNAL(closing()), this, TQT_SLOT(slotCloseAwayMessageDialog()));
awayMessageDialog->show();
}
else
@@ -844,14 +844,14 @@ void ICQContact::slotCloseAwayMessageDialog()
}
-const QString ICQContact::awayMessage()
+const TQString ICQContact::awayMessage()
{
kdDebug(14150) << k_funcinfo << property(mProtocol->awayMessage).value().toString() << endl;
return property(mProtocol->awayMessage).value().toString();
}
-void ICQContact::setAwayMessage(const QString &message)
+void ICQContact::setAwayMessage(const TQString &message)
{
/*kdDebug(14150) << k_funcinfo <<
"Called for '" << displayName() << "', away msg='" << message << "'" << endl;*/