summaryrefslogtreecommitdiffstats
path: root/kmail/messageproperty.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/messageproperty.cpp')
-rw-r--r--kmail/messageproperty.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/kmail/messageproperty.cpp b/kmail/messageproperty.cpp
index 7de13eb35..b1e02161b 100644
--- a/kmail/messageproperty.cpp
+++ b/kmail/messageproperty.cpp
@@ -1,5 +1,5 @@
/* Message Property
-
+
This file is part of KMail, the KDE mail client.
Copyright (c) Don Sanders <sanders@kde.org>
@@ -66,14 +66,13 @@ void MessageProperty::setFiltering( const KMMsgBase *msgBase, bool filter )
KMFolder* MessageProperty::filterFolder( Q_UINT32 serNum )
{
- if (sFolders.contains(serNum))
- return sFolders[serNum].operator->();
- return 0;
+ TQMap<Q_UINT32, TQGuardedPtr<KMFolder> >::const_iterator it = sFolders.find( serNum );
+ return it == sFolders.constEnd() ? 0 : (*it).operator->();
}
void MessageProperty::setFilterFolder( Q_UINT32 serNum, KMFolder* folder )
{
- sFolders.replace(serNum, TQGuardedPtr<KMFolder>(folder) );
+ sFolders.insert(serNum, TQGuardedPtr<KMFolder>(folder) );
}
KMFolder* MessageProperty::filterFolder( const KMMsgBase *msgBase )
@@ -88,15 +87,14 @@ void MessageProperty::setFilterFolder( const KMMsgBase *msgBase, KMFolder* folde
ActionScheduler* MessageProperty::filterHandler( Q_UINT32 serNum )
{
- if ( sHandlers.contains( serNum ))
- return sHandlers[serNum].operator->();
- return 0;
+ TQMap<Q_UINT32, TQGuardedPtr<ActionScheduler> >::const_iterator it = sHandlers.find( serNum );
+ return it == sHandlers.constEnd() ? 0 : (*it).operator->();
}
void MessageProperty::setFilterHandler( Q_UINT32 serNum, ActionScheduler* handler )
{
if (handler)
- sHandlers.replace( serNum, TQGuardedPtr<ActionScheduler>(handler) );
+ sHandlers.insert( serNum, TQGuardedPtr<ActionScheduler>(handler) );
else
sHandlers.remove( serNum );
}
@@ -113,16 +111,16 @@ void MessageProperty::setFilterHandler( const KMMsgBase *msgBase, ActionSchedule
bool MessageProperty::transferInProgress( Q_UINT32 serNum )
{
- if (sTransfers.contains(serNum))
- return sTransfers[serNum];
- return false;
+ TQMap<Q_UINT32, int >::const_iterator it = sTransfers.find( serNum );
+ return it == sTransfers.constEnd() ? false : *it;
}
void MessageProperty::setTransferInProgress( Q_UINT32 serNum, bool transfer, bool force )
{
int transferInProgress = 0;
- if (sTransfers.contains(serNum))
- transferInProgress = sTransfers[serNum];
+ TQMap<Q_UINT32, int >::const_iterator it = sTransfers.find( serNum );
+ if (it != sTransfers.constEnd())
+ transferInProgress = *it;
if ( force && !transfer )
transferInProgress = 0;
else
@@ -130,7 +128,7 @@ void MessageProperty::setTransferInProgress( Q_UINT32 serNum, bool transfer, boo
if ( transferInProgress < 0 )
transferInProgress = 0;
if (transferInProgress)
- sTransfers.replace( serNum, transferInProgress );
+ sTransfers.insert( serNum, transferInProgress );
else
sTransfers.remove( serNum );
}
@@ -147,15 +145,14 @@ void MessageProperty::setTransferInProgress( const KMMsgBase *msgBase, bool tran
Q_UINT32 MessageProperty::serialCache( const KMMsgBase *msgBase )
{
- if (sSerialCache.contains( msgBase ))
- return sSerialCache[msgBase];
- return 0;
+ TQMap<const KMMsgBase*, long >::const_iterator it = sSerialCache.find( msgBase );
+ return it == sSerialCache.constEnd() ? 0 : *it;
}
void MessageProperty::setSerialCache( const KMMsgBase *msgBase, Q_UINT32 serNum )
{
if (serNum)
- sSerialCache.replace( msgBase, serNum );
+ sSerialCache.insert( msgBase, serNum );
else
sSerialCache.remove( msgBase );
}