[Evolution-hackers] I see strange code, in disco_get_folder_info



In disco_get_folder_info:

	...
case CAMEL_DISCO_STORE_OFFLINE:
	/* Can't edit subscriptions while offline */
	if ((store->flags & CAMEL_STORE_SUBSCRIPTIONS) &&
	    !(flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED)) {
		camel_disco_store_check_online (disco_store, ex);
		return NULL;
	}
	...


Can the inventor of this code explain how "Camel", a library for E-mail
access, is responsible for helping "Evolution", an E-mail client,
displaying an Empty list in the "Folder subscription" window IF the
E-mail client is set offline?

And what is that check_online thing going to change if it returns NULL
nevertheless??

It looks like the application "Evolution" detects this by itself
already. It shows the user a nice error message if she tries to get such
a list while being offline. So why is it also in Camel code then?

Why does "Camel", a library for E-mail access, care about subscriptions
being editable or not when it has to return a list of non-subscribed
folders? And why isn't this, in case Camel should really care about it,
being checked for in camel_store_subscribe_folder and
camel_store_unsubscribe_folder. Why is it, in stead, "secured" by not
returning a list?

And what if I get myself a list, set the store offline and "then" start
editing the subscriptions? How does this hack protect me from doing
that? It doesn't, right?

So what is this hack about? If I disable it and let it return the
offline "get_folders" method of the provider, everything works perfect
for every provider.

I see strange code. While I'm awake. Begin used like regular code. It
doesn't crash. Only developers that want to see it, see it. Regular
developers don't know it's strange code.


-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]