After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 677402 - Patch for Evolution-Data-Server API changes
Patch for Evolution-Data-Server API changes
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: calendar
unspecified
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gnome-shell-maint
Depends on:
Blocks: 677497
 
 
Reported: 2012-06-04 17:08 UTC by Matthew Barnes
Modified: 2012-06-07 17:29 UTC
See Also:
GNOME target: 3.6
GNOME version: ---


Attachments
Adapt to Evolution-Data-Server API changes (34.47 KB, patch)
2012-06-04 17:08 UTC, Matthew Barnes
committed Details | Review

Description Matthew Barnes 2012-06-04 17:08:17 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.
Comment 1 Colin Walters 2012-06-07 00:40:59 UTC
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.
Comment 2 Matthew Barnes 2012-06-07 01:08:43 UTC
(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.
Comment 3 Colin Walters 2012-06-07 01:14:39 UTC
(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.
Comment 4 Matthew Barnes 2012-06-07 17:29:27 UTC
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.