[gnome-pilot] Fix build issue when enable hal.
- From: Matthew Charles Davey <mcdavey src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-pilot] Fix build issue when enable hal.
- Date: Mon, 9 Aug 2010 08:09:39 +0000 (UTC)
commit 140b3d0f681f37f38f02c8ef9d84af11e70c01d6
Author: Halton Huo <halton huo sun com>
Date: Thu Mar 18 14:12:51 2010 +0800
Fix build issue when enable hal.
gpilotd/gpilot-daemon.c | 17 ++++++++++++++---
gpilotd/gpilotd.c | 5 -----
2 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/gpilotd/gpilot-daemon.c b/gpilotd/gpilot-daemon.c
index 8c73778..a390e1f 100644
--- a/gpilotd/gpilot-daemon.c
+++ b/gpilotd/gpilot-daemon.c
@@ -88,6 +88,9 @@ static gboolean do_cradle_events (int pfd, GPilotContext *context, struct PilotU
static void gpilot_syncing_unknown_pilot (struct PilotUser pu, int pfd, GPilotDevice *device, GPilotContext *context);
static void gpilot_syncing_known_pilot (GPilotPilot *pilot, struct PilotUser pu, int pfd, GPilotDevice *device, GPilotContext *context);
static void pilot_disconnect (int sd);
+static void load_devices_xml (void);
+static int known_usb_device (gchar *match_str);
+static gboolean sync_device (GPilotDevice *device, GPilotContext *context);
#ifdef WITH_HAL
static DBusConnection *dbus_connection = NULL;
@@ -170,8 +173,11 @@ hal_device_added (LibHalContext *ctx, const char *udi)
GPilotDevice *device;
DBusError error;
GList *dev;
+ GpilotDaemonPrivate *priv;
- if (context->paused)
+ priv = GPILOT_DAEMON (daemon_object)->priv;
+
+ if (priv->gpilotd_context->paused)
return;
load_devices_xml ();
@@ -220,7 +226,7 @@ hal_device_added (LibHalContext *ctx, const char *udi)
return;
visor_net = g_array_index (product_net, gboolean, i);
- dev = context->devices;
+ dev = priv->gpilotd_context->devices;
while (dev != NULL) {
device = dev->data;
if (device->type == PILOT_DEVICE_USB_VISOR) {
@@ -235,7 +241,7 @@ hal_device_added (LibHalContext *ctx, const char *udi)
/* just try to sync. Until I can talk to
* the kernel guys this is the best way to
* go. */
- sync_device (device, context);
+ sync_device (device, priv->gpilotd_context);
if (!visor_net)
device->type = PILOT_DEVICE_USB_VISOR;
@@ -3019,6 +3025,11 @@ gpilot_daemon_class_init (GpilotDaemonClass *klass)
static void
gpilot_daemon_init (GpilotDaemon *daemon)
{
+#ifdef WITH_HAL
+ if ((hal_ctx = gpilotd_hal_init ()) != NULL)
+ hal_initialised = 1; /* if 0, fall back to polling sysfs */
+#endif
+
daemon->priv = GPILOT_DAEMON_GET_PRIVATE (daemon);
daemon->priv->gpilotd_context = gpilot_context_new ();
diff --git a/gpilotd/gpilotd.c b/gpilotd/gpilotd.c
index 9f95628..2eb8ae2 100644
--- a/gpilotd/gpilotd.c
+++ b/gpilotd/gpilotd.c
@@ -233,11 +233,6 @@ main (int argc, char *argv[])
g_message ("%s %s starting...", PACKAGE, VERSION);
dump_build_info ();
-#ifdef WITH_HAL
- if ((hal_ctx = gpilotd_hal_init ()) != NULL)
- hal_initialised = 1; /* if 0, fall back to polling sysfs */
-#endif
-
/* Setup the correct gpilotd.pid file */
remove_pid_file ();
write_pid_file ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]