diff options
Diffstat (limited to 'gsearchtool/src/gsearchtool-callbacks.c')
-rw-r--r-- | gsearchtool/src/gsearchtool-callbacks.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/gsearchtool/src/gsearchtool-callbacks.c b/gsearchtool/src/gsearchtool-callbacks.c index 55b1e086..23e81fc6 100644 --- a/gsearchtool/src/gsearchtool-callbacks.c +++ b/gsearchtool/src/gsearchtool-callbacks.c @@ -473,8 +473,7 @@ open_file_cb (GtkMenuItem * action, response = display_dialog_file_open_limit (gsearch->window, g_list_length (list)); if (response == GTK_RESPONSE_CANCEL) { - g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); - g_list_free (list); + g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); return; } } @@ -530,8 +529,7 @@ open_file_cb (GtkMenuItem * action, g_free (utf8_name); g_free (locale_file); } - g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); - g_list_free (list); + g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); } static gint @@ -606,8 +604,7 @@ open_folder_cb (GtkAction * action, response = display_dialog_folder_open_limit (gsearch->window, g_list_length (list)); if (response == GTK_RESPONSE_CANCEL) { - g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); - g_list_free (list); + g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); return; } } @@ -641,8 +638,7 @@ open_folder_cb (GtkAction * action, display_dialog_could_not_open_folder (gsearch->window, utf8_folder); - g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); - g_list_free (list); + g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); g_free (locale_folder); g_free (utf8_folder); g_object_unref (g_file); @@ -655,8 +651,7 @@ open_folder_cb (GtkAction * action, g_free (locale_file); g_free (utf8_folder); } - g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); - g_list_free (list); + g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); g_object_unref (g_file); g_object_unref (g_file_info); g_object_unref (g_app_info); @@ -903,8 +898,7 @@ move_to_trash_cb (GtkAction * action, g_free (message); } } - g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); - g_list_free (list); + g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); g_free (locale_filename); g_free (utf8_filename); g_free (utf8_basename); @@ -1083,7 +1077,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch, gtk_widget_show (new1); g_object_set_data_full (G_OBJECT (new1), "app", (GAppInfo *)list->data, - (GDestroyNotify) g_object_unref); + g_object_unref); gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1); g_signal_connect ((gpointer) new1, "activate", G_CALLBACK (open_file_cb), @@ -1123,7 +1117,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch, gtk_widget_show (new1); g_object_set_data_full (G_OBJECT (new1), "app", (GAppInfo *)list->data, - (GDestroyNotify) g_object_unref); + g_object_unref); if (list_length >= 4) { @@ -1378,8 +1372,7 @@ file_button_release_event_cb (GtkWidget * widget, } g_free (locale_file_first); g_free (utf8_name_first); - g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); - g_list_free (list); + g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); } else if (event->button == 1 || event->button == 2) { if (gsearch->is_search_results_single_click_to_activate == TRUE) { @@ -1531,8 +1524,7 @@ drag_begin_file_cb (GtkWidget * widget, gtk_tree_model_get (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter, COLUMN_ICON, &pixbuf, -1); - g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); - g_list_free (list); + g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); if (pixbuf) { gtk_drag_set_icon_pixbuf (context, pixbuf, 0, 0); @@ -1602,8 +1594,7 @@ drag_file_cb (GtkWidget * widget, g_free (utf8_name); g_free (locale_file); } - g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); - g_list_free (list); + g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); g_free (uri_list); } @@ -1867,8 +1858,7 @@ key_press_cb (GtkWidget * widget, gtk_tree_model_get (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter, COLUMN_NO_FILES_FOUND, &no_files_found, -1); - g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); - g_list_free (list); + g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free); if (!no_files_found) { gtk_menu_popup (GTK_MENU (gsearch->search_results_popup_menu), NULL, NULL, NULL, NULL, |