X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fmain.c;h=91a62d258b5299519f59bf293c45bf281151233c;hb=f222d19fbbd936de7f403eb29666b41e3447b48d;hp=8aac27afa1b85e13b779754d4a1c757678e545b7;hpb=b25c2bfcf89697009a3129f123073b84a312dfdd;p=evince.git diff --git a/shell/main.c b/shell/main.c index 8aac27af..91a62d25 100644 --- a/shell/main.c +++ b/shell/main.c @@ -137,7 +137,7 @@ load_files_remote (const char **files) /* Fake it for GTK+2.6 */ timestamp = get_startup_time (); #endif - connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); + connection = dbus_g_bus_get (DBUS_BUS_STARTER, &error); if (connection == NULL) { g_warning (error->message); g_error_free (error); @@ -158,6 +158,8 @@ load_files_remote (const char **files) 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 @@ -168,6 +170,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); + g_object_unref (remote_object); + dbus_g_connection_unref (connection); return FALSE; } #else @@ -177,9 +181,14 @@ load_files_remote (const char **files) G_TYPE_INVALID)) { g_warning (error->message); g_clear_error (&error); + g_object_unref (remote_object); + dbus_g_connection_unref (connection); return FALSE; } #endif + g_object_unref (remote_object); + dbus_g_connection_unref (connection); + return TRUE; } @@ -188,7 +197,7 @@ load_files_remote (const char **files) char *uri; uri = gnome_vfs_make_uri_from_shell_arg (files[i]); - page_label = ev_page_label ? ev_page_label : ""; + 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, @@ -232,6 +241,9 @@ load_files_remote (const char **files) result = TRUE; } + g_object_unref (remote_object); + dbus_g_connection_unref (connection); + gdk_notify_startup_complete (); return result; @@ -288,7 +300,7 @@ main (int argc, char *argv[]) ev_file_helpers_init (); ev_debug_init (); ev_stock_icons_init (); - gtk_window_set_default_icon_name ("postscript-viewer"); + gtk_window_set_default_icon_name ("evince"); load_files (poptGetArgs (context));