diff options
Diffstat (limited to 'kopete/plugins/history')
-rw-r--r-- | kopete/plugins/history/converter.cpp | 10 | ||||
-rw-r--r-- | kopete/plugins/history/historydialog.cpp | 26 | ||||
-rw-r--r-- | kopete/plugins/history/historylogger.cpp | 38 | ||||
-rw-r--r-- | kopete/plugins/history/historyplugin.cpp | 6 |
4 files changed, 40 insertions, 40 deletions
diff --git a/kopete/plugins/history/converter.cpp b/kopete/plugins/history/converter.cpp index 5a84e021..76b29a5c 100644 --- a/kopete/plugins/history/converter.cpp +++ b/kopete/plugins/history/converter.cpp @@ -118,7 +118,7 @@ void HistoryPlugin::convertOldHistory() while ( (fi2 = it2.current()) != 0 ) { //we assume that all "-" are dots. (like in hotmail.com) - TQString contactId=fi2->fileName().tqreplace(".log" , TQString()).tqreplace("-" , "."); + TQString contactId=fi2->fileName().replace(".log" , TQString()).replace("-" , "."); if(!contactId.isEmpty() ) { @@ -213,9 +213,9 @@ void HistoryPlugin::convertOldHistory() if(!docElem.isNull()) { TQDate date(year,month,1); - TQString name = protocolId.tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + TQString name = protocolId.replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + TQString::tqfromLatin1( "/" ) + - contactId.tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + contactId.replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + date.toString(".yyyyMM"); KSaveFile file( locateLocal( "data", TQString::tqfromLatin1( "kopete/logs/" ) + name+ TQString::tqfromLatin1( ".xml" ) ) ); if( file.status() == 0 ) @@ -275,9 +275,9 @@ void HistoryPlugin::convertOldHistory() if(!docElem.isNull()) { TQDate date(year,month,1); - TQString name = protocolId.tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + TQString name = protocolId.replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + TQString::tqfromLatin1( "/" ) + - contactId.tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + contactId.replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + date.toString(".yyyyMM"); KSaveFile file( locateLocal( "data", TQString::tqfromLatin1( "kopete/logs/" ) + name+ TQString::tqfromLatin1( ".xml" ) ) ); if( file.status() == 0 ) diff --git a/kopete/plugins/history/historydialog.cpp b/kopete/plugins/history/historydialog.cpp index b61738ae..e86f08b7 100644 --- a/kopete/plugins/history/historydialog.cpp +++ b/kopete/plugins/history/historydialog.cpp @@ -125,7 +125,7 @@ HistoryDialog::HistoryDialog(Kopete::MetaContact *mc, TQWidget* tqparent, } if (mMetaContact) - mMainWidget->contactComboBox->setCurrentItem(mMetaContactList.tqfind(mMetaContact)+1); + mMainWidget->contactComboBox->setCurrentItem(mMetaContactList.find(mMetaContact)+1); mMainWidget->dateSearchLine->setListView(mMainWidget->dateListView); mMainWidget->dateListView->setSorting(0, 0); //newest-first @@ -231,7 +231,7 @@ void HistoryDialog::slotLoadDays() for (unsigned int i=0; i<dayList.count(); i++) { TQDate c2Date(pair.date().year(),pair.date().month(),dayList[i]); - if (mInit.dateMCList.tqfind(pair) == mInit.dateMCList.end()) + if (mInit.dateMCList.find(pair) == mInit.dateMCList.end()) new KListViewDateItem(mMainWidget->dateListView, c2Date, pair.metaContact()); } mMainWidget->searchProgress->advance(1); @@ -255,13 +255,13 @@ void HistoryDialog::init(Kopete::Contact *c) { // Get year and month list TQRegExp rx( "\\.(\\d\\d\\d\\d)(\\d\\d)" ); - const TQString contact_in_filename=c->contactId().tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ); + const TQString contact_in_filename=c->contactId().replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ); TQFileInfo *fi; // BEGIN check if there are Kopete 0.7.x TQDir d1(locateLocal("data",TQString("kopete/logs/")+ - c->protocol()->pluginId().tqreplace( TQRegExp(TQString::tqfromLatin1("[./~?*]")),TQString::tqfromLatin1("-")) + c->protocol()->pluginId().replace( TQRegExp(TQString::tqfromLatin1("[./~?*]")),TQString::tqfromLatin1("-")) )); d1.setFilter( TQDir::Files | TQDir::NoSymLinks ); d1.setSorting( TQDir::Name ); @@ -272,7 +272,7 @@ void HistoryDialog::init(Kopete::Contact *c) TQFileInfoListIterator it1( *list1 ); while ( (fi = it1.current()) != 0 ) { - if(fi->fileName().tqcontains(contact_in_filename)) + if(fi->fileName().contains(contact_in_filename)) { rx.search(fi->fileName()); @@ -288,9 +288,9 @@ void HistoryDialog::init(Kopete::Contact *c) // END of kopete 0.7.x check TQString logDir = locateLocal("data",TQString("kopete/logs/")+ - c->protocol()->pluginId().tqreplace( TQRegExp(TQString::tqfromLatin1("[./~?*]")),TQString::tqfromLatin1("-")) + + c->protocol()->pluginId().replace( TQRegExp(TQString::tqfromLatin1("[./~?*]")),TQString::tqfromLatin1("-")) + TQString::tqfromLatin1( "/" ) + - c->account()->accountId().tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + c->account()->accountId().replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) ); TQDir d(logDir); d.setFilter( TQDir::Files | TQDir::NoSymLinks ); @@ -301,7 +301,7 @@ void HistoryDialog::init(Kopete::Contact *c) TQFileInfoListIterator it( *list ); while ( (fi = it.current()) != 0 ) { - if(fi->fileName().tqcontains(contact_in_filename)) + if(fi->fileName().contains(contact_in_filename)) { rx.search(fi->fileName()); @@ -375,7 +375,7 @@ void HistoryDialog::setMessages(TQValueList<Kopete::Message> msgs) if (!mMainWidget->searchLine->text().isEmpty()) // If there is a search, then we hightlight the keywords { - body = body.tqreplace(mMainWidget->searchLine->text(), "<span style=\"background-color:yellow\">" + mMainWidget->searchLine->text() + "</span>", false); + body = body.replace(mMainWidget->searchLine->text(), "<span style=\"background-color:yellow\">" + mMainWidget->searchLine->text() + "</span>", false); } resultHTML += "(<b>" + (*it).timestamp().time().toString() + "</b>) " @@ -482,7 +482,7 @@ void HistoryDialog::slotSearch() TQDate month(curItem->date().year(),curItem->date().month(),1); // if we haven't searched the relevant history logs, search them now - if (!monthsSearched[month].tqcontains(curItem->metaContact())) + if (!monthsSearched[month].contains(curItem->metaContact())) { monthsSearched[month].push_back(curItem->metaContact()); TQPtrList<Kopete::Contact> contacts = curItem->metaContact()->contacts(); @@ -505,12 +505,12 @@ void HistoryDialog::slotSearch() while(!stream.atEnd()) { textLine = stream.readLine(); - if (textLine.tqcontains(mMainWidget->searchLine->text(), false)) + if (textLine.contains(mMainWidget->searchLine->text(), false)) { if(rx.search(textLine) != -1) { // only match message body - if (rx.cap(2).tqcontains(mMainWidget->searchLine->text())) + if (rx.cap(2).contains(mMainWidget->searchLine->text())) matches[TQDate(curItem->date().year(),curItem->date().month(),rx.cap(1).toInt())].push_back(curItem->metaContact()); } // this will happen when multiline messages are searched, properly @@ -525,7 +525,7 @@ void HistoryDialog::slotSearch() } // relevant logfiles have been searched now, check if current date matches - if (matches[curItem->date()].tqcontains(curItem->metaContact())) + if (matches[curItem->date()].contains(curItem->metaContact())) curItem->setVisible(true); // Next date item diff --git a/kopete/plugins/history/historylogger.cpp b/kopete/plugins/history/historylogger.cpp index 714fe966..063ba73d 100644 --- a/kopete/plugins/history/historylogger.cpp +++ b/kopete/plugins/history/historylogger.cpp @@ -125,7 +125,7 @@ TQDomDocument HistoryLogger::getDocument(const Kopete::Contact *c, unsigned int return TQDomDocument(); } - if(!m_metaContact->contacts().tqcontains(c)) + if(!m_metaContact->contacts().contains(c)) { if(contain) *contain=false; @@ -133,7 +133,7 @@ TQDomDocument HistoryLogger::getDocument(const Kopete::Contact *c, unsigned int } TQMap<unsigned int , TQDomDocument> documents = m_documents[c]; - if (documents.tqcontains(month)) + if (documents.contains(month)) return documents[month]; @@ -156,7 +156,7 @@ TQDomDocument HistoryLogger::getDocument(const Kopete::Contact *c, const TQDate return TQDomDocument(); } - if(!m_metaContact->contacts().tqcontains(c)) + if(!m_metaContact->contacts().contains(c)) { if(contain) *contain=false; @@ -223,7 +223,7 @@ void HistoryLogger::appendMessage( const Kopete::Message &msg , const Kopete::Co } - if(!c || !m_metaContact->contacts().tqcontains(c) ) + if(!c || !m_metaContact->contacts().contains(c) ) { /*TQPtrList<Kopete::Contact> contacts= m_metaContact->contacts(); TQPtrListIterator<Kopete::Contact> it( contacts ); @@ -418,7 +418,7 @@ TQValueList<Kopete::Message> HistoryLogger::readMessages(unsigned int lines, return messages; } - if(c && !m_metaContact->contacts().tqcontains(c) ) + if(c && !m_metaContact->contacts().contains(c) ) return messages; if(sens ==0 ) //if no sens are selected, just continue in the previous sens @@ -473,7 +473,7 @@ TQValueList<Kopete::Message> HistoryLogger::readMessages(unsigned int lines, // date, this date will bocomes the limit. TQDomNode n; - if(m_currentElements.tqcontains(*it)) + if(m_currentElements.contains(*it)) n=m_currentElements[*it]; else //there is not yet "next message" register, so we will take the first (for the current month) { @@ -512,7 +512,7 @@ TQValueList<Kopete::Message> HistoryLogger::readMessages(unsigned int lines, } else //we don't have to merge the history. just take the next item in the contact { - if(m_currentElements.tqcontains(currentContact)) + if(m_currentElements.contains(currentContact)) msgElem=m_currentElements[currentContact]; else { @@ -572,7 +572,7 @@ TQValueList<Kopete::Message> HistoryLogger::readMessages(unsigned int lines, if(!m_hideOutgoing || dir != Kopete::Message::Outbound) { //parse only if we don't hide it - if( m_filter.isNull() || ( m_filterRegExp? msgElem.text().tqcontains(TQRegExp(m_filter,m_filterCaseSensitive)) : msgElem.text().tqcontains(m_filter,m_filterCaseSensitive) )) + if( m_filter.isNull() || ( m_filterRegExp? msgElem.text().contains(TQRegExp(m_filter,m_filterCaseSensitive)) : msgElem.text().contains(m_filter,m_filterCaseSensitive) )) { TQString f=msgElem.attribute("from" ); const Kopete::Contact *from=(f.isNull() || !currentContact) ? 0L : currentContact->account()->contacts()[f]; @@ -663,11 +663,11 @@ TQValueList<Kopete::Message> HistoryLogger::readMessages(unsigned int lines, TQString HistoryLogger::getFileName(const Kopete::Contact* c, TQDate date) { - TQString name = c->protocol()->pluginId().tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + TQString name = c->protocol()->pluginId().replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + TQString::tqfromLatin1( "/" ) + - c->account()->accountId().tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + c->account()->accountId().replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + TQString::tqfromLatin1( "/" ) + - c->contactId().tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + c->contactId().replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + date.toString(".yyyyMM"); TQString filename=locateLocal( "data", TQString::tqfromLatin1( "kopete/logs/" ) + name+ TQString::tqfromLatin1( ".xml" ) ) ; @@ -676,9 +676,9 @@ TQString HistoryLogger::getFileName(const Kopete::Contact* c, TQDate date) TQFileInfo fi(filename); if(!fi.exists()) { - name = c->protocol()->pluginId().tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + name = c->protocol()->pluginId().replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + TQString::tqfromLatin1( "/" ) + - c->contactId().tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + + c->contactId().replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + date.toString(".yyyyMM"); TQString filename2=locateLocal( "data", TQString::tqfromLatin1( "kopete/logs/" ) + name+ TQString::tqfromLatin1( ".xml" ) ) ; @@ -702,7 +702,7 @@ unsigned int HistoryLogger::getFirstMonth(const Kopete::Contact *c) // BEGIN check if there are Kopete 0.7.x TQDir d1(locateLocal("data",TQString("kopete/logs/")+ - c->protocol()->pluginId().tqreplace( TQRegExp(TQString::tqfromLatin1("[./~?*]")),TQString::tqfromLatin1("-")) + c->protocol()->pluginId().replace( TQRegExp(TQString::tqfromLatin1("[./~?*]")),TQString::tqfromLatin1("-")) )); d1.setFilter( TQDir::Files | TQDir::NoSymLinks ); d1.setSorting( TQDir::Name ); @@ -712,7 +712,7 @@ unsigned int HistoryLogger::getFirstMonth(const Kopete::Contact *c) while ( (fi = it1.current()) != 0 ) { - if(fi->fileName().tqcontains(c->contactId().tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ))) + if(fi->fileName().contains(c->contactId().replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ))) { rx.search(fi->fileName()); int result = 12*(TQDate::tqcurrentDate().year() - rx.cap(1).toUInt()) +TQDate::tqcurrentDate().month() - rx.cap(2).toUInt(); @@ -730,9 +730,9 @@ unsigned int HistoryLogger::getFirstMonth(const Kopete::Contact *c) TQDir d(locateLocal("data",TQString("kopete/logs/")+ - c->protocol()->pluginId().tqreplace( TQRegExp(TQString::tqfromLatin1("[./~?*]")),TQString::tqfromLatin1("-")) + + c->protocol()->pluginId().replace( TQRegExp(TQString::tqfromLatin1("[./~?*]")),TQString::tqfromLatin1("-")) + TQString::tqfromLatin1( "/" ) + - c->account()->accountId().tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) + c->account()->accountId().replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ) )); d.setFilter( TQDir::Files | TQDir::NoSymLinks ); @@ -742,7 +742,7 @@ unsigned int HistoryLogger::getFirstMonth(const Kopete::Contact *c) TQFileInfoListIterator it( *list ); while ( (fi = it.current()) != 0 ) { - if(fi->fileName().tqcontains(c->contactId().tqreplace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ))) + if(fi->fileName().contains(c->contactId().replace( TQRegExp( TQString::tqfromLatin1( "[./~?*]" ) ), TQString::tqfromLatin1( "-" ) ))) { rx.search(fi->fileName()); int result = 12*(TQDate::tqcurrentDate().year() - rx.cap(1).toUInt()) +TQDate::tqcurrentDate().month() - rx.cap(2).toUInt(); @@ -838,7 +838,7 @@ TQValueList<int> HistoryLogger::getDaysForMonth(TQDate date) pos += rxTime.matchedLength(); int day=rxTime.capturedTexts()[1].toInt(); - if ( day !=lastDay && dayList.tqfind(day) == dayList.end()) // avoid duplicates + if ( day !=lastDay && dayList.find(day) == dayList.end()) // avoid duplicates { dayList.append(rxTime.capturedTexts()[1].toInt()); lastDay=day; diff --git a/kopete/plugins/history/historyplugin.cpp b/kopete/plugins/history/historyplugin.cpp index 789b331c..3c83c371 100644 --- a/kopete/plugins/history/historyplugin.cpp +++ b/kopete/plugins/history/historyplugin.cpp @@ -76,7 +76,7 @@ HistoryPlugin::HistoryPlugin( TQObject *tqparent, const char *name, const TQStri TQValueList<Kopete::ChatSession*> sessions = Kopete::ChatSessionManager::self()->sessions(); for (TQValueListIterator<Kopete::ChatSession*> it= sessions.begin(); it!=sessions.end() ; ++it) { - if(!m_loggers.tqcontains(*it)) + if(!m_loggers.contains(*it)) { m_loggers.insert(*it, new HistoryGUIClient( *it ) ); connect( *it, TQT_SIGNAL(closing(Kopete::ChatSession*)), @@ -102,7 +102,7 @@ void HistoryPlugin::messageDisplayed(const Kopete::Message &m) if(m.direction()==Kopete::Message::Internal || !m.manager()) return; - if(!m_loggers.tqcontains(m.manager())) + if(!m_loggers.contains(m.manager())) { m_loggers.insert(m.manager() , new HistoryGUIClient( m.manager() ) ); connect(m.manager(), TQT_SIGNAL(closing(Kopete::ChatSession*)), @@ -149,7 +149,7 @@ void HistoryPlugin::slotViewCreated( KopeteView* v ) if(!m_currentChatSession) return; //i am sorry - if(!m_loggers.tqcontains(m_currentChatSession)) + if(!m_loggers.contains(m_currentChatSession)) { m_loggers.insert(m_currentChatSession , new HistoryGUIClient( m_currentChatSession ) ); connect( m_currentChatSession, TQT_SIGNAL(closing(Kopete::ChatSession*)), |