aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-18 13:58:27 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-18 13:58:46 +0100
commit411f0b3e91e25cf896d745fc783f93a64e720ba0 (patch)
tree1a40f7183c392a769faa1dee2946394a2ab514f1
parentf8526d486accde7af88e2e40a6e9b697ca204882 (diff)
downloadfiv-411f0b3e91e25cf896d745fc783f93a64e720ba0.tar.gz
fiv-411f0b3e91e25cf896d745fc783f93a64e720ba0.tar.xz
fiv-411f0b3e91e25cf896d745fc783f93a64e720ba0.zip
Bind F5 and r to refreshing the directory
-rw-r--r--fastiv.c14
1 files 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);