diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-17 21:36:48 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-17 21:36:48 +0000 |
commit | 6bd6f58dee3442cb3ab140be3966da2a07564040 (patch) | |
tree | 5a393ba697137b2d24a9be3f9a8cc381ffc5e0e4 /libs/gtkmm2ext/actions.cc | |
parent | 934ad9ab63b316f4e63cb5604c71d38fd7d1b445 (diff) |
MCP: somewhat functional (?) full keybinding GUI
git-svn-id: svn://localhost/ardour2/branches/3.0@11999 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/gtkmm2ext/actions.cc')
-rw-r--r-- | libs/gtkmm2ext/actions.cc | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/libs/gtkmm2ext/actions.cc b/libs/gtkmm2ext/actions.cc index 3fc9def399..74533f96a4 100644 --- a/libs/gtkmm2ext/actions.cc +++ b/libs/gtkmm2ext/actions.cc @@ -250,23 +250,29 @@ ActionManager::get_action (const char* path) return RefPtr<Action>(); } - char copy[strlen(path)+1]; - - if (*path == '/') { - const char* cslash = strchr (path, '/'); - if (!cslash) { - return RefPtr<Action> (); - } - strcpy (copy, cslash+1); - } else { - strcpy (copy, path); + /* Skip <Actions>/ in path */ + + int len = strlen (path); + + if (len < 3) { + /* shortest possible path: "a/b" */ + return RefPtr<Action>(); } + if (len > 10 && !strncmp (path, "<Actions>/", 10 )) { + path = path+10; + } else if (path[0] == '/') { + path++; + } + + char copy[len+1]; + strcpy (copy, path); char* slash = strchr (copy, '/'); if (!slash) { return RefPtr<Action> (); } *slash = '\0'; + return get_action (copy, ++slash); } |