From 47c8a359c5276062c4bc17f0e82410f29081b502 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:48:06 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/protocols/oscar/aim/aimcontact.cpp | 172 +++++++++++++++--------------- 1 file changed, 86 insertions(+), 86 deletions(-) (limited to 'kopete/protocols/oscar/aim/aimcontact.cpp') diff --git a/kopete/protocols/oscar/aim/aimcontact.cpp b/kopete/protocols/oscar/aim/aimcontact.cpp index 7e46c585..fc55537d 100644 --- a/kopete/protocols/oscar/aim/aimcontact.cpp +++ b/kopete/protocols/oscar/aim/aimcontact.cpp @@ -16,10 +16,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -43,8 +43,8 @@ #include "aimcontact.h" #include "aimaccount.h" -AIMContact::AIMContact( Kopete::Account* account, const QString& name, Kopete::MetaContact* parent, - const QString& icon, const Oscar::SSI& ssiItem ) +AIMContact::AIMContact( Kopete::Account* account, const TQString& name, Kopete::MetaContact* parent, + const TQString& icon, const Oscar::SSI& ssiItem ) : OscarContact(account, name, parent, icon, ssiItem ) { mProtocol=static_cast(protocol()); @@ -56,23 +56,23 @@ AIMContact::AIMContact( Kopete::Account* account, const QString& name, Kopete::M m_haveAwayMessage = false; m_mobile = false; // Set the last autoresponse time to the current time yesterday - m_lastAutoresponseTime = QDateTime::currentDateTime().addDays(-1); - - QObject::connect( mAccount->engine(), SIGNAL( receivedUserInfo( const QString&, const UserDetails& ) ), - this, SLOT( userInfoUpdated( const QString&, const UserDetails& ) ) ); - QObject::connect( mAccount->engine(), SIGNAL( userIsOffline( const QString& ) ), - this, SLOT( userOffline( const QString& ) ) ); - QObject::connect( mAccount->engine(), SIGNAL( receivedAwayMessage( const QString&, const QString& ) ), - this, SLOT( updateAwayMessage( const QString&, const QString& ) ) ); - QObject::connect( mAccount->engine(), SIGNAL( receivedProfile( const QString&, const QString& ) ), - this, SLOT( updateProfile( const QString&, const QString& ) ) ); - QObject::connect( mAccount->engine(), SIGNAL( userWarned( const QString&, Q_UINT16, Q_UINT16 ) ), - this, SLOT( gotWarning( const QString&, Q_UINT16, Q_UINT16 ) ) ); - QObject::connect( mAccount->engine(), SIGNAL( haveIconForContact( const QString&, QByteArray ) ), - this, SLOT( haveIcon( const QString&, QByteArray ) ) ); - QObject::connect( mAccount->engine(), SIGNAL( iconServerConnected() ), - this, SLOT( requestBuddyIcon() ) ); - QObject::connect( this, SIGNAL( featuresUpdated() ), this, SLOT( updateFeatures() ) ); + m_lastAutoresponseTime = TQDateTime::currentDateTime().addDays(-1); + + 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( userIsOffline( const TQString& ) ), + this, TQT_SLOT( userOffline( const TQString& ) ) ); + TQObject::connect( mAccount->engine(), TQT_SIGNAL( receivedAwayMessage( const TQString&, const TQString& ) ), + this, TQT_SLOT( updateAwayMessage( const TQString&, const TQString& ) ) ); + TQObject::connect( mAccount->engine(), TQT_SIGNAL( receivedProfile( const TQString&, const TQString& ) ), + this, TQT_SLOT( updateProfile( const TQString&, const TQString& ) ) ); + TQObject::connect( mAccount->engine(), TQT_SIGNAL( userWarned( const TQString&, Q_UINT16, Q_UINT16 ) ), + this, TQT_SLOT( gotWarning( const TQString&, Q_UINT16, Q_UINT16 ) ) ); + TQObject::connect( mAccount->engine(), TQT_SIGNAL( haveIconForContact( const TQString&, TQByteArray ) ), + this, TQT_SLOT( haveIcon( const TQString&, TQByteArray ) ) ); + TQObject::connect( mAccount->engine(), TQT_SIGNAL( iconServerConnected() ), + this, TQT_SLOT( requestBuddyIcon() ) ); + TQObject::connect( this, TQT_SIGNAL( featuresUpdated() ), this, TQT_SLOT( updateFeatures() ) ); } AIMContact::~AIMContact() @@ -84,18 +84,18 @@ bool AIMContact::isReachable() return true; } -QPtrList *AIMContact::customContextMenuActions() +TQPtrList *AIMContact::customContextMenuActions() { - QPtrList *actionCollection = new QPtrList(); + TQPtrList *actionCollection = new TQPtrList(); if ( !m_warnUserAction ) { - m_warnUserAction = new KAction( i18n( "&Warn User" ), 0, this, SLOT( warnUser() ), this, "warnAction" ); + m_warnUserAction = new KAction( i18n( "&Warn User" ), 0, this, TQT_SLOT( warnUser() ), this, "warnAction" ); } 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(); @@ -117,26 +117,26 @@ QPtrList *AIMContact::customContextMenuActions() return actionCollection; } -const QString AIMContact::awayMessage() +const TQString AIMContact::awayMessage() { return property(mProtocol->awayMessage).value().toString(); } -void AIMContact::setAwayMessage(const QString &message) +void AIMContact::setAwayMessage(const TQString &message) { kdDebug(14152) << k_funcinfo << "Called for '" << contactId() << "', away msg='" << message << "'" << endl; - QString filteredMessage = message; + TQString filteredMessage = message; filteredMessage.replace( - QRegExp(QString::fromLatin1("<[hH][tT][mM][lL].*>(.*)")), - QString::fromLatin1("\\1")); + TQRegExp(TQString::fromLatin1("<[hH][tT][mM][lL].*>(.*)")), + TQString::fromLatin1("\\1")); filteredMessage.replace( - QRegExp(QString::fromLatin1("<[bB][oO][dD][yY].*>(.*)")), - QString::fromLatin1("\\1") ); - QRegExp fontRemover( QString::fromLatin1("<[fF][oO][nN][tT].*>(.*)") ); + TQRegExp(TQString::fromLatin1("<[bB][oO][dD][yY].*>(.*)")), + TQString::fromLatin1("\\1") ); + TQRegExp fontRemover( TQString::fromLatin1("<[fF][oO][nN][tT].*>(.*)") ); fontRemover.setMinimal(true); while ( filteredMessage.find( fontRemover ) != -1 ) - filteredMessage.replace( fontRemover, QString::fromLatin1("\\1") ); + filteredMessage.replace( fontRemover, TQString::fromLatin1("\\1") ); setProperty(mProtocol->awayMessage, filteredMessage); } @@ -162,7 +162,7 @@ void AIMContact::slotUserInfo() m_infoDialog = new AIMUserInfoDialog( this, static_cast( account() ), false, Kopete::UI::Global::mainWidget(), 0 ); if( !m_infoDialog ) return; - connect( m_infoDialog, SIGNAL( finished() ), this, SLOT( closeUserInfoDialog() ) ); + connect( m_infoDialog, TQT_SIGNAL( finished() ), this, TQT_SLOT( closeUserInfoDialog() ) ); m_infoDialog->show(); if ( mAccount->isConnected() ) { @@ -174,7 +174,7 @@ void AIMContact::slotUserInfo() m_infoDialog->raise(); } -void AIMContact::userInfoUpdated( const QString& contact, const UserDetails& details ) +void AIMContact::userInfoUpdated( const TQString& contact, const UserDetails& details ) { if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) return; @@ -183,7 +183,7 @@ void AIMContact::userInfoUpdated( const QString& contact, const UserDetails& det //if they don't have an SSI alias, make sure we use the capitalization from the //server so their contact id looks all pretty. - QString nickname = property( Kopete::Global::Properties::self()->nickName() ).value().toString(); + TQString nickname = property( Kopete::Global::Properties::self()->nickName() ).value().toString(); if ( nickname.isEmpty() || Oscar::normalize( nickname ) == Oscar::normalize( contact ) ) setNickName( contact ); @@ -240,13 +240,13 @@ void AIMContact::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() ) ); } OscarContact::userInfoUpdated( contact, details ); } -void AIMContact::userOnline( const QString& userId ) +void AIMContact::userOnline( const TQString& userId ) { if ( Oscar::normalize( userId ) == Oscar::normalize( contactId() ) ) { @@ -255,7 +255,7 @@ void AIMContact::userOnline( const QString& userId ) } } -void AIMContact::userOffline( const QString& userId ) +void AIMContact::userOffline( const TQString& userId ) { if ( Oscar::normalize( userId ) == Oscar::normalize( contactId() ) ) { @@ -264,7 +264,7 @@ void AIMContact::userOffline( const QString& userId ) } } -void AIMContact::updateAwayMessage( const QString& contact, const QString& message ) +void AIMContact::updateAwayMessage( const TQString& contact, const TQString& message ) { if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) return; @@ -293,7 +293,7 @@ void AIMContact::updateAwayMessage( const QString& contact, const QString& messa emit updatedProfile(); } -void AIMContact::updateProfile( const QString& contact, const QString& profile ) +void AIMContact::updateProfile( const TQString& contact, const TQString& profile ) { if ( Oscar::normalize( contact ) != Oscar::normalize( contactId() ) ) return; @@ -302,7 +302,7 @@ void AIMContact::updateProfile( const QString& contact, const QString& profile ) emit updatedProfile(); } -void AIMContact::gotWarning( const QString& contact, Q_UINT16 increase, Q_UINT16 newLevel ) +void AIMContact::gotWarning( const TQString& contact, Q_UINT16 increase, Q_UINT16 newLevel ) { //somebody just got bitchslapped! :O Q_UNUSED( increase ); @@ -322,16 +322,16 @@ void AIMContact::requestBuddyIcon() } } -void AIMContact::haveIcon( const QString& user, QByteArray icon ) +void AIMContact::haveIcon( const TQString& user, TQByteArray icon ) { if ( Oscar::normalize( user ) != Oscar::normalize( contactId() ) ) return; kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Updating icon for " << contactId() << endl; - QImage buddyIcon( icon ); + TQImage buddyIcon( icon ); if ( buddyIcon.isNull() ) { - kdWarning(OSCAR_AIM_DEBUG) << k_funcinfo << "Failed to convert buddy icon to QImage" << endl; + kdWarning(OSCAR_AIM_DEBUG) << k_funcinfo << "Failed to convert buddy icon to TQImage" << endl; return; } @@ -346,8 +346,8 @@ void AIMContact::closeUserInfoDialog() void AIMContact::warnUser() { - QString nick = property( Kopete::Global::Properties::self()->nickName() ).value().toString(); - QString message = i18n( "Would you like to warn %1 anonymously or with your name?
" \ + TQString nick = property( Kopete::Global::Properties::self()->nickName() ).value().toString(); + TQString message = i18n( "Would you like to warn %1 anonymously or with your name?
" \ "(Warning a user on AIM will result in a \"Warning Level\"" \ " increasing for the user you warn. Once this level has reached a" \ " certain point, they will not be able to sign on. Please do not abuse" \ @@ -377,7 +377,7 @@ void AIMContact::slotInvisibleTo() void AIMContact::slotSendMsg(Kopete::Message& message, Kopete::ChatSession *) { Oscar::Message msg; - QString s; + TQString s; if (message.plainBody().isEmpty()) // no text, do nothing return; @@ -392,56 +392,56 @@ void AIMContact::slotSendMsg(Kopete::Message& message, Kopete::ChatSession *) //font-size:xxpt -> s=message.escapedBody(); - s.replace ( QRegExp( QString::fromLatin1("([^<]*)")), - QString::fromLatin1("")); + s.replace ( TQRegExp( TQString::fromLatin1("([^<]*)")), + TQString::fromLatin1("")); - s.replace ( QRegExp( QString::fromLatin1("")), - QString::fromLatin1("")); + s.replace ( TQRegExp( TQString::fromLatin1("")), + TQString::fromLatin1("")); - s.replace ( QRegExp( QString::fromLatin1("")), - QString::fromLatin1("")); + s.replace ( TQRegExp( TQString::fromLatin1("")), + TQString::fromLatin1("")); - s.replace ( QRegExp( QString::fromLatin1("")), - QString::fromLatin1("")); + s.replace ( TQRegExp( TQString::fromLatin1("")), + TQString::fromLatin1("")); - s.replace ( QRegExp( QString::fromLatin1("")), - QString::fromLatin1("")); + s.replace ( TQRegExp( TQString::fromLatin1("")), + TQString::fromLatin1("")); - s.replace ( QRegExp( QString::fromLatin1("")), - QString::fromLatin1("")); + s.replace ( TQRegExp( TQString::fromLatin1("")), + TQString::fromLatin1("")); - s.replace ( QRegExp( QString::fromLatin1("")), - QString::fromLatin1("")); + s.replace ( TQRegExp( TQString::fromLatin1("")), + TQString::fromLatin1("")); - s.replace ( QRegExp( QString::fromLatin1("")), - QString::fromLatin1("\\2")); + s.replace ( TQRegExp( TQString::fromLatin1("")), + TQString::fromLatin1("\\2")); //okay now change the to //0-9 are size 1 - s.replace ( QRegExp ( QString::fromLatin1("")), - QString::fromLatin1("")); + s.replace ( TQRegExp ( TQString::fromLatin1("")), + TQString::fromLatin1("")); //10-11 are size 2 - s.replace ( QRegExp ( QString::fromLatin1("")), - QString::fromLatin1("")); + s.replace ( TQRegExp ( TQString::fromLatin1("")), + TQString::fromLatin1("")); //12-13 are size 3 - s.replace ( QRegExp ( QString::fromLatin1("")), - QString::fromLatin1("")); + s.replace ( TQRegExp ( TQString::fromLatin1("")), + TQString::fromLatin1("")); //14-16 are size 4 - s.replace ( QRegExp ( QString::fromLatin1("")), - QString::fromLatin1("")); + s.replace ( TQRegExp ( TQString::fromLatin1("")), + TQString::fromLatin1("")); //17-22 are size 5 - s.replace ( QRegExp ( QString::fromLatin1("")), - QString::fromLatin1("")); + s.replace ( TQRegExp ( TQString::fromLatin1("")), + TQString::fromLatin1("")); //23-29 are size 6 - s.replace ( QRegExp ( QString::fromLatin1("")),QString::fromLatin1("")); + s.replace ( TQRegExp ( TQString::fromLatin1("")),TQString::fromLatin1("")); //30- (and any I missed) are size 7 - s.replace ( QRegExp ( QString::fromLatin1("")),QString::fromLatin1("")); + s.replace ( TQRegExp ( TQString::fromLatin1("")),TQString::fromLatin1("")); - s.replace ( QRegExp ( QString::fromLatin1("")), QString::fromLatin1("
") ); + s.replace ( TQRegExp ( TQString::fromLatin1("")), TQString::fromLatin1("
") ); // strip left over line break - s.remove( QRegExp( QString::fromLatin1( "
$" ) ) ); + s.remove( TQRegExp( TQString::fromLatin1( "
$" ) ) ); kdDebug(14190) << k_funcinfo << "sending " << s << endl; @@ -472,9 +472,9 @@ void AIMContact::updateFeatures() void AIMContact::sendAutoResponse(Kopete::Message& msg) { // The target time is 2 minutes later than the last message - int delta = m_lastAutoresponseTime.secsTo( QDateTime::currentDateTime() ); + int delta = m_lastAutoresponseTime.secsTo( TQDateTime::currentDateTime() ); kdDebug(14152) << k_funcinfo << "Last autoresponse time: " << m_lastAutoresponseTime << endl; - kdDebug(14152) << k_funcinfo << "Current time: " << QDateTime::currentDateTime() << endl; + kdDebug(14152) << k_funcinfo << "Current time: " << TQDateTime::currentDateTime() << endl; kdDebug(14152) << k_funcinfo << "Difference: " << delta << endl; // Check to see if we're past that time if(delta > 120) @@ -491,7 +491,7 @@ void AIMContact::sendAutoResponse(Kopete::Message& msg) } else { - QTextCodec* codec = contactCodec(); + TQTextCodec* codec = contactCodec(); message.setText( Oscar::Message::UserDefined, msg.plainBody(), codec ); } @@ -506,7 +506,7 @@ void AIMContact::sendAutoResponse(Kopete::Message& msg) manager(Kopete::Contact::CanCreate)->appendMessage(msg); manager(Kopete::Contact::CanCreate)->messageSucceeded(); // Update the last autoresponse time - m_lastAutoresponseTime = QDateTime::currentDateTime(); + m_lastAutoresponseTime = TQDateTime::currentDateTime(); } else { -- cgit v1.2.1