From: Carlos Garcia Campos Date: Mon, 8 Jan 2007 19:04:26 +0000 (+0000) Subject: Bump requirements to dbus-glib 0.71 and drop all ifdefs used. X-Git-Tag: EVINCE_0_7_1~9 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=8c83adb77352c7b8457b14efecc254a1d3f20a2e;p=evince.git Bump requirements to dbus-glib 0.71 and drop all ifdefs used. 2007-01-08 Carlos Garcia Campos * configure.ac: * shell/ev-application.c: (ev_application_register_service): * shell/main.c: (load_files_remote): Bump requirements to dbus-glib 0.71 and drop all ifdefs used. svn path=/trunk/; revision=2201 --- diff --git a/ChangeLog b/ChangeLog index e118c340..3e92a159 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-01-08 Carlos Garcia Campos + + * configure.ac: + * shell/ev-application.c: (ev_application_register_service): + * shell/main.c: (load_files_remote): + + Bump requirements to dbus-glib 0.71 and drop all ifdefs used. + 2007-01-08 Nickolay V. Shmyrev * doc/debugging.txt: diff --git a/configure.ac b/configure.ac index 8a21c50b..b59e00d3 100644 --- a/configure.ac +++ b/configure.ac @@ -40,7 +40,7 @@ dnl Check dependencies # SHELL_CFLAGS for shell implementation. # SHELL_LIBS -DBUS_GLIB_REQUIRED=0.33 +DBUS_GLIB_REQUIRED=0.71 GTK_REQUIRED=2.8.15 KEYRING_REQUIRED=0.4.0 @@ -129,9 +129,6 @@ if test "x$enable_dbus" = "xyes" ; then fi AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled]) - - DBUS_VERSION=`$PKG_CONFIG --modversion dbus-glib-1 | sed 's/0\.\([[0-9]]*\)\.\{0,1\}\([[0-9]]*\)/\1/'` - AC_DEFINE_UNQUOTED(DBUS_VERSION, $DBUS_VERSION, [DBUS version.]) fi SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE" diff --git a/shell/ev-application.c b/shell/ev-application.c index aee7390b..f669c140 100644 --- a/shell/ev-application.c +++ b/shell/ev-application.c @@ -75,7 +75,6 @@ ev_application_register_service (EvApplication *application) DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); -#if DBUS_VERSION >= 60 if (!org_freedesktop_DBus_request_name (driver_proxy, APPLICATION_SERVICE_NAME, DBUS_NAME_FLAG_DO_NOT_QUEUE, @@ -83,14 +82,6 @@ ev_application_register_service (EvApplication *application) g_warning ("Service registration failed."); g_clear_error (&err); } -#else - if (!org_freedesktop_DBus_request_name (driver_proxy, - APPLICATION_SERVICE_NAME, - 0, &request_name_result, &err)) { - g_warning ("Service registration failed."); - g_clear_error (&err); - } -#endif g_object_unref (driver_proxy); @@ -98,14 +89,8 @@ ev_application_register_service (EvApplication *application) return FALSE; } -#if DBUS_VERSION == 33 - dbus_g_object_class_install_info (G_OBJECT_GET_CLASS (application), - &dbus_glib_ev_application_object_info); -#else dbus_g_object_type_install_info (EV_TYPE_APPLICATION, &dbus_glib_ev_application_object_info); -#endif - dbus_g_connection_register_g_object (connection, "/org/gnome/evince/Evince", G_OBJECT (application)); diff --git a/shell/main.c b/shell/main.c index 3c5a83d3..0a653d1a 100644 --- a/shell/main.c +++ b/shell/main.c @@ -180,7 +180,6 @@ load_files (const char **files, } #ifdef ENABLE_DBUS - static gboolean load_files_remote (const char **files, GHashTable *args) @@ -189,9 +188,6 @@ load_files_remote (const char **files, GError *error = NULL; DBusGConnection *connection; gboolean result = FALSE; -#if DBUS_VERSION < 35 - DBusGPendingCall *call; -#endif DBusGProxy *remote_object; GdkDisplay *display; guint32 timestamp; @@ -212,31 +208,6 @@ load_files_remote (const char **files, "/org/gnome/evince/Evince", "org.gnome.evince.Application"); if (!files) { -#if DBUS_VERSION <= 33 - call = dbus_g_proxy_begin_call (remote_object, "OpenWindow", - DBUS_TYPE_UINT32, ×tamp, - DBUS_TYPE_INVALID); - - if (!dbus_g_proxy_end_call (remote_object, call, &error, DBUS_TYPE_INVALID)) { - g_warning (error->message); - g_clear_error (&error); - g_object_unref (remote_object); - dbus_g_connection_unref (connection); - return FALSE; - } -#elif DBUS_VERSION == 34 - call = dbus_g_proxy_begin_call (remote_object, "OpenWindow", - G_TYPE_UINT, timestamp, - G_TYPE_INVALID); - - if (!dbus_g_proxy_end_call (remote_object, call, &error, G_TYPE_INVALID)) { - g_warning (error->message); - g_clear_error (&error); - g_object_unref (remote_object); - dbus_g_connection_unref (connection); - return FALSE; - } -#else if (!dbus_g_proxy_call (remote_object, "OpenWindow", &error, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), args, G_TYPE_UINT, timestamp, @@ -248,7 +219,7 @@ load_files_remote (const char **files, dbus_g_connection_unref (connection); return FALSE; } -#endif + g_object_unref (remote_object); dbus_g_connection_unref (connection); @@ -261,33 +232,7 @@ load_files_remote (const char **files, uri = gnome_vfs_make_uri_from_shell_arg (files[i]); page_label = ev_page_label ? ev_page_label : ""; -#if DBUS_VERSION <= 33 - call = dbus_g_proxy_begin_call (remote_object, "OpenURI", - DBUS_TYPE_STRING, &uri, - DBUS_TYPE_STRING, &page_label, - DBUS_TYPE_UINT32, ×tamp, - DBUS_TYPE_INVALID); - - if (!dbus_g_proxy_end_call (remote_object, call, &error, DBUS_TYPE_INVALID)) { - g_warning (error->message); - g_clear_error (&error); - g_free (uri); - continue; - } -#elif DBUS_VERSION == 34 - call = dbus_g_proxy_begin_call (remote_object, "OpenURI", - G_TYPE_STRING, uri, - G_TYPE_STRING, page_label, - G_TYPE_UINT, timestamp, - G_TYPE_INVALID); - - if (!dbus_g_proxy_end_call (remote_object, call, &error, G_TYPE_INVALID)) { - g_warning (error->message); - g_clear_error (&error); - g_free (uri); - continue; - } -#else + if (!dbus_g_proxy_call (remote_object, "OpenURI", &error, G_TYPE_STRING, uri, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), args, @@ -299,7 +244,7 @@ load_files_remote (const char **files, g_free (uri); continue; } -#endif + g_free (uri); result = TRUE; }