accelerometer should be optional
authorThomas Thurman <tthurman@gnome.org>
Wed, 27 May 2009 05:15:08 +0000 (01:15 -0400)
committerThomas Thurman <tthurman@gnome.org>
Wed, 27 May 2009 05:15:08 +0000 (01:15 -0400)
sand.c

diff --git a/sand.c b/sand.c
index e671d10..7428e88 100644 (file)
--- a/sand.c
+++ b/sand.c
@@ -198,7 +198,7 @@ update_screen (gpointer data)
 
   int xstart, xend, xdelta, ystart, yend, ydelta;
 
 
   int xstart, xend, xdelta, ystart, yend, ydelta;
 
-  if (!dbus_call)
+  if (!dbus_call && dbus_proxy)
     dbus_call = dbus_g_proxy_begin_call (
                                         dbus_proxy,
                                         "get_device_orientation",
     dbus_call = dbus_g_proxy_begin_call (
                                         dbus_proxy,
                                         "get_device_orientation",
@@ -311,7 +311,10 @@ main(int argc, char **argv)
                                                "/com/nokia/mce/request",
                                                "com.nokia.mce.request", NULL);
 
                                                "/com/nokia/mce/request",
                                                "com.nokia.mce.request", NULL);
 
-  g_assert (dbus_proxy);
+  if (!dbus_proxy)
+    {
+      g_warning ("You have no accelerometer installed.  Gravity will always be downwards.\n");
+    }
 
   pixbuf = gdk_pixbuf_new_from_file ("/usr/share/sandcastle/sandcastle.png", NULL);
   pixels = (guint32*) gdk_pixbuf_get_pixels (pixbuf);
 
   pixbuf = gdk_pixbuf_new_from_file ("/usr/share/sandcastle/sandcastle.png", NULL);
   pixels = (guint32*) gdk_pixbuf_get_pixels (pixbuf);