[prev in list] [next in list] [prev in thread] [next in thread]
List: kmail-devel
Subject: Re: [PATCH] yet more threading fixes and fixes for search folders with imap
From: Till Adam <till () adam-lilienthal ! de>
Date: 2003-03-30 21:34:32
[Download RAW message or body]
On Sunday 30 March 2003 18:11, Till Adam wrote:
> The second, searchFoldersAndImap.diff contains changes necessary to make
> search folders work correctly with imap folders. It implements getMsg() for
> search folders by forwarding the request to the folder of origin of the
> message.
I've extracted that part and extended it with an implementation of
KMFolderSearch::ignoreJobsForMessage( KMMessage* msg ) which appears to be
also needed.
Ok to go in?
Till
["searchFoldersAndImap2.diff" (text/x-diff)]
Index: kmfoldersearch.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmfoldersearch.cpp,v
retrieving revision 1.17
diff -u -3 -p -w -r1.17 kmfoldersearch.cpp
--- kmfoldersearch.cpp 21 Mar 2003 10:44:19 -0000 1.17
+++ kmfoldersearch.cpp 30 Mar 2003 22:05:52 -0000
@@ -661,6 +661,33 @@ KMMsgBase* KMFolderSearch::getMsgBase(in
return folder->getMsgBase(folderIdx);
}
+//-----------------------------------------------------------------------------
+KMMessage* KMFolderSearch::getMsg(int idx)
+{
+ int folderIdx = -1;
+ KMFolder *folder = 0;
+ if (idx < 0 || (Q_UINT32)idx >= mSerNums.count())
+ return 0;
+ kernel->msgDict()->getLocation(mSerNums[idx], &folder, &folderIdx);
+ assert(folder && (folderIdx != -1));
+ KMMessage* msg = folder->getMsg( folderIdx );
+ return msg;
+}
+
+//-------------------------------------------------------------
+void
+KMFolderSearch::ignoreJobsForMessage( KMMessage* msg )
+{
+ if (!msg || msg->transferInProgress())
+ return;
+ KMAcctImap *account;
+ if ( !(account = static_cast<KMFolderImap*>(msg->parent())->account()) )
+ return;
+
+ account->ignoreJobsForMessage( msg );
+}
+
+
int KMFolderSearch::find(const KMMsgBase* msg) const
{
int pos = 0;
Index: kmfoldersearch.h
===================================================================
RCS file: /home/kde/kdepim/kmail/kmfoldersearch.h,v
retrieving revision 1.11
diff -u -3 -p -w -r1.11 kmfoldersearch.h
--- kmfoldersearch.h 9 Mar 2003 13:01:42 -0000 1.11
+++ kmfoldersearch.h 30 Mar 2003 22:05:52 -0000
@@ -96,6 +96,9 @@ public:
// Stops the current search
void stopSearch() { if (mSearch) mSearch->stop(); }
+ virtual KMMessage* getMsg(int idx);
+ virtual void ignoreJobsForMessage( KMMessage* );
+
protected slots:
// Reads search definition for this folder and creates a KMSearch
bool readSearch();
_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic