summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/yahoo/yahooaccount.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/protocols/yahoo/yahooaccount.cpp')
-rw-r--r--kopete/protocols/yahoo/yahooaccount.cpp260
1 files changed, 130 insertions, 130 deletions
diff --git a/kopete/protocols/yahoo/yahooaccount.cpp b/kopete/protocols/yahoo/yahooaccount.cpp
index ae33f264..fb2c3447 100644
--- a/kopete/protocols/yahoo/yahooaccount.cpp
+++ b/kopete/protocols/yahoo/yahooaccount.cpp
@@ -66,14 +66,14 @@
#include "yabentry.h"
#include "yahoouserinfodialog.h"
-YahooAccount::YahooAccount(YahooProtocol *parent, const TQString& accountId, const char *name)
- : Kopete::PasswordedAccount(parent, accountId, 0, name)
+YahooAccount::YahooAccount(YahooProtocol *tqparent, const TQString& accountId, const char *name)
+ : Kopete::PasswordedAccount(tqparent, accountId, 0, name)
{
// first things first - initialise internals
stateOnConnection = 0;
theHaveContactList = false;
- m_protocol = parent;
+ m_protocol = tqparent;
m_session = new Client( this );
m_lastDisconnectCode = 0;
m_currentMailCount = 0;
@@ -101,7 +101,7 @@ YahooAccount::YahooAccount(YahooProtocol *parent, const TQString& accountId, con
YahooContact* _myself=new YahooContact( this, accountId.lower(), accountId, Kopete::ContactList::self()->myself() );
setMyself( _myself );
- _myself->setOnlineStatus( parent->Offline );
+ _myself->setOnlineStatus( tqparent->Offline );
myself()->setProperty( YahooProtocol::protocol()->iconRemoteUrl, configGroup()->readEntry( "iconRemoteUrl", "" ) );
myself()->setProperty( Kopete::Global::Properties::self()->photo(), configGroup()->readEntry( "iconLocalUrl", "" ) );
myself()->setProperty( YahooProtocol::protocol()->iconCheckSum, configGroup()->readEntry( "iconCheckSum", 0 ) );
@@ -109,7 +109,7 @@ YahooAccount::YahooAccount(YahooProtocol *parent, const TQString& accountId, con
// initConnectionSignals( MakeConnections );
- TQString displayName = configGroup()->readEntry(TQString::fromLatin1("displayName"), TQString());
+ TQString displayName = configGroup()->readEntry(TQString::tqfromLatin1("displayName"), TQString());
if(!displayName.isEmpty())
_myself->setNickName(displayName);
@@ -130,17 +130,17 @@ YahooAccount::~YahooAccount()
void YahooAccount::setServer( const TQString &server )
{
- configGroup()->writeEntry( TQString::fromLatin1( "Server" ), server );
+ configGroup()->writeEntry( TQString::tqfromLatin1( "Server" ), server );
}
void YahooAccount::setPort( int port )
{
- configGroup()->writeEntry( TQString::fromLatin1( "Port" ), port );
+ configGroup()->writeEntry( TQString::tqfromLatin1( "Port" ), port );
}
-void YahooAccount::slotGoStatus( int status, const TQString &awayMessage)
+void YahooAccount::slotGotqStatus( int status, const TQString &awayMessage)
{
- kdDebug(YAHOO_GEN_DEBUG) << "GoStatus: " << status << " msg: " << awayMessage << endl;
+ kdDebug(YAHOO_GEN_DEBUG) << "GotqStatus: " << status << " msg: " << awayMessage << endl;
if( !isConnected() )
{
connect( m_protocol->statusFromYahoo( status ) );
@@ -148,7 +148,7 @@ void YahooAccount::slotGoStatus( int status, const TQString &awayMessage)
}
else
{
- m_session->changeStatus( Yahoo::Status( status ), awayMessage,
+ m_session->changetqStatus( Yahoo::tqStatus( status ), awayMessage,
(status == Yahoo::StatusAvailable)? Yahoo::StatusTypeAvailable : Yahoo::StatusTypeAway );
//sets the awayMessage property for the owner of the account. shows up in the statusbar icon's tooltip. the property is unset when awayMessage is null
@@ -167,16 +167,16 @@ TQString YahooAccount::stripMsgColorCodes(const TQString& msg)
TQString filteredMsg = msg;
//Handle bold, underline and italic messages
- filteredMsg.replace( "\033[1m", "<b>" );
- filteredMsg.replace( "\033[x1m", "</b>" );
- filteredMsg.replace( "\033[2m", "<i>" );
- filteredMsg.replace( "\033[x2m", "</i>" );
- filteredMsg.replace( "\033[4m", "<u>" );
- filteredMsg.replace( "\033[x4m", "</u>" );
+ filteredMsg.tqreplace( "\033[1m", "<b>" );
+ filteredMsg.tqreplace( "\033[x1m", "</b>" );
+ filteredMsg.tqreplace( "\033[2m", "<i>" );
+ filteredMsg.tqreplace( "\033[x2m", "</i>" );
+ filteredMsg.tqreplace( "\033[4m", "<u>" );
+ filteredMsg.tqreplace( "\033[x4m", "</u>" );
//GAIM doesn't check for ^[[3m. Does this ever get sent?
- filteredMsg.replace( "\033[3m", "<i>" );
- filteredMsg.replace( "\033[x3m", "</i>" );
+ filteredMsg.tqreplace( "\033[3m", "<i>" );
+ filteredMsg.tqreplace( "\033[x3m", "</i>" );
//Strip link tags
filteredMsg.remove( "\033[lm" );
@@ -196,30 +196,30 @@ TQColor YahooAccount::getMsgColor(const TQString& msg)
//kdDebug(YAHOO_GEN_DEBUG) << "msg is " << msg;
//Please note that some of the colors are hard-coded to
//match the yahoo colors
- if ( msg.find("\033[38m") != -1 )
- return Qt::red;
- if ( msg.find("\033[34m") != -1 )
- return Qt::green;
- if ( msg.find("\033[31m") != -1 )
- return Qt::blue;
- if ( msg.find("\033[39m") != -1 )
- return Qt::yellow;
- if ( msg.find("\033[36m") != -1 )
- return Qt::darkMagenta;
- if ( msg.find("\033[32m") != -1 )
- return Qt::cyan;
- if ( msg.find("\033[37m") != -1 )
+ if ( msg.tqfind("\033[38m") != -1 )
+ return TQt::red;
+ if ( msg.tqfind("\033[34m") != -1 )
+ return TQt::green;
+ if ( msg.tqfind("\033[31m") != -1 )
+ return TQt::blue;
+ if ( msg.tqfind("\033[39m") != -1 )
+ return TQt::yellow;
+ if ( msg.tqfind("\033[36m") != -1 )
+ return TQt::darkMagenta;
+ if ( msg.tqfind("\033[32m") != -1 )
+ return TQt::cyan;
+ if ( msg.tqfind("\033[37m") != -1 )
return TQColor("#FFAA39");
- if ( msg.find("\033[35m") != -1 )
+ if ( msg.tqfind("\033[35m") != -1 )
return TQColor("#FFD8D8");
- if ( msg.find("\033[#") != -1 )
+ if ( msg.tqfind("\033[#") != -1 )
{
- kdDebug(YAHOO_GEN_DEBUG) << "Custom color is " << msg.mid(msg.find("\033[#")+2,7) << endl;
- return TQColor(msg.mid(msg.find("\033[#")+2,7));
+ kdDebug(YAHOO_GEN_DEBUG) << "Custom color is " << msg.mid(msg.tqfind("\033[#")+2,7) << endl;
+ return TQColor(msg.mid(msg.tqfind("\033[#")+2,7));
}
//return a default value just in case
- return Qt::black;
+ return TQt::black;
}
void YahooAccount::initConnectionSignals( enum SignalConnectionType sct )
@@ -265,8 +265,8 @@ void YahooAccount::initConnectionSignals( enum SignalConnectionType sct )
TQObject::connect(m_session, TQT_SIGNAL(statusChanged(const TQString&,int,const TQString&,int,int,int)),
this, TQT_SLOT(slotStatusChanged(const TQString&,int,const TQString&,int,int,int)));
- TQObject::connect(m_session, TQT_SIGNAL(stealthStatusChanged(const TQString &, Yahoo::StealthStatus)),
- this, TQT_SLOT(slotStealthStatusChanged( const TQString &, Yahoo::StealthStatus)) );
+ TQObject::connect(m_session, TQT_SIGNAL(stealthStatusChanged(const TQString &, Yahoo::StealthtqStatus)),
+ this, TQT_SLOT(slotStealthStatusChanged( const TQString &, Yahoo::StealthtqStatus)) );
TQObject::connect(m_session, TQT_SIGNAL(gotIm(const TQString&, const TQString&, long, int)),
this, TQT_SLOT(slotGotIm(const TQString &, const TQString&, long, int)));
@@ -407,8 +407,8 @@ void YahooAccount::initConnectionSignals( enum SignalConnectionType sct )
TQObject::disconnect(m_session, TQT_SIGNAL(statusChanged(const TQString&,int,const TQString&,int,int,int)),
this, TQT_SLOT(slotStatusChanged(const TQString&,int,const TQString&,int,int,int)));
- TQObject::disconnect(m_session, TQT_SIGNAL(stealthStatusChanged(const TQString &, Yahoo::StealthStatus)),
- this, TQT_SLOT(slotStealthStatusChanged( const TQString &, Yahoo::StealthStatus)) );
+ TQObject::disconnect(m_session, TQT_SIGNAL(stealthStatusChanged(const TQString &, Yahoo::StealthtqStatus)),
+ this, TQT_SLOT(slotStealthStatusChanged( const TQString &, Yahoo::StealthtqStatus)) );
TQObject::disconnect(m_session, TQT_SIGNAL(gotIm(const TQString&, const TQString&, long, int)),
this, TQT_SLOT(slotGotIm(const TQString &, const TQString&, long, int)));
@@ -526,7 +526,7 @@ void YahooAccount::connectWithPassword( const TQString &passwd )
}
if ( isConnected() ||
- myself()->onlineStatus() == m_protocol->Connecting )
+ myself()->onlinetqStatus() == m_protocol->Connecting )
{
kdDebug(YAHOO_GEN_DEBUG) << "Yahoo plugin: Ignoring connect request (already connected)." << endl;
return;
@@ -549,7 +549,7 @@ void YahooAccount::connectWithPassword( const TQString &passwd )
kdDebug(YAHOO_GEN_DEBUG) << "Attempting to connect to Yahoo on <" << server << ":"
<< port << ">. user <" << accountId() << ">" << endl;
static_cast<YahooContact *>( myself() )->setOnlineStatus( m_protocol->Connecting );
- m_session->setStatusOnConnect( Yahoo::Status( initialStatus().internalStatus() ) );
+ m_session->setStatusOnConnect( Yahoo::tqStatus( initialtqStatus().internalStatus() ) );
m_session->connect( server, port, accountId().lower(), passwd );
}
@@ -567,7 +567,7 @@ void YahooAccount::disconnect()
static_cast<YahooContact *>( myself() )->setOnlineStatus( m_protocol->Offline );
// FIXME: to check
- //QHash<TQString,Kopete::Contact*>::ConstIterator it, itEnd = contacts().constEnd();
+ //TQHash<TQString,Kopete::Contact*>::ConstIterator it, itEnd = contacts().constEnd();
//for ( it = contacts().constBegin(); it != itEnd; ++it )
// static_cast<YahooContact *>( it.value() )->setOnlineStatus( m_protocol->Offline );
for ( TQDictIterator<Kopete::Contact> i( contacts() ); i.current(); ++i )
@@ -581,7 +581,7 @@ void YahooAccount::disconnect()
m_session->cancelConnect();
// FIXME: to check
- //QHash<TQString,Kopete::Contact*>::ConstIterator it, itEnd = contacts().constEnd();
+ //TQHash<TQString,Kopete::Contact*>::ConstIterator it, itEnd = contacts().constEnd();
//for ( it = contacts().constBegin(); it != itEnd; ++it )
// static_cast<YahooContact*>( it.value() )->setOnlineStatus( m_protocol->Offline );
for ( TQDictIterator<Kopete::Contact> i(contacts()); i.current(); ++i )
@@ -607,9 +607,9 @@ void YahooAccount::setAway(bool status, const TQString &awayMessage)
kdDebug(YAHOO_GEN_DEBUG) ;
if( awayMessage.isEmpty() )
- slotGoStatus( status ? 2 : 0 );
+ slotGotqStatus( status ? 2 : 0 );
else
- slotGoStatus( status ? 99 : 0, awayMessage );
+ slotGotqStatus( status ? 99 : 0, awayMessage );
}
void YahooAccount::slotConnected()
@@ -623,7 +623,7 @@ void YahooAccount::slotGoOnline()
if( !isConnected() )
connect( m_protocol->Online );
else
- slotGoStatus(0);
+ slotGotqStatus(0);
}
void YahooAccount::slotGoOffline()
@@ -663,7 +663,7 @@ YahooContact *YahooAccount::contact( const TQString &id )
return static_cast<YahooContact *>(contacts()[id]);
}
-bool YahooAccount::createContact(const TQString &contactId, Kopete::MetaContact *parentContact )
+bool YahooAccount::createContact(const TQString &contactId, Kopete::MetaContact *tqparentContact )
{
// kdDebug(YAHOO_GEN_DEBUG) << " contactId: " << contactId;
@@ -674,7 +674,7 @@ bool YahooAccount::createContact(const TQString &contactId, Kopete::MetaContact
// -- actualy (oct 2004) this method is only called when new contact are added. but this will
// maybe change and you will be noticed --Olivier
YahooContact *newContact = new YahooContact( this, contactId,
- parentContact->displayName(), parentContact );
+ tqparentContact->displayName(), tqparentContact );
return newContact != 0;
}
else
@@ -722,9 +722,9 @@ void YahooAccount::slotLoginResponse( int succ , const TQString &url )
setupActions( succ == Yahoo::LoginOk );
if ( succ == Yahoo::LoginOk || (succ == Yahoo::LoginDupl && m_lastDisconnectCode == 2) )
{
- if ( initialStatus().internalStatus() )
+ if ( initialtqStatus().internalStatus() )
{
- static_cast<YahooContact *>( myself() )->setOnlineStatus( initialStatus() );
+ static_cast<YahooContact *>( myself() )->setOnlineStatus( initialtqStatus() );
}
else
{
@@ -750,7 +750,7 @@ void YahooAccount::slotLoginResponse( int succ , const TQString &url )
else if(succ == Yahoo::LoginLock)
{
initConnectionSignals( DeleteConnections );
- errorMsg = i18n("Could not log into the Yahoo service: your account has been locked.\nVisit %1 to reactivate it.").arg(url);
+ errorMsg = i18n("Could not log into the Yahoo service: your account has been locked.\nVisit %1 to reactivate it.").tqarg(url);
KMessageBox::queuedMessageBox(Kopete::UI::Global::mainWidget(), KMessageBox::Error, errorMsg);
static_cast<YahooContact *>( myself() )->setOnlineStatus( m_protocol->Offline );
disconnected( BadUserName ); // FIXME: add a more appropriate disconnect reason
@@ -801,8 +801,8 @@ void YahooAccount::slotDisconnected()
TQString message;
message = i18n( "%1 has been disconnected.\nError message:\n%2 - %3" )
- .arg( accountId() ).arg( m_session->error() ).arg( m_session->errorString() );
- KNotification::event( "connection_lost", message, myself()->onlineStatus().protocolIcon() );
+ .tqarg( accountId() ).tqarg( m_session->error() ).tqarg( m_session->errorString() );
+ KNotification::event( "connection_lost", message, myself()->onlinetqStatus().protocolIcon() );
}
void YahooAccount::slotLoginFailed()
@@ -814,8 +814,8 @@ void YahooAccount::slotLoginFailed()
TQString message;
message = i18n( "There was an error while connecting %1 to the Yahoo server.\nError message:\n%2 - %3" )
- .arg( accountId()).arg( m_session->error() ).arg( m_session->errorString() );
- KNotification::event( "cannot_connect", message, myself()->onlineStatus().protocolIcon() );
+ .tqarg( accountId()).tqarg( m_session->error() ).tqarg( m_session->errorString() );
+ KNotification::event( "cannot_connect", message, myself()->onlinetqStatus().protocolIcon() );
}
void YahooAccount::slotError( int level )
@@ -825,17 +825,17 @@ void YahooAccount::slotError( int level )
return;
else if( level <= Client::Warning )
KMessageBox::information( Kopete::UI::Global::mainWidget(),
- i18n( "%1\n\nReason: %2").arg( m_session->errorInformation() ).arg( m_session->errorString() ),
+ i18n( "%1\n\nReason: %2").tqarg( m_session->errorInformation() ).tqarg( m_session->errorString() ),
i18n( "Yahoo Plugin" ) );
else
KMessageBox::error( Kopete::UI::Global::mainWidget(), i18n( "%1\n\nReason: %2" )
- .arg( m_session->errorInformation() ).arg( m_session->errorString() ), i18n( "Yahoo Plugin" ) );
+ .tqarg( m_session->errorInformation() ).tqarg( m_session->errorString() ), i18n( "Yahoo Plugin" ) );
}
void YahooAccount::slotGotBuddy( const TQString &userid, const TQString &alias, const TQString &group )
{
kdDebug(YAHOO_GEN_DEBUG) ;
- IDs[userid] = QPair<TQString, TQString>(group, alias);
+ IDs[userid] = TQPair<TQString, TQString>(group, alias);
// Serverside -> local
if ( !contact( userid ) )
@@ -854,7 +854,7 @@ void YahooAccount::slotBuddyAddResult( const TQString &userid, const TQString &g
kdDebug(YAHOO_GEN_DEBUG) << success << endl;
if(success)
- IDs[userid] = QPair<TQString, TQString>(group, TQString());
+ IDs[userid] = TQPair<TQString, TQString>(group, TQString());
// FIXME (same)
//kdDebug(YAHOO_GEN_DEBUG) << IDs << endl;
@@ -878,7 +878,7 @@ void YahooAccount::slotBuddyChangeGroupResult(const TQString &userid, const TQSt
kdDebug(YAHOO_GEN_DEBUG);
if(success)
- IDs[userid] = QPair<TQString, TQString>(group, TQString());
+ IDs[userid] = TQPair<TQString, TQString>(group, TQString());
// FIXME
//kdDebug(YAHOO_GEN_DEBUG) << IDs << endl;
@@ -888,8 +888,8 @@ void YahooAccount::slotAuthorizationAccepted( const TQString &who )
{
kdDebug(YAHOO_GEN_DEBUG) ;
TQString message;
- message = i18n( "User %1 has granted your authorization request." ).arg( who );
- KNotification::event( TQString::fromLatin1("kopete_authorization"), message );
+ message = i18n( "User %1 has granted your authorization request." ).tqarg( who );
+ KNotification::event( TQString::tqfromLatin1("kopete_authorization"), message );
if( contact( who ) )
contact( who )->setOnlineStatus( m_protocol->Online );
@@ -900,8 +900,8 @@ void YahooAccount::slotAuthorizationRejected( const TQString &who, const TQStrin
kdDebug(YAHOO_GEN_DEBUG) ;
TQString message;
message = i18n( "User %1 has rejected your authorization request.\n%2" )
- .arg( who ).arg( msg );
- KNotification::event( TQString::fromLatin1("kopete_authorization"), message );
+ .tqarg( who ).tqarg( msg );
+ KNotification::event( TQString::tqfromLatin1("kopete_authorization"), message );
}
void YahooAccount::slotgotAuthorizationRequest( const TQString &user, const TQString &msg, const TQString &name )
@@ -932,7 +932,7 @@ void YahooAccount::slotgotAuthorizationRequest( const TQString &user, const TQSt
hideFlags |= Kopete::UI::ContactAddedNotifyDialog::AddCheckBox | Kopete::UI::ContactAddedNotifyDialog::AddGroupBox ;
Kopete::UI::ContactAddedNotifyDialog *dialog=
- new Kopete::UI::ContactAddedNotifyDialog( user,TQString::null,this, hideFlags );
+ new Kopete::UI::ContactAddedNotifyDialog( user,TQString(),this, hideFlags );
TQObject::connect(dialog,TQT_SIGNAL(applyClicked(const TQString&)),
this,TQT_SLOT(slotContactAddedNotifyDialogClosed(const TQString& )));
dialog->show();
@@ -946,7 +946,7 @@ void YahooAccount::slotContactAddedNotifyDialogClosed( const TQString &user )
if(!dialog || !isConnected())
return;
- m_session->sendAuthReply( user, dialog->authorized(), TQString::null );
+ m_session->sendAuthReply( user, dialog->authorized(), TQString() );
if(dialog->added())
{
@@ -995,24 +995,24 @@ void YahooAccount::slotStatusChanged( const TQString &who, int stat, const TQStr
if ( kc )
{
- Kopete::OnlineStatus newStatus = m_protocol->statusFromYahoo( stat );
- Kopete::OnlineStatus oldStatus = kc->onlineStatus();
+ Kopete::OnlineStatus newtqStatus = m_protocol->statusFromYahoo( stat );
+ Kopete::OnlineStatus oldtqStatus = kc->onlinetqStatus();
- if( newStatus == m_protocol->Custom ) {
+ if( newtqStatus == m_protocol->Custom ) {
if( away == 0 )
- newStatus =m_protocol->Online;
+ newtqStatus =m_protocol->Online;
kc->setProperty( m_protocol->awayMessage, msg);
}
else
kc->removeProperty( m_protocol->awayMessage );
// from original file
- if( newStatus != m_protocol->Offline && oldStatus == m_protocol->Offline && contact(who) != myself() )
+ if( newtqStatus != m_protocol->Offline && oldtqStatus == m_protocol->Offline && contact(who) != myself() )
{
//m_session->requestBuddyIcon( who ); // Try to get Buddy Icon
if ( !myself()->property( Kopete::Global::Properties::self()->photo() ).isNull() &&
- myself()->onlineStatus() != m_protocol->Invisible &&
+ myself()->onlinetqStatus() != m_protocol->Invisible &&
!kc->stealthed() )
{
kc->sendBuddyIconUpdate( m_session->pictureFlag() );
@@ -1020,21 +1020,21 @@ void YahooAccount::slotStatusChanged( const TQString &who, int stat, const TQStr
}
}
- //if( newStatus == static_cast<YahooProtocol*>( m_protocol )->Idle ) {
- if( newStatus == m_protocol->Idle )
+ //if( newtqStatus == static_cast<YahooProtocol*>( m_protocol )->Idle ) {
+ if( newtqStatus == m_protocol->Idle )
kc->setIdleTime( idle ? idle : 1 );
else
kc->setIdleTime( 0 );
- kc->setOnlineStatus( newStatus );
+ kc->setOnlineStatus( newtqStatus );
slotGotBuddyIconChecksum( who, pictureChecksum );
}
}
-void YahooAccount::slotStealthStatusChanged( const TQString &who, Yahoo::StealthStatus state )
+void YahooAccount::slotStealthStatusChanged( const TQString &who, Yahoo::StealthtqStatus state )
{
- //kdDebug(YAHOO_GEN_DEBUG) << "Stealth Status of " << who << "changed to " << state;
+ //kdDebug(YAHOO_GEN_DEBUG) << "Stealth tqStatus of " << who << "changed to " << state;
YahooContact* kc = contact( who );
if ( kc == NULL ) {
@@ -1053,7 +1053,7 @@ TQString YahooAccount::prepareIncomingMessage( const TQString &messageText )
kdDebug(YAHOO_GEN_DEBUG) << "Message after stripping color codes '" << newMsgText << "'" << endl;
- newMsgText.replace( TQString::fromLatin1( "&" ), TQString::fromLatin1( "&amp;" ) );
+ newMsgText.tqreplace( TQString::tqfromLatin1( "&" ), TQString::tqfromLatin1( "&amp;" ) );
// Replace Font tags
regExp.setMinimal( true );
@@ -1063,7 +1063,7 @@ TQString YahooAccount::prepareIncomingMessage( const TQString &messageText )
pos = regExp.search( newMsgText, pos );
if ( pos >= 0 ) {
pos += regExp.matchedLength();
- newMsgText.replace( regExp, TQString::fromLatin1("<font\\1style=\"font-size:\\2pt\">" ) );
+ newMsgText.tqreplace( regExp, TQString::tqfromLatin1("<font\\1style=\"font-size:\\2pt\">" ) );
}
}
@@ -1095,7 +1095,7 @@ TQString YahooAccount::prepareIncomingMessage( const TQString &messageText )
pos = regExp.search( newMsgText, pos );
if ( pos >= 0 ) {
pos += regExp.matchedLength();
- newMsgText.replace( regExp, TQString::fromLatin1("&lt;" ) );
+ newMsgText.tqreplace( regExp, TQString::tqfromLatin1("&lt;" ) );
}
}
regExp.setPattern( "([^\"bui])>" );
@@ -1104,22 +1104,22 @@ TQString YahooAccount::prepareIncomingMessage( const TQString &messageText )
pos = regExp.search( newMsgText, pos );
if ( pos >= 0 ) {
pos += regExp.matchedLength();
- newMsgText.replace( regExp, TQString::fromLatin1("\\1&gt;" ) );
+ newMsgText.tqreplace( regExp, TQString::tqfromLatin1("\\1&gt;" ) );
}
}
// add closing tags when needed
regExp.setMinimal( false );
regExp.setPattern( "(<b>.*)(?!</b>)" );
- newMsgText.replace( regExp, TQString::fromLatin1("\\1</b>" ) );
+ newMsgText.tqreplace( regExp, TQString::tqfromLatin1("\\1</b>" ) );
regExp.setPattern( "(<i>.*)(?!</i>)" );
- newMsgText.replace( regExp, TQString::fromLatin1("\\1</i>" ) );
+ newMsgText.tqreplace( regExp, TQString::tqfromLatin1("\\1</i>" ) );
regExp.setPattern( "(<u>.*)(?!</u>)" );
- newMsgText.replace( regExp, TQString::fromLatin1("\\1</u>" ) );
+ newMsgText.tqreplace( regExp, TQString::tqfromLatin1("\\1</u>" ) );
regExp.setPattern( "(<font.*)(?!</font>)" );
- newMsgText.replace( regExp, TQString::fromLatin1("\\1</font>" ) );
+ newMsgText.tqreplace( regExp, TQString::tqfromLatin1("\\1</font>" ) );
- newMsgText.replace( TQString::fromLatin1( "\r" ), TQString::fromLatin1( "<br/>" ) );
+ newMsgText.tqreplace( TQString::tqfromLatin1( "\r" ), TQString::tqfromLatin1( "<br/>" ) );
return newMsgText;
}
@@ -1143,7 +1143,7 @@ void YahooAccount::slotGotIm( const TQString &who, const TQString &msg, long tm,
// FIXME to check
if (tm == 0)
- //msgDT = TQDateTime( TQDate::currentDate(), TQTime::currentTime(), Qt::LocalTime );
+ //msgDT = TQDateTime( TQDate::tqcurrentDate(), TQTime::currentTime(), TQt::LocalTime );
msgDT.setTime_t(time(0L));
else
//msgDT = TQDateTime::fromTime_t(tm);
@@ -1181,7 +1181,7 @@ void YahooAccount::slotGotBuzz( const TQString &who, long tm )
// FIXME: to check
if (tm == 0)
- //msgDT = TQDateTime( TQDate::currentDate(), TQTime::currentTime(), Qt::LocalTime );
+ //msgDT = TQDateTime( TQDate::tqcurrentDate(), TQTime::currentTime(), TQt::LocalTime );
msgDT.setTime_t(time(0L));
else
//msgDT = TQDateTime::fromTime_t(tm);
@@ -1192,7 +1192,7 @@ void YahooAccount::slotGotBuzz( const TQString &who, long tm )
TQString buzzMsgText = i18n("This string is shown when the user is buzzed by a contact", "Buzz");
Kopete::Message kmsg(msgDT, contact(who), justMe, buzzMsgText, Kopete::Message::Inbound,
- Kopete::Message::PlainText, TQString::null, Kopete::Message::TypeAction);
+ Kopete::Message::PlainText, TQString(), Kopete::Message::TypeAction);
TQColor fgColor( "gold" );
kmsg.setFg( fgColor );
@@ -1208,7 +1208,7 @@ void YahooAccount::slotGotConfInvite( const TQString & who, const TQString & roo
kdDebug(YAHOO_GEN_DEBUG) << who << " has invited you to join the conference \"" << room << "\" : " << msg << endl;
kdDebug(YAHOO_GEN_DEBUG) << "Members: " << members << endl;
- if( !m_pendingConfInvites.contains( room ) ) // We have to keep track of the invites as the server will send the same invite twice if it gets canceled by the host
+ if( !m_pendingConfInvites.tqcontains( room ) ) // We have to keep track of the invites as the server will send the same invite twice if it gets canceled by the host
m_pendingConfInvites.push_back( room );
else
{
@@ -1222,13 +1222,13 @@ void YahooAccount::slotGotConfInvite( const TQString & who, const TQString & roo
{
if( *it != m_session->userId() )
{
- m.append( TQString(", %1").arg( *it ) );
+ m.append( TQString(", %1").tqarg( *it ) );
myMembers.push_back( *it );
}
}
if( KMessageBox::Yes == KMessageBox::questionYesNo( Kopete::UI::Global::mainWidget(),
i18n("%1 has invited you to join a conference with %2.\n\nHis/her message: %3\n\nAccept?")
- .arg(who).arg(m).arg(msg), TQString(), i18n("Accept"), i18n("Ignore") ) )
+ .tqarg(who).tqarg(m).tqarg(msg), TQString(), i18n("Accept"), i18n("Ignore") ) )
{
m_session->joinConference( room, myMembers );
if( !m_conferences[room] )
@@ -1267,13 +1267,13 @@ void YahooAccount::prepareConference( const TQString &who )
char c = rand()%52;
room += (c > 25) ? c + 71 : c + 65;
}
- room = TQString("%1-%2--").arg(accountId()).arg(room);
+ room = TQString("%1-%2--").tqarg(accountId()).tqarg(room);
kdDebug(YAHOO_GEN_DEBUG) << "The generated roomname is: " << room << endl;
TQStringList buddies;
// FIXME: to check
- //QHash<TQString,Kopete::Contact*>::ConstIterator it, itEnd = contacts().constEnd();
+ //TQHash<TQString,Kopete::Contact*>::ConstIterator it, itEnd = contacts().constEnd();
//for( it = contacts().constBegin(); it != itEnd; ++it )
//{
// buddies.push_back( it.value()->contactId() );
@@ -1321,7 +1321,7 @@ void YahooAccount::slotConfUserDecline( const TQString &who, const TQString &roo
{
kdDebug(YAHOO_GEN_DEBUG) ;
- if( !m_conferences.contains( room ) )
+ if( !m_conferences.tqcontains( room ) )
{
kdDebug(YAHOO_GEN_DEBUG) << "Error. No chatsession for this conference found." << endl;
return;
@@ -1329,7 +1329,7 @@ void YahooAccount::slotConfUserDecline( const TQString &who, const TQString &roo
YahooConferenceChatSession *session = m_conferences[room];
- TQString body = i18n( "%1 has declined to join the conference: \"%2\"").arg( who ).arg( msg );
+ TQString body = i18n( "%1 has declined to join the conference: \"%2\"").tqarg( who ).tqarg( msg );
Kopete::Message message = Kopete::Message( contact( who ), myself(), body, Kopete::Message::Internal, Kopete::Message::PlainText );
session->appendMessage( message );
@@ -1338,7 +1338,7 @@ void YahooAccount::slotConfUserDecline( const TQString &who, const TQString &roo
void YahooAccount::slotConfUserJoin( const TQString &who, const TQString &room )
{
kdDebug(YAHOO_GEN_DEBUG) ;
- if( !m_conferences.contains( room ) )
+ if( !m_conferences.tqcontains( room ) )
{
kdDebug(YAHOO_GEN_DEBUG) << "Error. No chatsession for this conference found." << endl;
return;
@@ -1355,7 +1355,7 @@ void YahooAccount::slotConfUserJoin( const TQString &who, const TQString &room )
void YahooAccount::slotConfUserLeave( const TQString & who, const TQString &room )
{
kdDebug(YAHOO_GEN_DEBUG) ;
- if( !m_conferences.contains( room ) )
+ if( !m_conferences.tqcontains( room ) )
{
kdDebug(YAHOO_GEN_DEBUG) << "Error. No chatsession for this conference found." << endl;
return;
@@ -1390,7 +1390,7 @@ void YahooAccount::slotConfMessage( const TQString &who, const TQString &room, c
{
kdDebug(YAHOO_GEN_DEBUG) ;
- if( !m_conferences.contains( room ) )
+ if( !m_conferences.tqcontains( room ) )
{
kdDebug(YAHOO_GEN_DEBUG) << "Error. No chatsession for this conference found." << endl;
return;
@@ -1445,13 +1445,13 @@ void YahooAccount::slotGotYABRevision( long rev, bool merged )
if( merged )
{
kdDebug(YAHOO_GEN_DEBUG) << "Merge Revision received: " << rev << endl;
- configGroup()->writeEntry( "YABLastMerge", (Q_INT64)rev );
+ configGroup()->writeEntry( "YABLastMerge", (TQ_INT64)rev );
m_YABLastMerge = rev;
}
else
{
kdDebug(YAHOO_GEN_DEBUG) << "Remote Revision received: " << rev << endl;
- configGroup()->writeEntry( "YABLastRemoteRevision", (Q_INT64)rev );
+ configGroup()->writeEntry( "YABLastRemoteRevision", (TQ_INT64)rev );
m_YABLastRemoteRevision = rev;
}
}
@@ -1522,7 +1522,7 @@ void YahooAccount::slotGotFile( const TQString & who, const TQString & url , l
void YahooAccount::slotReceiveFileAccepted(Kopete::Transfer *transfer, const TQString& fileName)
{
kdDebug(YAHOO_GEN_DEBUG) ;
- if( !m_pendingFileTransfers.contains( transfer->info().internalId() ) )
+ if( !m_pendingFileTransfers.tqcontains( transfer->info().internalId() ) )
return;
m_pendingFileTransfers.remove( transfer->info().internalId() );
@@ -1531,7 +1531,7 @@ void YahooAccount::slotReceiveFileAccepted(Kopete::Transfer *transfer, const TQS
//Create directory if it doesn't already exist
TQDir dir;
TQString path = TQFileInfo( fileName ).dirPath();
- for( int i = 1; i <= path.contains('/'); ++i )
+ for( int i = 1; i <= path.tqcontains('/'); ++i )
{
if( !dir.exists( path.section( '/', 0, i ) ) )
{
@@ -1554,7 +1554,7 @@ void YahooAccount::slotReceiveFileAccepted(Kopete::Transfer *transfer, const TQS
void YahooAccount::slotReceiveFileRefused( const Kopete::FileTransferInfo& info )
{
- if( !m_pendingFileTransfers.contains( info.internalId() ) )
+ if( !m_pendingFileTransfers.tqcontains( info.internalId() ) )
return;
m_pendingFileTransfers.remove( info.internalId() );
@@ -1642,7 +1642,7 @@ void YahooAccount::slotMailNotify( const TQString& from, const TQString& subjec
if ( cnt > 0 && from.isEmpty() )
{
- TQObject::connect(KNotification::event( TQString::fromLatin1("yahoo_mail"), i18n( "You have one unread message in your Yahoo inbox.",
+ TQObject::connect(KNotification::event( TQString::tqfromLatin1("yahoo_mail"), i18n( "You have one unread message in your Yahoo inbox.",
"You have %n unread messages in your Yahoo inbox.", cnt ), TQPixmap() , 0 ),
TQT_SIGNAL(activated(unsigned int ) ) , this, TQT_SLOT( slotOpenInbox() ) );
@@ -1651,7 +1651,7 @@ void YahooAccount::slotMailNotify( const TQString& from, const TQString& subjec
else if ( cnt > 0 )
{ kdDebug(YAHOO_GEN_DEBUG) << "attempting to trigger event" << endl;
- TQObject::connect(KNotification::event( TQString::fromLatin1("yahoo_mail"), i18n( "You have a message from %1 in your Yahoo inbox. <br><br>Subject: %2").arg( from ).arg( subject ),
+ TQObject::connect(KNotification::event( TQString::tqfromLatin1("yahoo_mail"), i18n( "You have a message from %1 in your Yahoo inbox. <br><br>Subject: %2").tqarg( from ).tqarg( subject ),
TQPixmap() , 0 ), TQT_SIGNAL(activated(unsigned int ) ) , this, TQT_SLOT( slotOpenInbox() ) );
m_currentMailCount = cnt;
@@ -1676,12 +1676,12 @@ void YahooAccount::slotGotWebcamInvite( const TQString& who )
return;
}
- if( m_pendingWebcamInvites.contains( who ) )
+ if( m_pendingWebcamInvites.tqcontains( who ) )
return;
m_pendingWebcamInvites.append( who );
- if( KMessageBox::Yes == KMessageBox::questionYesNo( Kopete::UI::Global::mainWidget(), i18n("%1 has invited you to view his/her webcam. Accept?").arg( who ),
+ if( KMessageBox::Yes == KMessageBox::questionYesNo( Kopete::UI::Global::mainWidget(), i18n("%1 has invited you to view his/her webcam. Accept?").tqarg( who ),
TQString(), i18n("Accept"), i18n("Ignore") ) )
{
m_pendingWebcamInvites.remove( who );
@@ -1690,7 +1690,7 @@ void YahooAccount::slotGotWebcamInvite( const TQString& who )
}
void YahooAccount::slotWebcamNotAvailable( const TQString &who )
{
- KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, i18n("Webcam for %1 is not available.").arg(who), i18n( "Yahoo Plugin" ) );
+ KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, i18n("Webcam for %1 is not available.").tqarg(who), i18n( "Yahoo Plugin" ) );
}
void YahooAccount::slotGotWebcamImage( const TQString& who, const TQPixmap& image )
@@ -1723,7 +1723,7 @@ void YahooAccount::slotGotBuddyIconChecksum(const TQString &who, int checksum)
}
if ( checksum == kc->property( YahooProtocol::protocol()->iconCheckSum ).value().toInt() &&
- TQFile::exists( locateLocal( "appdata", "yahoopictures/"+ who.lower().replace(TQRegExp("[./~]"),"-") +".png" ) ) )
+ TQFile::exists( locateLocal( "appdata", "yahoopictures/"+ who.lower().tqreplace(TQRegExp("[./~]"),"-") +".png" ) ) )
{
kdDebug(YAHOO_GEN_DEBUG) << "Icon already exists. I will not request it again." << endl;
return;
@@ -1741,7 +1741,7 @@ void YahooAccount::slotGotBuddyIconInfo(const TQString &who, KURL url, int check
}
if ( checksum == kc->property( YahooProtocol::protocol()->iconCheckSum ).value().toInt() &&
- TQFile::exists( locateLocal( "appdata", "yahoopictures/"+ who.lower().replace(TQRegExp("[./~]"),"-") +".png" ) ))
+ TQFile::exists( locateLocal( "appdata", "yahoopictures/"+ who.lower().tqreplace(TQRegExp("[./~]"),"-") +".png" ) ))
{
kdDebug(YAHOO_GEN_DEBUG) << "Icon already exists. I will not download it again." << endl;
return;
@@ -1777,7 +1777,7 @@ void YahooAccount::setBuddyIcon( const KURL &url )
myself()->removeProperty( YahooProtocol::protocol()->iconExpire );
if ( m_session )
- m_session->setPictureStatus( Yahoo::NoPicture );
+ m_session->setPicturetqStatus( Yahoo::NoPicture );
}
else
{
@@ -1791,7 +1791,7 @@ void YahooAccount::setBuddyIcon( const KURL &url )
KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, i18n( "<qt>The selected buddy icon could not be opened. <br />Please set a new buddy icon.</qt>" ), i18n( "Yahoo Plugin" ) );
return;
}
- image = image.smoothScale( 96, 96, TQImage::ScaleMin );
+ image = image.smoothScale( 96, 96, TQ_ScaleMin );
if(image.width() < image.height())
{
image = image.copy((image.width()-image.height())/2, 0, 96, 96);
@@ -1827,7 +1827,7 @@ void YahooAccount::setBuddyIcon( const KURL &url )
configGroup()->writeEntry( "iconLocalUrl", newlocation );
if ( checksum != static_cast<uint>(myself()->property( YahooProtocol::protocol()->iconCheckSum ).value().toInt()) ||
- TQDateTime::currentDateTime().toTime_t() > expire )
+ TQDateTime::tqcurrentDateTime().toTime_t() > expire )
{
myself()->setProperty( YahooProtocol::protocol()->iconCheckSum, checksum );
configGroup()->writeEntry( "iconCheckSum", checksum );
@@ -1848,7 +1848,7 @@ void YahooAccount::slotBuddyIconChanged( const TQString &url, int expires )
myself()->setProperty( YahooProtocol::protocol()->iconExpire , expires );
configGroup()->writeEntry( "iconRemoteUrl", url );
configGroup()->writeEntry( "iconExpire", expires );
- m_session->setPictureStatus( Yahoo::Picture );
+ m_session->setPicturetqStatus( Yahoo::Picture );
m_session->sendPictureChecksum( TQString(), checksum );
}
}
@@ -1893,7 +1893,7 @@ void YahooAccount::slotWebcamViewerJoined( const TQString &viewer )
void YahooAccount::slotWebcamViewerRequest( const TQString &viewer )
{
if( KMessageBox::Yes == KMessageBox::questionYesNo( Kopete::UI::Global::mainWidget(), i18n("%1 wants to view your webcam. Grant access?")
- .arg(viewer), TQString::null, i18n("Accept"), i18n("Ignore") ) )
+ .tqarg(viewer), TQString(), i18n("Accept"), i18n("Ignore") ) )
m_session->grantWebcamAccess( viewer );
}
@@ -1928,52 +1928,52 @@ void YahooAccount::slotWebcamPaused( const TQString &who )
void YahooAccount::setOnlineStatus( const Kopete::OnlineStatus &status, const TQString &reason)
{
kdDebug(YAHOO_GEN_DEBUG) ;
- if ( myself()->onlineStatus().status() == Kopete::OnlineStatus::Offline &&
+ if ( myself()->onlinetqStatus().status() == Kopete::OnlineStatus::Offline &&
status.status() != Kopete::OnlineStatus::Offline )
{
if( !reason.isEmpty() )
m_session->setStatusMessageOnConnect( reason );
connect( status );
}
- else if ( myself()->onlineStatus().status() != Kopete::OnlineStatus::Offline &&
+ else if ( myself()->onlinetqStatus().status() != Kopete::OnlineStatus::Offline &&
status.status() == Kopete::OnlineStatus::Offline )
{
disconnect();
}
- else if ( myself()->onlineStatus().status() != Kopete::OnlineStatus::Offline &&
+ else if ( myself()->onlinetqStatus().status() != Kopete::OnlineStatus::Offline &&
status.internalStatus() == 2 && !reason.isEmpty())
{
- slotGoStatus( 99, reason );
+ slotGotqStatus( 99, reason );
}
- else if ( myself()->onlineStatus().status() != Kopete::OnlineStatus::Offline &&
+ else if ( myself()->onlinetqStatus().status() != Kopete::OnlineStatus::Offline &&
status.internalStatus() == 99 && reason.isEmpty())
{
- slotGoStatus( 2, reason );
+ slotGotqStatus( 2, reason );
}
- else if ( myself()->onlineStatus().status() != Kopete::OnlineStatus::Offline )
+ else if ( myself()->onlinetqStatus().status() != Kopete::OnlineStatus::Offline )
{
- slotGoStatus( status.internalStatus(), reason );
+ slotGotqStatus( status.internalStatus(), reason );
}
}
/* FIXME: not ported yet
void YahooAccount::setStatusMessage(const Kopete::StatusMessage &statusMessage)
{
- int currentStatus = myself()->onlineStatus().internalStatus();
- m_session->changeStatus( Yahoo::Status( currentStatus ), statusMessage.message(),
- (currentStatus == Yahoo::StatusAvailable)? Yahoo::StatusTypeAvailable : Yahoo::StatusTypeAway );
+ int currenttqStatus = myself()->onlinetqStatus().internalStatus();
+ m_session->changetqStatus( Yahoo::tqStatus( currenttqStatus ), statusMessage.message(),
+ (currenttqStatus == Yahoo::StatusAvailable)? Yahoo::StatusTypeAvailable : Yahoo::StatusTypeAway );
myself()->setStatusMessage( statusMessage );
}
*/
void YahooAccount::slotOpenInbox()
{
- KRun::runURL( KURL( TQString::fromLatin1("http://mail.yahoo.com/") ) , "text/html" );
+ KRun::runURL( KURL( TQString::tqfromLatin1("http://mail.yahoo.com/") ) , "text/html" );
}
void YahooAccount::slotOpenYAB()
{
- KRun::runURL( KURL( TQString::fromLatin1("http://address.yahoo.com/") ) , "text/html" );
+ KRun::runURL( KURL( TQString::tqfromLatin1("http://address.yahoo.com/") ) , "text/html" );
}
void YahooAccount::slotEditOwnYABEntry()