diff options
Diffstat (limited to 'kmail/kmfoldersearch.cpp')
-rw-r--r-- | kmail/kmfoldersearch.cpp | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/kmail/kmfoldersearch.cpp b/kmail/kmfoldersearch.cpp index 522785d11..471d2f3e0 100644 --- a/kmail/kmfoldersearch.cpp +++ b/kmail/kmfoldersearch.cpp @@ -262,9 +262,9 @@ void KMSearch::slotProcessNextBatch() folder->open("kmsearch"); mOpenedFolders.append( folder ); connect( folder->storage(), - TQT_SIGNAL( searchResult( KMFolder*, TQValueList<Q_UINT32>, const KMSearchPattern*, bool ) ), + TQT_SIGNAL( searchResult( KMFolder*, TQValueList<TQ_UINT32>, const KMSearchPattern*, bool ) ), this, - TQT_SLOT( slotSearchFolderResult( KMFolder*, TQValueList<Q_UINT32>, const KMSearchPattern*, bool ) ) ); + TQT_SLOT( slotSearchFolderResult( KMFolder*, TQValueList<TQ_UINT32>, const KMSearchPattern*, bool ) ) ); folder->storage()->search( mSearchPattern ); } else --mRemainingFolders; @@ -274,7 +274,7 @@ void KMSearch::slotProcessNextBatch() } void KMSearch::slotSearchFolderResult( KMFolder* folder, - TQValueList<Q_UINT32> serNums, + TQValueList<TQ_UINT32> serNums, const KMSearchPattern* pattern, bool complete ) { @@ -282,7 +282,7 @@ void KMSearch::slotSearchFolderResult( KMFolder* folder, return; kdDebug(5006) << k_funcinfo << folder->label() << " found " << serNums.count() << endl; mLastFolder = folder->label(); - TQValueListIterator<Q_UINT32> it; + TQValueListIterator<TQ_UINT32> it; for ( it = serNums.begin(); it != serNums.end(); ++it ) { emit found( *it ); @@ -291,10 +291,10 @@ void KMSearch::slotSearchFolderResult( KMFolder* folder, if ( complete ) { disconnect( folder->storage(), - TQT_SIGNAL( searchResult( KMFolder*, TQValueList<Q_UINT32>, + TQT_SIGNAL( searchResult( KMFolder*, TQValueList<TQ_UINT32>, const KMSearchPattern*, bool ) ), this, - TQT_SLOT( slotSearchFolderResult( KMFolder*, TQValueList<Q_UINT32>, + TQT_SLOT( slotSearchFolderResult( KMFolder*, TQValueList<TQ_UINT32>, const KMSearchPattern*, bool ) ) ); --mRemainingFolders; mSearchCount += folder->count(); @@ -325,12 +325,12 @@ KMFolderSearch::KMFolderSearch(KMFolder* folder, const char* name) //Hook up some slots for live updating of search folders //TODO: Optimize folderInvalidated, folderAdded, folderRemoved - connect(kmkernel->folderMgr(), TQT_SIGNAL(msgAdded(KMFolder*, Q_UINT32)), - this, TQT_SLOT(examineAddedMessage(KMFolder*, Q_UINT32))); - connect(kmkernel->folderMgr(), TQT_SIGNAL(msgRemoved(KMFolder*, Q_UINT32)), - this, TQT_SLOT(examineRemovedMessage(KMFolder*, Q_UINT32))); - connect(kmkernel->folderMgr(), TQT_SIGNAL(msgChanged(KMFolder*, Q_UINT32, int)), - this, TQT_SLOT(examineChangedMessage(KMFolder*, Q_UINT32, int))); + connect(kmkernel->folderMgr(), TQT_SIGNAL(msgAdded(KMFolder*, TQ_UINT32)), + this, TQT_SLOT(examineAddedMessage(KMFolder*, TQ_UINT32))); + connect(kmkernel->folderMgr(), TQT_SIGNAL(msgRemoved(KMFolder*, TQ_UINT32)), + this, TQT_SLOT(examineRemovedMessage(KMFolder*, TQ_UINT32))); + connect(kmkernel->folderMgr(), TQT_SIGNAL(msgChanged(KMFolder*, TQ_UINT32, int)), + this, TQT_SLOT(examineChangedMessage(KMFolder*, TQ_UINT32, int))); connect(kmkernel->folderMgr(), TQT_SIGNAL(folderInvalidated(KMFolder*)), this, TQT_SLOT(examineInvalidatedFolder(KMFolder*))); connect(kmkernel->folderMgr(), TQT_SIGNAL(folderAdded(KMFolder*)), @@ -340,12 +340,12 @@ KMFolderSearch::KMFolderSearch(KMFolder* folder, const char* name) connect(kmkernel->folderMgr(), TQT_SIGNAL(msgHeaderChanged(KMFolder*,int)), this, TQT_SLOT(propagateHeaderChanged(KMFolder*,int))); - connect(kmkernel->imapFolderMgr(), TQT_SIGNAL(msgAdded(KMFolder*, Q_UINT32)), - this, TQT_SLOT(examineAddedMessage(KMFolder*, Q_UINT32))); - connect(kmkernel->imapFolderMgr(), TQT_SIGNAL(msgRemoved(KMFolder*, Q_UINT32)), - this, TQT_SLOT(examineRemovedMessage(KMFolder*, Q_UINT32))); - connect(kmkernel->imapFolderMgr(), TQT_SIGNAL(msgChanged(KMFolder*, Q_UINT32, int)), - this, TQT_SLOT(examineChangedMessage(KMFolder*, Q_UINT32, int))); + connect(kmkernel->imapFolderMgr(), TQT_SIGNAL(msgAdded(KMFolder*, TQ_UINT32)), + this, TQT_SLOT(examineAddedMessage(KMFolder*, TQ_UINT32))); + connect(kmkernel->imapFolderMgr(), TQT_SIGNAL(msgRemoved(KMFolder*, TQ_UINT32)), + this, TQT_SLOT(examineRemovedMessage(KMFolder*, TQ_UINT32))); + connect(kmkernel->imapFolderMgr(), TQT_SIGNAL(msgChanged(KMFolder*, TQ_UINT32, int)), + this, TQT_SLOT(examineChangedMessage(KMFolder*, TQ_UINT32, int))); connect(kmkernel->imapFolderMgr(), TQT_SIGNAL(folderInvalidated(KMFolder*)), this, TQT_SLOT(examineInvalidatedFolder(KMFolder*))); connect(kmkernel->imapFolderMgr(), TQT_SIGNAL(folderAdded(KMFolder*)), @@ -355,12 +355,12 @@ KMFolderSearch::KMFolderSearch(KMFolder* folder, const char* name) connect(kmkernel->imapFolderMgr(), TQT_SIGNAL(msgHeaderChanged(KMFolder*,int)), this, TQT_SLOT(propagateHeaderChanged(KMFolder*,int))); - connect(kmkernel->dimapFolderMgr(), TQT_SIGNAL(msgAdded(KMFolder*, Q_UINT32)), - this, TQT_SLOT(examineAddedMessage(KMFolder*, Q_UINT32))); - connect(kmkernel->dimapFolderMgr(), TQT_SIGNAL(msgRemoved(KMFolder*, Q_UINT32)), - this, TQT_SLOT(examineRemovedMessage(KMFolder*, Q_UINT32))); - connect(kmkernel->dimapFolderMgr(), TQT_SIGNAL(msgChanged(KMFolder*, Q_UINT32, int)), - this, TQT_SLOT(examineChangedMessage(KMFolder*, Q_UINT32, int))); + connect(kmkernel->dimapFolderMgr(), TQT_SIGNAL(msgAdded(KMFolder*, TQ_UINT32)), + this, TQT_SLOT(examineAddedMessage(KMFolder*, TQ_UINT32))); + connect(kmkernel->dimapFolderMgr(), TQT_SIGNAL(msgRemoved(KMFolder*, TQ_UINT32)), + this, TQT_SLOT(examineRemovedMessage(KMFolder*, TQ_UINT32))); + connect(kmkernel->dimapFolderMgr(), TQT_SIGNAL(msgChanged(KMFolder*, TQ_UINT32, int)), + this, TQT_SLOT(examineChangedMessage(KMFolder*, TQ_UINT32, int))); connect(kmkernel->dimapFolderMgr(), TQT_SIGNAL(folderInvalidated(KMFolder*)), this, TQT_SLOT(examineInvalidatedFolder(KMFolder*))); connect(kmkernel->dimapFolderMgr(), TQT_SIGNAL(folderAdded(KMFolder*)), @@ -399,8 +399,8 @@ void KMFolderSearch::setSearch(KMSearch *search) delete mSearch; mSearch = search; // take ownership if (mSearch) { - TQObject::connect(search, TQT_SIGNAL(found(Q_UINT32)), - TQT_SLOT(addSerNum(Q_UINT32))); + TQObject::connect(search, TQT_SIGNAL(found(TQ_UINT32)), + TQT_SLOT(addSerNum(TQ_UINT32))); TQObject::connect(search, TQT_SIGNAL(finished(bool)), TQT_SLOT(searchFinished(bool))); } @@ -423,7 +423,7 @@ void KMFolderSearch::executeSearch() if (mSearch) mSearch->stop(); setSearch(mSearch); - invalidateFolder(); + tqinvalidateFolder(); } const KMSearch* KMFolderSearch::search() const @@ -438,7 +438,7 @@ void KMFolderSearch::searchFinished(bool success) close("foldersearch"); } -void KMFolderSearch::addSerNum(Q_UINT32 serNum) +void KMFolderSearch::addSerNum(TQ_UINT32 serNum) { if (mInvalid) // A new search is scheduled don't bother doing anything return; @@ -472,9 +472,9 @@ void KMFolderSearch::addSerNum(Q_UINT32 serNum) emitMsgAddedSignals(mSerNums.count()-1); } -void KMFolderSearch::removeSerNum(Q_UINT32 serNum) +void KMFolderSearch::removeSerNum(TQ_UINT32 serNum) { - TQValueVector<Q_UINT32>::const_iterator it; + TQValueVector<TQ_UINT32>::const_iterator it; int i = 0; for(it = mSerNums.begin(); it != mSerNums.end(); ++it, ++i) if ((*it) == serNum) { @@ -502,7 +502,7 @@ int KMFolderSearch::addMsg(KMMessage*, int* index_return) bool KMFolderSearch::readSearch() { mSearch = new KMSearch; - TQObject::connect(mSearch, TQT_SIGNAL(found(Q_UINT32)), TQT_SLOT(addSerNum(Q_UINT32))); + TQObject::connect(mSearch, TQT_SIGNAL(found(TQ_UINT32)), TQT_SLOT(addSerNum(TQ_UINT32))); TQObject::connect(mSearch, TQT_SIGNAL(finished(bool)), TQT_SLOT(searchFinished(bool))); return mSearch->read(location()); } @@ -603,7 +603,7 @@ int KMFolderSearch::create() clearIndex(); if (!mSearch) { mSearch = new KMSearch(); - TQObject::connect(mSearch, TQT_SIGNAL(found(Q_UINT32)), TQT_SLOT(addSerNum(Q_UINT32))); + TQObject::connect(mSearch, TQT_SIGNAL(found(TQ_UINT32)), TQT_SLOT(addSerNum(TQ_UINT32))); TQObject::connect(mSearch, TQT_SIGNAL(finished(bool)), TQT_SLOT(searchFinished(bool))); } mSearch->write(location()); @@ -645,7 +645,7 @@ const KMMsgBase* KMFolderSearch::getMsgBase(int idx) const { int folderIdx = -1; KMFolder *folder = 0; - if (idx < 0 || (Q_UINT32)idx >= mSerNums.count()) + if (idx < 0 || (TQ_UINT32)idx >= mSerNums.count()) return 0; KMMsgDict::instance()->getLocation(mSerNums[idx], &folder, &folderIdx); assert(folder && (folderIdx != -1)); @@ -656,7 +656,7 @@ KMMsgBase* KMFolderSearch::getMsgBase(int idx) { int folderIdx = -1; KMFolder *folder = 0; - if (idx < 0 || (Q_UINT32)idx >= mSerNums.count()) + if (idx < 0 || (TQ_UINT32)idx >= mSerNums.count()) return 0; KMMsgDict::instance()->getLocation(mSerNums[idx], &folder, &folderIdx); if (!folder || folderIdx == -1) @@ -669,7 +669,7 @@ KMMessage* KMFolderSearch::getMsg(int idx) { int folderIdx = -1; KMFolder *folder = 0; - if (idx < 0 || (Q_UINT32)idx >= mSerNums.count()) + if (idx < 0 || (TQ_UINT32)idx >= mSerNums.count()) return 0; KMMsgDict::instance()->getLocation(mSerNums[idx], &folder, &folderIdx); assert(folder && (folderIdx != -1)); @@ -701,8 +701,8 @@ KMFolderSearch::ignoreJobsForMessage( KMMessage* msg ) int KMFolderSearch::find(const KMMsgBase* msg) const { int pos = 0; - Q_UINT32 serNum = msg->getMsgSerNum(); - TQValueVector<Q_UINT32>::const_iterator it; + TQ_UINT32 serNum = msg->getMsgSerNum(); + TQValueVector<TQ_UINT32>::const_iterator it; for(it = mSerNums.begin(); it != mSerNums.end(); ++it) { if ((*it) == serNum) return pos; @@ -757,19 +757,19 @@ int KMFolderSearch::writeIndex( bool ) return -1; } fprintf(tmpIndexStream, IDS_SEARCH_HEADER, IDS_SEARCH_VERSION); - Q_UINT32 byteOrder = 0x12345678; + TQ_UINT32 byteOrder = 0x12345678; fwrite(&byteOrder, sizeof(byteOrder), 1, tmpIndexStream); - Q_UINT32 count = mSerNums.count(); + TQ_UINT32 count = mSerNums.count(); if (!fwrite(&count, sizeof(count), 1, tmpIndexStream)) { fclose(tmpIndexStream); truncate(TQFile::encodeName(filename), 0); return -1; } - TQValueVector<Q_UINT32>::iterator it; + TQValueVector<TQ_UINT32>::iterator it; for(it = mSerNums.begin(); it != mSerNums.end(); ++it) { - Q_UINT32 serNum = *it; + TQ_UINT32 serNum = *it; if (!fwrite(&serNum, sizeof(serNum), 1, tmpIndexStream)) return -1; } @@ -815,7 +815,7 @@ bool KMFolderSearch::readIndex() return false; } bool swapByteOrder; - Q_UINT32 byte_order; + TQ_UINT32 byte_order; if (!fread(&byte_order, sizeof(byte_order), 1, mIdsStream)) { fclose(mIdsStream); mIdsStream = 0; @@ -823,7 +823,7 @@ bool KMFolderSearch::readIndex() } swapByteOrder = (byte_order == 0x78563412); - Q_UINT32 count; + TQ_UINT32 count; if (!fread(&count, sizeof(count), 1, mIdsStream)) { fclose(mIdsStream); mIdsStream = 0; @@ -835,7 +835,7 @@ bool KMFolderSearch::readIndex() mUnreadMsgs = 0; mSerNums.reserve(count); for (unsigned int index = 0; index < count; index++) { - Q_UINT32 serNum; + TQ_UINT32 serNum; int folderIdx = -1; KMFolder *folder = 0; bool readOk = fread(&serNum, sizeof(serNum), 1, mIdsStream); @@ -901,7 +901,7 @@ KMMsgBase* KMFolderSearch::takeIndexEntry(int idx) { assert(idx >= 0 && idx < (int)mSerNums.count()); KMMsgBase *msgBase = getMsgBase(idx); - TQValueVector<Q_UINT32>::iterator it = mSerNums.begin(); + TQValueVector<TQ_UINT32>::iterator it = mSerNums.begin(); mSerNums.erase(&it[idx]); return msgBase; } @@ -932,7 +932,7 @@ void KMFolderSearch::truncateIndex() truncate(TQFile::encodeName(indexLocation()), IDS_SEARCH_HEADER_LEN); } -void KMFolderSearch::examineAddedMessage(KMFolder *aFolder, Q_UINT32 serNum) +void KMFolderSearch::examineAddedMessage(KMFolder *aFolder, TQ_UINT32 serNum) { if (!search() && !readSearch()) return; @@ -954,14 +954,14 @@ void KMFolderSearch::examineAddedMessage(KMFolder *aFolder, Q_UINT32 serNum) KMFolderOpener openFolder(folder, "foldersearch"); // if we are already checking this folder, refcount - if ( mFoldersCurrentlyBeingSearched.contains( folder ) ) { + if ( mFoldersCurrentlyBeingSearched.tqcontains( folder ) ) { unsigned int count = mFoldersCurrentlyBeingSearched[folder]; - mFoldersCurrentlyBeingSearched.replace( folder, count+1 ); + mFoldersCurrentlyBeingSearched.tqreplace( folder, count+1 ); } else { connect( folder->storage(), - TQT_SIGNAL( searchDone( KMFolder*, Q_UINT32, const KMSearchPattern*, bool ) ), + TQT_SIGNAL( searchDone( KMFolder*, TQ_UINT32, const KMSearchPattern*, bool ) ), this, - TQT_SLOT( slotSearchExamineMsgDone( KMFolder*, Q_UINT32, + TQT_SLOT( slotSearchExamineMsgDone( KMFolder*, TQ_UINT32, const KMSearchPattern*, bool ) ) ); mFoldersCurrentlyBeingSearched.insert( folder, 1 ); } @@ -969,7 +969,7 @@ void KMFolderSearch::examineAddedMessage(KMFolder *aFolder, Q_UINT32 serNum) } void KMFolderSearch::slotSearchExamineMsgDone( KMFolder* folder, - Q_UINT32 serNum, + TQ_UINT32 serNum, const KMSearchPattern* pattern, bool matches ) { @@ -978,24 +978,24 @@ void KMFolderSearch::slotSearchExamineMsgDone( KMFolder* folder, << " matches?" << matches << endl; KMFolderOpener openFolder(folder, "foldersearch"); - Q_ASSERT( mFoldersCurrentlyBeingSearched.contains( folder ) ); + Q_ASSERT( mFoldersCurrentlyBeingSearched.tqcontains( folder ) ); unsigned int count = mFoldersCurrentlyBeingSearched[folder]; if ( count == 1 ) { disconnect( folder->storage(), - TQT_SIGNAL( searchDone( KMFolder*, Q_UINT32, + TQT_SIGNAL( searchDone( KMFolder*, TQ_UINT32, const KMSearchPattern*, bool ) ), this, - TQT_SLOT( slotSearchExamineMsgDone( KMFolder*, Q_UINT32, + TQT_SLOT( slotSearchExamineMsgDone( KMFolder*, TQ_UINT32, const KMSearchPattern*, bool ) ) ); mFoldersCurrentlyBeingSearched.remove( folder ); } else { - mFoldersCurrentlyBeingSearched.replace( folder, count-1 ); + mFoldersCurrentlyBeingSearched.tqreplace( folder, count-1 ); } if ( !matches ) { - TQValueVector<Q_UINT32>::const_iterator it; - it = qFind( mSerNums.begin(), mSerNums.end(), serNum ); + TQValueVector<TQ_UINT32>::const_iterator it; + it = tqFind( mSerNums.begin(), mSerNums.end(), serNum ); if (it != mSerNums.end()) { removeSerNum( serNum ); } @@ -1006,15 +1006,15 @@ void KMFolderSearch::slotSearchExamineMsgDone( KMFolder* folder, // mSearch->stop(); // mExecuteSearchTimer->start( 0, true ); // } else { - TQValueVector<Q_UINT32>::const_iterator it; - it = qFind( mSerNums.begin(), mSerNums.end(), serNum ); + TQValueVector<TQ_UINT32>::const_iterator it; + it = tqFind( mSerNums.begin(), mSerNums.end(), serNum ); if (it == mSerNums.end()) { addSerNum( serNum ); } // } } -void KMFolderSearch::examineRemovedMessage(KMFolder *folder, Q_UINT32 serNum) +void KMFolderSearch::examineRemovedMessage(KMFolder *folder, TQ_UINT32 serNum) { if (!search() && !readSearch()) return; @@ -1032,7 +1032,7 @@ void KMFolderSearch::examineRemovedMessage(KMFolder *folder, Q_UINT32 serNum) } } -void KMFolderSearch::examineChangedMessage(KMFolder *aFolder, Q_UINT32 serNum, int delta) +void KMFolderSearch::examineChangedMessage(KMFolder *aFolder, TQ_UINT32 serNum, int delta) { if (!search() && !readSearch()) return; @@ -1042,8 +1042,8 @@ void KMFolderSearch::examineChangedMessage(KMFolder *aFolder, Q_UINT32 serNum, i open("foldersearch"); mTempOpened = true; } - TQValueVector<Q_UINT32>::const_iterator it; - it = qFind( mSerNums.begin(), mSerNums.end(), serNum ); + TQValueVector<TQ_UINT32>::const_iterator it; + it = tqFind( mSerNums.begin(), mSerNums.end(), serNum ); if (it != mSerNums.end()) { mUnreadMsgs += delta; emit numUnreadMsgsChanged( folder() ); @@ -1102,8 +1102,8 @@ void KMFolderSearch::propagateHeaderChanged(KMFolder *aFolder, int idx) mTempOpened = true; } - Q_UINT32 serNum = KMMsgDict::instance()->getMsgSerNum(aFolder, idx); - TQValueVector<Q_UINT32>::const_iterator it; + TQ_UINT32 serNum = KMMsgDict::instance()->getMsgSerNum(aFolder, idx); + TQValueVector<TQ_UINT32>::const_iterator it; for(it = mSerNums.begin(); it != mSerNums.end(); ++it) { if ((*it) == serNum) { emit msgHeaderChanged(folder(), pos); @@ -1115,14 +1115,14 @@ void KMFolderSearch::propagateHeaderChanged(KMFolder *aFolder, int idx) KMFolderOpener openAFolder(aFolder, "foldersearch"); // if we are already checking this folder, refcount - if ( mFoldersCurrentlyBeingSearched.contains( aFolder ) ) { + if ( mFoldersCurrentlyBeingSearched.tqcontains( aFolder ) ) { unsigned int count = mFoldersCurrentlyBeingSearched[aFolder]; - mFoldersCurrentlyBeingSearched.replace( aFolder, count+1 ); + mFoldersCurrentlyBeingSearched.tqreplace( aFolder, count+1 ); } else { connect( aFolder->storage(), - TQT_SIGNAL( searchDone( KMFolder*, Q_UINT32, const KMSearchPattern*, bool ) ), + TQT_SIGNAL( searchDone( KMFolder*, TQ_UINT32, const KMSearchPattern*, bool ) ), this, - TQT_SLOT( slotSearchExamineMsgDone( KMFolder*, Q_UINT32, + TQT_SLOT( slotSearchExamineMsgDone( KMFolder*, TQ_UINT32, const KMSearchPattern*, bool ) ) ); mFoldersCurrentlyBeingSearched.insert( aFolder, 1 ); } |