From 411f0b3e91e25cf896d745fc783f93a64e720ba0 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Thu, 18 Nov 2021 13:58:27 +0100 Subject: Bind F5 and r to refreshing the directory --- fastiv.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/fastiv.c b/fastiv.c index 70210b1..8a70a0c 100644 --- a/fastiv.c +++ b/fastiv.c @@ -275,8 +275,10 @@ on_open_location(G_GNUC_UNUSED GtkPlacesSidebar *sidebar, GFile *location, G_GNUC_UNUSED GtkPlacesOpenFlags flags, G_GNUC_UNUSED gpointer user_data) { gchar *path = g_file_get_path(location); - load_directory(path); - g_free(path); + if (path) { + load_directory(path); + g_free(path); + } } // Cursor keys, e.g., simply cannot be bound through accelerators @@ -321,6 +323,14 @@ on_key_press(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event, on_open(); return TRUE; + case GDK_KEY_F5: + case GDK_KEY_r: { + char *copy = g_strdup(g.directory); + load_directory(copy); + g_free(copy); + return TRUE; + } + case GDK_KEY_F9: if (gtk_widget_is_visible(g.browser_sidebar)) gtk_widget_hide(g.browser_sidebar); -- cgit v1.2.3-70-g09d2