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/libkopete/kabcpersistence.cpp | 42 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'kopete/libkopete/kabcpersistence.cpp') diff --git a/kopete/libkopete/kabcpersistence.cpp b/kopete/libkopete/kabcpersistence.cpp index 93d55b35..f1acaea1 100644 --- a/kopete/libkopete/kabcpersistence.cpp +++ b/kopete/libkopete/kabcpersistence.cpp @@ -45,7 +45,7 @@ namespace Kopete { /** - * utility function to merge two QStrings containing individual elements separated by 0xE000 + * utility function to merge two TQStrings containing individual elements separated by 0xE000 */ static TQString unionContents( TQString arg1, TQString arg2 ) { @@ -53,13 +53,13 @@ static TQString unionContents( TQString arg1, TQString arg2 ) TQStringList outList = TQStringList::split( separator, arg1 ); TQStringList arg2List = TQStringList::split( separator, arg2 ); for ( TQStringList::iterator it = arg2List.begin(); it != arg2List.end(); ++it ) - if ( !outList.contains( *it ) ) + if ( !outList.tqcontains( *it ) ) outList.append( *it ); TQString out = outList.join( separator ); return out; } -KABCPersistence::KABCPersistence( TQObject * parent, const char * name ) : TQObject( parent, name ) +KABCPersistence::KABCPersistence( TQObject * tqparent, const char * name ) : TQObject( tqparent, name ) { s_pendingResources.setAutoDelete( false ); } @@ -128,13 +128,13 @@ void KABCPersistence::write( MetaContact * mc ) for ( ; it != addressMap.end(); ++it ) { // read existing data for this key - TQString currentCustomForProtocol = theAddressee.custom( it.key(), TQString::fromLatin1( "All" ) ); + TQString currentCustomForProtocol = theAddressee.custom( it.key(), TQString::tqfromLatin1( "All" ) ); // merge without duplicating TQString toWrite = unionContents( currentCustomForProtocol, it.data().join( TQChar( 0xE000 ) ) ); // Note if nothing ends up in the KABC data, this is because insertCustom does nothing if any param is empty. kdDebug( 14010 ) << k_funcinfo << "Writing: " << it.key() << ", " << "All" << ", " << toWrite << endl; - theAddressee.insertCustom( it.key(), TQString::fromLatin1( "All" ), toWrite ); - TQString check = theAddressee.custom( it.key(), TQString::fromLatin1( "All" ) ); + theAddressee.insertCustom( it.key(), TQString::tqfromLatin1( "All" ), toWrite ); + TQString check = theAddressee.custom( it.key(), TQString::tqfromLatin1( "All" ) ); } ab->insertAddressee( theAddressee ); //kdDebug( 14010 ) << k_funcinfo << "dumping addressbook before write " << endl; @@ -173,7 +173,7 @@ void KABCPersistence::write( MetaContact * mc ) void KABCPersistence::writeAddressBook( const KABC::Resource * res) { - if ( !s_pendingResources.containsRef( res ) ) + if ( !s_pendingResources.tqcontainsRef( res ) ) s_pendingResources.append( res ); if ( !s_addrBookWritePending ) { @@ -229,7 +229,7 @@ void KABCPersistence::removeKABC( MetaContact *) { // remove the link //kdDebug( 14010 ) << k_funcinfo << "...not found." << endl; - d->metaContactId=TQString::null; + d->metaContactId=TQString(); } else { @@ -274,24 +274,24 @@ bool KABCPersistence::syncWithKABC( MetaContact * mc ) splitField( *it, app, name, value ); kdDebug( 14010 ) << "app=" << app << " name=" << name << " value=" << value << endl; - if ( app.startsWith( TQString::fromLatin1( "messaging/" ) ) ) + if ( app.startsWith( TQString::tqfromLatin1( "messaging/" ) ) ) { - if ( name == TQString::fromLatin1( "All" ) ) + if ( name == TQString::tqfromLatin1( "All" ) ) { kdDebug( 14010 ) << " syncing \"" << app << ":" << name << " with contactlist " << endl; // Get the protocol name from the custom field // by chopping the 'messaging/' prefix from the custom field app name TQString protocolName = app.right( app.length() - 10 ); // munge Jabber hack - if ( protocolName == TQString::fromLatin1( "xmpp" ) ) - protocolName = TQString::fromLatin1( "jabber" ); + if ( protocolName == TQString::tqfromLatin1( "xmpp" ) ) + protocolName = TQString::tqfromLatin1( "jabber" ); // Check Kopete supports it - Protocol * proto = dynamic_cast( PluginManager::self()->loadPlugin( TQString::fromLatin1( "kopete_" ) + protocolName ) ); + Protocol * proto = dynamic_cast( PluginManager::self()->loadPlugin( TQString::tqfromLatin1( "kopete_" ) + protocolName ) ); if ( !proto ) { KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, - i18n( "\"%1\" is not supported by Kopete." ).arg( protocolName ), + i18n( "\"%1\" is not supported by Kopete." ).tqarg( protocolName ), i18n( "Could Not Sync with KDE Address Book" ) ); continue; } @@ -305,7 +305,7 @@ bool KABCPersistence::syncWithKABC( MetaContact * mc ) // Is it in the contact list? // First discard anything after an 0xE120, this is used by IRC to separate nick and server group name, but // IRC doesn't support this properly yet, so the user will have to select an appropriate account manually - int separatorPos = (*it).find( TQChar( 0xE120 ) ); + int separatorPos = (*it).tqfind( TQChar( 0xE120 ) ); if ( separatorPos != -1 ) *it = (*it).left( separatorPos ); @@ -332,14 +332,14 @@ bool KABCPersistence::syncWithKABC( MetaContact * mc ) } kdDebug( 14010 ) << *it << " already exists in OTHER metacontact, move here?" << endl; // find the Kopete::Contact and attempt to move it to this metacontact. - otherMc->findContact( proto->pluginId(), TQString::null, *it )->setMetaContact( mc ); + otherMc->findContact( proto->pluginId(), TQString(), *it )->setMetaContact( mc ); } else { // if not, prompt to add it kdDebug( 14010 ) << proto->pluginId() << "://" << *it << " was not found in the contact list. Prompting to add..." << endl; if ( KMessageBox::Yes == KMessageBox::questionYesNo( Kopete::UI::Global::mainWidget(), - i18n( "An address was added to this contact by another application.
Would you like to use it in Kopete?
Protocol: %1
Address: %2
" ).arg( proto->displayName() ).arg( *it ), i18n( "Import Address From Address Book" ), i18n("Use"), i18n("Do Not Use"), TQString::fromLatin1( "ImportFromKABC" ) ) ) + i18n( "An address was added to this contact by another application.
Would you like to use it in Kopete?
Protocol: %1
Address: %2
" ).tqarg( proto->displayName() ).tqarg( *it ), i18n( "Import Address From Address Book" ), i18n("Use"), i18n("Do Not Use"), TQString::tqfromLatin1( "ImportFromKABC" ) ) ) { // Check the accounts for this protocol are all connected // Most protocols do not allow you to add contacts while offline @@ -353,7 +353,7 @@ bool KABCPersistence::syncWithKABC( MetaContact * mc ) if ( !allAccountsConnected ) { KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, - i18n( "One or more of your accounts using %1 are offline. Most systems have to be connected to add contacts. Please connect these accounts and try again." ).arg( protocolName ), + i18n( "One or more of your accounts using %1 are offline. Most systems have to be connected to add contacts. Please connect these accounts and try again." ).tqarg( protocolName ), i18n( "Not Connected" ) ); continue; } @@ -378,7 +378,7 @@ bool KABCPersistence::syncWithKABC( MetaContact * mc ) else if ( accounts.isEmpty() ) { KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry, - i18n( "You do not have an account configured for %1 yet. Please create an account, connect it, and try again." ).arg( protocolName ), + i18n( "You do not have an account configured for %1 yet. Please create an account, connect it, and try again." ).tqarg( protocolName ), i18n( "No Account Found" ) ); continue; } @@ -420,12 +420,12 @@ bool KABCPersistence::syncWithKABC( MetaContact * mc ) // FIXME: Remove when IM address API is in KABC (KDE 4) void KABCPersistence::splitField( const TQString &str, TQString &app, TQString &name, TQString &value ) { - int colon = str.find( ':' ); + int colon = str.tqfind( ':' ); if ( colon != -1 ) { TQString tmp = str.left( colon ); value = str.mid( colon + 1 ); - int dash = tmp.find( '-' ); + int dash = tmp.tqfind( '-' ); if ( dash != -1 ) { app = tmp.left( dash ); name = tmp.mid( dash + 1 ); -- cgit v1.2.1