From b4bdf1974afde17fadc9ebf7f043496ed7fa9709 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 8 Nov 2005 09:03:17 +0000 Subject: 2005-11-08 Christophe Fergeau * src/hal-common.c: * src/hal-common.h: * src/ipod-device.c: (ipod_device_set_property), (ipod_device_hal_initialize), (ipod_device_detect_volume_info), (ipod_device_new), (ipod_device_eject): sync with libipoddevice CVS, use #ifdef HAVE_LIBHAL instead of #if HAVE_LIBHAL git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1143 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- ChangeLog | 9 +++++++++ src/hal-common.c | 3 +++ src/hal-common.h | 2 -- src/ipod-device.c | 17 ++++++++++++----- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 11b1802..58f0d0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-11-08 Christophe Fergeau + + * src/hal-common.c: + * src/hal-common.h: + * src/ipod-device.c: (ipod_device_set_property), + (ipod_device_hal_initialize), (ipod_device_detect_volume_info), + (ipod_device_new), (ipod_device_eject): sync with libipoddevice CVS, + use #ifdef HAVE_LIBHAL instead of #if HAVE_LIBHAL + 2005-11-06 Christophe Fergeau * src/ipod-device.h: diff --git a/src/hal-common.c b/src/hal-common.c index 23dca80..6b36d6f 100644 --- a/src/hal-common.c +++ b/src/hal-common.c @@ -62,6 +62,9 @@ #include #include +#include + +static GMainContext *ipod_device_global_main_context = NULL; dbus_bool_t hal_mainloop_integration(LibHalContext *ctx, DBusError *error) diff --git a/src/hal-common.h b/src/hal-common.h index a4e8909..db525fa 100644 --- a/src/hal-common.h +++ b/src/hal-common.h @@ -68,8 +68,6 @@ #include #include -static GMainContext *ipod_device_global_main_context = NULL; - dbus_bool_t hal_mainloop_integration(LibHalContext *ctx, DBusError *error); void ipod_device_set_global_main_context(GMainContext *ctx); diff --git a/src/ipod-device.c b/src/ipod-device.c index 124a585..c085265 100644 --- a/src/ipod-device.c +++ b/src/ipod-device.c @@ -555,7 +555,7 @@ ipod_device_set_property(GObject *object, guint prop_id, } else { str = volumes[0]; } -#if HAVE_LIBHAL +#ifdef HAVE_LIBHAL g_free_if_not_null(device->priv->hal_volume_id); device->priv->hal_volume_id = g_strdup(str); #else @@ -848,7 +848,7 @@ ipod_device_finalize(GObject *object) LibHalContext * ipod_device_hal_initialize() { -#if HAVE_LIBHAL +#ifdef HAVE_LIBHAL LibHalContext *hal_context; DBusError error; DBusConnection *dbus_connection; @@ -1205,7 +1205,7 @@ ipod_device_restore_reboot_preferences(IpodDevice *device) gboolean ipod_device_detect_volume_info(IpodDevice *device) { -#if HAVE_LIBHAL +#ifdef HAVE_LIBHAL LibHalContext *hal_context; gchar **volumes; gchar *hd_mount_point, *hd_device_path; @@ -1434,7 +1434,7 @@ ipod_device_has_open_fd(IpodDevice *device) return FALSE; } -#if HAVE_LIBHAL +#ifdef HAVE_LIBHAL /* modded from g-v-m */ static int ipod_device_run_command(IpodDevice *device, const char *command, @@ -1513,6 +1513,13 @@ ipod_device_new(const gchar *hal_volume_id) IpodDevice *device = g_object_new(TYPE_IPOD_DEVICE, "hal-volume-id", hal_volume_id, NULL); + if (device == NULL) { + /* This can happen if one forgot to call g_type_init before + * calling ipod_device_new + */ + return NULL; + } + if(!device->priv->is_ipod) { g_object_unref(device); return NULL; @@ -1532,7 +1539,7 @@ ipod_device_rescan_disk(IpodDevice *device) guint ipod_device_eject(IpodDevice *device, GError **error_out) { -#if HAVE_LIBHAL +#ifdef HAVE_LIBHAL gint exit_status; GError *error = NULL; -- cgit