[gthumb] search: clear the file list when a new search is started



commit d105fde671e36126f05fd925dd35538824966c3e
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Dec 31 18:55:54 2020 +0100

    search: clear the file list when a new search is started

 extensions/search/gth-search-task.c |  6 ------
 gthumb/gth-browser.c                | 10 ++++++++--
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/extensions/search/gth-search-task.c b/extensions/search/gth-search-task.c
index 5281da09..10a225f3 100644
--- a/extensions/search/gth-search-task.c
+++ b/extensions/search/gth-search-task.c
@@ -110,11 +110,6 @@ save_search_result_copy_done_cb (void     **buffer,
        task->priv->io_operation = FALSE;
 
        gth_browser_update_extra_widget (task->priv->browser);
-       gth_monitor_folder_changed (gth_main_get_default_monitor (),
-                                   task->priv->search_catalog,
-                                   gth_catalog_get_file_list (GTH_CATALOG (task->priv->search)),
-                                   GTH_MONITOR_EVENT_CREATED);
-
        gtk_widget_hide (task->priv->dialog);
        gth_task_completed (GTH_TASK (task), task->priv->error);
 }
@@ -241,7 +236,6 @@ file_is_visible (GthSearchTask *task,
                return TRUE;
        else
                return ! g_file_info_get_is_hidden (info);
-
 }
 
 
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 157adab2..2ffc0e85 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -3099,7 +3099,7 @@ static gboolean
 _g_file_list_only_contains (GList *l,
                            GFile *file)
 {
-       return (l->next == NULL) && _g_file_equal (file, G_FILE (l->data));
+       return (l != NULL) && (l->next == NULL) && _g_file_equal (file, G_FILE (l->data));
 }
 
 
@@ -3220,7 +3220,13 @@ folder_changed_cb (GthMonitor      *monitor,
                }
        }
 
-       if (update_folder_tree || update_file_list) {
+       if ((event == GTH_MONITOR_EVENT_CREATED)
+               && _g_file_list_only_contains (list, browser->priv->location->file))
+       {
+               gth_file_list_set_files (GTH_FILE_LIST (browser->priv->file_list), NULL);
+               gth_file_list_set_files (GTH_FILE_LIST (browser->priv->thumbnail_list), NULL);
+       }
+       else if (update_folder_tree || update_file_list) {
                MonitorEventData *monitor_data;
                gboolean          current_file_deleted = FALSE;
                GthFileData      *new_file = NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]