X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fmain.c;h=4fff6dfebfae1887ffd6fed01825b0477327d2a9;hb=5cc8e92ad9fb04792682b474a670aaa803666f78;hp=f6600f0f19edafc347dddff103e28797f0ee8066;hpb=28df8004a43a579e93ea905a2426fe42e1e6dfa7;p=evince.git diff --git a/shell/main.c b/shell/main.c index f6600f0f..4fff6dfe 100644 --- a/shell/main.c +++ b/shell/main.c @@ -74,6 +74,7 @@ load_files_remote (const char **files) int i; GError *error = NULL; DBusGConnection *connection; + gboolean result = FALSE; #if DBUS_VERSION < 35 DBusGPendingCall *call; #endif @@ -92,7 +93,15 @@ load_files_remote (const char **files) "/org/gnome/evince/Evince", "org.gnome.evince.Application"); if (!files) { -#if DBUS_VERSION < 35 +#if DBUS_VERSION <= 33 + call = dbus_g_proxy_begin_call (remote_object, "OpenWindow", DBUS_TYPE_INVALID); + + if (!dbus_g_proxy_end_call (remote_object, call, &error, DBUS_TYPE_INVALID)) { + g_warning (error->message); + g_clear_error (&error); + return FALSE; + } +#elif DBUS_VERSION == 34 call = dbus_g_proxy_begin_call (remote_object, "OpenWindow", G_TYPE_INVALID); if (!dbus_g_proxy_end_call (remote_object, call, &error, G_TYPE_INVALID)) { @@ -111,13 +120,24 @@ load_files_remote (const char **files) } for (i = 0; files[i]; i++) { - gboolean result = TRUE; const char *page_label; char *uri; uri = gnome_vfs_make_uri_from_shell_arg (files[i]); page_label = ev_page_label ? ev_page_label : ""; -#if DBUS_VERSION < 35 +#if DBUS_VERSION <= 33 + call = dbus_g_proxy_begin_call (remote_object, "OpenURI", + DBUS_TYPE_STRING, &uri, + DBUS_TYPE_STRING, &page_label, + 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, @@ -126,7 +146,8 @@ load_files_remote (const char **files) if (!dbus_g_proxy_end_call (remote_object, call, &error, G_TYPE_INVALID)) { g_warning (error->message); g_clear_error (&error); - result = FALSE; + g_free (uri); + continue; } #else if (!dbus_g_proxy_call (remote_object, "OpenURI", &error, @@ -135,14 +156,15 @@ load_files_remote (const char **files) G_TYPE_INVALID)) { g_warning (error->message); g_clear_error (&error); - result = FALSE; + g_free (uri); + continue; } #endif g_free (uri); - return result; + result = TRUE; } - return TRUE; + return result; } #endif /* ENABLE_DBUS */