[gnome-commander] search: reduce time of accessing protected data in SearchData



commit 54ae6df2ae11b21e77924363d45522061d540409
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Fri Apr 15 19:39:35 2011 +0200

    search: reduce time of accessing protected data in SearchData

 src/gnome-cmd-search-dialog.cc |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/gnome-cmd-search-dialog.cc b/src/gnome-cmd-search-dialog.cc
index 80cfb9b..ad7d6cc 100755
--- a/src/gnome-cmd-search-dialog.cc
+++ b/src/gnome-cmd-search-dialog.cc
@@ -376,17 +376,19 @@ static gboolean update_search_status_widgets (SearchData *data)
     {
         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));
-
-        gnome_cmd_file_list_free (data->pdata.files);
+        GList *files = data->pdata.files;
         data->pdata.files = NULL;
 
         // update status bar with the latest message
         set_statusmsg (data, data->pdata.msg);
 
         g_mutex_unlock (data->pdata.mutex);
+
+        // add all files found since last update to the list
+        for (GList *i = files; i; i = i->next)
+            data->dialog->priv->result_list->append_file(GNOME_CMD_FILE (i->data));
+
+        gnome_cmd_file_list_free (files);
     }
 
     if (!data->search_done)



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