summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/oscar/aim/aimcontact.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/aim/aimcontact.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/aim/aimcontact.cpp')
-rw-r--r--kopete/protocols/oscar/aim/aimcontact.cpp172
1 files changed, 86 insertions, 86 deletions
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 <time.h>
-#include <qimage.h>
-#include <qregexp.h>
-#include <qtimer.h>
-#include <qtextcodec.h>
+#include <tqimage.h>
+#include <tqregexp.h>
+#include <tqtimer.h>
+#include <tqtextcodec.h>
#include <kapplication.h>
#include <kactionclasses.h>
@@ -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<AIMProtocol *>(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<KAction> *AIMContact::customContextMenuActions()
+TQPtrList<KAction> *AIMContact::customContextMenuActions()
{
- QPtrList<KAction> *actionCollection = new QPtrList<KAction>();
+ TQPtrList<KAction> *actionCollection = new TQPtrList<KAction>();
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<KAction> *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].*>(.*)</[hH][tT][mM][lL]>")),
- QString::fromLatin1("\\1"));
+ TQRegExp(TQString::fromLatin1("<[hH][tT][mM][lL].*>(.*)</[hH][tT][mM][lL]>")),
+ TQString::fromLatin1("\\1"));
filteredMessage.replace(
- QRegExp(QString::fromLatin1("<[bB][oO][dD][yY].*>(.*)</[bB][oO][dD][yY]>")),
- QString::fromLatin1("\\1") );
- QRegExp fontRemover( QString::fromLatin1("<[fF][oO][nN][tT].*>(.*)</[fF][oO][nN][tT]>") );
+ TQRegExp(TQString::fromLatin1("<[bB][oO][dD][yY].*>(.*)</[bB][oO][dD][yY]>")),
+ TQString::fromLatin1("\\1") );
+ TQRegExp fontRemover( TQString::fromLatin1("<[fF][oO][nN][tT].*>(.*)</[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<AIMAccount*>( 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( "<qt>Would you like to warn %1 anonymously or with your name?<br>" \
+ TQString nick = property( Kopete::Global::Properties::self()->nickName() ).value().toString();
+ TQString message = i18n( "<qt>Would you like to warn %1 anonymously or with your name?<br>" \
"(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 -> <font ptsize=xx>
s=message.escapedBody();
- s.replace ( QRegExp( QString::fromLatin1("<span style=\"([^\"]*)\">([^<]*)</span>")),
- QString::fromLatin1("<style>\\1;\"\\2</style>"));
+ s.replace ( TQRegExp( TQString::fromLatin1("<span style=\"([^\"]*)\">([^<]*)</span>")),
+ TQString::fromLatin1("<style>\\1;\"\\2</style>"));
- s.replace ( QRegExp( QString::fromLatin1("<style>([^\"]*)font-style:italic;([^\"]*)\"([^<]*)</style>")),
- QString::fromLatin1("<i><style>\\1\\2\"\\3</style></i>"));
+ s.replace ( TQRegExp( TQString::fromLatin1("<style>([^\"]*)font-style:italic;([^\"]*)\"([^<]*)</style>")),
+ TQString::fromLatin1("<i><style>\\1\\2\"\\3</style></i>"));
- s.replace ( QRegExp( QString::fromLatin1("<style>([^\"]*)font-weight:600;([^\"]*)\"([^<]*)</style>")),
- QString::fromLatin1("<b><style>\\1\\2\"\\3</style></b>"));
+ s.replace ( TQRegExp( TQString::fromLatin1("<style>([^\"]*)font-weight:600;([^\"]*)\"([^<]*)</style>")),
+ TQString::fromLatin1("<b><style>\\1\\2\"\\3</style></b>"));
- s.replace ( QRegExp( QString::fromLatin1("<style>([^\"]*)text-decoration:underline;([^\"]*)\"([^<]*)</style>")),
- QString::fromLatin1("<u><style>\\1\\2\"\\3</style></u>"));
+ s.replace ( TQRegExp( TQString::fromLatin1("<style>([^\"]*)text-decoration:underline;([^\"]*)\"([^<]*)</style>")),
+ TQString::fromLatin1("<u><style>\\1\\2\"\\3</style></u>"));
- s.replace ( QRegExp( QString::fromLatin1("<style>([^\"]*)font-family:([^;]*);([^\"]*)\"([^<]*)</style>")),
- QString::fromLatin1("<font face=\"\\2\"><style>\\1\\3\"\\4</style></font>"));
+ s.replace ( TQRegExp( TQString::fromLatin1("<style>([^\"]*)font-family:([^;]*);([^\"]*)\"([^<]*)</style>")),
+ TQString::fromLatin1("<font face=\"\\2\"><style>\\1\\3\"\\4</style></font>"));
- s.replace ( QRegExp( QString::fromLatin1("<style>([^\"]*)font-size:([^p]*)pt;([^\"]*)\"([^<]*)</style>")),
- QString::fromLatin1("<font ptsize=\"\\2\"><style>\\1\\3\"\\4</style></font>"));
+ s.replace ( TQRegExp( TQString::fromLatin1("<style>([^\"]*)font-size:([^p]*)pt;([^\"]*)\"([^<]*)</style>")),
+ TQString::fromLatin1("<font ptsize=\"\\2\"><style>\\1\\3\"\\4</style></font>"));
- s.replace ( QRegExp( QString::fromLatin1("<style>([^\"]*)color:([^;]*);([^\"]*)\"([^<]*)</style>")),
- QString::fromLatin1("<font color=\"\\2\"><style>\\1\\3\"\\4</style></font>"));
+ s.replace ( TQRegExp( TQString::fromLatin1("<style>([^\"]*)color:([^;]*);([^\"]*)\"([^<]*)</style>")),
+ TQString::fromLatin1("<font color=\"\\2\"><style>\\1\\3\"\\4</style></font>"));
- s.replace ( QRegExp( QString::fromLatin1("<style>([^\"]*)\"([^<]*)</style>")),
- QString::fromLatin1("\\2"));
+ s.replace ( TQRegExp( TQString::fromLatin1("<style>([^\"]*)\"([^<]*)</style>")),
+ TQString::fromLatin1("\\2"));
//okay now change the <font ptsize="xx"> to <font size="xx">
//0-9 are size 1
- s.replace ( QRegExp ( QString::fromLatin1("<font ptsize=\"\\d\">")),
- QString::fromLatin1("<font size=\"1\">"));
+ s.replace ( TQRegExp ( TQString::fromLatin1("<font ptsize=\"\\d\">")),
+ TQString::fromLatin1("<font size=\"1\">"));
//10-11 are size 2
- s.replace ( QRegExp ( QString::fromLatin1("<font ptsize=\"1[01]\">")),
- QString::fromLatin1("<font size=\"2\">"));
+ s.replace ( TQRegExp ( TQString::fromLatin1("<font ptsize=\"1[01]\">")),
+ TQString::fromLatin1("<font size=\"2\">"));
//12-13 are size 3
- s.replace ( QRegExp ( QString::fromLatin1("<font ptsize=\"1[23]\">")),
- QString::fromLatin1("<font size=\"3\">"));
+ s.replace ( TQRegExp ( TQString::fromLatin1("<font ptsize=\"1[23]\">")),
+ TQString::fromLatin1("<font size=\"3\">"));
//14-16 are size 4
- s.replace ( QRegExp ( QString::fromLatin1("<font ptsize=\"1[456]\">")),
- QString::fromLatin1("<font size=\"4\">"));
+ s.replace ( TQRegExp ( TQString::fromLatin1("<font ptsize=\"1[456]\">")),
+ TQString::fromLatin1("<font size=\"4\">"));
//17-22 are size 5
- s.replace ( QRegExp ( QString::fromLatin1("<font ptsize=\"(?:1[789]|2[012])\">")),
- QString::fromLatin1("<font size=\"5\">"));
+ s.replace ( TQRegExp ( TQString::fromLatin1("<font ptsize=\"(?:1[789]|2[012])\">")),
+ TQString::fromLatin1("<font size=\"5\">"));
//23-29 are size 6
- s.replace ( QRegExp ( QString::fromLatin1("<font ptsize=\"2[3456789]\">")),QString::fromLatin1("<font size=\"6\">"));
+ s.replace ( TQRegExp ( TQString::fromLatin1("<font ptsize=\"2[3456789]\">")),TQString::fromLatin1("<font size=\"6\">"));
//30- (and any I missed) are size 7
- s.replace ( QRegExp ( QString::fromLatin1("<font ptsize=\"[^\"]*\">")),QString::fromLatin1("<font size=\"7\">"));
+ s.replace ( TQRegExp ( TQString::fromLatin1("<font ptsize=\"[^\"]*\">")),TQString::fromLatin1("<font size=\"7\">"));
- s.replace ( QRegExp ( QString::fromLatin1("<br[ /]*>")), QString::fromLatin1("<br>") );
+ s.replace ( TQRegExp ( TQString::fromLatin1("<br[ /]*>")), TQString::fromLatin1("<br>") );
// strip left over line break
- s.remove( QRegExp( QString::fromLatin1( "<br>$" ) ) );
+ s.remove( TQRegExp( TQString::fromLatin1( "<br>$" ) ) );
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
{