diff options
Diffstat (limited to 'kopete/plugins/history/converter.cpp')
-rw-r--r-- | kopete/plugins/history/converter.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/kopete/plugins/history/converter.cpp b/kopete/plugins/history/converter.cpp index 76b29a5c..677ed1d2 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 ); @@ -112,7 +112,7 @@ void HistoryPlugin::convertOldHistory() progressDlg->progressBar()->reset(); progressDlg->progressBar()->setTotalSteps(d2.count()); - progressDlg->setLabel(i18n("Parsing old history in %1").tqarg(fi->fileName())); + progressDlg->setLabel(i18n("Parsing old history in %1").arg(fi->fileName())); progressDlg->show(); //if it was not already showed... while ( (fi2 = it2.current()) != 0 ) @@ -122,7 +122,7 @@ void HistoryPlugin::convertOldHistory() if(!contactId.isEmpty() ) { - progressDlg->setLabel(i18n("Parsing old history in %1:\n%2").tqarg(fi->fileName()).tqarg(contactId)); + progressDlg->setLabel(i18n("Parsing old history in %1:\n%2").arg(fi->fileName()).arg(contactId)); kapp->processEvents(0); //make sure the text is updated in the progressDlg int month=0; @@ -155,12 +155,12 @@ void HistoryPlugin::convertOldHistory() buffer += TQString::fromUtf8(cbuf); } - if( buffer.startsWith( TQString::tqfromLatin1( "<message " ) ) ) + if( buffer.startsWith( TQString::fromLatin1( "<message " ) ) ) { msgBlock = buffer; // find the end of the message block - while( !feof( f ) && buffer != TQString::tqfromLatin1( "</message>\n" ) /*strcmp("</message>\n", cbuf )*/ ) + while( !feof( f ) && buffer != TQString::fromLatin1( "</message>\n" ) /*strcmp("</message>\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 ); |