summaryrefslogtreecommitdiff
path: root/plugins/gtkui/gtkui.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-10-13 16:20:15 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-10-13 16:20:15 +0200
commit8432dde252701d869a81ab85a4412445b528cf24 (patch)
tree24929210b9ec5272a40199ac84f195061acf26d4 /plugins/gtkui/gtkui.c
parent2cdd465d542c0373c0d8c9fe8d8b5d3f7f6e3087 (diff)
gtkui: better default hotkeys creation
Diffstat (limited to 'plugins/gtkui/gtkui.c')
-rw-r--r--plugins/gtkui/gtkui.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index bf5a3bc4..78a60f7d 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -994,11 +994,13 @@ gtkui_thread (void *ctx) {
gtk_binding_entry_remove (binding_set, GDK_KEY_KP_Tab, GDK_CONTROL_MASK|GDK_SHIFT_MASK);
// initialize default hotkey mapping
- struct stat st;
- char checkpath[PATH_MAX];
- snprintf (checkpath, sizeof (checkpath), "%s/config", deadbeef->get_config_dir ());
- if (stat (checkpath, &st)) {
- gtkui_set_default_hotkeys ();
+ if (!deadbeef->conf_get_int ("hotkeys_created", 0)) {
+ // check if any hotkeys were created manually (e.g. beta versions of 0.6)
+ if (!deadbeef->conf_find ("hotkey.key", NULL)) {
+ gtkui_set_default_hotkeys ();
+ }
+ deadbeef->conf_set_int ("hotkeys_created", 1);
+ deadbeef->conf_save ();
}
#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_set_events (GTK_WIDGET (mainwin), gtk_widget_get_events (GTK_WIDGET (mainwin)) | GDK_SCROLL_MASK);