From kde-pim Thu May 08 21:38:57 2008 From: "Dmitry Ivanov" Date: Thu, 08 May 2008 21:38:57 +0000 To: kde-pim Subject: [Kde-pim] AgentBase::Observer behaviour Message-Id: <6df8d8b90805081438s3185dd82r653afa3f406ee08d () mail ! gmail ! com> X-MARC-Message: https://marc.info/?l=kde-pim&m=121028279316233 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 ); // 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. 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() ? These issues look like bugs to me. Or am I missing something? Best, Dmitry -- A: Because it destroys the flow of the conversation Q: Why is top-posting bad? _______________________________________________ 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/