int i;
GError *error = NULL;
DBusGConnection *connection;
+ gboolean result = FALSE;
#if DBUS_VERSION < 35
DBusGPendingCall *call;
#endif
"/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)) {
}
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,
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,
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 */
int
main (int argc, char *argv[])
{
-#ifdef ENABLE_METADATA
gboolean enable_metadata = FALSE;
-#endif
poptContext context;
GValue context_as_value = { 0 };
GnomeProgram *program;
gnome_authentication_manager_init ();
-#if ENABLE_METADATA
+
if (enable_metadata) {
ev_metadata_manager_init ();
}
-#endif
ev_job_queue_init ();
g_set_application_name (_("Evince Document Viewer"));
poptFreeContext (context);
ev_file_helpers_shutdown ();
-#if ENABLE_METADATA
if (enable_metadata) {
ev_metadata_manager_shutdown ();
}
-#endif
return 0;
}