From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmail/kmfoldersearch.cpp | 238 +++++++++++++++++++++++------------------------ 1 file changed, 119 insertions(+), 119 deletions(-) (limited to 'kmail/kmfoldersearch.cpp') diff --git a/kmail/kmfoldersearch.cpp b/kmail/kmfoldersearch.cpp index 896383b42..85ba2040f 100644 --- a/kmail/kmfoldersearch.cpp +++ b/kmail/kmfoldersearch.cpp @@ -42,7 +42,7 @@ #include #include -#include +#include #ifdef HAVE_BYTESWAP_H #include @@ -69,8 +69,8 @@ #define IDS_SEARCH_HEADER_LEN 30 -KMSearch::KMSearch(QObject * parent, const char * name) - :QObject(parent, name) +KMSearch::KMSearch(TQObject * parent, const char * name) + :TQObject(parent, name) { mRemainingFolders = -1; mRecursive = true; @@ -80,8 +80,8 @@ KMSearch::KMSearch(QObject * parent, const char * name) mFoundCount = 0; mSearchCount = 0; - mProcessNextBatchTimer = new QTimer(0, "mProcessNextBatchTimer"); - connect(mProcessNextBatchTimer, SIGNAL(timeout()), this, SLOT(slotProcessNextBatch())); + mProcessNextBatchTimer = new TQTimer(0, "mProcessNextBatchTimer"); + connect(mProcessNextBatchTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotProcessNextBatch())); } KMSearch::~KMSearch() @@ -90,7 +90,7 @@ KMSearch::~KMSearch() delete mSearchPattern; } -bool KMSearch::write(QString location) const +bool KMSearch::write(TQString location) const { KConfig config(location); config.setGroup("Search Folder"); @@ -104,14 +104,14 @@ bool KMSearch::write(QString location) const return true; } -bool KMSearch::read(QString location) +bool KMSearch::read(TQString location) { KConfig config( location ); config.setGroup( "Search Folder" ); if ( !mSearchPattern ) mSearchPattern = new KMSearchPattern(); mSearchPattern->readConfig( &config ); - QString rootString = config.readEntry( "Base" ); + TQString rootString = config.readEntry( "Base" ); mRoot = kmkernel->findFolderById( rootString ); mRecursive = config.readBoolEntry( "Recursive" ); return true; @@ -147,7 +147,7 @@ bool KMSearch::inScope(KMFolder* folder) const void KMSearch::start() { //close all referenced folders - QValueListIterator > fit; + TQValueListIterator > fit; for (fit = mOpenedFolders.begin(); fit != mOpenedFolders.end(); ++fit) { if (!(*fit)) continue; @@ -180,7 +180,7 @@ void KMSearch::start() //Append all descendants to folders KMFolderNode* node; KMFolder* folder; - QValueListConstIterator > it; + TQValueListConstIterator > it; for ( it = mFolders.begin(); it != mFolders.end(); ++it ) { folder = *it; @@ -191,7 +191,7 @@ void KMSearch::start() dir = &kmkernel->folderMgr()->dir(); if ( !dir ) continue; - QPtrListIterator it(*dir); + TQPtrListIterator it(*dir); while ( (node = it.current()) ) { ++it; if ( !node->isDir() ) { @@ -204,7 +204,7 @@ void KMSearch::start() } mRemainingFolders = mFolders.count(); - mLastFolder = QString::null; + mLastFolder = TQString::null; mProcessNextBatchTimer->start( 0, true ); } @@ -217,7 +217,7 @@ void KMSearch::stop() kmkernel->msgIndex()->stopQuery( this ); } else { mIncompleteFolders.clear(); - QValueListConstIterator > jt; + TQValueListConstIterator > jt; for ( jt = mOpenedFolders.begin(); jt != mOpenedFolders.end(); ++jt ) { KMFolder *folder = *jt; if ( !folder ) @@ -237,7 +237,7 @@ void KMSearch::stop() mRemainingFolders = -1; mOpenedFolders.clear(); mFolders.clear(); - mLastFolder = QString::null; + mLastFolder = TQString::null; mRunByIndex = mRunning = false; emit finished(false); } @@ -262,9 +262,9 @@ void KMSearch::slotProcessNextBatch() folder->open("kmsearch"); mOpenedFolders.append( folder ); connect( folder->storage(), - SIGNAL( searchResult( KMFolder*, QValueList, const KMSearchPattern*, bool ) ), + TQT_SIGNAL( searchResult( KMFolder*, TQValueList, const KMSearchPattern*, bool ) ), this, - SLOT( slotSearchFolderResult( KMFolder*, QValueList, const KMSearchPattern*, bool ) ) ); + TQT_SLOT( slotSearchFolderResult( KMFolder*, TQValueList, const KMSearchPattern*, bool ) ) ); folder->storage()->search( mSearchPattern ); } else --mRemainingFolders; @@ -274,7 +274,7 @@ void KMSearch::slotProcessNextBatch() } void KMSearch::slotSearchFolderResult( KMFolder* folder, - QValueList serNums, + TQValueList 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(); - QValueListIterator it; + TQValueListIterator 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(), - SIGNAL( searchResult( KMFolder*, QValueList, + TQT_SIGNAL( searchResult( KMFolder*, TQValueList, const KMSearchPattern*, bool ) ), this, - SLOT( slotSearchFolderResult( KMFolder*, QValueList, + TQT_SLOT( slotSearchFolderResult( KMFolder*, TQValueList, const KMSearchPattern*, bool ) ) ); --mRemainingFolders; mSearchCount += folder->count(); @@ -304,7 +304,7 @@ void KMSearch::slotSearchFolderResult( KMFolder* folder, { mRemainingFolders = 0; mRunning = false; - mLastFolder = QString::null; + mLastFolder = TQString::null; mRemainingFolders = -1; mFolders.clear(); emit finished( true ); @@ -325,54 +325,54 @@ 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(), SIGNAL(msgAdded(KMFolder*, Q_UINT32)), - this, SLOT(examineAddedMessage(KMFolder*, Q_UINT32))); - connect(kmkernel->folderMgr(), SIGNAL(msgRemoved(KMFolder*, Q_UINT32)), - this, SLOT(examineRemovedMessage(KMFolder*, Q_UINT32))); - connect(kmkernel->folderMgr(), SIGNAL(msgChanged(KMFolder*, Q_UINT32, int)), - this, SLOT(examineChangedMessage(KMFolder*, Q_UINT32, int))); - connect(kmkernel->folderMgr(), SIGNAL(folderInvalidated(KMFolder*)), - this, SLOT(examineInvalidatedFolder(KMFolder*))); - connect(kmkernel->folderMgr(), SIGNAL(folderAdded(KMFolder*)), - this, SLOT(examineInvalidatedFolder(KMFolder*))); - connect(kmkernel->folderMgr(), SIGNAL(folderRemoved(KMFolder*)), - this, SLOT(examineRemovedFolder(KMFolder*))); - connect(kmkernel->folderMgr(), SIGNAL(msgHeaderChanged(KMFolder*,int)), - this, SLOT(propagateHeaderChanged(KMFolder*,int))); - - connect(kmkernel->imapFolderMgr(), SIGNAL(msgAdded(KMFolder*, Q_UINT32)), - this, SLOT(examineAddedMessage(KMFolder*, Q_UINT32))); - connect(kmkernel->imapFolderMgr(), SIGNAL(msgRemoved(KMFolder*, Q_UINT32)), - this, SLOT(examineRemovedMessage(KMFolder*, Q_UINT32))); - connect(kmkernel->imapFolderMgr(), SIGNAL(msgChanged(KMFolder*, Q_UINT32, int)), - this, SLOT(examineChangedMessage(KMFolder*, Q_UINT32, int))); - connect(kmkernel->imapFolderMgr(), SIGNAL(folderInvalidated(KMFolder*)), - this, SLOT(examineInvalidatedFolder(KMFolder*))); - connect(kmkernel->imapFolderMgr(), SIGNAL(folderAdded(KMFolder*)), - this, SLOT(examineInvalidatedFolder(KMFolder*))); - connect(kmkernel->imapFolderMgr(), SIGNAL(folderRemoved(KMFolder*)), - this, SLOT(examineRemovedFolder(KMFolder*))); - connect(kmkernel->imapFolderMgr(), SIGNAL(msgHeaderChanged(KMFolder*,int)), - this, SLOT(propagateHeaderChanged(KMFolder*,int))); - - connect(kmkernel->dimapFolderMgr(), SIGNAL(msgAdded(KMFolder*, Q_UINT32)), - this, SLOT(examineAddedMessage(KMFolder*, Q_UINT32))); - connect(kmkernel->dimapFolderMgr(), SIGNAL(msgRemoved(KMFolder*, Q_UINT32)), - this, SLOT(examineRemovedMessage(KMFolder*, Q_UINT32))); - connect(kmkernel->dimapFolderMgr(), SIGNAL(msgChanged(KMFolder*, Q_UINT32, int)), - this, SLOT(examineChangedMessage(KMFolder*, Q_UINT32, int))); - connect(kmkernel->dimapFolderMgr(), SIGNAL(folderInvalidated(KMFolder*)), - this, SLOT(examineInvalidatedFolder(KMFolder*))); - connect(kmkernel->dimapFolderMgr(), SIGNAL(folderAdded(KMFolder*)), - this, SLOT(examineInvalidatedFolder(KMFolder*))); - connect(kmkernel->dimapFolderMgr(), SIGNAL(folderRemoved(KMFolder*)), - this, SLOT(examineRemovedFolder(KMFolder*))); - connect(kmkernel->dimapFolderMgr(), SIGNAL(msgHeaderChanged(KMFolder*,int)), - this, SLOT(propagateHeaderChanged(KMFolder*,int))); - - mExecuteSearchTimer = new QTimer(0, "mExecuteSearchTimer"); - connect(mExecuteSearchTimer, SIGNAL(timeout()), - this, SLOT(executeSearch())); + 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(folderInvalidated(KMFolder*)), + this, TQT_SLOT(examineInvalidatedFolder(KMFolder*))); + connect(kmkernel->folderMgr(), TQT_SIGNAL(folderAdded(KMFolder*)), + this, TQT_SLOT(examineInvalidatedFolder(KMFolder*))); + connect(kmkernel->folderMgr(), TQT_SIGNAL(folderRemoved(KMFolder*)), + this, TQT_SLOT(examineRemovedFolder(KMFolder*))); + 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(folderInvalidated(KMFolder*)), + this, TQT_SLOT(examineInvalidatedFolder(KMFolder*))); + connect(kmkernel->imapFolderMgr(), TQT_SIGNAL(folderAdded(KMFolder*)), + this, TQT_SLOT(examineInvalidatedFolder(KMFolder*))); + connect(kmkernel->imapFolderMgr(), TQT_SIGNAL(folderRemoved(KMFolder*)), + this, TQT_SLOT(examineRemovedFolder(KMFolder*))); + 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(folderInvalidated(KMFolder*)), + this, TQT_SLOT(examineInvalidatedFolder(KMFolder*))); + connect(kmkernel->dimapFolderMgr(), TQT_SIGNAL(folderAdded(KMFolder*)), + this, TQT_SLOT(examineInvalidatedFolder(KMFolder*))); + connect(kmkernel->dimapFolderMgr(), TQT_SIGNAL(folderRemoved(KMFolder*)), + this, TQT_SLOT(examineRemovedFolder(KMFolder*))); + connect(kmkernel->dimapFolderMgr(), TQT_SIGNAL(msgHeaderChanged(KMFolder*,int)), + this, TQT_SLOT(propagateHeaderChanged(KMFolder*,int))); + + mExecuteSearchTimer = new TQTimer(0, "mExecuteSearchTimer"); + connect(mExecuteSearchTimer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(executeSearch())); } KMFolderSearch::~KMFolderSearch() @@ -391,7 +391,7 @@ void KMFolderSearch::setSearch(KMSearch *search) mInvalid = false; setDirty( true ); //have to write the index if (!mUnlinked) { - unlink(QFile::encodeName(indexLocation())); + unlink(TQFile::encodeName(indexLocation())); mUnlinked = true; } if (mSearch != search) { @@ -399,10 +399,10 @@ void KMFolderSearch::setSearch(KMSearch *search) delete mSearch; mSearch = search; // take ownership if (mSearch) { - QObject::connect(search, SIGNAL(found(Q_UINT32)), - SLOT(addSerNum(Q_UINT32))); - QObject::connect(search, SIGNAL(finished(bool)), - SLOT(searchFinished(bool))); + TQObject::connect(search, TQT_SIGNAL(found(Q_UINT32)), + TQT_SLOT(addSerNum(Q_UINT32))); + TQObject::connect(search, TQT_SIGNAL(finished(bool)), + TQT_SLOT(searchFinished(bool))); } } if (mSearch) @@ -458,7 +458,7 @@ void KMFolderSearch::addSerNum(Q_UINT32 serNum) } setDirty( true ); //TODO append a single entry to .ids file and sync. if (!mUnlinked) { - unlink(QFile::encodeName(indexLocation())); + unlink(TQFile::encodeName(indexLocation())); mUnlinked = true; } mSerNums.append(serNum); @@ -474,7 +474,7 @@ void KMFolderSearch::addSerNum(Q_UINT32 serNum) void KMFolderSearch::removeSerNum(Q_UINT32 serNum) { - QValueVector::const_iterator it; + TQValueVector::const_iterator it; int i = 0; for(it = mSerNums.begin(); it != mSerNums.end(); ++it, ++i) if ((*it) == serNum) { @@ -487,7 +487,7 @@ void KMFolderSearch::removeSerNum(Q_UINT32 serNum) return; } if (!mUnlinked) { - unlink(QFile::encodeName(indexLocation())); + unlink(TQFile::encodeName(indexLocation())); mUnlinked = true; } } @@ -502,8 +502,8 @@ int KMFolderSearch::addMsg(KMMessage*, int* index_return) bool KMFolderSearch::readSearch() { mSearch = new KMSearch; - QObject::connect(mSearch, SIGNAL(found(Q_UINT32)), SLOT(addSerNum(Q_UINT32))); - QObject::connect(mSearch, SIGNAL(finished(bool)), SLOT(searchFinished(bool))); + TQObject::connect(mSearch, TQT_SIGNAL(found(Q_UINT32)), TQT_SLOT(addSerNum(Q_UINT32))); + TQObject::connect(mSearch, TQT_SIGNAL(finished(bool)), TQT_SLOT(searchFinished(bool))); return mSearch->read(location()); } @@ -531,7 +531,7 @@ int KMFolderSearch::canAccess() { assert(!folder()->name().isEmpty()); - if (access(QFile::encodeName(location()), R_OK | W_OK | X_OK) != 0) + if (access(TQFile::encodeName(location()), R_OK | W_OK | X_OK) != 0) return 1; return 0; } @@ -557,7 +557,7 @@ void KMFolderSearch::reallyDoClose(const char* owner) } //close all referenced folders - QValueListIterator > fit; + TQValueListIterator > fit; for (fit = mFolders.begin(); fit != mFolders.end(); ++fit) { if (!(*fit)) continue; @@ -578,7 +578,7 @@ void KMFolderSearch::reallyDoClose(const char* owner) int KMFolderSearch::create() { int old_umask; - int rc = unlink(QFile::encodeName(location())); + int rc = unlink(TQFile::encodeName(location())); if (!rc) return rc; rc = 0; @@ -587,14 +587,14 @@ int KMFolderSearch::create() assert(mOpenCount == 0); kdDebug(5006) << "Creating folder " << location() << endl; - if (access(QFile::encodeName(location()), F_OK) == 0) { + if (access(TQFile::encodeName(location()), F_OK) == 0) { kdDebug(5006) << "KMFolderSearch::create call to access function failed." << endl; return EEXIST; } old_umask = umask(077); - FILE *mStream = fopen(QFile::encodeName(location()), "w+"); + FILE *mStream = fopen(TQFile::encodeName(location()), "w+"); umask(old_umask); if (!mStream) return errno; fclose(mStream); @@ -602,8 +602,8 @@ int KMFolderSearch::create() clearIndex(); if (!mSearch) { mSearch = new KMSearch(); - QObject::connect(mSearch, SIGNAL(found(Q_UINT32)), SLOT(addSerNum(Q_UINT32))); - QObject::connect(mSearch, SIGNAL(finished(bool)), SLOT(searchFinished(bool))); + TQObject::connect(mSearch, TQT_SIGNAL(found(Q_UINT32)), TQT_SLOT(addSerNum(Q_UINT32))); + TQObject::connect(mSearch, TQT_SIGNAL(finished(bool)), TQT_SLOT(searchFinished(bool))); } mSearch->write(location()); mOpenCount++; @@ -625,14 +625,14 @@ bool KMFolderSearch::isReadOnly() const } FolderJob* KMFolderSearch::doCreateJob(KMMessage*, FolderJob::JobType, - KMFolder*, QString, const AttachmentStrategy* ) const + KMFolder*, TQString, const AttachmentStrategy* ) const { // Should never be called assert(0); return 0; } -FolderJob* KMFolderSearch::doCreateJob(QPtrList&, const QString&, +FolderJob* KMFolderSearch::doCreateJob(TQPtrList&, const TQString&, FolderJob::JobType, KMFolder*) const { // Should never be called @@ -701,7 +701,7 @@ int KMFolderSearch::find(const KMMsgBase* msg) const { int pos = 0; Q_UINT32 serNum = msg->getMsgSerNum(); - QValueVector::const_iterator it; + TQValueVector::const_iterator it; for(it = mSerNums.begin(); it != mSerNums.end(); ++it) { if ((*it) == serNum) return pos; @@ -710,9 +710,9 @@ int KMFolderSearch::find(const KMMsgBase* msg) const return -1; } -QString KMFolderSearch::indexLocation() const +TQString KMFolderSearch::indexLocation() const { - QString sLocation(folder()->path()); + TQString sLocation(folder()->path()); if (!sLocation.isEmpty()) sLocation += '/'; sLocation += '.'; @@ -726,7 +726,7 @@ QString KMFolderSearch::indexLocation() const int KMFolderSearch::updateIndex() { if (mSearch && search()->running()) - unlink(QFile::encodeName(indexLocation())); + unlink(TQFile::encodeName(indexLocation())); else if (dirty()) return writeIndex(); @@ -737,22 +737,22 @@ int KMFolderSearch::writeIndex( bool ) { // TODO:If we fail to write the index we should panic the kernel // TODO:and the same for other folder types too, and the msgDict. - QString filename = indexLocation(); + TQString filename = indexLocation(); int old_umask = umask(077); - QString tempName = filename + ".temp"; - unlink(QFile::encodeName(tempName)); + TQString tempName = filename + ".temp"; + unlink(TQFile::encodeName(tempName)); // We touch the folder, otherwise the index is regenerated, if KMail is // running, while the clock switches from daylight savings time to normal time - utime(QFile::encodeName(location()), 0); + utime(TQFile::encodeName(location()), 0); - FILE *tmpIndexStream = fopen(QFile::encodeName(tempName), "w"); + FILE *tmpIndexStream = fopen(TQFile::encodeName(tempName), "w"); umask(old_umask); if (!tmpIndexStream) { kdDebug(5006) << "Cannot write '" << filename << strerror(errno) << " (" << errno << ")" << endl; - truncate(QFile::encodeName(filename), 0); + truncate(TQFile::encodeName(filename), 0); return -1; } fprintf(tmpIndexStream, IDS_SEARCH_HEADER, IDS_SEARCH_VERSION); @@ -762,11 +762,11 @@ int KMFolderSearch::writeIndex( bool ) Q_UINT32 count = mSerNums.count(); if (!fwrite(&count, sizeof(count), 1, tmpIndexStream)) { fclose(tmpIndexStream); - truncate(QFile::encodeName(filename), 0); + truncate(TQFile::encodeName(filename), 0); return -1; } - QValueVector::iterator it; + TQValueVector::iterator it; for(it = mSerNums.begin(); it != mSerNums.end(); ++it) { Q_UINT32 serNum = *it; if (!fwrite(&serNum, sizeof(serNum), 1, tmpIndexStream)) @@ -777,7 +777,7 @@ int KMFolderSearch::writeIndex( bool ) if (fsync(fileno(tmpIndexStream)) != 0) return errno; if (fclose(tmpIndexStream) != 0) return errno; - ::rename(QFile::encodeName(tempName), QFile::encodeName(indexLocation())); + ::rename(TQFile::encodeName(tempName), TQFile::encodeName(indexLocation())); mDirty = FALSE; mUnlinked = FALSE; @@ -801,8 +801,8 @@ KMMessage* KMFolderSearch::readMsg(int idx) bool KMFolderSearch::readIndex() { clearIndex(); - QString filename = indexLocation(); - mIdsStream = fopen(QFile::encodeName(filename), "r+"); + TQString filename = indexLocation(); + mIdsStream = fopen(TQFile::encodeName(filename), "r+"); if (!mIdsStream) return false; @@ -878,8 +878,8 @@ bool KMFolderSearch::readIndex() int KMFolderSearch::removeContents() { - unlink(QFile::encodeName(location())); - unlink(QFile::encodeName(indexLocation())); + unlink(TQFile::encodeName(location())); + unlink(TQFile::encodeName(indexLocation())); mUnlinked = true; return 0; } @@ -900,7 +900,7 @@ KMMsgBase* KMFolderSearch::takeIndexEntry(int idx) { assert(idx >= 0 && idx < (int)mSerNums.count()); KMMsgBase *msgBase = getMsgBase(idx); - QValueVector::iterator it = mSerNums.begin(); + TQValueVector::iterator it = mSerNums.begin(); mSerNums.erase(&it[idx]); return msgBase; } @@ -915,7 +915,7 @@ KMMsgInfo* KMFolderSearch::setIndexEntry(int idx, KMMessage *msg) void KMFolderSearch::clearIndex(bool, bool) { //close all referenced folders - QValueListIterator > fit; + TQValueListIterator > fit; for (fit = mFolders.begin(); fit != mFolders.end(); ++fit) { if (!(*fit)) continue; @@ -928,7 +928,7 @@ void KMFolderSearch::clearIndex(bool, bool) void KMFolderSearch::truncateIndex() { - truncate(QFile::encodeName(indexLocation()), IDS_SEARCH_HEADER_LEN); + truncate(TQFile::encodeName(indexLocation()), IDS_SEARCH_HEADER_LEN); } void KMFolderSearch::examineAddedMessage(KMFolder *aFolder, Q_UINT32 serNum) @@ -958,9 +958,9 @@ void KMFolderSearch::examineAddedMessage(KMFolder *aFolder, Q_UINT32 serNum) mFoldersCurrentlyBeingSearched.replace( folder, count+1 ); } else { connect( folder->storage(), - SIGNAL( searchDone( KMFolder*, Q_UINT32, const KMSearchPattern*, bool ) ), + TQT_SIGNAL( searchDone( KMFolder*, Q_UINT32, const KMSearchPattern*, bool ) ), this, - SLOT( slotSearchExamineMsgDone( KMFolder*, Q_UINT32, + TQT_SLOT( slotSearchExamineMsgDone( KMFolder*, Q_UINT32, const KMSearchPattern*, bool ) ) ); mFoldersCurrentlyBeingSearched.insert( folder, 1 ); } @@ -982,10 +982,10 @@ void KMFolderSearch::slotSearchExamineMsgDone( KMFolder* folder, unsigned int count = mFoldersCurrentlyBeingSearched[folder]; if ( count == 1 ) { disconnect( folder->storage(), - SIGNAL( searchDone( KMFolder*, Q_UINT32, + TQT_SIGNAL( searchDone( KMFolder*, Q_UINT32, const KMSearchPattern*, bool ) ), this, - SLOT( slotSearchExamineMsgDone( KMFolder*, Q_UINT32, + TQT_SLOT( slotSearchExamineMsgDone( KMFolder*, Q_UINT32, const KMSearchPattern*, bool ) ) ); mFoldersCurrentlyBeingSearched.remove( folder ); } else { @@ -993,7 +993,7 @@ void KMFolderSearch::slotSearchExamineMsgDone( KMFolder* folder, } if ( !matches ) { - QValueVector::const_iterator it; + TQValueVector::const_iterator it; it = qFind( mSerNums.begin(), mSerNums.end(), serNum ); if (it != mSerNums.end()) { removeSerNum( serNum ); @@ -1005,7 +1005,7 @@ void KMFolderSearch::slotSearchExamineMsgDone( KMFolder* folder, // mSearch->stop(); // mExecuteSearchTimer->start( 0, true ); // } else { - QValueVector::const_iterator it; + TQValueVector::const_iterator it; it = qFind( mSerNums.begin(), mSerNums.end(), serNum ); if (it == mSerNums.end()) { addSerNum( serNum ); @@ -1041,7 +1041,7 @@ void KMFolderSearch::examineChangedMessage(KMFolder *aFolder, Q_UINT32 serNum, i open("foldersearch"); mTempOpened = true; } - QValueVector::const_iterator it; + TQValueVector::const_iterator it; it = qFind( mSerNums.begin(), mSerNums.end(), serNum ); if (it != mSerNums.end()) { mUnreadMsgs += delta; @@ -1066,7 +1066,7 @@ void KMFolderSearch::examineInvalidatedFolder(KMFolder *folder) mSearch->stop(); if (!mUnlinked) { - unlink(QFile::encodeName(indexLocation())); + unlink(TQFile::encodeName(indexLocation())); mUnlinked = true; } @@ -1102,7 +1102,7 @@ void KMFolderSearch::propagateHeaderChanged(KMFolder *aFolder, int idx) } Q_UINT32 serNum = KMMsgDict::instance()->getMsgSerNum(aFolder, idx); - QValueVector::const_iterator it; + TQValueVector::const_iterator it; for(it = mSerNums.begin(); it != mSerNums.end(); ++it) { if ((*it) == serNum) { emit msgHeaderChanged(folder(), pos); @@ -1119,9 +1119,9 @@ void KMFolderSearch::propagateHeaderChanged(KMFolder *aFolder, int idx) mFoldersCurrentlyBeingSearched.replace( aFolder, count+1 ); } else { connect( aFolder->storage(), - SIGNAL( searchDone( KMFolder*, Q_UINT32, const KMSearchPattern*, bool ) ), + TQT_SIGNAL( searchDone( KMFolder*, Q_UINT32, const KMSearchPattern*, bool ) ), this, - SLOT( slotSearchExamineMsgDone( KMFolder*, Q_UINT32, + TQT_SLOT( slotSearchExamineMsgDone( KMFolder*, Q_UINT32, const KMSearchPattern*, bool ) ) ); mFoldersCurrentlyBeingSearched.insert( aFolder, 1 ); } -- cgit v1.2.1