summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Fergeau <teuf@gnome.org>2005-11-08 09:03:17 +0000
committerChristophe Fergeau <teuf@gnome.org>2005-11-08 09:03:17 +0000
commitb4bdf1974afde17fadc9ebf7f043496ed7fa9709 (patch)
treeb972cb1de9e1bd88956704267dff45b53ba1840d /src
parent58c0453c931f0a3aac3542220b71bc2ed34ebfa5 (diff)
downloadlibgpod-b4bdf1974afde17fadc9ebf7f043496ed7fa9709.tar.gz
libgpod-b4bdf1974afde17fadc9ebf7f043496ed7fa9709.tar.xz
libgpod-b4bdf1974afde17fadc9ebf7f043496ed7fa9709.zip
2005-11-08 Christophe Fergeau <teuf@gnome.org>
* 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
Diffstat (limited to 'src')
-rw-r--r--src/hal-common.c3
-rw-r--r--src/hal-common.h2
-rw-r--r--src/ipod-device.c17
3 files changed, 15 insertions, 7 deletions
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 <dbus/dbus.h>
#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+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 <dbus/dbus.h>
#include <dbus/dbus-glib.h>
-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;