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

List:       kde-pim
Subject:    Re: [Kde-pim] AgentBase::Observer behaviour
From:       Volker Krause <vkrause () kde ! org>
Date:       2008-05-12 15:00:20
Message-ID: 200805121700.25525.vkrause () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Thursday 08 May 2008 23:38:57 Dmitry Ivanov wrote:
> Hi,
>
> I was playing with krss and AgentBase::Observer::collectionAdded(),
> collectionChanged(), collectionRemoved() and ran into a problem.
>
> The problem is twofold:
>
> 1. By default the resource is online. When I add a new collection
> via akonadiconsole the resource (krss) gets notification, but in
> collectionAdded(Collection col, Collection parent) I see 'col' and
> 'parent' have only 'id' set, 'name' and 'remoteId' (for 'parent' only)
> are empty.
>
> If I explicitly call setOnline(true) from inside the resource the
> properties of 'col' and 'parent' I receive in collectionAdded()
> are set correctly.
>
> So I had a look at what setOnline() does:
>
> void AgentBase::setOnline( bool state )
> {
>   Q_D( AgentBase );
>   d->mOnline = state;
>   d->mSettings->setValue( QLatin1String( "Agent/Online" ), state );
>   d->mMonitor->fetchCollection( state );

^^ that's wrong and should be removed, changing the online state should not 
change the change recorder configuration.

>   // TODO: d->monitor->fetchItemData( state );
> }
>
> It turned out that by default 'mOnline' is set to 'true' but
> 'fetchCollection' is set to 'false' in 'mMonitor'. That's why the
> resource gets notifications but the collections are empty. Only
> calling setOnline(true) explicitly helps

The amount of data fetched by the monitor should be configured by the 
resource, eg:
changeRecorder()->fetchCollection( true );

> 2. If I put the resource offline I _still_ receive notifications
> and 'col' and 'parent' are empty (only 'id' is set). Isn't
> ChangeRecorder supposed to intercept the notification messages and
> save them when the resource is offline? Maybe AgentBase::setOnline()
> misses a call to mMonitor->setChangeRecordingEnabled() ?

Right, that call is apparently missing there.

regards
Volker

["signature.asc" (application/pgp-signature)]

_______________________________________________
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