From 089118c18533dfa3e6ce5065dbebdd4db94051f1 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 18 Dec 2011 18:33:51 -0600 Subject: Rename old tq methods that no longer need a unique name --- kopete/plugins/history/converter.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'kopete/plugins/history/converter.cpp') diff --git a/kopete/plugins/history/converter.cpp b/kopete/plugins/history/converter.cpp index 76b29a5c..64af8c81 100644 --- a/kopete/plugins/history/converter.cpp +++ b/kopete/plugins/history/converter.cpp @@ -44,7 +44,7 @@ void HistoryPlugin::convertOldHistory() progressDlg->setAllowCancel(false); //because i am too lazy to allow to cancel - TQString kopetedir=locateLocal( "data", TQString::tqfromLatin1( "kopete")); + TQString kopetedir=locateLocal( "data", TQString::fromLatin1( "kopete")); TQDir d( kopetedir ); //d should point to ~/.kde/share/apps/kopete/ d.setFilter( TQDir::Dirs ); @@ -155,12 +155,12 @@ void HistoryPlugin::convertOldHistory() buffer += TQString::fromUtf8(cbuf); } - if( buffer.startsWith( TQString::tqfromLatin1( "\n" ) /*strcmp("\n", cbuf )*/ ) + while( !feof( f ) && buffer != TQString::fromLatin1( "\n" ) /*strcmp("\n", cbuf )*/ ) { fgets(cbuf, CBUFLENGTH, f); buffer = TQString::fromUtf8(cbuf); @@ -178,7 +178,7 @@ void HistoryPlugin::convertOldHistory() msgelement = xmllist.documentElement(); node = msgelement.firstChild(); - if( msgelement.attribute( TQString::tqfromLatin1( "direction" ) ) == TQString::tqfromLatin1( "inbound" ) ) + if( msgelement.attribute( TQString::fromLatin1( "direction" ) ) == TQString::fromLatin1( "inbound" ) ) dir = Kopete::Message::Inbound; else dir = Kopete::Message::Outbound; @@ -194,12 +194,12 @@ void HistoryPlugin::convertOldHistory() element = node.toElement(); tagname = element.tagName(); - if( tagname == TQString::tqfromLatin1( "srcnick" ) ) + if( tagname == TQString::fromLatin1( "srcnick" ) ) nick = element.text(); - else if( tagname == TQString::tqfromLatin1( "date" ) ) + else if( tagname == TQString::fromLatin1( "date" ) ) date = element.text(); - else if( tagname == TQString::tqfromLatin1( "body" ) ) + else if( tagname == TQString::fromLatin1( "body" ) ) body = element.text().stripWhiteSpace(); } @@ -213,11 +213,11 @@ void HistoryPlugin::convertOldHistory() if(!docElem.isNull()) { TQDate date(year,month,1); - TQString name = protocolId.replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + - TQString::tqfromLatin1( "/" ) + - contactId.replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + TQString name = protocolId.replace( TQRegExp( TQString::fromLatin1( "[./~?*]" ) ), TQString::fromLatin1( "-" ) ) + + TQString::fromLatin1( "/" ) + + contactId.replace( TQRegExp( TQString::fromLatin1( "[./~?*]" ) ), TQString::fromLatin1( "-" ) ) + date.toString(".yyyyMM"); - KSaveFile file( locateLocal( "data", TQString::tqfromLatin1( "kopete/logs/" ) + name+ TQString::tqfromLatin1( ".xml" ) ) ); + KSaveFile file( locateLocal( "data", TQString::fromLatin1( "kopete/logs/" ) + name+ TQString::fromLatin1( ".xml" ) ) ); if( file.status() == 0 ) { TQTextStream *stream = file.textStream(); @@ -254,7 +254,7 @@ void HistoryPlugin::convertOldHistory() headElem.appendChild(contactElem); TQDomElement importElem = doc.createElement( "imported" ); importElem.setAttribute( "from", fi->fileName() ); - importElem.setAttribute( "date", TQDateTime::tqcurrentDateTime().toString() ); + importElem.setAttribute( "date", TQDateTime::currentDateTime().toString() ); headElem.appendChild(importElem); } TQDomElement msgElem = doc.createElement( "msg" ); @@ -275,11 +275,11 @@ void HistoryPlugin::convertOldHistory() if(!docElem.isNull()) { TQDate date(year,month,1); - TQString name = protocolId.replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + - TQString::tqfromLatin1( "/" ) + - contactId.replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + TQString name = protocolId.replace( TQRegExp( TQString::fromLatin1( "[./~?*]" ) ), TQString::fromLatin1( "-" ) ) + + TQString::fromLatin1( "/" ) + + contactId.replace( TQRegExp( TQString::fromLatin1( "[./~?*]" ) ), TQString::fromLatin1( "-" ) ) + date.toString(".yyyyMM"); - KSaveFile file( locateLocal( "data", TQString::tqfromLatin1( "kopete/logs/" ) + name+ TQString::tqfromLatin1( ".xml" ) ) ); + KSaveFile file( locateLocal( "data", TQString::fromLatin1( "kopete/logs/" ) + name+ TQString::fromLatin1( ".xml" ) ) ); if( file.status() == 0 ) { TQTextStream *stream = file.textStream(); @@ -310,12 +310,12 @@ bool HistoryPlugin::detectOldHistory() return false; - TQDir d( locateLocal( "data", TQString::tqfromLatin1( "kopete/logs")) ); + TQDir d( locateLocal( "data", TQString::fromLatin1( "kopete/logs")) ); d.setFilter( TQDir::Dirs ); if(d.count() >= 3) // '.' and '..' are included return false; //the new history already exists - TQDir d2( locateLocal( "data", TQString::tqfromLatin1( "kopete")) ); + TQDir d2( locateLocal( "data", TQString::fromLatin1( "kopete")) ); d2.setFilter( TQDir::Dirs ); const TQFileInfoList *list = d2.entryInfoList(); TQFileInfoListIterator it( *list ); -- cgit v1.2.3