~ubuntu-branches/ubuntu/oneiric/gnome-settings-daemon/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/00git_dont_crash_if_session_not_ready.patch

  • Committer: Package Import Robot
  • Author(s): Rodrigo Moya
  • Date: 2011-09-19 17:05:48 UTC
  • mfrom: (1.1.51 upstream)
  • Revision ID: package-import@ubuntu.com-20110919170548-gegm8ewt6qf7v7lp
Tags: 3.1.92-0ubuntu1
* New upstream release
* debian/control:
  - Bump libcolord-dev build dependency
* debian/patches/00git_guard_against_division_by_0.patch:
* debian/patches/00git_dont_crash_if_session_not_ready.patch:
* debian/patches/00git_numlock_status.patch:
* debian/patches/00git_disconnect_callbacks.patch:
  - Remove upstream patches
* debian/patches/06_use_application_indicator.patch:
* debian/patches/16_use_synchronous_notifications.patch:
  - Rebased

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
commit a0c62ab873bff5339e0f239550e24bd5161eb981
2
 
Author: Richard Hughes <richard@hughsie.com>
3
 
Date:   Thu Sep 8 11:44:22 2011 +0100
4
 
 
5
 
    power: Don't crash if we try to calculate the idle state before connected to gnome-session
6
 
    
7
 
    Resolves https://bugzilla.gnome.org/show_bug.cgi?id=657917
8
 
 
9
 
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
10
 
index 6c0174a..9706356 100644
11
 
--- a/plugins/power/gsd-power-manager.c
12
 
+++ b/plugins/power/gsd-power-manager.c
13
 
@@ -2730,6 +2730,12 @@ idle_is_session_idle (GsdPowerManager *manager)
14
 
         GVariant *result;
15
 
         guint status;
16
 
 
17
 
+        /* not yet connected to gnome-session */
18
 
+        if (manager->priv->session_presence_proxy == NULL) {
19
 
+                g_warning ("gnome-session is not available");
20
 
+                return FALSE;
21
 
+        }
22
 
+
23
 
         /* get the session status */
24
 
         result = g_dbus_proxy_get_cached_property (manager->priv->session_presence_proxy,
25
 
                                                    "status");
26
 
@@ -2750,6 +2756,12 @@ idle_is_session_inhibited (GsdPowerManager *manager, guint mask)
27
 
         GVariant *retval = NULL;
28
 
         GError *error = NULL;
29
 
 
30
 
+        /* not yet connected to gnome-session */
31
 
+        if (manager->priv->session_proxy == NULL) {
32
 
+                g_warning ("gnome-session is not available");
33
 
+                return FALSE;
34
 
+        }
35
 
+
36
 
         retval = g_dbus_proxy_call_sync (manager->priv->session_proxy,
37
 
                                          "IsInhibited",
38
 
                                          g_variant_new ("(u)",