diff --git a/thunar/thunar-session-client.c b/thunar/thunar-session-client.c index 303e484fac8228137e615e22dde711930e7fe9aa..de8db1f6f97a4cdf106075634daf2d1a5d307c0d 100644 --- a/thunar/thunar-session-client.c +++ b/thunar/thunar-session-client.c @@ -79,9 +79,6 @@ struct _ThunarSessionClient gchar *path; gchar *id; - guint trash_load_idle; - guint trash_checks; - #ifdef HAVE_LIBSM SmcConn connection; #endif @@ -118,9 +115,6 @@ thunar_session_client_finalize (GObject *object) { ThunarSessionClient *session_client = THUNAR_SESSION_CLIENT (object); - if (session_client->trash_load_idle != 0) - g_source_remove (session_client->trash_load_idle); - #ifdef HAVE_LIBSM /* disconnect from the session manager */ if (G_LIKELY (session_client->connection != NULL)) @@ -275,43 +269,6 @@ thunar_session_client_connect (ThunarSessionClient *session_client, -static gboolean -thunar_session_client_restore_trash (gpointer data) -{ - ThunarSessionClient *session_client = THUNAR_SESSION_CLIENT (data); - GFile *trash; - ThunarFile *directory; - guint32 item_count = 0; - - /* make sure the trash is loaded */ - trash = thunar_g_file_new_for_trash (); - directory = thunar_file_cache_lookup (trash); - g_object_unref (trash); - - if (G_LIKELY (directory != NULL)) - { - thunar_file_reload (directory); - item_count = thunar_file_get_item_count (directory); - g_object_unref (directory); - } - - /* continue checking for 15 seconds or files are found */ - return (session_client->trash_checks++ < 5 && item_count == 0); -} - - - -static void -thunar_session_client_restore_finised (gpointer data) -{ - ThunarSessionClient *session_client = THUNAR_SESSION_CLIENT (data); - - session_client->trash_load_idle = 0; - session_client->trash_checks = 0; -} - - - static void thunar_session_client_restore (ThunarSessionClient *session_client) { @@ -356,17 +313,7 @@ thunar_session_client_restore (ThunarSessionClient *session_client) gtk_widget_show (window); /* open tabs */ - if (thunar_window_set_directories (THUNAR_WINDOW (window), uris, active_tab)) - { - /* add idle to make sure the trash status is up2date (bug #9513) */ - if (session_client->trash_load_idle == 0) - { - session_client->trash_load_idle = - g_timeout_add_seconds_full (G_PRIORITY_DEFAULT_IDLE, 3, thunar_session_client_restore_trash, - session_client, thunar_session_client_restore_finised); - } - } - else + if (!thunar_window_set_directories (THUNAR_WINDOW (window), uris, active_tab)) { /* no tabs were opened */ gtk_widget_destroy (window);