[file-roller/wip/gtk4: 25/54] window: restore the last location when disabling the filter
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller/wip/gtk4: 25/54] window: restore the last location when disabling the filter
- Date: Sun, 2 Oct 2022 17:56:49 +0000 (UTC)
commit cf48039d9e7b0e92abedd1b78348094de3e3b7e0
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Oct 1 15:56:18 2022 +0200
window: restore the last location when disabling the filter
src/fr-window.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/fr-window.c b/src/fr-window.c
index f352add5..92d4f24f 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -275,6 +275,7 @@ typedef struct {
GtkSortType sort_type;
char * last_location;
+ char * location_before_filter;
gboolean view_sidebar;
FrWindowListMode list_mode;
@@ -527,6 +528,7 @@ fr_window_free_private_data (FrWindow *window)
private->drag_file_list = NULL;
g_free (private->last_location);
+ g_free (private->location_before_filter);
fr_window_free_batch_data (window);
g_free (private->batch_title);
@@ -6680,6 +6682,8 @@ fr_window_find (FrWindow *window,
FrWindowPrivate *private = fr_window_get_instance_private (window);
if (active) {
+ g_free (private->location_before_filter);
+ private->location_before_filter = g_strdup (gtk_editable_get_text (GTK_EDITABLE
(private->location_entry)));
private->filter_mode = TRUE;
gtk_widget_show (private->filter_bar);
gtk_widget_hide (private->location_bar);
@@ -6698,7 +6702,10 @@ fr_window_find (FrWindow *window,
fr_window_update_file_list (window, TRUE);
fr_window_update_dir_tree (window);
fr_window_update_current_location (window);
- fr_window_go_to_location (window, gtk_editable_get_text (GTK_EDITABLE
(private->location_entry)), FALSE);
+ fr_window_go_to_location (window, private->location_before_filter, FALSE);
+
+ g_free (private->location_before_filter);
+ private->location_before_filter = NULL;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]