[anjuta] document-manager: Do not check file types if there is no files in find files window
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] document-manager: Do not check file types if there is no files in find files window
- Date: Mon, 13 Feb 2012 21:50:38 +0000 (UTC)
commit 2be81d0622d97d79ef7972478cfea0aaeef06733
Author: SÃbastien Granjoux <seb sfo free fr>
Date: Mon Feb 13 22:42:24 2012 +0100
document-manager: Do not check file types if there is no files in find files window
plugins/document-manager/search-files.c | 35 +++++++++++++++++-------------
1 files changed, 20 insertions(+), 15 deletions(-)
---
diff --git a/plugins/document-manager/search-files.c b/plugins/document-manager/search-files.c
index a4a0cd9..6974969 100644
--- a/plugins/document-manager/search-files.c
+++ b/plugins/document-manager/search-files.c
@@ -448,25 +448,30 @@ search_files_search_clicked (SearchFiles* sf)
g_free (project_uri);
- /* Queue file filtering */
- queue = anjuta_command_queue_new(ANJUTA_COMMAND_QUEUE_EXECUTE_MANUAL);
- g_signal_connect (queue, "finished",
- G_CALLBACK (search_files_filter_finished), sf);
- for (file = files; file != NULL; file = g_list_next (file))
+ /* Check that there are some files to process */
+ if (files != NULL)
{
- SearchFilterFileCommand* cmd =
- search_filter_file_command_new(G_FILE (file->data),
- mime_types);
- g_signal_connect (cmd, "command-finished",
- G_CALLBACK (search_files_filter_command_finished), sf);
- anjuta_command_queue_push(queue, ANJUTA_COMMAND(cmd));
+ /* Queue file filtering */
+ queue = anjuta_command_queue_new(ANJUTA_COMMAND_QUEUE_EXECUTE_MANUAL);
+ g_signal_connect (queue, "finished",
+ G_CALLBACK (search_files_filter_finished), sf);
+ for (file = files; file != NULL; file = g_list_next (file))
+ {
+ SearchFilterFileCommand* cmd =
+ search_filter_file_command_new(G_FILE (file->data),
+ mime_types);
+ g_signal_connect (cmd, "command-finished",
+ G_CALLBACK (search_files_filter_command_finished), sf);
+ anjuta_command_queue_push(queue, ANJUTA_COMMAND(cmd));
+ }
+ sf->priv->busy = TRUE;
+ anjuta_command_queue_start (queue);
+
+ g_list_foreach (files, (GFunc) g_object_unref, NULL);
+ g_list_free (files);
}
- sf->priv->busy = TRUE;
- anjuta_command_queue_start (queue);
search_files_update_ui(sf);
- g_list_foreach (files, (GFunc) g_object_unref, NULL);
- g_list_free (files);
g_free (mime_types);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]