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 667685 - [PATCH] Use GDBus
[PATCH] Use GDBus
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Display
git master
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-11 11:56 UTC by Robert Ancell
Modified: 2012-01-12 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use GDBus instead of dbus-glib (7.67 KB, patch)
2012-01-11 11:56 UTC, Robert Ancell
reviewed Details | Review
Use GDBus instead of dbus-glib (7.71 KB, patch)
2012-01-12 14:18 UTC, Robert Ancell
none Details | Review
Use GDBus instead of dbus-glib (7.90 KB, patch)
2012-01-12 14:34 UTC, Robert Ancell
committed Details | Review

Description Robert Ancell 2012-01-11 11:56:35 UTC
Created attachment 205014 [details] [review]
Use GDBus instead of dbus-glib

Use GDBus instead of dbus-glib
Comment 1 Matthias Clasen 2012-01-11 11:59:40 UTC
Review of attachment 205014 [details] [review]:

Looks good to me, fwiw
Comment 2 Bastien Nocera 2012-01-11 12:14:18 UTC
Review of attachment 205014 [details] [review]:

Apart from the error handling, looks fine to me.

::: panels/display/cc-display-panel.c
@@ +2260,1 @@
   g_assert (self->priv->proxy != NULL); /* that call does not fail unless we pass bogus names */

That's not true anymore, and we should have a good error message here. Passing G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START might alleviate that problem.
Comment 3 Robert Ancell 2012-01-12 14:18:43 UTC
Created attachment 205103 [details] [review]
Use GDBus instead of dbus-glib

Don't crash out if the dbus proxy fails to resolve.  Note that I intentionally didn't improve the error handling in the code as the rest of the code seems to be like that and it's probably better resolved in another patch.
Comment 4 Bastien Nocera 2012-01-12 14:23:31 UTC
(In reply to comment #3)
> Created an attachment (id=205103) [details] [review]
> Use GDBus instead of dbus-glib
> 
> Don't crash out if the dbus proxy fails to resolve.  Note that I intentionally
> didn't improve the error handling in the code as the rest of the code seems to
> be like that and it's probably better resolved in another patch.

That's still not equivalent to what was there before. We would have got an error message from the "ApplyConfiguration" call if the proxy didn't correspond to any running instance, and got an error message to that effect.

Something like those removed lines would have done (obviously change the mention of the session bus to something else):
-  if (self->priv->connection == NULL) {
-    error_message (self, _("Could not get session bus while applying display configuration"), error->message);
-    g_error_free (error);
-    return;
-  }
Comment 5 Robert Ancell 2012-01-12 14:34:24 UTC
Created attachment 205105 [details] [review]
Use GDBus instead of dbus-glib

Ah, I see what you mean.  This one should solve that then.
Comment 6 Bastien Nocera 2012-01-12 15:40:17 UTC
Review of attachment 205105 [details] [review]:

Small change, I'll commit that now.

::: panels/display/cc-display-panel.c
@@ +2259,3 @@
+                                                     NULL,
+                                                     &error);
+                                                     "org.gnome.SettingsDaemon",

Should be:
if (self->priv->proxy == NULL) {
  error_message (self, _("Failed to apply configuration: %s"), error->message);
  g_error_free (error);
  return;
}
Comment 7 Bastien Nocera 2012-01-12 15:47:53 UTC
With the aforementioned fixes.