[Kde-pim] Does an Akonadi resource know what Collection it's handling?

David Jarvie djarvie at kde.org
Wed May 26 17:19:56 BST 2010


On Wed, May 26, 2010 2:51 pm, Kevin Krammer wrote:
> On Wednesday, 2010-05-26, David Jarvie wrote:
>> On Wed, May 26, 2010 1:51 pm, Kevin Krammer wrote:
>> > On Wednesday, 2010-05-26, David Jarvie wrote:
>
>> >> If the calendar file being represented by the Collection is in an old
>> >> KAlarm format, the user should be offered the option of updating it
>> >> to the
>> >> current format (although I haven't yet worked out how this option
>> >> should be offered for an Akonadi resource). But if the Collection is
>> >> read-only, this option should not be available.
>> >
>> > You can probably offer this as part of the resource configuration,
>> > i.e. when the user has selected a file to work on in the config UI.
>> >
>> > At this point you usually also know whether the user wants this to be
>> > read-only (a common setting in resources).
>>
>> That sounds entirely reasonable when an Akonadi resource is first
>> configured. But what happens at a later date when a new version of
>> KAlarm
>> is installed and it uses an updated format? If the calendar is also
>> accessed by another computer with the original version of KAlarm, it
>> can't be automatically updated without asking the user.
>
> Good point.
> So there are a handful possible locations on when such a check might be
> necessary:
> - when the config is changed to a different file
> - when  the config is changed from read-only to read-write
> - when the resource (re-)starts
>
> and, theoretically,
> - when the collection's ACL gets changed by another process, now allowing
> write access
>
> Theoretical because your resource could just change it back if it is still
> read-only according to its config.
>
> I think it would be sufficient to just acknowledge the read/write
> permission settings given to your resource through its config.
> Well an obviously whether the file is writable :)

There will still be the need to at least notify the user that a read-write
calendar needs updating and therefore must now be read-only until it is
updated. It would be preferable to be able to prompt the user whether to
update it. The question is, where does the prompt come from? Presumably it
needs to be output by the application, not by the resource (since the
resource starts in the background).

The obvious solution is for the resource to set an attribute on the
Collection indicating the compatibility status, and then the application
can prompt the user and if desired, tell the resource to update the
calendar format.

I'm not entirely clear about the mechanism for doing some of this, but if
somebody can tell me that this seems a reasonable approach, I'm sure I'll
manage to work it out.

Cheers,
-- 
David Jarvie.
KDE developer.
KAlarm author - http://www.astrojar.org.uk/kalarm

_______________________________________________
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