[Evolution-hackers] Confusion between EServerSideSource's remote-deletable and removable properties

2013-01-17 Thread Milan Crha
Hi,
I'm sorry, but I'm quite confused with the EServerSideSource's
remote-deletable and removable properties. They seem to me like they
should do the same, mark the ESource with a flag that it can be removed
by a user, but they are actually not.

I'm currently playing with Public Folders support for EWS, and when I
subscribe to a public calendar, then the source is properly added, as
expected, but I cannot unsubscribe from it, I get an error:
 Data source 'Public Calendar Folder' is not removable
The reason might be that the underlying code [1] calls
e_source_remove_sync(), which is basically what I want from it, I want
to remove the source. The ews-backend in source registry takes care to
not delete the server side folder, thus it seems to me that it's
particularly a lie to claim e_server_side_source_set_remote_deletable()
when the code avoids it, but that's probably unrelated.

Maybe I'm just brain-stuck or such, please forgive me, but I cannot get
the right meaning and correlation between these two from their DOC. It
speaks something about DBus interfaces (oh my God, interfaces for
boolean properties on the source, really?), but I do not get from it why
the e_source_remove_sync() cannot work for whichever of these is TRUE.

I found that I should rather call the e_source_remote_delete() for one
type of the ESource, and the e_source_remove_sync() for another type,
but, isn't this unnecessary complicated? It basically means, that each
and every remove this source, please code will always look like:

   if (e_source_get_removable (source))
e_source_remove (...);
   else if (e_source_get_remote_deletable (source))
e_source_remote_delete (...);
   else
g_warning (I'm sorry, no way);

when the client side wants to make sure that they can satisfy user's
need to delete a source which is now useless for him/her.

Even it's nice to know whether the source is local or remote, then
the simple operations like add/remove may not be that complicated.
I think, at least.

Can anyone clarify what I got wrong, please?
Thanks and bye,
Milan

[1]
http://git.gnome.org/browse/evolution-ews/tree/src/server/e-ews-folder.c?h=gnome-3-6#n606

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] Confusion between EServerSideSource's remote-deletable and removable properties

2013-01-17 Thread Matthew Barnes
On Thu, 2013-01-17 at 11:08 +0100, Milan Crha wrote:
 I'm sorry, but I'm quite confused with the EServerSideSource's
 remote-deletable and removable properties. They seem to me like they
 should do the same, mark the ESource with a flag that it can be removed
 by a user, but they are actually not.

Removable is for simply deleting the local key file.  This is handled
directly by the ESourceRegistryServer.

Remote-Deletable is for deleting a remote resource represented by the
ESource.  It requires the ESource be owned by a collection backend, and
only after the remote deletion is successful is the local key file
deleted.

On the client-side we probably should have separate GtkActions for
deleting a local ESource versus permanently deleting a remote resource,
so they can at least be labeled differently (e.g. Delete Calendar vs.
Delete Remote Calendar) since no one reads warning dialogs.

Matt

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-hackers