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

List:       kde-pim
Subject:    Re: [Kde-pim] KDE3.5: Investigating a KMail folder by DCOP
From:       "Friedrich W. H. Kossebau" <Friedrich.W.H () kossebau ! de>
Date:       2006-07-22 17:58:51
Message-ID: 200607221958.52638.Friedrich.W.H () kossebau ! de
[Download RAW message or body]

Am Donnerstag, 20. Juli 2006 15:27, schrieb Allen Winter:
> On Thursday 20 July 2006 09:20, Friedrich W. H. Kossebau wrote:
> > Hi,
> >
> > is there a way to investigate a folder in KMail by DCOP? E.g. to find out
> > if there are any unread messages (and how many?)
>
> You should be able to borrow code from the Kontact KMail Summary plugin.
> See kontact/plugins/kmail/summarywidget.cpp

Have it working, except for the fact that...
The DCOP signal "unreadCountChanged" is not really supported by KMail :(

For one there is the DCOP-Signal
  void unreadCountChanged( const QString& folderURL, int numUnread );
declared in KMailIface, but never emitted in KMail. Too sad, would have 
liked it to get all important data by push.

"unreadCountChanged()" without arguments gets emitted only 
in  "slotMailChecked(...)". But not e.g. when an unread email gets selected 
and thus turns to "read".

It works for the Kontact summary plugin, because the summary is only shown if 
no other part like the KMail one is in front. And when one switches back to 
the summary all the summary plugins are asked to update. There even seems to 
special support for this with the "timeOfLastMessageCountChange()" DCOP 
method in KMail. Oh, what a dirty hack :)

I have no KMail insight, no 3.5 developing environment setup. And tagging is 
on monday :(

You can own yourself a beer at akademy if you commit 
  kapp->dcopClient()->emitDCOPSignal( "unreadCountChanged()", QByteArray() );
to all places where the number is affected :)
A beer and also a chocolate if you even add the signal
  void unreadCountChanged( const QString& folderURL, int numUnread );
where needed.

Regards
Friedrich
_______________________________________________
kde-pim mailing list
kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic