From 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 22 Jun 2011 00:30:31 +0000 Subject: 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 --- kopete/plugins/history/converter.cpp | 62 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'kopete/plugins/history/converter.cpp') diff --git a/kopete/plugins/history/converter.cpp b/kopete/plugins/history/converter.cpp index d2e4839d..5a84e021 100644 --- a/kopete/plugins/history/converter.cpp +++ b/kopete/plugins/history/converter.cpp @@ -40,17 +40,17 @@ void HistoryPlugin::convertOldHistory() i18n( "Would you like to remove old history files?" ) , i18n( "History Converter" ), KStdGuiItem::del(), i18n("Keep") ) == KMessageBox::Yes; KProgressDialog *progressDlg=new KProgressDialog(Kopete::UI::Global::mainWidget() , "history_progress_dlg" , i18n( "History converter" ) , - TQString::null , true); //modal to make sure the user will not doing stupid things (we have a kapp->processEvents()) + TQString() , true); //modal to make sure the user will not doing stupid things (we have a kapp->processEvents()) progressDlg->setAllowCancel(false); //because i am too lazy to allow to cancel - TQString kopetedir=locateLocal( "data", TQString::fromLatin1( "kopete")); + TQString kopetedir=locateLocal( "data", TQString::tqfromLatin1( "kopete")); TQDir d( kopetedir ); //d should point to ~/.kde/share/apps/kopete/ d.setFilter( TQDir::Dirs ); - const QFileInfoList *list = d.entryInfoList(); - QFileInfoListIterator it( *list ); + const TQFileInfoList *list = d.entryInfoList(); + TQFileInfoListIterator it( *list ); TQFileInfo *fi; while ( (fi = it.current()) != 0 ) { @@ -74,9 +74,9 @@ void HistoryPlugin::convertOldHistory() KGlobal::config()->setGroup("MSN"); accountId=KGlobal::config()->readEntry( "UserID" ); } - else if(fi->fileName() == "ICQProtocol" || fi->fileName() == "icq_logs" ) + else if(fi->fileName() == "ICTQProtocol" || fi->fileName() == "icq_logs" ) { - protocolId="ICQProtocol"; + protocolId="ICTQProtocol"; KGlobal::config()->setGroup("ICQ"); accountId=KGlobal::config()->readEntry( "UIN" ); } @@ -106,23 +106,23 @@ void HistoryPlugin::convertOldHistory() TQDir d2( fi->absFilePath() ); d2.setFilter( TQDir::Files ); d2.setNameFilter("*.log"); - const QFileInfoList *list = d2.entryInfoList(); - QFileInfoListIterator it2( *list ); + const TQFileInfoList *list = d2.entryInfoList(); + TQFileInfoListIterator it2( *list ); TQFileInfo *fi2; progressDlg->progressBar()->reset(); progressDlg->progressBar()->setTotalSteps(d2.count()); - progressDlg->setLabel(i18n("Parsing old history in %1").arg(fi->fileName())); + progressDlg->setLabel(i18n("Parsing old history in %1").tqarg(fi->fileName())); progressDlg->show(); //if it was not already showed... while ( (fi2 = it2.current()) != 0 ) { //we assume that all "-" are dots. (like in hotmail.com) - TQString contactId=fi2->fileName().replace(".log" , TQString::null).replace("-" , "."); + TQString contactId=fi2->fileName().tqreplace(".log" , TQString()).tqreplace("-" , "."); if(!contactId.isEmpty() ) { - progressDlg->setLabel(i18n("Parsing old history in %1:\n%2").arg(fi->fileName()).arg(contactId)); + progressDlg->setLabel(i18n("Parsing old history in %1:\n%2").tqarg(fi->fileName()).tqarg(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::fromLatin1( "\n" ) /*strcmp("\n", cbuf )*/ ) + while( !feof( f ) && buffer != TQString::tqfromLatin1( "\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::fromLatin1( "direction" ) ) == TQString::fromLatin1( "inbound" ) ) + if( msgelement.attribute( TQString::tqfromLatin1( "direction" ) ) == TQString::tqfromLatin1( "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::fromLatin1( "srcnick" ) ) + if( tagname == TQString::tqfromLatin1( "srcnick" ) ) nick = element.text(); - else if( tagname == TQString::fromLatin1( "date" ) ) + else if( tagname == TQString::tqfromLatin1( "date" ) ) date = element.text(); - else if( tagname == TQString::fromLatin1( "body" ) ) + else if( tagname == TQString::tqfromLatin1( "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::fromLatin1( "[./~?*]" ) ), TQString::fromLatin1( "-" ) ) + - TQString::fromLatin1( "/" ) + - contactId.replace( TQRegExp( TQString::fromLatin1( "[./~?*]" ) ), TQString::fromLatin1( "-" ) ) + + TQString name = protocolId.tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + TQString::tqfromLatin1( "/" ) + + contactId.tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + date.toString(".yyyyMM"); - KSaveFile file( locateLocal( "data", TQString::fromLatin1( "kopete/logs/" ) + name+ TQString::fromLatin1( ".xml" ) ) ); + KSaveFile file( locateLocal( "data", TQString::tqfromLatin1( "kopete/logs/" ) + name+ TQString::tqfromLatin1( ".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::currentDateTime().toString() ); + importElem.setAttribute( "date", TQDateTime::tqcurrentDateTime().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::fromLatin1( "[./~?*]" ) ), TQString::fromLatin1( "-" ) ) + - TQString::fromLatin1( "/" ) + - contactId.replace( TQRegExp( TQString::fromLatin1( "[./~?*]" ) ), TQString::fromLatin1( "-" ) ) + + TQString name = protocolId.tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + TQString::tqfromLatin1( "/" ) + + contactId.tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + date.toString(".yyyyMM"); - KSaveFile file( locateLocal( "data", TQString::fromLatin1( "kopete/logs/" ) + name+ TQString::fromLatin1( ".xml" ) ) ); + KSaveFile file( locateLocal( "data", TQString::tqfromLatin1( "kopete/logs/" ) + name+ TQString::tqfromLatin1( ".xml" ) ) ); if( file.status() == 0 ) { TQTextStream *stream = file.textStream(); @@ -310,15 +310,15 @@ bool HistoryPlugin::detectOldHistory() return false; - TQDir d( locateLocal( "data", TQString::fromLatin1( "kopete/logs")) ); + TQDir d( locateLocal( "data", TQString::tqfromLatin1( "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::fromLatin1( "kopete")) ); + TQDir d2( locateLocal( "data", TQString::tqfromLatin1( "kopete")) ); d2.setFilter( TQDir::Dirs ); - const QFileInfoList *list = d2.entryInfoList(); - QFileInfoListIterator it( *list ); + const TQFileInfoList *list = d2.entryInfoList(); + TQFileInfoListIterator it( *list ); TQFileInfo *fi; while ( (fi = it.current()) != 0 ) { @@ -327,7 +327,7 @@ bool HistoryPlugin::detectOldHistory() if(fi->fileName() == "MSNProtocol" || fi->fileName() == "msn_logs" ) return true; - else if(fi->fileName() == "ICQProtocol" || fi->fileName() == "icq_logs" ) + else if(fi->fileName() == "ICTQProtocol" || fi->fileName() == "icq_logs" ) return true; else if(fi->fileName() == "AIMProtocol" || fi->fileName() == "aim_logs" ) return true; -- cgit v1.2.1