GNOME Bugzilla – Bug 677402
Patch for Evolution-Data-Server API changes
Last modified: 2012-06-07 17:29:51 UTC
Created attachment 215566 [details] [review] Adapt to Evolution-Data-Server API changes Evolution-Data-Server just landed some major API changes in an effort to get off of GConf and overhaul the way it stores account information. I blogged about this recently with more details: http://mbarnes.livejournal.com/4631.html I'm trying to provide patches to affected modules. Here's yours. This bumps the evolution-data-server requirement to >= 3.5.3.
Review of attachment 215566 [details] [review]: This certainly looks cleaner; I don't know the e-d-s API at all, so I'm just going to have to take your word for it. Maybe davidz has some comments since he originally wrote this code. But let's move forward with this. ::: src/calendar-server/calendar-sources.c @@ +184,3 @@ sources->priv = CALENDAR_SOURCES_GET_PRIVATE (sources); + /* XXX Not sure what to do if this fails. Well, using g_error() over g_critical() is better here if it "shouldn't happen", because the use of critical will just lead to a segfault shortly after as we try to dereference a NULL registry pointer. If something "shouldn't happen", g_error is fine by me. @@ +188,3 @@ + * registry in as a G_PARAM_CONSTRUCT_ONLY property? */ + sources->priv->registry = e_source_registry_new_sync (NULL, &error); + if (error != NULL) { gnome-shell is GNU style; braces on new line.
(In reply to comment #1) > Well, using g_error() over g_critical() is better here if it "shouldn't > happen", because the use of critical will just lead to a segfault shortly after > as we try to dereference a NULL registry pointer. > > If something "shouldn't happen", g_error is fine by me. That's easy enough. If this were my own code, I'd have CalendarSources implement GInitable and change calendar_sources_get() to calendar_sources_new() with a GError parameter. Just so it can exit more cleanly. But maybe not worth the trouble, and I didn't want to overstep. > gnome-shell is GNU style; braces on new line. Yeah, sorry. Evolution isn't. Old habits... I'll assume the changes needed are trivial enough that a new patch isn't necessary, unless you want the GInitable thing done, or unless David has more comments.
(In reply to comment #2) > I'll assume the changes needed are trivial enough that a new patch isn't > necessary, unless you want the GInitable thing done, or unless David has more > comments. Please commit, better to get the build going again, we can iterate from there.
Committed with the g_error() and brace fix in: http://git.gnome.org/browse/gnome-shell/commit/?id=b31d22488ea4ed0fc21c6f62397a5bd45599ade0 I left the "XXX" comment about error handling in there in case someone wants to follow up.