Skip to content
Commit 760c438e authored by Matthew Barnes's avatar Matthew Barnes
Browse files

Bug 647698 - Selected calendar doesnt authenticate after offline/online

When I wrote e_load_cal_source_async() it didn't occur to me that a
calendar backend may emit "auth-required" after the initial connection
attempt.  And because I was passing the allocated context data for the
asynchronous load operation to e_cal_set_auth_func(), meaning the data
gets freed at the end of the load operation, I was then calling
e_cal_set_auth_func(cal, NULL, NULL) after the initial authentication
was complete so that the ECal would not try to access the freed context
data after the load operation finished.

But that turned out to break the case of switching to offline mode, then
back to online mode.  Most calendar backends need to re-authenticate when
they come back online.

This commit instead passes data to the authentication function by way of
g_object_set_data_full() so that the authentication function can be left
in place for the duration of the ECal instance.

Note that e_cal_set_auth_func() lacks a GDestroyNotify argument for the
user data passed to it, which rules out passing any kind of allocated
data structure.  This is an API design flaw, in my opinion.  But
g_object_set_data_full() *does* take a GDestroyNotify argument.
parent 0b07e836
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment