diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-11-18 13:58:27 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-11-18 13:58:46 +0100 |
commit | 411f0b3e91e25cf896d745fc783f93a64e720ba0 (patch) | |
tree | 1a40f7183c392a769faa1dee2946394a2ab514f1 /fastiv.c | |
parent | f8526d486accde7af88e2e40a6e9b697ca204882 (diff) | |
download | fiv-411f0b3e91e25cf896d745fc783f93a64e720ba0.tar.gz fiv-411f0b3e91e25cf896d745fc783f93a64e720ba0.tar.xz fiv-411f0b3e91e25cf896d745fc783f93a64e720ba0.zip |
Bind F5 and r to refreshing the directory
Diffstat (limited to 'fastiv.c')
-rw-r--r-- | fastiv.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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); |