[gnome-commander] search: first update progress bar and then add all found entries to the result list



commit 8241239b18b9f3de6cc8f589cd33b47e61d05281
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Fri Apr 15 19:34:02 2011 +0200

    search: first update progress bar and then add all found entries to the result list

 src/gnome-cmd-search-dialog.cc |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/src/gnome-cmd-search-dialog.cc b/src/gnome-cmd-search-dialog.cc
index 1f5af8c..80cfb9b 100755
--- a/src/gnome-cmd-search-dialog.cc
+++ b/src/gnome-cmd-search-dialog.cc
@@ -369,27 +369,25 @@ static gpointer perform_search_operation (SearchData *data)
 
 static gboolean update_search_status_widgets (SearchData *data)
 {
+    // update the progress bar
+    progress_bar_update (data->dialog->priv->pbar, PBAR_MAX);
+
     if (data->pdata.mutex)
+    {
         g_mutex_lock (data->pdata.mutex);
 
-    // Add all files found since last update to the list
-    for (GList *files = data->pdata.files; files; files = files->next)
-        data->dialog->priv->result_list->append_file(GNOME_CMD_FILE (files->data));
+        // add all files found since last update to the list
+        for (GList *files = data->pdata.files; files; files = files->next)
+            data->dialog->priv->result_list->append_file(GNOME_CMD_FILE (files->data));
 
-    if (data->pdata.files)
-    {
         gnome_cmd_file_list_free (data->pdata.files);
         data->pdata.files = NULL;
-    }
 
-    // Update status bar with the latest message
-    set_statusmsg (data, data->pdata.msg);
+        // update status bar with the latest message
+        set_statusmsg (data, data->pdata.msg);
 
-    if (data->pdata.mutex)
         g_mutex_unlock (data->pdata.mutex);
-
-    // Update the progress bar
-    progress_bar_update (data->dialog->priv->pbar, PBAR_MAX);
+    }
 
     if (!data->search_done)
         return TRUE;



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