From 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 22 Jun 2011 00:30:31 +0000 Subject: TQt4 port kdenetwork This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/protocols/oscar/aim/aimaccount.cpp | 110 +++++++++++++++--------------- 1 file changed, 55 insertions(+), 55 deletions(-) (limited to 'kopete/protocols/oscar/aim/aimaccount.cpp') diff --git a/kopete/protocols/oscar/aim/aimaccount.cpp b/kopete/protocols/oscar/aim/aimaccount.cpp index 9a6ec9de..1f0269c8 100644 --- a/kopete/protocols/oscar/aim/aimaccount.cpp +++ b/kopete/protocols/oscar/aim/aimaccount.cpp @@ -118,7 +118,7 @@ void AIMMyselfContact::sendMessage( Kopete::Message& message, Kopete::ChatSessio return; //okay, now we need to change the message.escapedBody from real HTML to aimhtml. //looking right now for docs on that "format". - //looks like everything except for alignment codes comes in the format of spans + //looks like everything except for tqalignment codes comes in the format of spans //font-style:italic -> //font-weight:600 -> (anything > 400 should be , 400 is not bold) @@ -127,53 +127,53 @@ void AIMMyselfContact::sendMessage( Kopete::Message& message, Kopete::ChatSessio //font-size:xxpt -> s=message.escapedBody(); - s.replace ( TQRegExp( TQString::fromLatin1("([^<]*)")), - TQString::fromLatin1("")); + s.tqreplace ( TQRegExp( TQString::tqfromLatin1("([^<]*)")), + TQString::tqfromLatin1("")); - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); + s.tqreplace ( TQRegExp( TQString::tqfromLatin1("")), + TQString::tqfromLatin1("")); - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); + s.tqreplace ( TQRegExp( TQString::tqfromLatin1("")), + TQString::tqfromLatin1("")); - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); + s.tqreplace ( TQRegExp( TQString::tqfromLatin1("")), + TQString::tqfromLatin1("")); - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); + s.tqreplace ( TQRegExp( TQString::tqfromLatin1("")), + TQString::tqfromLatin1("")); - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); + s.tqreplace ( TQRegExp( TQString::tqfromLatin1("")), + TQString::tqfromLatin1("")); - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("")); + s.tqreplace ( TQRegExp( TQString::tqfromLatin1("")), + TQString::tqfromLatin1("")); - s.replace ( TQRegExp( TQString::fromLatin1("")), - TQString::fromLatin1("\\2")); + s.tqreplace ( TQRegExp( TQString::tqfromLatin1("")), + TQString::tqfromLatin1("\\2")); //okay now change the to //0-9 are size 1 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); + s.tqreplace ( TQRegExp ( TQString::tqfromLatin1("")), + TQString::tqfromLatin1("")); //10-11 are size 2 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); + s.tqreplace ( TQRegExp ( TQString::tqfromLatin1("")), + TQString::tqfromLatin1("")); //12-13 are size 3 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); + s.tqreplace ( TQRegExp ( TQString::tqfromLatin1("")), + TQString::tqfromLatin1("")); //14-16 are size 4 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); + s.tqreplace ( TQRegExp ( TQString::tqfromLatin1("")), + TQString::tqfromLatin1("")); //17-22 are size 5 - s.replace ( TQRegExp ( TQString::fromLatin1("")), - TQString::fromLatin1("")); + s.tqreplace ( TQRegExp ( TQString::tqfromLatin1("")), + TQString::tqfromLatin1("")); //23-29 are size 6 - s.replace ( TQRegExp ( TQString::fromLatin1("")),TQString::fromLatin1("")); + s.tqreplace ( TQRegExp ( TQString::tqfromLatin1("")),TQString::tqfromLatin1("")); //30- (and any I missed) are size 7 - s.replace ( TQRegExp ( TQString::fromLatin1("")),TQString::fromLatin1("")); + s.tqreplace ( TQRegExp ( TQString::tqfromLatin1("")),TQString::tqfromLatin1("")); - s.replace ( TQRegExp ( TQString::fromLatin1("")), TQString::fromLatin1("
") ); + s.tqreplace ( TQRegExp ( TQString::tqfromLatin1("")), TQString::tqfromLatin1("
") ); kdDebug(14190) << k_funcinfo << "sending " << s << endl; @@ -200,13 +200,13 @@ void AIMMyselfContact::sendMessage( Kopete::Message& message, Kopete::ChatSessio } -AIMAccount::AIMAccount(Kopete::Protocol *parent, TQString accountID, const char *name) - : OscarAccount(parent, accountID, name, false) +AIMAccount::AIMAccount(Kopete::Protocol *tqparent, TQString accountID, const char *name) + : OscarAccount(tqparent, accountID, name, false) { kdDebug(14152) << k_funcinfo << accountID << ": Called."<< endl; AIMMyselfContact* mc = new AIMMyselfContact( this ); setMyself( mc ); - myself()->setOnlineStatus( static_cast( parent )->statusOffline ); + myself()->setOnlineStatus( static_cast( tqparent )->statusOffline ); TQString profile = configGroup()->readEntry( "Profile", i18n( "Visit the Kopete website at http://kopete.kde.org") ); mc->setOwnProfile( profile ); @@ -235,9 +235,9 @@ AIMAccount::~AIMAccount() { } -OscarContact *AIMAccount::createNewContact( const TQString &contactId, Kopete::MetaContact *parentContact, const SSI& ssiItem ) +OscarContact *AIMAccount::createNewContact( const TQString &contactId, Kopete::MetaContact *tqparentContact, const SSI& ssiItem ) { - AIMContact* contact = new AIMContact( this, contactId, parentContact, TQString::null, ssiItem ); + AIMContact* contact = new AIMContact( this, contactId, tqparentContact, TQString(), ssiItem ); if ( !ssiItem.alias().isEmpty() ) contact->setProperty( Kopete::Global::Properties::self()->nickName(), ssiItem.alias() ); @@ -280,7 +280,7 @@ TQString AIMAccount::sanitizedMessage( const TQString& message ) continue; if ( fontEl.hasAttribute( "back" ) ) { - kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Found attribute to replace. Doing replacement" << endl; + kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Found attribute to tqreplace. Doing replacement" << endl; TQString backgroundColor = fontEl.attribute( "back" ); backgroundColor.insert( 0, "background-color: " ); backgroundColor.append( ';' ); @@ -300,13 +300,13 @@ KActionMenu* AIMAccount::actionMenu() // mActionMenu is managed by Kopete::Account. It is deleted when // it is no longer shown, so we can (safely) just make a new one here. KActionMenu *mActionMenu = new KActionMenu(accountId(), - myself()->onlineStatus().iconFor( this ), this, "AIMAccount::mActionMenu"); + myself()->onlinetqStatus().iconFor( this ), this, "AIMAccount::mActionMenu"); AIMProtocol *p = AIMProtocol::protocol(); TQString accountNick = myself()->property( Kopete::Global::Properties::self()->nickName() ).value().toString(); - mActionMenu->popupMenu()->insertTitle( myself()->onlineStatus().iconFor( myself() ), - i18n( "%2 <%1>" ).arg( accountId(), accountNick )); + mActionMenu->popupMenu()->insertTitle( myself()->onlinetqStatus().iconFor( myself() ), + i18n( "%2 <%1>" ).tqarg( accountId(), accountNick )); mActionMenu->insert( new KAction( i18n("Online"), p->statusOnline.iconFor( this ), 0, this, TQT_SLOT( slotGoOnline() ), mActionMenu, "AIMAccount::mActionOnline") ); @@ -322,7 +322,7 @@ KActionMenu* AIMAccount::actionMenu() mActionMenu->insert( mActionOffline ); mActionMenu->popupMenu()->insertSeparator(); - KAction* m_joinChatAction = new KAction( i18n( "Join Chat..." ), TQString::null, 0, this, + KAction* m_joinChatAction = new KAction( i18n( "Join Chat..." ), TQString(), 0, this, TQT_SLOT( slotJoinChat() ), mActionMenu, "join_a_chat" ); mActionMenu->insert( new KToggleAction( i18n( "Set Visibility..." ), 0, 0, @@ -344,16 +344,16 @@ void AIMAccount::setAway(bool away, const TQString &awayReason) // kdDebug(14152) << k_funcinfo << accountId() << "reason is " << awayReason << endl; if ( away ) { - engine()->setStatus( Client::Away, awayReason ); + engine()->settqStatus( Client::Away, awayReason ); AIMMyselfContact* me = static_cast ( myself() ); me->setLastAwayMessage(awayReason); me->setProperty( Kopete::Global::Properties::self()->awayMessage(), awayReason ); } else { - engine()->setStatus( Client::Online ); + engine()->settqStatus( Client::Online ); AIMMyselfContact* me = static_cast ( myself() ); - me->setLastAwayMessage(TQString::null); + me->setLastAwayMessage(TQString()); me->removeProperty( Kopete::Global::Properties::self()->awayMessage() ); } } @@ -374,7 +374,7 @@ void AIMAccount::setUserProfile(const TQString &profile) AIMMyselfContact* aimmc = dynamic_cast( myself() ); if ( aimmc ) aimmc->setOwnProfile( profile ); - configGroup()->writeEntry( TQString::fromLatin1( "Profile" ), profile ); + configGroup()->writeEntry( TQString::tqfromLatin1( "Profile" ), profile ); } void AIMAccount::slotEditInfo() @@ -451,7 +451,7 @@ void AIMAccount::slotBuddyIconChanged() iconFile.open( IO_ReadOnly ); KMD5 iconHash; - iconHash.update( iconFile ); + iconHash.update( *TQT_TQIODEVICE(&iconFile) ); kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "hash is :" << iconHash.hexDigest() << endl; //find old item, create updated item @@ -532,13 +532,13 @@ void AIMAccount::slotJoinChat() void AIMAccount::slotGoOnline() { - if ( myself()->onlineStatus().status() == Kopete::OnlineStatus::Away ) + if ( myself()->onlinetqStatus().status() == Kopete::OnlineStatus::Away ) { kdDebug(14152) << k_funcinfo << accountId() << " was away. welcome back." << endl; - engine()->setStatus( Client::Online ); + engine()->settqStatus( Client::Online ); myself()->removeProperty( Kopete::Global::Properties::self()->awayMessage() ); } - else if ( myself()->onlineStatus().status() == Kopete::OnlineStatus::Offline ) + else if ( myself()->onlinetqStatus().status() == Kopete::OnlineStatus::Offline ) { kdDebug(14152) << k_funcinfo << accountId() << " was offline. time to connect" << endl; OscarAccount::connect(); @@ -597,16 +597,16 @@ void AIMAccount::disconnected( DisconnectReason reason ) void AIMAccount::messageReceived( const Oscar::Message& message ) { kdDebug(14152) << k_funcinfo << " Got a message, calling OscarAccount::messageReceived" << endl; - // Want to call the parent to do everything else + // Want to call the tqparent to do everything else if ( message.type() != 0x0003 ) { OscarAccount::messageReceived(message); // Check to see if our status is away, and send an away message - // Might be duplicate code from the parent class to get some needed information + // Might be duplicate code from the tqparent class to get some needed information // Perhaps a refactoring is needed. kdDebug(14152) << k_funcinfo << "Checking to see if I'm online.." << endl; - if( myself()->onlineStatus().status() == Kopete::OnlineStatus::Away ) + if( myself()->onlinetqStatus().status() == Kopete::OnlineStatus::Away ) { TQString sender = Oscar::normalize( message.sender() ); AIMContact* aimSender = static_cast ( contacts()[sender] ); //should exist now @@ -759,7 +759,7 @@ void AIMAccount::connectWithPassword( const TQString & ) // Get the screen name for this account TQString screenName = accountId(); - TQString server = configGroup()->readEntry( "Server", TQString::fromLatin1( "login.oscar.aol.com" ) ); + TQString server = configGroup()->readEntry( "Server", TQString::tqfromLatin1( "login.oscar.aol.com" ) ); uint port = configGroup()->readNumEntry( "Port", 5190 ); Connection* c = setupConnection( server, port ); @@ -771,7 +771,7 @@ void AIMAccount::connectWithPassword( const TQString & ) << "AIM network because no password was specified in the " << "preferences." << endl; } - else if ( myself()->onlineStatus() == static_cast( protocol() )->statusOffline ) + else if ( myself()->onlinetqStatus() == static_cast( protocol() )->statusOffline ) { kdDebug(14152) << k_funcinfo << "Logging in as " << accountId() << endl ; updateVersionUpdaterStamp(); @@ -895,7 +895,7 @@ void AIMAccount::setPrivacySettings( int privacy ) void AIMAccount::setPrivacyTLVs( BYTE privacy, DWORD userClasses ) { SSIManager* ssi = engine()->ssiManager(); - Oscar::SSI item = ssi->findItem( TQString::null, ROSTER_VISIBILITY ); + Oscar::SSI item = ssi->findItem( TQString(), ROSTER_VISIBILITY ); TQValueList tList; @@ -905,7 +905,7 @@ void AIMAccount::setPrivacyTLVs( BYTE privacy, DWORD userClasses ) if ( !item ) { kdDebug(OSCAR_AIM_DEBUG) << k_funcinfo << "Adding new privacy TLV item" << endl; - Oscar::SSI s( TQString::null, 0, ssi->nextContactId(), ROSTER_VISIBILITY, tList ); + Oscar::SSI s( TQString(), 0, ssi->nextContactId(), ROSTER_VISIBILITY, tList ); engine()->modifySSIItem( item, s ); } else -- cgit v1.2.1