diff options
Diffstat (limited to 'kopete/protocols/yahoo/yahoocontact.cpp')
-rw-r--r-- | kopete/protocols/yahoo/yahoocontact.cpp | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/kopete/protocols/yahoo/yahoocontact.cpp b/kopete/protocols/yahoo/yahoocontact.cpp index d5f79250..d26eb739 100644 --- a/kopete/protocols/yahoo/yahoocontact.cpp +++ b/kopete/protocols/yahoo/yahoocontact.cpp @@ -39,9 +39,9 @@ #include "sendfiletask.h" // QT Includes -#include <qregexp.h> -#include <qfile.h> -#include <qradiobutton.h> +#include <tqregexp.h> +#include <tqfile.h> +#include <tqradiobutton.h> // KDE Includes #include <kdebug.h> @@ -60,7 +60,7 @@ #include <kstandarddirs.h> #include <kfiledialog.h> -YahooContact::YahooContact( YahooAccount *account, const QString &userId, const QString &fullName, Kopete::MetaContact *metaContact ) +YahooContact::YahooContact( YahooAccount *account, const TQString &userId, const TQString &fullName, Kopete::MetaContact *metaContact ) : Kopete::Contact( account, userId, metaContact ) { //kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << endl; @@ -99,7 +99,7 @@ YahooContact::~YahooContact() m_YABEntry = 0L; } -QString YahooContact::userId() const +TQString YahooContact::userId() const { return m_userId; } @@ -113,7 +113,7 @@ void YahooContact::setOnlineStatus(const Kopete::OnlineStatus &status) (status.weight()==0) ? 0 : (status.weight() -1) , protocol() , status.internalStatus()+1000 , - status.overlayIcons() + QStringList("yahoo_stealthed") , + status.overlayIcons() + TQStringList("yahoo_stealthed") , i18n("%1|Stealthed").arg( status.description() ) ) ); } else if( !m_stealthed && status.internalStatus() > 999 )// Stealthed -> Not Stealthed @@ -136,7 +136,7 @@ bool YahooContact::stealthed() return m_stealthed; } -void YahooContact::serialize(QMap<QString, QString> &serializedData, QMap<QString, QString> &addressBookData) +void YahooContact::serialize(TQMap<TQString, TQString> &serializedData, TQMap<TQString, TQString> &addressBookData) { //kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << endl; @@ -173,7 +173,7 @@ void YahooContact::sync(unsigned int flags) } else { - QString newGroup = metaContact()->groups().first()->displayName(); + TQString newGroup = metaContact()->groups().first()->displayName(); if ( flags & Kopete::Contact::MovedBetweenGroup ) { kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << "contact changed groups. moving on server" << endl; @@ -206,22 +206,22 @@ Kopete::ChatSession *YahooContact::manager( Kopete::Contact::CanCreateFlags canC Kopete::ContactPtrList m_them; m_them.append( this ); m_manager = new YahooChatSession( protocol(), account()->myself(), m_them ); - connect( m_manager, SIGNAL( destroyed() ), this, SLOT( slotChatSessionDestroyed() ) ); - connect( m_manager, SIGNAL( messageSent ( Kopete::Message&, Kopete::ChatSession* ) ), this, SLOT( slotSendMessage( Kopete::Message& ) ) ); - connect( m_manager, SIGNAL( myselfTyping( bool) ), this, SLOT( slotTyping( bool ) ) ); - connect( m_account, SIGNAL( receivedTypingMsg( const QString &, bool ) ), m_manager, SLOT( receivedTypingMsg( const QString&, bool ) ) ); - connect( this, SIGNAL(displayPictureChanged()), m_manager, SLOT(slotDisplayPictureChanged())); + connect( m_manager, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( slotChatSessionDestroyed() ) ); + connect( m_manager, TQT_SIGNAL( messageSent ( Kopete::Message&, Kopete::ChatSession* ) ), this, TQT_SLOT( slotSendMessage( Kopete::Message& ) ) ); + connect( m_manager, TQT_SIGNAL( myselfTyping( bool) ), this, TQT_SLOT( slotTyping( bool ) ) ); + connect( m_account, TQT_SIGNAL( receivedTypingMsg( const TQString &, bool ) ), m_manager, TQT_SLOT( receivedTypingMsg( const TQString&, bool ) ) ); + connect( this, TQT_SIGNAL(displayPictureChanged()), m_manager, TQT_SLOT(slotDisplayPictureChanged())); } return m_manager; } -QString YahooContact::prepareMessage( const QString &messageText ) +TQString YahooContact::prepareMessage( const TQString &messageText ) { // Yahoo does not understand XML/HTML message data, so send plain text // instead. (Yahoo has its own format for "rich text".) - QString newMsg( messageText ); - QRegExp regExp; + TQString newMsg( messageText ); + TQRegExp regExp; int pos = 0; regExp.setMinimal( true ); @@ -232,7 +232,7 @@ QString YahooContact::prepareMessage( const QString &messageText ) pos = regExp.search( messageText, pos ); if ( pos >= 0 ) { pos += regExp.matchedLength(); - newMsg.replace( regExp, QString::fromLatin1("<span\\1font-weight:600\\2>\033[1m\\3\033[x1m</span>" ) ); + newMsg.replace( regExp, TQString::fromLatin1("<span\\1font-weight:600\\2>\033[1m\\3\033[x1m</span>" ) ); } } @@ -243,7 +243,7 @@ QString YahooContact::prepareMessage( const QString &messageText ) pos = regExp.search( messageText, pos ); if ( pos >= 0 ) { pos += regExp.matchedLength(); - newMsg.replace( regExp, QString::fromLatin1("<span\\1text-decoration:underline\\2>\033[4m\\3\033[x4m</span>" ) ); + newMsg.replace( regExp, TQString::fromLatin1("<span\\1text-decoration:underline\\2>\033[4m\\3\033[x4m</span>" ) ); } } @@ -254,7 +254,7 @@ QString YahooContact::prepareMessage( const QString &messageText ) pos = regExp.search( messageText, pos ); if ( pos >= 0 ) { pos += regExp.matchedLength(); - newMsg.replace( regExp, QString::fromLatin1("<span\\1font-style:italic\\2>\033[2m\\3\033[x2m</span>" ) ); + newMsg.replace( regExp, TQString::fromLatin1("<span\\1font-style:italic\\2>\033[2m\\3\033[x2m</span>" ) ); } } @@ -265,7 +265,7 @@ QString YahooContact::prepareMessage( const QString &messageText ) pos = regExp.search( messageText, pos ); if ( pos >= 0 ) { pos += regExp.matchedLength(); - newMsg.replace( regExp, QString::fromLatin1("<span\\1\\3>\033[#\\2m\\4\033[#000000m</span>" ) ); + newMsg.replace( regExp, TQString::fromLatin1("<span\\1\\3>\033[#\\2m\\4\033[#000000m</span>" ) ); } } @@ -276,7 +276,7 @@ QString YahooContact::prepareMessage( const QString &messageText ) pos = regExp.search( messageText, pos ); if ( pos >= 0 ) { pos += regExp.matchedLength(); - newMsg.replace( regExp, QString::fromLatin1("<span\\1\\3><font face=\"\\2\">\\4</span>" ) ); + newMsg.replace( regExp, TQString::fromLatin1("<span\\1\\3><font face=\"\\2\">\\4</span>" ) ); } } @@ -287,7 +287,7 @@ QString YahooContact::prepareMessage( const QString &messageText ) pos = regExp.search( messageText, pos ); if ( pos >= 0 ) { pos += regExp.matchedLength(); - newMsg.replace( regExp, QString::fromLatin1("<span\\1\\3><font size=\"\\2\">\\4</span>" ) ); + newMsg.replace( regExp, TQString::fromLatin1("<span\\1\\3><font size=\"\\2\">\\4</span>" ) ); } } @@ -298,18 +298,18 @@ QString YahooContact::prepareMessage( const QString &messageText ) pos = regExp.search( messageText, pos ); if ( pos >= 0 ) { pos += regExp.matchedLength(); - newMsg.replace( regExp, QString::fromLatin1("\\2") ); + newMsg.replace( regExp, TQString::fromLatin1("\\2") ); } } // convert escaped chars - newMsg.replace( QString::fromLatin1( ">" ), QString::fromLatin1( ">" ) ); - newMsg.replace( QString::fromLatin1( "<" ), QString::fromLatin1( "<" ) ); - newMsg.replace( QString::fromLatin1( """ ), QString::fromLatin1( "\"" ) ); - newMsg.replace( QString::fromLatin1( " " ), QString::fromLatin1( " " ) ); - newMsg.replace( QString::fromLatin1( "&" ), QString::fromLatin1( "&" ) ); - newMsg.replace( QString::fromLatin1( "<br />" ), QString::fromLatin1( "\r" ) ); - newMsg.replace( QString::fromLatin1( "<br/>" ), QString::fromLatin1( "\r" ) ); + newMsg.replace( TQString::fromLatin1( ">" ), TQString::fromLatin1( ">" ) ); + newMsg.replace( TQString::fromLatin1( "<" ), TQString::fromLatin1( "<" ) ); + newMsg.replace( TQString::fromLatin1( """ ), TQString::fromLatin1( "\"" ) ); + newMsg.replace( TQString::fromLatin1( " " ), TQString::fromLatin1( " " ) ); + newMsg.replace( TQString::fromLatin1( "&" ), TQString::fromLatin1( "&" ) ); + newMsg.replace( TQString::fromLatin1( "<br />" ), TQString::fromLatin1( "\r" ) ); + newMsg.replace( TQString::fromLatin1( "<br/>" ), TQString::fromLatin1( "\r" ) ); return newMsg; } @@ -318,7 +318,7 @@ void YahooContact::slotSendMessage( Kopete::Message &message ) { kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << endl; - QString messageText = message.escapedBody(); + TQString messageText = message.escapedBody(); kdDebug(YAHOO_GEN_DEBUG) << "Original message: " << messageText << endl; messageText = prepareMessage( messageText ); kdDebug(YAHOO_GEN_DEBUG) << "Converted message: " << messageText << endl; @@ -339,10 +339,10 @@ void YahooContact::slotSendMessage( Kopete::Message &message ) manager(Kopete::Contact::CanCreate)->messageSucceeded(); } -void YahooContact::sendFile( const KURL &sourceURL, const QString &fileName, uint fileSize ) +void YahooContact::sendFile( const KURL &sourceURL, const TQString &fileName, uint fileSize ) { Kopete::TransferManager::transferManager()->sendFile( sourceURL, fileName, fileSize, - false, this, SLOT(slotSendFile( const KURL & )) ); + false, this, TQT_SLOT(slotSendFile( const KURL & )) ); } void YahooContact::slotTyping(bool isTyping_ ) @@ -361,13 +361,13 @@ void YahooContact::slotChatSessionDestroyed() m_sessionActive = false; } -QPtrList<KAction> *YahooContact::customContextMenuActions() +TQPtrList<KAction> *YahooContact::customContextMenuActions() { - QPtrList<KAction> *actionCollection = new QPtrList<KAction>(); + TQPtrList<KAction> *actionCollection = new TQPtrList<KAction>(); if ( !m_webcamAction ) { m_webcamAction = new KAction( i18n( "View &Webcam" ), "webcamreceive", KShortcut(), - this, SLOT( requestWebcam() ), this, "view_webcam" ); + this, TQT_SLOT( requestWebcam() ), this, "view_webcam" ); } if ( isReachable() ) m_webcamAction->setEnabled( true ); @@ -378,7 +378,7 @@ QPtrList<KAction> *YahooContact::customContextMenuActions() if( !m_inviteWebcamAction ) { m_inviteWebcamAction = new KAction( i18n( "Invite to view your Webcam" ), "webcamsend", KShortcut(), - this, SLOT( inviteWebcam() ), this, "invite_webcam" ); + this, TQT_SLOT( inviteWebcam() ), this, "invite_webcam" ); } if ( isReachable() ) m_inviteWebcamAction->setEnabled( true ); @@ -388,7 +388,7 @@ QPtrList<KAction> *YahooContact::customContextMenuActions() if ( !m_buzzAction ) { - m_buzzAction = new KAction( i18n( "&Buzz Contact" ), "bell", KShortcut(), this, SLOT( buzzContact() ), this, "buzz_contact"); + m_buzzAction = new KAction( i18n( "&Buzz Contact" ), "bell", KShortcut(), this, TQT_SLOT( buzzContact() ), this, "buzz_contact"); } if ( isReachable() ) m_buzzAction->setEnabled( true ); @@ -398,7 +398,7 @@ QPtrList<KAction> *YahooContact::customContextMenuActions() if ( !m_stealthAction ) { - m_stealthAction = new KAction( i18n( "&Stealth Setting" ), "yahoo_stealthed", KShortcut(), this, SLOT( stealthContact() ), this, "stealth_contact"); + m_stealthAction = new KAction( i18n( "&Stealth Setting" ), "yahoo_stealthed", KShortcut(), this, TQT_SLOT( stealthContact() ), this, "stealth_contact"); } if ( isReachable() ) m_stealthAction->setEnabled( true ); @@ -408,7 +408,7 @@ QPtrList<KAction> *YahooContact::customContextMenuActions() if ( !m_inviteConferenceAction ) { - m_inviteConferenceAction = new KAction( i18n( "&Invite to Conference" ), "kontact_contacts", KShortcut(), this, SLOT( inviteConference() ), this, "invite_conference"); + m_inviteConferenceAction = new KAction( i18n( "&Invite to Conference" ), "kontact_contacts", KShortcut(), this, TQT_SLOT( inviteConference() ), this, "invite_conference"); } if ( isReachable() ) m_inviteConferenceAction->setEnabled( true ); @@ -418,7 +418,7 @@ QPtrList<KAction> *YahooContact::customContextMenuActions() if ( !m_profileAction ) { - m_profileAction = new KAction( i18n( "&View Yahoo Profile" ), "kontact_notes", KShortcut(), this, SLOT( slotUserProfile() ), this, "profile_contact"); + m_profileAction = new KAction( i18n( "&View Yahoo Profile" ), "kontact_notes", KShortcut(), this, TQT_SLOT( slotUserProfile() ), this, "profile_contact"); } m_profileAction->setEnabled( true ); actionCollection->append( m_profileAction ); @@ -440,14 +440,14 @@ void YahooContact::slotUserInfo() dlg->setData( *m_YABEntry ); dlg->setAccountConnected( m_account->isConnected() ); dlg->show(); - QObject::connect( dlg, SIGNAL(saveYABEntry( YABEntry & )), m_account, SLOT(slotSaveYABEntry( YABEntry & ))); + TQObject::connect( dlg, TQT_SIGNAL(saveYABEntry( YABEntry & )), m_account, TQT_SLOT(slotSaveYABEntry( YABEntry & ))); } void YahooContact::slotUserProfile() { kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << endl; - QString profileSiteString = QString::fromLatin1("http://profiles.yahoo.com/") + userId(); + TQString profileSiteString = TQString::fromLatin1("http://profiles.yahoo.com/") + userId(); KRun::runURL( KURL( profileSiteString ) , "text/html" ); } @@ -477,7 +477,7 @@ void YahooContact::stealthContact() // Show dialog - if ( stealthSettingDialog->exec() == QDialog::Rejected ) + if ( stealthSettingDialog->exec() == TQDialog::Rejected ) { stealthSettingDialog->delayedDestruct(); return; @@ -518,7 +518,7 @@ void YahooContact::buzzContact() Kopete::Message msg = Kopete::Message( manager(Kopete::Contact::CannotCreate)->myself() , manager(Kopete::Contact::CannotCreate)->members(), i18n("Buzzz!!!"), Kopete::Message::Outbound, Kopete::Message::PlainText, - QString::null , Kopete::Message::TypeAction); + TQString::null , Kopete::Message::TypeAction); view->appendMessage( msg ); } } @@ -530,7 +530,7 @@ void YahooContact::sendBuddyIconChecksum( int checksum ) } -void YahooContact::sendBuddyIconInfo( const QString &url, int checksum ) +void YahooContact::sendBuddyIconInfo( const TQString &url, int checksum ) { kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << endl; m_account->yahooSession()->sendPictureInformation( m_userId, url, checksum ); @@ -545,14 +545,14 @@ void YahooContact::sendBuddyIconUpdate( int type ) } // new version -void YahooContact::setDisplayPicture(const QByteArray &data, int checksum) +void YahooContact::setDisplayPicture(const TQByteArray &data, int checksum) { kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << data.size() << endl; - QString newlocation = locateLocal( "appdata", "yahoopictures/"+ contactId().lower().replace(QRegExp("[./~]"),"-") +".png" ) ; + TQString newlocation = locateLocal( "appdata", "yahoopictures/"+ contactId().lower().replace(TQRegExp("[./~]"),"-") +".png" ) ; setProperty( YahooProtocol::protocol()->iconCheckSum, checksum ); - QFile f( newlocation ); + TQFile f( newlocation ); if (!f.open( IO_WriteOnly )) { kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << "Saving of " << newlocation << " failed!" << endl; @@ -561,7 +561,7 @@ void YahooContact::setDisplayPicture(const QByteArray &data, int checksum) f.writeBlock(data.data(), data.size()); f.close(); - setProperty( Kopete::Global::Properties::self()->photo(), QString() ); + setProperty( Kopete::Global::Properties::self()->photo(), TQString() ); setProperty( Kopete::Global::Properties::self()->photo() , newlocation ); emit displayPictureChanged(); @@ -590,8 +590,8 @@ const YABEntry *YahooContact::yabEntry() void YahooContact::slotEmitDisplayPictureChanged() { kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << endl; - QString newlocation=locateLocal( "appdata", "yahoopictures/"+ contactId().lower().replace(QRegExp("[./~]"),"-") +".png" ) ; - setProperty( Kopete::Global::Properties::self()->photo(), QString::null ); + TQString newlocation=locateLocal( "appdata", "yahoopictures/"+ contactId().lower().replace(TQRegExp("[./~]"),"-") +".png" ) ; + setProperty( Kopete::Global::Properties::self()->photo(), TQString::null ); setProperty( Kopete::Global::Properties::self()->photo() , newlocation ); emit displayPictureChanged(); } @@ -613,7 +613,7 @@ void YahooContact::inviteWebcam() m_account->yahooSession()->sendWebcamInvite( m_userId ); } -void YahooContact::receivedWebcamImage( const QPixmap& image ) +void YahooContact::receivedWebcamImage( const TQPixmap& image ) { if( !m_webcamDialog ) initWebcamViewer(); @@ -639,19 +639,19 @@ void YahooContact::initWebcamViewer() if ( !m_webcamDialog ) { m_webcamDialog = new YahooWebcamDialog( userId(), Kopete::UI::Global::mainWidget() ); -// QObject::connect( m_webcamDialog, SIGNAL( closeClicked() ), this, SLOT( closeWebcamDialog() ) ); +// TQObject::connect( m_webcamDialog, TQT_SIGNAL( closeClicked() ), this, TQT_SLOT( closeWebcamDialog() ) ); - QObject::connect( this, SIGNAL( signalWebcamClosed( int ) ), - m_webcamDialog, SLOT( webcamClosed( int ) ) ); + TQObject::connect( this, TQT_SIGNAL( signalWebcamClosed( int ) ), + m_webcamDialog, TQT_SLOT( webcamClosed( int ) ) ); - QObject::connect( this, SIGNAL( signalWebcamPaused() ), - m_webcamDialog, SLOT( webcamPaused() ) ); + TQObject::connect( this, TQT_SIGNAL( signalWebcamPaused() ), + m_webcamDialog, TQT_SLOT( webcamPaused() ) ); - QObject::connect( this, SIGNAL ( signalReceivedWebcamImage( const QPixmap& ) ), - m_webcamDialog, SLOT( newImage( const QPixmap& ) ) ); + TQObject::connect( this, TQT_SIGNAL ( signalReceivedWebcamImage( const TQPixmap& ) ), + m_webcamDialog, TQT_SLOT( newImage( const TQPixmap& ) ) ); - QObject::connect( m_webcamDialog, SIGNAL ( closingWebcamDialog ( ) ), - this, SLOT ( closeWebcamDialog ( ) ) ); + TQObject::connect( m_webcamDialog, TQT_SIGNAL ( closingWebcamDialog ( ) ), + this, TQT_SLOT ( closeWebcamDialog ( ) ) ); } m_webcamDialog->show(); } @@ -673,17 +673,17 @@ void YahooContact::requestWebcam() void YahooContact::closeWebcamDialog() { - QObject::disconnect( this, SIGNAL( signalWebcamClosed( int ) ), - m_webcamDialog, SLOT( webcamClosed( int ) ) ); + TQObject::disconnect( this, TQT_SIGNAL( signalWebcamClosed( int ) ), + m_webcamDialog, TQT_SLOT( webcamClosed( int ) ) ); - QObject::disconnect( this, SIGNAL( signalWebcamPaused() ), - m_webcamDialog, SLOT( webcamPaused( ) ) ); + TQObject::disconnect( this, TQT_SIGNAL( signalWebcamPaused() ), + m_webcamDialog, TQT_SLOT( webcamPaused( ) ) ); - QObject::disconnect( this, SIGNAL ( signalReceivedWebcamImage( const QPixmap& ) ), - m_webcamDialog, SLOT( newImage( const QPixmap& ) ) ); + TQObject::disconnect( this, TQT_SIGNAL ( signalReceivedWebcamImage( const TQPixmap& ) ), + m_webcamDialog, TQT_SLOT( newImage( const TQPixmap& ) ) ); - QObject::disconnect( m_webcamDialog, SIGNAL ( closingWebcamDialog ( ) ), - this, SLOT ( closeWebcamDialog ( ) ) ); + TQObject::disconnect( m_webcamDialog, TQT_SIGNAL ( closingWebcamDialog ( ) ), + this, TQT_SLOT ( closeWebcamDialog ( ) ) ); if( m_receivingWebcam ) m_account->yahooSession()->closeWebcam( contactId() ); m_webcamDialog->delayedDestruct(); @@ -826,8 +826,8 @@ void YahooContact::readYABEntry() m_YABEntry->workURL = property( YahooProtocol::protocol()->propWorkURL ).value().toString(); // Miscellanous - m_YABEntry->birthday = QDate::fromString( property( YahooProtocol::protocol()->propBirthday ).value().toString(), Qt::ISODate ); - m_YABEntry->anniversary = QDate::fromString( property( YahooProtocol::protocol()->propAnniversary ).value().toString(), Qt::ISODate ); + m_YABEntry->birthday = TQDate::fromString( property( YahooProtocol::protocol()->propBirthday ).value().toString(), Qt::ISODate ); + m_YABEntry->anniversary = TQDate::fromString( property( YahooProtocol::protocol()->propAnniversary ).value().toString(), Qt::ISODate ); m_YABEntry->notes = property( YahooProtocol::protocol()->propNotes ).value().toString(); m_YABEntry->additional1 = property( YahooProtocol::protocol()->propAdditional1 ).value().toString(); m_YABEntry->additional2 = property( YahooProtocol::protocol()->propAdditional2 ).value().toString(); |