$OpenBSD: patch-gnome-session_gsm-manager_c,v 1.8 2010/12/03 13:15:27 ajacoutot Exp $

OpenBSD does not support uPower.

--- gnome-session/gsm-manager.c.orig	Fri Dec  3 13:41:07 2010
+++ gnome-session/gsm-manager.c	Fri Dec  3 13:42:09 2010
@@ -38,7 +38,9 @@
 #include <dbus/dbus-glib.h>
 #include <dbus/dbus-glib-lowlevel.h>
 
+#ifndef __OpenBSD__
 #include <upower.h>
+#endif
 
 #include <gtk/gtk.h> /* for logout dialog */
 #include <gconf/gconf-client.h>
@@ -135,7 +137,9 @@ struct GsmManagerPrivate
         DBusGConnection        *connection;
 
         /* Interface with other parts of the system */
+#ifndef __OpenBSD__
         UpClient               *up_client;
+#endif
 };
 
 enum {
@@ -1013,6 +1017,7 @@ manager_perhaps_lock (GsmManager *manager)
 static void
 manager_attempt_hibernate (GsmManager *manager)
 {
+#ifndef __OpenBSD__
         gboolean  can_hibernate;
         GError   *error;
         gboolean  ret;
@@ -1031,11 +1036,13 @@ manager_attempt_hibernate (GsmManager *manager)
                         g_error_free (error);
                 }
         }
+#endif
 }
 
 static void
 manager_attempt_suspend (GsmManager *manager)
 {
+#ifndef __OpenBSD__
         gboolean  can_suspend;
         GError   *error;
         gboolean  ret;
@@ -1054,6 +1061,7 @@ manager_attempt_suspend (GsmManager *manager)
                         g_error_free (error);
                 }
         }
+#endif
 }
 
 static void
@@ -2288,10 +2296,12 @@ gsm_manager_dispose (GObject *object)
                 manager->priv->gconf_client = NULL;
         }
 
+#ifndef __OpenBSD__
         if (manager->priv->up_client != NULL) {
                 g_object_unref (manager->priv->up_client);
                 manager->priv->up_client = NULL;
         }
+#endif
 
         G_OBJECT_CLASS (gsm_manager_parent_class)->dispose (object);
 }
@@ -2523,7 +2533,9 @@ gsm_manager_init (GsmManager *manager)
                           G_CALLBACK (on_presence_status_changed),
                           manager);
 
+#ifndef __OpenBSD__
         manager->priv->up_client = up_client_new ();
+#endif
 
         /* GConf setup */
         gconf_client_add_dir (manager->priv->gconf_client,
@@ -3069,10 +3081,12 @@ gsm_manager_can_shutdown (GsmManager *manager,
         gboolean can_suspend;
         gboolean can_hibernate;
 
+#ifndef __OpenBSD__
         g_object_get (manager->priv->up_client,
                       "can-suspend", &can_suspend,
                       "can-hibernate", &can_hibernate,
                       NULL);
+#endif
 
 #ifdef GNOME_ENABLE_DEBUG
         g_debug ("GsmManager: CanShutdown called");
