summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete/kabcpersistence.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 00:30:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-22 00:30:31 +0000
commit69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch)
tree073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kopete/libkopete/kabcpersistence.cpp
parent3467e6464beac3a162839bf7078e22e3a74d73e7 (diff)
downloadtdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz
tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip
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
Diffstat (limited to 'kopete/libkopete/kabcpersistence.cpp')
-rw-r--r--kopete/libkopete/kabcpersistence.cpp42
1 files changed, 21 insertions, 21 deletions
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<Protocol*>( PluginManager::self()->loadPlugin( TQString::fromLatin1( "kopete_" ) + protocolName ) );
+ Protocol * proto = dynamic_cast<Protocol*>( PluginManager::self()->loadPlugin( TQString::tqfromLatin1( "kopete_" ) + protocolName ) );
if ( !proto )
{
KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry,
- i18n( "<qt>\"%1\" is not supported by Kopete.</qt>" ).arg( protocolName ),
+ i18n( "<qt>\"%1\" is not supported by Kopete.</qt>" ).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( "<qt>An address was added to this contact by another application.<br>Would you like to use it in Kopete?<br><b>Protocol:</b> %1<br><b>Address:</b> %2</qt>" ).arg( proto->displayName() ).arg( *it ), i18n( "Import Address From Address Book" ), i18n("Use"), i18n("Do Not Use"), TQString::fromLatin1( "ImportFromKABC" ) ) )
+ i18n( "<qt>An address was added to this contact by another application.<br>Would you like to use it in Kopete?<br><b>Protocol:</b> %1<br><b>Address:</b> %2</qt>" ).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( "<qt>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.</qt>" ).arg( protocolName ),
+ i18n( "<qt>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.</qt>" ).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( "<qt>You do not have an account configured for <b>%1</b> yet. Please create an account, connect it, and try again.</qt>" ).arg( protocolName ),
+ i18n( "<qt>You do not have an account configured for <b>%1</b> yet. Please create an account, connect it, and try again.</qt>" ).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 );