typedef KMMsgBase* KMMsgBasePtr
then:
const KMMsgBasePtr != ( const KMMsgBase* == "(const KMMsgBase)*" )
but rather "const (KMMsgBase*)"

Fix: s/KMMsgBasePtr/KMMsgBase*/ + clean-up const business.
Did anyone need KMMsgBasePtr?

svn path=/trunk/kdenetwork/kmail/; revision=156512
wilder-work
Allan Sandfeld Jensen 24 years ago
parent 85511321b0
commit e7a0485fa1
  1. 12
      kmfolder.cpp
  2. 7
      kmfolder.h
  3. 2
      kmmsgbase.cpp
  4. 2
      kmmsgbase.h
  5. 2
      kmmsgdict.cpp
  6. 14
      kmmsglist.cpp
  7. 20
      kmmsglist.h

@ -492,7 +492,7 @@ void KMFolder::markNewAsUnread()
void KMFolder::markUnreadAsRead()
{
KMMsgBase* msgBase;
const KMMsgBase* msgBase;
QValueList<int> items;
for (int i=count()-1; i>=0; --i)
@ -549,7 +549,7 @@ int KMFolder::reduceSize( int aSize )
kdDebug(5006) << "Reducing folder to size of " << aSize << " Mo" << endl;
QSortedList<KMMsgBase> * slice=0L;
QPtrList< QSortedList<KMMsgBase> > sliceArr;
KMMsgBase* mb;
const KMMsgBase* mb;
ulong folderSize, msgSize, sliceSize, firstSliceSize, lastSliceSize, size;
int sliceIndex;
int delMsg = 0;
@ -630,7 +630,7 @@ int KMFolder::expungeOldMsg(int days)
{
int i, msgnb=0;
time_t msgTime, maxTime;
KMMsgBase* mb;
const KMMsgBase* mb;
QValueList<int> rmvMsgList;
maxTime = time(0L) - days * 3600 * 24;
@ -682,7 +682,7 @@ void KMFolder::expireOldMessages() {
int days = 0;
int maxUnreadTime = 0;
int maxReadTime = 0;
KMMsgBase *mb = NULL;
const KMMsgBase *mb = NULL;
QValueList<int> rmvMsgList;
int i = 0;
time_t msgTime, maxTime = 0;
@ -775,7 +775,7 @@ void KMFolder::reallyAddCopyOfMsg(KMMessage* aMsg)
//-----------------------------------------------------------------------------
void KMFolder::removeMsg(KMMsgBasePtr aMsg)
void KMFolder::removeMsg(const KMMsgBase* aMsg)
{
int idx = find(aMsg);
assert( idx != -1);
@ -1224,7 +1224,7 @@ void KMFolder::headerOfMsgChanged(const KMMsgBase* aMsg, int idx)
return;
}
if (idx < 0)
idx = mMsgList.find((KMMsgBasePtr)aMsg);
idx = mMsgList.find((KMMsgBase*)aMsg);
if (idx >= 0)
emit msgHeaderChanged(idx);
else

@ -107,7 +107,8 @@ public:
in the index. Whenever you only need subject, from, date, status
you should use this method instead of getMsg() because getMsg()
will load the message if necessary and this method does not. */
virtual KMMsgBase* getMsgBase(int idx) const { return mMsgList[idx]; }
virtual const KMMsgBase* getMsgBase(int idx) const { return mMsgList[idx]; }
virtual KMMsgBase* getMsgBase(int idx) { return mMsgList[idx]; }
/** Same as getMsgBase(int). */
const KMMsgBase* operator[](int idx) const { return mMsgList[idx]; }
@ -134,7 +135,7 @@ public:
/** Remove (first occurance of) given message from the folder. */
virtual void removeMsg(int i, bool imapQuiet = FALSE);
virtual void removeMsg(KMMsgBasePtr msg);
virtual void removeMsg(const KMMsgBase* msg);
virtual void removeMsg(QPtrList<KMMessage> msgList, bool imapQuiet = FALSE);
/** Delete messages in the folder that are older than days. Return the
@ -153,7 +154,7 @@ public:
virtual int moveMsg(QPtrList<KMMessage>, int* index_return = NULL);
/** Returns the index of the given message or -1 if not found. */
virtual int find(const KMMsgBasePtr msg) const { return mMsgList.find(msg); }
virtual int find(const KMMsgBase* msg) const { return mMsgList.find((KMMsgBase*)msg); }
/** Returns the index of the given message or -1 if not found. */
virtual int find(const QString& msgIdMD5) const;

@ -766,7 +766,7 @@ unsigned long KMMsgBase::getMsgSerNum() const
{
unsigned long msn = 0;
if (mParent) {
int index = mParent->find((KMMsgBasePtr)this);
int index = mParent->find((KMMsgBase*)this);
msn = kernel->msgDict()->getMsgSerNum(mParent, index);
}
return msn;

@ -263,6 +263,4 @@ public:
bool syncIndexString() const;
};
typedef KMMsgBase* KMMsgBasePtr;
#endif /*kmmsgbase_h*/

@ -176,7 +176,7 @@ unsigned long KMMsgDict::insert(unsigned long msgSerNum,
KMFolder *folder = msg->parent();
if (folder && index == -1)
index = folder->find((const KMMsgBasePtr)msg);
index = folder->find(msg);
KMMsgDictEntry *entry = new KMMsgDictEntry(folder, index);
dict->replace((long)msn, entry);

@ -26,7 +26,7 @@ KMMsgList::~KMMsgList()
//-----------------------------------------------------------------------------
void KMMsgList::clear(bool doDelete, bool syncDict)
{
KMMsgBasePtr msg = 0;
KMMsgBase* msg = 0;
long i;
KMMsgDict *dict = 0;
@ -52,7 +52,7 @@ void KMMsgList::clear(bool doDelete, bool syncDict)
bool KMMsgList::resize(int aSize)
{
int i, oldSize = size();
KMMsgBasePtr msg;
KMMsgBase* msg;
assert(aSize>=0);
@ -92,7 +92,7 @@ bool KMMsgList::reset(int aSize)
//-----------------------------------------------------------------------------
void KMMsgList::set(int idx, KMMsgBasePtr aMsg)
void KMMsgList::set(int idx, KMMsgBase* aMsg)
{
int doubleSize;
@ -116,7 +116,7 @@ void KMMsgList::set(int idx, KMMsgBasePtr aMsg)
//-----------------------------------------------------------------------------
void KMMsgList::insert(int idx, KMMsgBasePtr aMsg, bool syncDict)
void KMMsgList::insert(int idx, KMMsgBase* aMsg, bool syncDict)
{
int i, doubleSize;
@ -150,7 +150,7 @@ void KMMsgList::insert(int idx, KMMsgBasePtr aMsg, bool syncDict)
//-----------------------------------------------------------------------------
int KMMsgList::append(KMMsgBasePtr aMsg, bool syncDict)
int KMMsgList::append(KMMsgBase* aMsg, bool syncDict)
{
int idx = mHigh;
insert(idx, aMsg, syncDict); // mHigh gets modified in here
@ -186,9 +186,9 @@ void KMMsgList::remove(int idx)
//-----------------------------------------------------------------------------
KMMsgBasePtr KMMsgList::take(int idx)
KMMsgBase* KMMsgList::take(int idx)
{
KMMsgBasePtr msg=at(idx);
KMMsgBase* msg=at(idx);
remove(idx);
return msg;
}

@ -10,8 +10,8 @@
class KMMsgDict;
#define KMMsgListInherited QMemArray<KMMsgBasePtr>
class KMMsgList: public QMemArray<KMMsgBasePtr>
#define KMMsgListInherited QMemArray<KMMsgBase*>
class KMMsgList: public QMemArray<KMMsgBase*>
{
public:
/** Valid parameters for sort() */
@ -29,16 +29,16 @@ public:
/** Returns message at given index and removes it from the list.
Also removes from message dictionary. */
virtual KMMsgBasePtr take(int idx);
virtual KMMsgBase* take(int idx);
/** Insert message at given index. Resizes the array if necessary.
If @p syncDict, also updates message dictionary. */
virtual void insert(int idx, KMMsgBasePtr msg, bool syncDict = true);
virtual void insert(int idx, KMMsgBase* msg, bool syncDict = true);
/** Append given message after the last used message. Resizes the
array if necessary. Returns index of new position.
If @p syncDict, also updates message dictionary. */
virtual int append(KMMsgBasePtr msg, bool syncDict = true);
virtual int append(KMMsgBase* msg, bool syncDict = true);
/** Clear messages. If autoDelete is set (default) the messages are
deleted. The array is not resized. If @p syncDict, also updates
@ -54,15 +54,15 @@ public:
virtual bool reset(int size);
/** Returns message at given index. */
virtual KMMsgBasePtr at(int idx) { return KMMsgListInherited::at(idx); }
KMMsgBasePtr at(int idx) const { return KMMsgListInherited::at(idx); }
KMMsgBasePtr operator[](int idx) { return KMMsgListInherited::at(idx); }
KMMsgBasePtr operator[](int idx) const { return KMMsgListInherited::at(idx); }
virtual KMMsgBase* at(int idx) { return KMMsgListInherited::at(idx); }
const KMMsgBase* at(int idx) const { return KMMsgListInherited::at(idx); }
KMMsgBase* operator[](int idx) { return KMMsgListInherited::at(idx); }
const KMMsgBase* operator[](int idx) const { return KMMsgListInherited::at(idx); }
/** Set message at given index. The array is resized if necessary. If
there is already a message at the given index this message is *not*
deleted. Does not sync the message dictionary. */
virtual void set(int idx, KMMsgBasePtr msg);
virtual void set(int idx, KMMsgBase* msg);
/** Returns first unused index (index of last message plus one). */
int high(void) const { return mHigh; }

Loading…
Cancel
Save