[Kde-pim] Re: two itemChanged signals fired by Akonadi::Monitor for a single modifyJob

Christian Mollekopf chrigi_1 at fastmail.fm
Thu Dec 23 16:45:32 GMT 2010


On Thursday 23 December 2010 10:47:34 Stephen Kelly wrote:
> Christian Mollekopf wrote:
> > On Wednesday 22 December 2010 19:22:07 Kevin Krammer wrote:
> >> Hi,
> >> 
> >> On Wednesday, 2010-12-22, Christian Mollekopf wrote:
> >> > Hi,
> >> > 
> >> > I am trying to detect if an Akonadi::Item changed because of the
> >> > Akonadi::ItemModifyJob which I issued, or because another program
> >> > changed the Item.
> >> 
> >> What is the larger use case at hand, i.e. why do you need to decide who
> >> change the item.
> > 
> > I have an editor for a note (Akonotes resource), and I want to do
> > periodic autosaves. For the case that the item was modified from
> > outside, i monitor the item for a change, and in case of a change I
> > update the editor content. If I make now an autosave from this editor, I
> > don't want to update the content of the editor (because the cursor would
> > move) since it is already up to date.
> 
> You can run your autosave jobs in a custom session, and not monitor that
> session.
> 
> myMonitor->ignoreSession(m_autosaveSession);
> 
> http://api.kde.org/4.x-api/kdepimlibs-
> apidocs/akonadi/html/classAkonadi_1_1Monitor.html#a2a9b82068b614c07e5d5d1f9
> 5a30a6f4

Thanks for the hint, that made the code much cleaner and less error prone.

What I am doing now is:
Every time I save the item, i create a custom session, specifically  for this 
save operation, and ignore it in the monitor of that item. That way the item 
which executes the save ignores the change, but all other items still get the 
change.

This works fine and I believe that the second signal originated from the 
KOrganizer deamon which for some reasond changed an item while I had the same 
Incidence (i.e. Todo) open. (so i think it doesn't happen with the akonotes 
resource, only with the kcal resource)

Cheers,

Chris
> 
> Cheers,
> 
> Steve.
> 
> _______________________________________________
> KDE PIM mailing list kde-pim at kde.org
> https://mail.kde.org/mailman/listinfo/kde-pim
> KDE PIM home page at http://pim.kde.org/
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list