diff options
Diffstat (limited to 'kopete/kopete/kconf_update/kopete-nameTracking.cpp')
-rw-r--r-- | kopete/kopete/kconf_update/kopete-nameTracking.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/kopete/kopete/kconf_update/kopete-nameTracking.cpp b/kopete/kopete/kconf_update/kopete-nameTracking.cpp index f1a4e37d..ff969fc2 100644 --- a/kopete/kopete/kconf_update/kopete-nameTracking.cpp +++ b/kopete/kopete/kconf_update/kopete-nameTracking.cpp @@ -15,7 +15,7 @@ */ #include <tqdir.h> -#include <tqtextstream.h> +#include <textstream.h> #include <tqdom.h> #include <kstandarddirs.h> @@ -25,7 +25,7 @@ static TQTextStream qcerr( stderr, IO_WriteOnly ); int main() { KInstance* inst = new KInstance( "Update script" ); - TQString filename = locateLocal( "data", TQString::tqfromLatin1( "kopete/contactlist.xml" ) ); + TQString filename = locateLocal( "data", TQString::fromLatin1( "kopete/contactlist.xml" ) ); // Load contact list & save backup. TQFile contactListFile( filename ); @@ -33,7 +33,7 @@ int main() TQDomDocument contactList; contactList.setContent( &contactListFile ); contactListFile.close(); - TQDir().rename( filename, filename + TQString::tqfromLatin1( ".bak" ) ); + TQDir().rename( filename, filename + TQString::fromLatin1( ".bak" ) ); // parse the XML file TQDomElement list = contactList.documentElement(); @@ -43,7 +43,7 @@ int main() { // update all the MetaContacts - if( mcElement.tagName() == TQString::tqfromLatin1("meta-contact") ) + if( mcElement.tagName() == TQString::fromLatin1("meta-contact") ) { TQDomElement displayName; TQDomElement subcontact; @@ -51,13 +51,13 @@ int main() TQDomElement elem = mcElement.firstChild().toElement(); while( !elem.isNull() ) { - if( elem.tagName() == TQString::tqfromLatin1( "display-name" ) ) + if( elem.tagName() == TQString::fromLatin1( "display-name" ) ) displayName = elem; - if( elem.tagName() == TQString::tqfromLatin1( "plugin-data" ) ) + if( elem.tagName() == TQString::fromLatin1( "plugin-data" ) ) { // check if it's a contact by checking for "protocol" substring in the tag, // and the presence of a contactId child element. - TQString pluginId = elem.attribute( TQString::tqfromLatin1( "plugin-id" ) ); + TQString pluginId = elem.attribute( TQString::fromLatin1( "plugin-id" ) ); bool isProtocol = ( pluginId.contains( "protocol", false ) > 0 ); // case-insensitive search bool hasContactId = false; TQDomNode field = elem.firstChild(); @@ -66,8 +66,8 @@ int main() TQDomElement fieldElem = field.toElement(); if( !fieldElem.isNull() && - fieldElem.tagName() == TQString::tqfromLatin1( "plugin-data-field" ) && - fieldElem.attribute( TQString::tqfromLatin1( "key" ) ) == TQString::tqfromLatin1( "contactId" ) ) + fieldElem.tagName() == TQString::fromLatin1( "plugin-data-field" ) && + fieldElem.attribute( TQString::fromLatin1( "key" ) ) == TQString::fromLatin1( "contactId" ) ) { hasContactId = true; break; @@ -85,8 +85,8 @@ int main() // check if we're even tracking the subcontact's name // if displayName.isNull(), it simply won't find the attribute; no harm done bool tracking = - ( displayName.attribute( TQString::tqfromLatin1( "trackChildNameChanges" ), - TQString::tqfromLatin1( "0" ) ) == TQString::tqfromLatin1( "1" ) ); + ( displayName.attribute( TQString::fromLatin1( "trackChildNameChanges" ), + TQString::fromLatin1( "0" ) ) == TQString::fromLatin1( "1" ) ); if( !displayName.isNull() && !subcontact.isNull() && tracking ) { // collect info @@ -94,26 +94,26 @@ int main() TQString nsPID; TQString nsAID; - nsPID = subcontact.attribute( TQString::tqfromLatin1( "plugin-id" ) ); + nsPID = subcontact.attribute( TQString::fromLatin1( "plugin-id" ) ); TQDomNode field = subcontact.firstChild(); while( !field.isNull() ) { TQDomElement fieldElem = field.toElement(); - if( !fieldElem.isNull() && fieldElem.tagName() == TQString::tqfromLatin1( "plugin-data-field" ) ) + if( !fieldElem.isNull() && fieldElem.tagName() == TQString::fromLatin1( "plugin-data-field" ) ) { - if( fieldElem.attribute( TQString::tqfromLatin1( "key" ) ) == TQString::tqfromLatin1( "contactId" ) ) + if( fieldElem.attribute( TQString::fromLatin1( "key" ) ) == TQString::fromLatin1( "contactId" ) ) nsCID = fieldElem.text(); - if( fieldElem.attribute( TQString::tqfromLatin1( "key" ) ) == TQString::tqfromLatin1( "accountId" ) ) + if( fieldElem.attribute( TQString::fromLatin1( "key" ) ) == TQString::fromLatin1( "accountId" ) ) nsAID = fieldElem.text(); } field = field.nextSibling(); } // create the tracking info - displayName.setAttribute( TQString::tqfromLatin1( "nameSourceContactId" ), nsCID ); - displayName.setAttribute( TQString::tqfromLatin1( "nameSourcePluginId" ), nsPID ); - displayName.setAttribute( TQString::tqfromLatin1( "nameSourceAccountId" ), nsAID ); + displayName.setAttribute( TQString::fromLatin1( "nameSourceContactId" ), nsCID ); + displayName.setAttribute( TQString::fromLatin1( "nameSourcePluginId" ), nsPID ); + displayName.setAttribute( TQString::fromLatin1( "nameSourceAccountId" ), nsAID ); } } |