[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Patch to set status of all unread mails to read
From:       Harald Fernengel <harry () bnro ! de>
Date:       2001-04-29 20:22:14
[Download RAW message or body]

Hello,

this patch will set all selected mails to status "read" in case they were 
"unread". This is because I often skip a lot of mails in mailinglists and 
then mark all mails to set them to "read". Unfortunately I'll then lose all 
"replied" and "flagged" status indicators.

This is my first try, so don't hesitate to contact me if you dislike 
something in this patch...

Harry
["kmail.patch" (text/plain)]

Index: kmheaders.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmheaders.cpp,v
retrieving revision 1.277
diff -r1.277 kmheaders.cpp
899c899
< void KMHeaders::setMsgStatus (KMMsgStatus status, int /*msgId*/)
---
> void KMHeaders::setMsgStatusCond (KMMsgStatus newStatus, KMMsgStatus oldStatus, int /*msgId*/)
907,908c907
<       msgBase->setStatus(status);
<       if (mFolder->account())
---
>       if (oldStatus == KMMsgStatusUnknown || msgBase->status() == oldStatus)
910,913c909,916
<         unget = !mFolder->isMessage(item->msgId());
<         KMMessage *msg = mFolder->getMsg(item->msgId());
<         mFolder->account()->setStatus(msg, status);
<         if (unget) mFolder->unGetMsg(item->msgId());
---
>         msgBase->setStatus(newStatus);
>         if (mFolder->account())
>         {
>           unget = !mFolder->isMessage(item->msgId());
>           KMMessage *msg = mFolder->getMsg(item->msgId());
>           mFolder->account()->setStatus(msg, newStatus);
>           if (unget) mFolder->unGetMsg(item->msgId());
>         }
915a919,925
> }
> 
> 
> //-----------------------------------------------------------------------------
> void KMHeaders::setMsgStatus (KMMsgStatus status, int /*msgId*/)
> {
>   setMsgStatusCond(status, KMMsgStatusUnknown, -1);
Index: kmheaders.h
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmheaders.h,v
retrieving revision 1.74
diff -r1.74 kmheaders.h
93a94,95
>   // Sets message status to "newStatus" only if it has the status "oldStatus"
>   virtual void setMsgStatusCond (KMMsgStatus newStatus, KMMsgStatus oldStatus, int msgId=-1);
Index: kmmainwin.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmmainwin.cpp,v
retrieving revision 1.302
diff -r1.302 kmmainwin.cpp
1244a1245,1249
> //-----------------------------------------------------------------------------
> void KMMainWin::slotSetMsgStatusUnread2Read()
> {
>   mHeaders->setMsgStatusCond(KMMsgStatusRead, KMMsgStatusUnread);
> }
1753a1759,1764
> 
>   KAction *unread2readAction = new KAction (i18n("&Mark unread as read"), "kmmsgold", 0, this,
>                                    SLOT(slotSetMsgStatusUnread2Read()),
>                                    actionCollection(), "status_unread2read");
> 
>   statusMenu->insert( unread2readAction );
Index: kmmainwin.h
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmmainwin.h,v
retrieving revision 1.87
diff -r1.87 kmmainwin.h
166a167
>   void slotSetMsgStatusUnread2Read();

_______________________________________________
Kmail Developers mailing list
Kmail@master.kde.org
http://master.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