diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kopete/libkopete/kopetecontactlist.cpp | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-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/kopetecontactlist.cpp')
-rw-r--r-- | kopete/libkopete/kopetecontactlist.cpp | 276 |
1 files changed, 138 insertions, 138 deletions
diff --git a/kopete/libkopete/kopetecontactlist.cpp b/kopete/libkopete/kopetecontactlist.cpp index 6e33f257..65960dcf 100644 --- a/kopete/libkopete/kopetecontactlist.cpp +++ b/kopete/libkopete/kopetecontactlist.cpp @@ -85,7 +85,7 @@ ContactList::ContactList() d=new Private; //the myself metacontact can't be created now, because it will use - //ContactList::self() as parent which will call this constructor -> infinite loop + //ContactList::self() as tqparent which will call this constructor -> infinite loop d->myself=0L; //no contactlist loaded yet, don't save them @@ -218,7 +218,7 @@ TQPtrList<Group> ContactList::selectedGroups() const void ContactList::addMetaContact( MetaContact *mc ) { - if ( d->contacts.contains( mc ) ) + if ( d->contacts.tqcontains( mc ) ) return; d->contacts.append( mc ); @@ -232,13 +232,13 @@ void ContactList::addMetaContact( MetaContact *mc ) void ContactList::removeMetaContact(MetaContact *m) { - if ( !d->contacts.contains(m) ) + if ( !d->contacts.tqcontains(m) ) { kdDebug(14010) << k_funcinfo << "Trying to remove a not listed MetaContact." << endl; return; } - if ( d->selectedMetaContacts.contains( m ) ) + if ( d->selectedMetaContacts.tqcontains( m ) ) { d->selectedMetaContacts.remove( m ); setSelectedItems( d->selectedMetaContacts, d->selectedGroups ); @@ -259,7 +259,7 @@ void ContactList::removeMetaContact(MetaContact *m) void ContactList::addGroup( Group * g ) { - if(!d->groups.contains(g) ) + if(!d->groups.tqcontains(g) ) { d->groups.append( g ); emit groupAdded( g ); @@ -269,7 +269,7 @@ void ContactList::addGroup( Group * g ) void ContactList::removeGroup( Group *g ) { - if ( d->selectedGroups.contains( g ) ) + if ( d->selectedGroups.tqcontains( g ) ) { d->selectedGroups.remove( g ); setSelectedItems( d->selectedMetaContacts, d->selectedGroups ); @@ -378,14 +378,14 @@ void ContactList::loadXML() // don't save when we're in the middle of this... d->loaded = false; - TQString filename = locateLocal( "appdata", TQString::fromLatin1( "contactlist.xml" ) ); + TQString filename = locateLocal( "appdata", TQString::tqfromLatin1( "contactlist.xml" ) ); if( filename.isEmpty() ) { d->loaded=true; return ; } - TQDomDocument contactList( TQString::fromLatin1( "kopete-contact-list" ) ); + TQDomDocument contactList( TQString::tqfromLatin1( "kopete-contact-list" ) ); TQFile contactListFile( filename ); contactListFile.open( IO_ReadOnly ); @@ -393,10 +393,10 @@ void ContactList::loadXML() TQDomElement list = contactList.documentElement(); - TQString versionString = list.attribute( TQString::fromLatin1( "version" ), TQString::null ); + TQString versionString = list.attribute( TQString::tqfromLatin1( "version" ), TQString() ); uint version = 0; - if( TQRegExp( TQString::fromLatin1( "[0-9]+\\.[0-9]" ) ).exactMatch( versionString ) ) - version = versionString.replace( TQString::fromLatin1( "." ), TQString::null ).toUInt(); + if( TQRegExp( TQString::tqfromLatin1( "[0-9]+\\.[0-9]" ) ).exactMatch( versionString ) ) + version = versionString.tqreplace( TQString::tqfromLatin1( "." ), TQString() ).toUInt(); if( version < Private::ContactListVersion ) { @@ -410,7 +410,7 @@ void ContactList::loadXML() convertContactList( filename, version, Private::ContactListVersion ); - contactList = TQDomDocument ( TQString::fromLatin1( "kopete-contact-list" ) ); + contactList = TQDomDocument ( TQString::tqfromLatin1( "kopete-contact-list" ) ); contactListFile.open( IO_ReadOnly ); contactList.setContent( &contactListFile ); @@ -423,10 +423,10 @@ void ContactList::loadXML() TQDomElement element = list.firstChild().toElement(); while( !element.isNull() ) { - if( element.tagName() == TQString::fromLatin1("meta-contact") ) + if( element.tagName() == TQString::tqfromLatin1("meta-contact") ) { //TODO: id isn't used - //TQString id = element.attribute( "id", TQString::null ); + //TQString id = element.attribute( "id", TQString() ); Kopete::MetaContact *metaContact = new Kopete::MetaContact(); if ( !metaContact->fromXML( element ) ) { @@ -439,7 +439,7 @@ void ContactList::loadXML() metaContact ); } } - else if( element.tagName() == TQString::fromLatin1("kopete-group") ) + else if( element.tagName() == TQString::tqfromLatin1("kopete-group") ) { Kopete::Group *group = new Kopete::Group(); if( !group->fromXML( element ) ) @@ -453,7 +453,7 @@ void ContactList::loadXML() } } // Only load myself metacontact information when Global Identity is enabled. - else if( element.tagName() == TQString::fromLatin1("myself-meta-contact") && Kopete::Config::enableGlobalIdentity() ) + else if( element.tagName() == TQString::tqfromLatin1("myself-meta-contact") && Kopete::Config::enableGlobalIdentity() ) { if( !myself()->fromXML( element ) ) { @@ -479,19 +479,19 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers // changes to allow incremental (multi-pass) conversion so we don't have // to rewrite the whole conversion code for each change. - TQDomDocument contactList( TQString::fromLatin1( "messaging-contact-list" ) ); + TQDomDocument contactList( TQString::tqfromLatin1( "messaging-contact-list" ) ); TQFile contactListFile( fileName ); contactListFile.open( IO_ReadOnly ); contactList.setContent( &contactListFile ); TQDomElement oldList = contactList.documentElement(); - TQDomDocument newList( TQString::fromLatin1( "kopete-contact-list" ) ); - newList.appendChild( newList.createProcessingInstruction( TQString::fromLatin1( "xml" ), TQString::fromLatin1( "version=\"1.0\"" ) ) ); + TQDomDocument newList( TQString::tqfromLatin1( "kopete-contact-list" ) ); + newList.appendChild( newList.createProcessingInstruction( TQString::tqfromLatin1( "xml" ), TQString::tqfromLatin1( "version=\"1.0\"" ) ) ); - TQDomElement newRoot = newList.createElement( TQString::fromLatin1( "kopete-contact-list" ) ); + TQDomElement newRoot = newList.createElement( TQString::tqfromLatin1( "kopete-contact-list" ) ); newList.appendChild( newRoot ); - newRoot.setAttribute( TQString::fromLatin1( "version" ), TQString::fromLatin1( "1.0" ) ); + newRoot.setAttribute( TQString::tqfromLatin1( "version" ), TQString::tqfromLatin1( "1.0" ) ); TQDomNode oldNode = oldList.firstChild(); while( !oldNode.isNull() ) @@ -499,10 +499,10 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers TQDomElement oldElement = oldNode.toElement(); if( !oldElement.isNull() ) { - if( oldElement.tagName() == TQString::fromLatin1("meta-contact") ) + if( oldElement.tagName() == TQString::tqfromLatin1("meta-contact") ) { // Ignore ID, it is not used in the current list anyway - TQDomElement newMetaContact = newList.createElement( TQString::fromLatin1( "meta-contact" ) ); + TQDomElement newMetaContact = newList.createElement( TQString::tqfromLatin1( "meta-contact" ) ); newRoot.appendChild( newMetaContact ); // Plugin data is stored completely different, and requires @@ -518,48 +518,48 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers while( !oldContactNode.isNull() ) { TQDomElement oldContactElement = oldContactNode.toElement(); - if( !oldContactElement.isNull() && oldContactElement.tagName() == TQString::fromLatin1("address-book-field") ) + if( !oldContactElement.isNull() && oldContactElement.tagName() == TQString::tqfromLatin1("address-book-field") ) { // Convert address book fields. // Jabber will be called "xmpp", Aim/Toc and Aim/Oscar both will // be called "aim". MSN, AIM, IRC, Oscar and SMS don't use address // book fields yet; Gadu and ICQ can be converted as-is. // As Yahoo is unfinished we won't try to convert at all. - TQString id = oldContactElement.attribute( TQString::fromLatin1( "id" ), TQString::null ); + TQString id = oldContactElement.attribute( TQString::tqfromLatin1( "id" ), TQString() ); TQString data = oldContactElement.text(); TQString app, key, val; - TQString separator = TQString::fromLatin1( "," ); - if( id == TQString::fromLatin1( "messaging/gadu" ) ) - separator = TQString::fromLatin1( "\n" ); - else if( id == TQString::fromLatin1( "messaging/icq" ) ) - separator = TQString::fromLatin1( ";" ); - else if( id == TQString::fromLatin1( "messaging/jabber" ) ) - id = TQString::fromLatin1( "messaging/xmpp" ); - - if( id == TQString::fromLatin1( "messaging/gadu" ) || id == TQString::fromLatin1( "messaging/icq" ) || - id == TQString::fromLatin1( "messaging/winpopup" ) || id == TQString::fromLatin1( "messaging/xmpp" ) ) + TQString separator = TQString::tqfromLatin1( "," ); + if( id == TQString::tqfromLatin1( "messaging/gadu" ) ) + separator = TQString::tqfromLatin1( "\n" ); + else if( id == TQString::tqfromLatin1( "messaging/icq" ) ) + separator = TQString::tqfromLatin1( ";" ); + else if( id == TQString::tqfromLatin1( "messaging/jabber" ) ) + id = TQString::tqfromLatin1( "messaging/xmpp" ); + + if( id == TQString::tqfromLatin1( "messaging/gadu" ) || id == TQString::tqfromLatin1( "messaging/icq" ) || + id == TQString::tqfromLatin1( "messaging/winpopup" ) || id == TQString::tqfromLatin1( "messaging/xmpp" ) ) { app = id; - key = TQString::fromLatin1( "All" ); - val = data.replace( separator, TQChar( 0xE000 ) ); + key = TQString::tqfromLatin1( "All" ); + val = data.tqreplace( separator, TQChar( 0xE000 ) ); } if( !app.isEmpty() ) { - TQDomElement addressBookField = newList.createElement( TQString::fromLatin1( "address-book-field" ) ); + TQDomElement addressBookField = newList.createElement( TQString::tqfromLatin1( "address-book-field" ) ); newMetaContact.appendChild( addressBookField ); - addressBookField.setAttribute( TQString::fromLatin1( "app" ), app ); - addressBookField.setAttribute( TQString::fromLatin1( "key" ), key ); + addressBookField.setAttribute( TQString::tqfromLatin1( "app" ), app ); + addressBookField.setAttribute( TQString::tqfromLatin1( "key" ), key ); addressBookField.appendChild( newList.createTextNode( val ) ); // ICQ didn't store the contactId locally, only in the address // book fields, so we need to be able to access it later - if( id == TQString::fromLatin1( "messaging/icq" ) ) + if( id == TQString::tqfromLatin1( "messaging/icq" ) ) icqData = TQStringList::split( TQChar( 0xE000 ), val ); - else if( id == TQString::fromLatin1("messaging/gadu") ) + else if( id == TQString::tqfromLatin1("messaging/gadu") ) gaduData = TQStringList::split( TQChar( 0xE000 ), val ); } } @@ -573,103 +573,103 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers TQDomElement oldContactElement = oldContactNode.toElement(); if( !oldContactElement.isNull() ) { - if( oldContactElement.tagName() == TQString::fromLatin1("display-name") ) + if( oldContactElement.tagName() == TQString::tqfromLatin1("display-name") ) { - TQDomElement displayName = newList.createElement( TQString::fromLatin1( "display-name" ) ); + TQDomElement displayName = newList.createElement( TQString::tqfromLatin1( "display-name" ) ); displayName.appendChild( newList.createTextNode( oldContactElement.text() ) ); newMetaContact.appendChild( displayName ); } - else if( oldContactElement.tagName() == TQString::fromLatin1("groups") ) + else if( oldContactElement.tagName() == TQString::tqfromLatin1("groups") ) { - TQDomElement groups = newList.createElement( TQString::fromLatin1( "groups" ) ); + TQDomElement groups = newList.createElement( TQString::tqfromLatin1( "groups" ) ); newMetaContact.appendChild( groups ); TQDomNode oldGroup = oldContactElement.firstChild(); while( !oldGroup.isNull() ) { TQDomElement oldGroupElement = oldGroup.toElement(); - if ( oldGroupElement.tagName() == TQString::fromLatin1("group") ) + if ( oldGroupElement.tagName() == TQString::tqfromLatin1("group") ) { - TQDomElement group = newList.createElement( TQString::fromLatin1( "group" ) ); + TQDomElement group = newList.createElement( TQString::tqfromLatin1( "group" ) ); group.appendChild( newList.createTextNode( oldGroupElement.text() ) ); groups.appendChild( group ); } - else if ( oldGroupElement.tagName() == TQString::fromLatin1("top-level") ) + else if ( oldGroupElement.tagName() == TQString::tqfromLatin1("top-level") ) { - TQDomElement group = newList.createElement( TQString::fromLatin1( "top-level" ) ); + TQDomElement group = newList.createElement( TQString::tqfromLatin1( "top-level" ) ); groups.appendChild( group ); } oldGroup = oldGroup.nextSibling(); } } - else if( oldContactElement.tagName() == TQString::fromLatin1( "plugin-data" ) ) + else if( oldContactElement.tagName() == TQString::tqfromLatin1( "plugin-data" ) ) { // Convert the plugin data - TQString id = oldContactElement.attribute( TQString::fromLatin1( "plugin-id" ), TQString::null ); + TQString id = oldContactElement.attribute( TQString::tqfromLatin1( "plugin-id" ), TQString() ); TQString data = oldContactElement.text(); bool convertOldAim = false; uint fieldCount = 1; TQString addressBookLabel; - if( id == TQString::fromLatin1("MSNProtocol") ) + if( id == TQString::tqfromLatin1("MSNProtocol") ) { fieldCount = 3; - addressBookLabel = TQString::fromLatin1("msn"); + addressBookLabel = TQString::tqfromLatin1("msn"); } - else if( id == TQString::fromLatin1("IRCProtocol") ) + else if( id == TQString::tqfromLatin1("IRCProtocol") ) { fieldCount = 3; - addressBookLabel = TQString::fromLatin1("irc"); + addressBookLabel = TQString::tqfromLatin1("irc"); } - else if( id == TQString::fromLatin1("OscarProtocol") ) + else if( id == TQString::tqfromLatin1("OscarProtocol") ) { fieldCount = 2; - addressBookLabel = TQString::fromLatin1("aim"); + addressBookLabel = TQString::tqfromLatin1("aim"); } - else if( id == TQString::fromLatin1("AIMProtocol") ) + else if( id == TQString::tqfromLatin1("AIMProtocol") ) { - id = TQString::fromLatin1("OscarProtocol"); + id = TQString::tqfromLatin1("OscarProtocol"); convertOldAim = true; - addressBookLabel = TQString::fromLatin1("aim"); + addressBookLabel = TQString::tqfromLatin1("aim"); } - else if( id == TQString::fromLatin1("ICQProtocol") || id == TQString::fromLatin1("WPProtocol") || id == TQString::fromLatin1("GaduProtocol") ) + else if( id == TQString::tqfromLatin1("ICTQProtocol") || id == TQString::tqfromLatin1("WPProtocol") || id == TQString::tqfromLatin1("GaduProtocol") ) { fieldCount = 1; } - else if( id == TQString::fromLatin1("JabberProtocol") ) + else if( id == TQString::tqfromLatin1("JabberProtocol") ) { fieldCount = 4; } - else if( id == TQString::fromLatin1("SMSProtocol") ) + else if( id == TQString::tqfromLatin1("SMSProtocol") ) { // SMS used a variable serializing using a dot as delimiter. // The minimal count is three though (id, name, delimiter). fieldCount = 2; - addressBookLabel = TQString::fromLatin1("sms"); + addressBookLabel = TQString::tqfromLatin1("sms"); } if( pluginData[ id ].isNull() ) { - pluginData[ id ] = newList.createElement( TQString::fromLatin1( "plugin-data" ) ); - pluginData[ id ].setAttribute( TQString::fromLatin1( "plugin-id" ), id ); + pluginData[ id ] = newList.createElement( TQString::tqfromLatin1( "plugin-data" ) ); + pluginData[ id ].setAttribute( TQString::tqfromLatin1( "plugin-id" ), id ); newMetaContact.appendChild( pluginData[ id ] ); } // Do the actual conversion - if( id == TQString::fromLatin1( "MSNProtocol" ) || id == TQString::fromLatin1( "OscarProtocol" ) || - id == TQString::fromLatin1( "AIMProtocol" ) || id == TQString::fromLatin1( "IRCProtocol" ) || - id == TQString::fromLatin1( "ICQProtocol" ) || id == TQString::fromLatin1( "JabberProtocol" ) || - id == TQString::fromLatin1( "SMSProtocol" ) || id == TQString::fromLatin1( "WPProtocol" ) || - id == TQString::fromLatin1( "GaduProtocol" ) ) + if( id == TQString::tqfromLatin1( "MSNProtocol" ) || id == TQString::tqfromLatin1( "OscarProtocol" ) || + id == TQString::tqfromLatin1( "AIMProtocol" ) || id == TQString::tqfromLatin1( "IRCProtocol" ) || + id == TQString::tqfromLatin1( "ICTQProtocol" ) || id == TQString::tqfromLatin1( "JabberProtocol" ) || + id == TQString::tqfromLatin1( "SMSProtocol" ) || id == TQString::tqfromLatin1( "WPProtocol" ) || + id == TQString::tqfromLatin1( "GaduProtocol" ) ) { - TQStringList strList = TQStringList::split( TQString::fromLatin1( "||" ), data ); + TQStringList strList = TQStringList::split( TQString::tqfromLatin1( "||" ), data ); // Unescape '||' for( TQStringList::iterator it = strList.begin(); it != strList.end(); ++it ) { - ( *it ).replace( TQString::fromLatin1( "\\|;" ), TQString::fromLatin1( "|" ) ). - replace( TQString::fromLatin1( "\\\\" ), TQString::fromLatin1( "\\" ) ); + ( *it ).tqreplace( TQString::tqfromLatin1( "\\|;" ), TQString::tqfromLatin1( "|" ) ). + tqreplace( TQString::tqfromLatin1( "\\\\" ), TQString::tqfromLatin1( "\\" ) ); } uint idx = 0; @@ -677,65 +677,65 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers { TQDomElement dataField; - dataField = newList.createElement( TQString::fromLatin1( "plugin-data-field" ) ); + dataField = newList.createElement( TQString::tqfromLatin1( "plugin-data-field" ) ); pluginData[ id ].appendChild( dataField ); - dataField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "contactId" ) ); - if( id == TQString::fromLatin1("ICQProtocol") ) + dataField.setAttribute( TQString::tqfromLatin1( "key" ), TQString::tqfromLatin1( "contactId" ) ); + if( id == TQString::tqfromLatin1("ICTQProtocol") ) dataField.appendChild( newList.createTextNode( icqData[ idx ] ) ); - else if( id == TQString::fromLatin1("GaduProtocol") ) + else if( id == TQString::tqfromLatin1("GaduProtocol") ) dataField.appendChild( newList.createTextNode( gaduData[ idx ] ) ); - else if( id == TQString::fromLatin1("JabberProtocol") ) + else if( id == TQString::tqfromLatin1("JabberProtocol") ) dataField.appendChild( newList.createTextNode( strList[ idx + 1 ] ) ); else dataField.appendChild( newList.createTextNode( strList[ idx ] ) ); - dataField = newList.createElement( TQString::fromLatin1( "plugin-data-field" ) ); + dataField = newList.createElement( TQString::tqfromLatin1( "plugin-data-field" ) ); pluginData[ id ].appendChild( dataField ); - dataField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "displayName" ) ); - if( convertOldAim || id == TQString::fromLatin1("ICQProtocol") || id == TQString::fromLatin1("WPProtocol") || id == TQString::fromLatin1("GaduProtocol") ) + dataField.setAttribute( TQString::tqfromLatin1( "key" ), TQString::tqfromLatin1( "displayName" ) ); + if( convertOldAim || id == TQString::tqfromLatin1("ICTQProtocol") || id == TQString::tqfromLatin1("WPProtocol") || id == TQString::tqfromLatin1("GaduProtocol") ) dataField.appendChild( newList.createTextNode( strList[ idx ] ) ); - else if( id == TQString::fromLatin1("JabberProtocol") ) + else if( id == TQString::tqfromLatin1("JabberProtocol") ) dataField.appendChild( newList.createTextNode( strList[ idx + 2 ] ) ); else dataField.appendChild( newList.createTextNode( strList[ idx + 1 ] ) ); - if( id == TQString::fromLatin1("MSNProtocol") ) + if( id == TQString::tqfromLatin1("MSNProtocol") ) { - dataField = newList.createElement( TQString::fromLatin1( "plugin-data-field" ) ); + dataField = newList.createElement( TQString::tqfromLatin1( "plugin-data-field" ) ); pluginData[ id ].appendChild( dataField ); - dataField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "groups" ) ); + dataField.setAttribute( TQString::tqfromLatin1( "key" ), TQString::tqfromLatin1( "groups" ) ); dataField.appendChild( newList.createTextNode( strList[ idx + 2 ] ) ); } - else if( id == TQString::fromLatin1("IRCProtocol") ) + else if( id == TQString::tqfromLatin1("IRCProtocol") ) { - dataField = newList.createElement( TQString::fromLatin1( "plugin-data-field" ) ); + dataField = newList.createElement( TQString::tqfromLatin1( "plugin-data-field" ) ); pluginData[ id ].appendChild( dataField ); - dataField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "serverName" ) ); + dataField.setAttribute( TQString::tqfromLatin1( "key" ), TQString::tqfromLatin1( "serverName" ) ); dataField.appendChild( newList.createTextNode( strList[ idx + 2 ] ) ); } - else if( id == TQString::fromLatin1("JabberProtocol") ) + else if( id == TQString::tqfromLatin1("JabberProtocol") ) { - dataField = newList.createElement( TQString::fromLatin1( "plugin-data-field" ) ); + dataField = newList.createElement( TQString::tqfromLatin1( "plugin-data-field" ) ); pluginData[ id ].appendChild( dataField ); - dataField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "accountId" ) ); + dataField.setAttribute( TQString::tqfromLatin1( "key" ), TQString::tqfromLatin1( "accountId" ) ); dataField.appendChild( newList.createTextNode( strList[ idx ] ) ); - dataField = newList.createElement( TQString::fromLatin1( "plugin-data-field" ) ); + dataField = newList.createElement( TQString::tqfromLatin1( "plugin-data-field" ) ); pluginData[ id ].appendChild( dataField ); - dataField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "groups" ) ); + dataField.setAttribute( TQString::tqfromLatin1( "key" ), TQString::tqfromLatin1( "groups" ) ); dataField.appendChild( newList.createTextNode( strList[ idx + 3 ] ) ); } - else if( id == TQString::fromLatin1( "SMSProtocol" ) && - ( idx + 2 < strList.size() ) && strList[ idx + 2 ] != TQString::fromLatin1( "." ) ) + else if( id == TQString::tqfromLatin1( "SMSProtocol" ) && + ( idx + 2 < strList.size() ) && strList[ idx + 2 ] != TQString::tqfromLatin1( "." ) ) { - dataField = newList.createElement( TQString::fromLatin1( "plugin-data-field" ) ); + dataField = newList.createElement( TQString::tqfromLatin1( "plugin-data-field" ) ); pluginData[ id ].appendChild( dataField ); - dataField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "serviceName" ) ); + dataField.setAttribute( TQString::tqfromLatin1( "key" ), TQString::tqfromLatin1( "serviceName" ) ); dataField.appendChild( newList.createTextNode( strList[ idx + 2 ] ) ); - dataField = newList.createElement( TQString::fromLatin1( "plugin-data-field" ) ); + dataField = newList.createElement( TQString::tqfromLatin1( "plugin-data-field" ) ); pluginData[ id ].appendChild( dataField ); - dataField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "servicePrefs" ) ); + dataField.setAttribute( TQString::tqfromLatin1( "key" ), TQString::tqfromLatin1( "servicePrefs" ) ); dataField.appendChild( newList.createTextNode( strList[ idx + 3 ] ) ); // Add extra fields @@ -744,30 +744,30 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers // MSN, AIM, IRC, Oscar and SMS didn't store address book fields up // to now, so create one - if( id != TQString::fromLatin1("ICQProtocol") && id != TQString::fromLatin1("JabberProtocol") && id != TQString::fromLatin1("WPProtocol") && id != TQString::fromLatin1("GaduProtocol") ) + if( id != TQString::tqfromLatin1("ICTQProtocol") && id != TQString::tqfromLatin1("JabberProtocol") && id != TQString::tqfromLatin1("WPProtocol") && id != TQString::tqfromLatin1("GaduProtocol") ) { - TQDomElement addressBookField = newList.createElement( TQString::fromLatin1( "address-book-field" ) ); + TQDomElement addressBookField = newList.createElement( TQString::tqfromLatin1( "address-book-field" ) ); newMetaContact.appendChild( addressBookField ); - addressBookField.setAttribute( TQString::fromLatin1( "app" ), - TQString::fromLatin1( "messaging/" ) + addressBookLabel ); - addressBookField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "All" ) ); + addressBookField.setAttribute( TQString::tqfromLatin1( "app" ), + TQString::tqfromLatin1( "messaging/" ) + addressBookLabel ); + addressBookField.setAttribute( TQString::tqfromLatin1( "key" ), TQString::tqfromLatin1( "All" ) ); addressBookField.appendChild( newList.createTextNode( strList[ idx ] ) ); } idx += fieldCount; } } - else if( id == TQString::fromLatin1("ContactNotesPlugin") || id == TQString::fromLatin1("CryptographyPlugin") || id == TQString::fromLatin1("TranslatorPlugin") ) + else if( id == TQString::tqfromLatin1("ContactNotesPlugin") || id == TQString::tqfromLatin1("CryptographyPlugin") || id == TQString::tqfromLatin1("TranslatorPlugin") ) { - TQDomElement dataField = newList.createElement( TQString::fromLatin1( "plugin-data-field" ) ); + TQDomElement dataField = newList.createElement( TQString::tqfromLatin1( "plugin-data-field" ) ); pluginData[ id ].appendChild( dataField ); - if( id == TQString::fromLatin1("ContactNotesPlugin") ) - dataField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "notes" ) ); - else if( id == TQString::fromLatin1("CryptographyPlugin") ) - dataField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "gpgKey" ) ); - else if( id == TQString::fromLatin1("TranslatorPlugin") ) - dataField.setAttribute( TQString::fromLatin1( "key" ), TQString::fromLatin1( "languageKey" ) ); + if( id == TQString::tqfromLatin1("ContactNotesPlugin") ) + dataField.setAttribute( TQString::tqfromLatin1( "key" ), TQString::tqfromLatin1( "notes" ) ); + else if( id == TQString::tqfromLatin1("CryptographyPlugin") ) + dataField.setAttribute( TQString::tqfromLatin1( "key" ), TQString::tqfromLatin1( "gpgKey" ) ); + else if( id == TQString::tqfromLatin1("TranslatorPlugin") ) + dataField.setAttribute( TQString::tqfromLatin1( "key" ), TQString::tqfromLatin1( "languageKey" ) ); dataField.appendChild( newList.createTextNode( data ) ); } @@ -776,9 +776,9 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers oldContactNode = oldContactNode.nextSibling(); } } - else if( oldElement.tagName() == TQString::fromLatin1("kopete-group") ) + else if( oldElement.tagName() == TQString::tqfromLatin1("kopete-group") ) { - TQDomElement newGroup = newList.createElement( TQString::fromLatin1( "kopete-group" ) ); + TQDomElement newGroup = newList.createElement( TQString::tqfromLatin1( "kopete-group" ) ); newRoot.appendChild( newGroup ); TQDomNode oldGroupNode = oldNode.firstChild(); @@ -786,38 +786,38 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers { TQDomElement oldGroupElement = oldGroupNode.toElement(); - if( oldGroupElement.tagName() == TQString::fromLatin1("display-name") ) + if( oldGroupElement.tagName() == TQString::tqfromLatin1("display-name") ) { - TQDomElement displayName = newList.createElement( TQString::fromLatin1( "display-name" ) ); + TQDomElement displayName = newList.createElement( TQString::tqfromLatin1( "display-name" ) ); displayName.appendChild( newList.createTextNode( oldGroupElement.text() ) ); newGroup.appendChild( displayName ); } - if( oldGroupElement.tagName() == TQString::fromLatin1("type") ) + if( oldGroupElement.tagName() == TQString::tqfromLatin1("type") ) { - if( oldGroupElement.text() == TQString::fromLatin1("Temporary") ) - newGroup.setAttribute( TQString::fromLatin1( "type" ), TQString::fromLatin1( "temporary" ) ); - else if( oldGroupElement.text() == TQString::fromLatin1( "TopLevel" ) ) - newGroup.setAttribute( TQString::fromLatin1( "type" ), TQString::fromLatin1( "top-level" ) ); + if( oldGroupElement.text() == TQString::tqfromLatin1("Temporary") ) + newGroup.setAttribute( TQString::tqfromLatin1( "type" ), TQString::tqfromLatin1( "temporary" ) ); + else if( oldGroupElement.text() == TQString::tqfromLatin1( "TopLevel" ) ) + newGroup.setAttribute( TQString::tqfromLatin1( "type" ), TQString::tqfromLatin1( "top-level" ) ); else - newGroup.setAttribute( TQString::fromLatin1( "type" ), TQString::fromLatin1( "standard" ) ); + newGroup.setAttribute( TQString::tqfromLatin1( "type" ), TQString::tqfromLatin1( "standard" ) ); } - if( oldGroupElement.tagName() == TQString::fromLatin1("view") ) + if( oldGroupElement.tagName() == TQString::tqfromLatin1("view") ) { - if( oldGroupElement.text() == TQString::fromLatin1("collapsed") ) - newGroup.setAttribute( TQString::fromLatin1( "view" ), TQString::fromLatin1( "collapsed" ) ); + if( oldGroupElement.text() == TQString::tqfromLatin1("collapsed") ) + newGroup.setAttribute( TQString::tqfromLatin1( "view" ), TQString::tqfromLatin1( "collapsed" ) ); else - newGroup.setAttribute( TQString::fromLatin1( "view" ), TQString::fromLatin1( "expanded" ) ); + newGroup.setAttribute( TQString::tqfromLatin1( "view" ), TQString::tqfromLatin1( "expanded" ) ); } - else if( oldGroupElement.tagName() == TQString::fromLatin1("plugin-data") ) + else if( oldGroupElement.tagName() == TQString::tqfromLatin1("plugin-data") ) { // Per-group plugin data // FIXME: This needs updating too, ideally, convert this in a later // contactlist.xml version - TQDomElement groupPluginData = newList.createElement( TQString::fromLatin1( "plugin-data" ) ); + TQDomElement groupPluginData = newList.createElement( TQString::tqfromLatin1( "plugin-data" ) ); newGroup.appendChild( groupPluginData ); - groupPluginData.setAttribute( TQString::fromLatin1( "plugin-id" ), - oldGroupElement.attribute( TQString::fromLatin1( "plugin-id" ), TQString::null ) ); + groupPluginData.setAttribute( TQString::tqfromLatin1( "plugin-id" ), + oldGroupElement.attribute( TQString::tqfromLatin1( "plugin-id" ), TQString() ) ); groupPluginData.appendChild( newList.createTextNode( oldGroupElement.text() ) ); } @@ -836,7 +836,7 @@ void ContactList::convertContactList( const TQString &fileName, uint /* fromVers // Close the file, and save the new file contactListFile.close(); - TQDir().rename( fileName, fileName + TQString::fromLatin1( ".bak" ) ); + TQDir().rename( fileName, fileName + TQString::tqfromLatin1( ".bak" ) ); // kdDebug( 14010 ) << k_funcinfo << "XML output:\n" << newList.toString( 2 ) << endl; @@ -862,7 +862,7 @@ void Kopete::ContactList::saveXML() return; } - TQString contactListFileName = locateLocal( "appdata", TQString::fromLatin1( "contactlist.xml" ) ); + TQString contactListFileName = locateLocal( "appdata", TQString::tqfromLatin1( "contactlist.xml" ) ); KSaveFile contactListFile( contactListFileName ); if( contactListFile.status() == 0 ) { @@ -894,8 +894,8 @@ void Kopete::ContactList::saveXML() const TQDomDocument ContactList::toXML() { TQDomDocument doc; - doc.appendChild( doc.createElement( TQString::fromLatin1("kopete-contact-list") ) ); - doc.documentElement().setAttribute( TQString::fromLatin1("version"), TQString::fromLatin1("1.0")); + doc.appendChild( doc.createElement( TQString::tqfromLatin1("kopete-contact-list") ) ); + doc.documentElement().setAttribute( TQString::tqfromLatin1("version"), TQString::tqfromLatin1("1.0")); // Save group information. ie: Open/Closed, pehaps later icons? Who knows. for( Kopete::Group *g = d->groups.first(); g; g = d->groups.next() ) @@ -910,7 +910,7 @@ const TQDomDocument ContactList::toXML() if( Kopete::Config::enableGlobalIdentity() ) { TQDomElement myselfElement = myself()->toXML(true); // Save minimal information. - myselfElement.setTagName( TQString::fromLatin1("myself-meta-contact") ); + myselfElement.setTagName( TQString::tqfromLatin1("myself-meta-contact") ); doc.documentElement().appendChild( doc.importNode( myselfElement, true ) ); } @@ -934,7 +934,7 @@ TQStringList ContactList::contactStatuses() const TQPtrListIterator<Kopete::MetaContact> it( d->contacts ); for( ; it.current(); ++it ) { - meta_contacts.append( TQString::fromLatin1( "%1 (%2)" ). + meta_contacts.append( TQString::tqfromLatin1( "%1 (%2)" ). arg( it.current()->displayName(), it.current()->statusString() )); } return meta_contacts; |