# HG changeset patch # User nadvornik # Date 1212826402 0 # Node ID a31524ae39cb759870c67cdcb0a9f1fbae90f5ec # Parent 03614b7883ea9e9ee38e127b20c240990d399bec used new notification in search.c diff -r 03614b7883ea -r a31524ae39cb src/search.c --- a/src/search.c Sat Jun 07 07:45:08 2008 +0000 +++ b/src/search.c Sat Jun 07 08:13:22 2008 +0000 @@ -237,6 +237,7 @@ static void search_window_close(SearchData *sd); +static void search_notify_cb(FileData *fd, NotifyType type, gpointer data); /* *------------------------------------------------------------------- @@ -2530,6 +2531,8 @@ g_free(sd->search_similarity_path); string_list_free(sd->search_keyword_list); + file_data_unregister_notify_func(search_notify_cb, sd); + g_free(sd); } @@ -2817,6 +2820,8 @@ search_window_list = g_list_append(search_window_list, sd); + file_data_register_notify_func(search_notify_cb, sd, NOTIFY_PRIORITY_MEDIUM); + gtk_widget_show(sd->window); } @@ -2859,21 +2864,21 @@ } } -void search_maint_renamed(FileData *fd) +static void search_notify_cb(FileData *fd, NotifyType type, gpointer data) { - GList *work; - - work = search_window_list; - while (work) + SearchData *sd = data; + + if (!fd->change) return; + + switch(fd->change->type) { - SearchData *sd = work->data; - work = work->next; - - search_result_change_path(sd, fd); + case FILEDATA_CHANGE_MOVE: + case FILEDATA_CHANGE_RENAME: + case FILEDATA_CHANGE_DELETE: + search_result_change_path(sd, fd); + break; + case FILEDATA_CHANGE_COPY: + case FILEDATA_CHANGE_UNSPECIFIED: + break; } } - -void search_maint_removed(FileData *fd) -{ - search_maint_renamed(fd); -} diff -r 03614b7883ea -r a31524ae39cb src/search.h --- a/src/search.h Sat Jun 07 07:45:08 2008 +0000 +++ b/src/search.h Sat Jun 07 08:13:22 2008 +0000 @@ -18,8 +18,4 @@ void search_new(FileData *dir_fd, FileData *example_file); -void search_maint_renamed(FileData *fd); -void search_maint_removed(FileData *fd); - - #endif diff -r 03614b7883ea -r a31524ae39cb src/utilops.c --- a/src/utilops.c Sat Jun 07 07:45:08 2008 +0000 +++ b/src/utilops.c Sat Jun 07 08:13:22 2008 +0000 @@ -247,7 +247,6 @@ layout_maint_moved(fd, NULL); view_window_maint_moved(fd); - search_maint_renamed(fd); break; case FILEDATA_CHANGE_COPY: break; @@ -256,12 +255,10 @@ layout_maint_renamed(fd); view_window_maint_moved(fd); - search_maint_renamed(fd); break; case FILEDATA_CHANGE_DELETE: layout_maint_removed(fd, NULL); view_window_maint_removed(fd, NULL); - search_maint_removed(fd); collection_maint_removed(fd); break;