summaryrefslogtreecommitdiffstats
path: root/kmail/folderstorage.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /kmail/folderstorage.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/folderstorage.cpp')
-rw-r--r--kmail/folderstorage.cpp120
1 files changed, 60 insertions, 60 deletions
diff --git a/kmail/folderstorage.cpp b/kmail/folderstorage.cpp
index 89fc20db9..c1d447a67 100644
--- a/kmail/folderstorage.cpp
+++ b/kmail/folderstorage.cpp
@@ -52,8 +52,8 @@ using KMail::ListJob;
#include <kconfig.h>
#include <kdebug.h>
-#include <qfile.h>
-#include <qregexp.h>
+#include <tqfile.h>
+#include <tqregexp.h>
#include <mimelib/mimepp.h>
#include <errno.h>
@@ -61,7 +61,7 @@ using KMail::ListJob;
//-----------------------------------------------------------------------------
FolderStorage::FolderStorage( KMFolder* folder, const char* aName )
- : QObject( folder, aName ), mFolder( folder ), mEmitChangedTimer( 0L )
+ : TQObject( folder, aName ), mFolder( folder ), mEmitChangedTimer( 0L )
{
mOpenCount = 0;
mQuiet = 0;
@@ -79,21 +79,21 @@ FolderStorage::FolderStorage( KMFolder* folder, const char* aName )
mNoContent = false;
mNoChildren = false;
mRDict = 0;
- mDirtyTimer = new QTimer(this, "mDirtyTimer");
- connect(mDirtyTimer, SIGNAL(timeout()),
- this, SLOT(updateIndex()));
+ mDirtyTimer = new TQTimer(this, "mDirtyTimer");
+ connect(mDirtyTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(updateIndex()));
mHasChildren = HasNoChildren;
mContentsType = KMail::ContentsTypeMail;
- connect(this, SIGNAL(closed(KMFolder*)), mFolder, SIGNAL(closed()));
+ connect(this, TQT_SIGNAL(closed(KMFolder*)), mFolder, TQT_SIGNAL(closed()));
}
//-----------------------------------------------------------------------------
FolderStorage::~FolderStorage()
{
mJobList.setAutoDelete( true );
- QObject::disconnect( SIGNAL(destroyed(QObject*)), this, 0 );
+ TQObject::disconnect( TQT_SIGNAL(destroyed(TQObject*)), this, 0 );
mJobList.clear();
KMMsgDict::deleteRentry(mRDict);
}
@@ -110,29 +110,29 @@ void FolderStorage::close( const char* owner, bool aForced )
}
//-----------------------------------------------------------------------------
-QString FolderStorage::dotEscape(const QString& aStr)
+TQString FolderStorage::dotEscape(const TQString& aStr)
{
if (aStr[0] != '.') return aStr;
- return aStr.left(aStr.find(QRegExp("[^\\.]"))) + aStr;
+ return aStr.left(aStr.find(TQRegExp("[^\\.]"))) + aStr;
}
void FolderStorage::addJob( FolderJob* job ) const
{
- QObject::connect( job, SIGNAL(destroyed(QObject*)),
- SLOT(removeJob(QObject*)) );
+ TQObject::connect( job, TQT_SIGNAL(destroyed(TQObject*)),
+ TQT_SLOT(removeJob(TQObject*)) );
mJobList.append( job );
}
-void FolderStorage::removeJob( QObject* job )
+void FolderStorage::removeJob( TQObject* job )
{
mJobList.remove( static_cast<FolderJob*>( job ) );
}
//-----------------------------------------------------------------------------
-QString FolderStorage::location() const
+TQString FolderStorage::location() const
{
- QString sLocation(const_cast<FolderStorage*>(this)->folder()->path());
+ TQString sLocation(const_cast<FolderStorage*>(this)->folder()->path());
if (!sLocation.isEmpty()) sLocation += '/';
sLocation += dotEscape(fileName());
@@ -140,7 +140,7 @@ QString FolderStorage::location() const
return sLocation;
}
-QString FolderStorage::fileName() const
+TQString FolderStorage::fileName() const
{
return mFolder->name();
}
@@ -211,9 +211,9 @@ void FolderStorage::quiet(bool beQuiet)
* a timer is created when a folder is checked
*/
if ( !mEmitChangedTimer) {
- mEmitChangedTimer= new QTimer( this, "mEmitChangedTimer" );
- connect( mEmitChangedTimer, SIGNAL( timeout() ),
- this, SLOT( slotEmitChangedTimer() ) );
+ mEmitChangedTimer= new TQTimer( this, "mEmitChangedTimer" );
+ connect( mEmitChangedTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( slotEmitChangedTimer() ) );
}
mQuiet++;
} else {
@@ -256,7 +256,7 @@ int FolderStorage::expungeOldMsg(int days)
int i, msgnb=0;
time_t msgTime, maxTime;
const KMMsgBase* mb;
- QValueList<int> rmvMsgList;
+ TQValueList<int> rmvMsgList;
maxTime = time(0) - days * 3600 * 24;
@@ -309,8 +309,8 @@ bool FolderStorage::canAddMsgNow(KMMessage* aMsg, int* aIndex_ret)
if (!aMsg->isComplete() && msgParent && msgParent->folderType() == KMFolderTypeImap)
{
FolderJob *job = msgParent->createJob(aMsg);
- connect(job, SIGNAL(messageRetrieved(KMMessage*)),
- SLOT(reallyAddMsg(KMMessage*)));
+ connect(job, TQT_SIGNAL(messageRetrieved(KMMessage*)),
+ TQT_SLOT(reallyAddMsg(KMMessage*)));
job->start();
aMsg->setTransferInProgress( true );
return false;
@@ -355,9 +355,9 @@ int FolderStorage::find( const KMMessage * msg ) const {
}
//-----------------------------------------------------------------------------
-void FolderStorage::removeMsg(const QPtrList<KMMsgBase>& msgList, bool imapQuiet)
+void FolderStorage::removeMsg(const TQPtrList<KMMsgBase>& msgList, bool imapQuiet)
{
- for( QPtrListIterator<KMMsgBase> it( msgList ); *it; ++it )
+ for( TQPtrListIterator<KMMsgBase> it( msgList ); *it; ++it )
{
int idx = find(it.current());
assert( idx != -1);
@@ -366,9 +366,9 @@ void FolderStorage::removeMsg(const QPtrList<KMMsgBase>& msgList, bool imapQuiet
}
//-----------------------------------------------------------------------------
-void FolderStorage::removeMsg(const QPtrList<KMMessage>& msgList, bool imapQuiet)
+void FolderStorage::removeMsg(const TQPtrList<KMMessage>& msgList, bool imapQuiet)
{
- for( QPtrListIterator<KMMessage> it( msgList ); *it; ++it )
+ for( TQPtrListIterator<KMMessage> it( msgList ); *it; ++it )
{
int idx = find(it.current());
assert( idx != -1);
@@ -413,7 +413,7 @@ void FolderStorage::removeMsg(int idx, bool)
--mTotalMsgs;
mSize = -1;
- QString msgIdMD5 = mb->msgIdMD5();
+ TQString msgIdMD5 = mb->msgIdMD5();
emit msgRemoved( idx, msgIdMD5 );
emit msgRemoved( folder() );
}
@@ -452,14 +452,14 @@ KMMessage* FolderStorage::take(int idx)
setDirty( true );
mSize = -1;
needsCompact=true; // message is taken from here - needs to be compacted
- QString msgIdMD5 = msg->msgIdMD5();
+ TQString msgIdMD5 = msg->msgIdMD5();
emit msgRemoved( idx, msgIdMD5 );
emit msgRemoved( folder() );
return msg;
}
-void FolderStorage::take(QPtrList<KMMessage> msgList)
+void FolderStorage::take(TQPtrList<KMMessage> msgList)
{
for ( KMMessage* msg = msgList.first(); msg; msg = msgList.next() )
{
@@ -496,7 +496,7 @@ KMMessage* FolderStorage::getMsg(int idx)
if (mb->isMessage()) {
msg = ((KMMessage*)mb);
} else {
- QString mbSubject = mb->subject();
+ TQString mbSubject = mb->subject();
msg = readMsg(idx);
// sanity check
if (mCompactable && (!msg || (msg->subject().isEmpty() != mbSubject.isEmpty()))) {
@@ -585,7 +585,7 @@ bool FolderStorage::isMessage(int idx)
//-----------------------------------------------------------------------------
FolderJob* FolderStorage::createJob( KMMessage *msg, FolderJob::JobType jt,
- KMFolder *folder, QString partSpecifier,
+ KMFolder *folder, TQString partSpecifier,
const AttachmentStrategy *as ) const
{
FolderJob * job = doCreateJob( msg, jt, folder, partSpecifier, as );
@@ -595,7 +595,7 @@ FolderJob* FolderStorage::createJob( KMMessage *msg, FolderJob::JobType jt,
}
//-----------------------------------------------------------------------------
-FolderJob* FolderStorage::createJob( QPtrList<KMMessage>& msgList, const QString& sets,
+FolderJob* FolderStorage::createJob( TQPtrList<KMMessage>& msgList, const TQString& sets,
FolderJob::JobType jt, KMFolder *folder ) const
{
FolderJob * job = doCreateJob( msgList, sets, jt, folder );
@@ -624,7 +624,7 @@ int FolderStorage::moveMsg(KMMessage* aMsg, int* aIndex_ret)
}
//-----------------------------------------------------------------------------
-int FolderStorage::moveMsg(QPtrList<KMMessage> msglist, int* aIndex_ret)
+int FolderStorage::moveMsg(TQPtrList<KMMessage> msglist, int* aIndex_ret)
{
KMMessage* aMsg = msglist.first();
assert(aMsg != 0);
@@ -633,11 +633,11 @@ int FolderStorage::moveMsg(QPtrList<KMMessage> msglist, int* aIndex_ret)
if (msgParent)
msgParent->open("foldermovemsg");
- QValueList<int> index;
+ TQValueList<int> index;
open("moveMsg");
int rc = addMsg(msglist, index);
close("moveMsg");
- // FIXME: we want to have a QValueList to pass it back, so change this method
+ // FIXME: we want to have a TQValueList to pass it back, so change this method
if ( !index.isEmpty() )
aIndex_ret = &index.first();
@@ -649,11 +649,11 @@ int FolderStorage::moveMsg(QPtrList<KMMessage> msglist, int* aIndex_ret)
//-----------------------------------------------------------------------------
-int FolderStorage::rename(const QString& newName, KMFolderDir *newParent)
+int FolderStorage::rename(const TQString& newName, KMFolderDir *newParent)
{
- QString oldLoc, oldIndexLoc, oldIdsLoc, newLoc, newIndexLoc, newIdsLoc;
- QString oldSubDirLoc, newSubDirLoc;
- QString oldName;
+ TQString oldLoc, oldIndexLoc, oldIdsLoc, newLoc, newIndexLoc, newIdsLoc;
+ TQString oldSubDirLoc, newSubDirLoc;
+ TQString oldName;
int rc=0;
KMFolderDir *oldParent;
@@ -663,7 +663,7 @@ int FolderStorage::rename(const QString& newName, KMFolderDir *newParent)
oldIndexLoc = indexLocation();
oldSubDirLoc = folder()->subdirLocation();
oldIdsLoc = KMMsgDict::instance()->getFolderIdsLocation( *this );
- QString oldConfigString = "Folder-" + folder()->idString();
+ TQString oldConfigString = "Folder-" + folder()->idString();
close("rename", true);
@@ -678,7 +678,7 @@ int FolderStorage::rename(const QString& newName, KMFolderDir *newParent)
newSubDirLoc = folder()->subdirLocation();
newIdsLoc = KMMsgDict::instance()->getFolderIdsLocation( *this );
- if (::rename(QFile::encodeName(oldLoc), QFile::encodeName(newLoc))) {
+ if (::rename(TQFile::encodeName(oldLoc), TQFile::encodeName(newLoc))) {
folder()->setName(oldName);
folder()->setParent(oldParent);
rc = errno;
@@ -686,26 +686,26 @@ int FolderStorage::rename(const QString& newName, KMFolderDir *newParent)
else {
// rename/move index file and index.sorted file
if (!oldIndexLoc.isEmpty()) {
- ::rename(QFile::encodeName(oldIndexLoc), QFile::encodeName(newIndexLoc));
- ::rename(QFile::encodeName(oldIndexLoc) + ".sorted",
- QFile::encodeName(newIndexLoc) + ".sorted");
+ ::rename(TQFile::encodeName(oldIndexLoc), TQFile::encodeName(newIndexLoc));
+ ::rename(TQFile::encodeName(oldIndexLoc) + ".sorted",
+ TQFile::encodeName(newIndexLoc) + ".sorted");
}
// rename/move serial number file
if (!oldIdsLoc.isEmpty())
- ::rename(QFile::encodeName(oldIdsLoc), QFile::encodeName(newIdsLoc));
+ ::rename(TQFile::encodeName(oldIdsLoc), TQFile::encodeName(newIdsLoc));
// rename/move the subfolder directory
KMFolderDir* child = 0;
if( folder() )
child = folder()->child();
- if (!::rename(QFile::encodeName(oldSubDirLoc), QFile::encodeName(newSubDirLoc) )) {
+ if (!::rename(TQFile::encodeName(oldSubDirLoc), TQFile::encodeName(newSubDirLoc) )) {
// now that the subfolder directory has been renamed and/or moved also
// change the name that is stored in the corresponding KMFolderNode
// (provide that the name actually changed)
if( child && ( oldName != newName ) ) {
- child->setName( "." + QFile::encodeName(newName) + ".directory" );
+ child->setName( "." + TQFile::encodeName(newName) + ".directory" );
}
}
@@ -750,8 +750,8 @@ void FolderStorage::remove()
KMMsgDict::mutableInstance()->removeFolderIds( *this );
mExportsSernums = false; // do not writeFolderIds after removal
}
- unlink(QFile::encodeName(indexLocation()) + ".sorted");
- unlink(QFile::encodeName(indexLocation()));
+ unlink(TQFile::encodeName(indexLocation()) + ".sorted");
+ unlink(TQFile::encodeName(indexLocation()));
int rc = removeContents();
@@ -778,7 +778,7 @@ int FolderStorage::expunge()
KMMsgDict::mutableInstance()->removeFolderIds( *this );
if ( mAutoCreateIndex )
truncateIndex();
- else unlink(QFile::encodeName(indexLocation()));
+ else unlink(TQFile::encodeName(indexLocation()));
int rc = expungeContents();
if (rc) return rc;
@@ -799,7 +799,7 @@ int FolderStorage::expunge()
}
//-----------------------------------------------------------------------------
-QString FolderStorage::label() const
+TQString FolderStorage::label() const
{
return folder()->label();
}
@@ -974,8 +974,8 @@ void FolderStorage::readFolderIdsFile()
void FolderStorage::invalidateFolder()
{
if ( !mExportsSernums ) return;
- unlink(QFile::encodeName( indexLocation()) + ".sorted");
- unlink(QFile::encodeName( indexLocation()) + ".ids");
+ unlink(TQFile::encodeName( indexLocation()) + ".sorted");
+ unlink(TQFile::encodeName( indexLocation()) + ".ids");
fillMessageDict();
KMMsgDict::mutableInstance()->writeFolderIds( *this );
emit invalidated( folder() );
@@ -1040,9 +1040,9 @@ void FolderStorage::setStatus(int idx, KMMsgStatus status, bool toggle)
//-----------------------------------------------------------------------------
-void FolderStorage::setStatus(QValueList<int>& ids, KMMsgStatus status, bool toggle)
+void FolderStorage::setStatus(TQValueList<int>& ids, KMMsgStatus status, bool toggle)
{
- for ( QValueList<int>::Iterator it = ids.begin(); it != ids.end(); ++it )
+ for ( TQValueList<int>::Iterator it = ids.begin(); it != ids.end(); ++it )
{
FolderStorage::setStatus(*it, status, toggle);
}
@@ -1053,7 +1053,7 @@ void FolderStorage::ignoreJobsForMessage( KMMessage *msg )
if ( !msg || msg->transferInProgress() )
return;
- QPtrListIterator<FolderJob> it( mJobList );
+ TQPtrListIterator<FolderJob> it( mJobList );
while ( it.current() )
{
//FIXME: the questions is : should we iterate through all
@@ -1122,7 +1122,7 @@ void FolderStorage::slotProcessNextSearchBatch()
{
if ( !mSearchPattern )
return;
- QValueList<Q_UINT32> matchingSerNums;
+ TQValueList<Q_UINT32> matchingSerNums;
const int end = QMIN( mCurrentSearchedMsg + 15, count() );
for ( int i = mCurrentSearchedMsg; i < end; ++i )
{
@@ -1134,7 +1134,7 @@ void FolderStorage::slotProcessNextSearchBatch()
bool complete = ( end >= count() );
emit searchResult( folder(), matchingSerNums, mSearchPattern, complete );
if ( !complete )
- QTimer::singleShot( 0, this, SLOT(slotProcessNextSearchBatch()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(slotProcessNextSearchBatch()) );
}
//-----------------------------------------------------------------------------
@@ -1146,11 +1146,11 @@ void FolderStorage::search( const KMSearchPattern* pattern, Q_UINT32 serNum )
}
//-----------------------------------------------------------------------------
-int FolderStorage::addMsg( QPtrList<KMMessage>& msgList, QValueList<int>& index_ret )
+int FolderStorage::addMsg( TQPtrList<KMMessage>& msgList, TQValueList<int>& index_ret )
{
int ret = 0;
int index;
- for ( QPtrListIterator<KMMessage> it( msgList ); *it; ++it )
+ for ( TQPtrListIterator<KMMessage> it( msgList ); *it; ++it )
{
int aret = addMsg( *it, &index );
index_ret << index;