diff -urN -x Makefile mythplugins-0.19/mythcontrols/mythcontrols/actionset.cpp fixmythplugins-0.19/mythcontrols/mythcontrols/actionset.cpp
old
|
new
|
|
139 | 139 | /* method description in header */ |
140 | 140 | QStringList * ActionSet::actionStrings(const QString &context_name) const |
141 | 141 | { |
142 | | QStringList *action_strings = new QStringList(); |
143 | | QDictIterator<Action> it(*(_contexts[context_name])); |
| 142 | Context *c = _contexts[context_name]; |
144 | 143 | |
145 | | for (; it.current(); ++it) |
146 | | action_strings->append(it.currentKey()); |
| 144 | if (c == NULL) return NULL; |
| 145 | else |
| 146 | { |
| 147 | QStringList *action_strings = new QStringList(); |
| 148 | QDictIterator<Action> it(*(_contexts[context_name])); |
| 149 | |
| 150 | for (; it.current(); ++it) |
| 151 | action_strings->append(it.currentKey()); |
147 | 152 | |
148 | | return action_strings; |
| 153 | return action_strings; |
| 154 | } |
149 | 155 | } |
150 | 156 | |
151 | 157 | |
diff -urN -x Makefile mythplugins-0.19/mythcontrols/mythcontrols/keybindings.h fixmythplugins-0.19/mythcontrols/mythcontrols/keybindings.h
old
|
new
|
|
65 | 65 | /** |
66 | 66 | * @brief Get a list of the context names. |
67 | 67 | * @return A list of the context names. |
| 68 | * @note The returned list is a copy and can be modified without |
| 69 | * side-effects. |
68 | 70 | */ |
69 | 71 | inline QStringList * getContexts() const |
70 | 72 | { |
diff -urN -x Makefile mythplugins-0.19/mythcontrols/mythcontrols/mythcontrols.cpp fixmythplugins-0.19/mythcontrols/mythcontrols/mythcontrols.cpp
old
|
new
|
|
46 | 46 | #include "keygrabber.h" |
47 | 47 | |
48 | 48 | |
49 | | static QMap<int,QString> FindContexts(const QString &context) |
50 | | { |
51 | | QMap<int,QString> retval; |
52 | | retval.clear(); |
53 | | if (context != JUMP_CONTEXT) retval[-1] = JUMP_CONTEXT; |
54 | | retval[0] = context; |
55 | | if (context != JUMP_CONTEXT && context != GLOBAL_CONTEXT) |
56 | | { |
57 | | if (context == "TV Editting") |
58 | | retval[1] = "TV Playback"; |
59 | | retval[2] = GLOBAL_CONTEXT; |
60 | | if (context != "qt") |
61 | | retval[3] = "qt"; |
62 | | } |
63 | | return retval; |
64 | | } |
65 | 49 | |
66 | 50 | static const QString KeyToDisplay(const QString key) |
67 | 51 | { |
… |
… |
|
838 | 822 | refreshKeyInformation(); |
839 | 823 | } |
840 | 824 | |
841 | | void MythControls::addBindings(QDict<binding_t> &bindings, const QString &context, const QString &contextParent, int bindlevel) |
| 825 | |
| 826 | |
| 827 | void MythControls::addBindings(QDict<binding_t> &bindings, |
| 828 | const QString &context, |
| 829 | const QString &contextParent, int bindlevel) |
842 | 830 | { |
843 | 831 | QStringList *actions = key_bindings->getActions(context); |
844 | 832 | |
… |
… |
|
872 | 860 | |
873 | 861 | BindingList *MythControls::getKeyBindings(const QString &context) |
874 | 862 | { |
| 863 | QStringList keys; |
875 | 864 | QDict<binding_t> bindings; |
876 | 865 | bindings.clear(); |
877 | 866 | |
878 | | QMap<int,QString> contextList = FindContexts(context); |
879 | | for (QMap<int,QString>::iterator it = contextList.begin(); it != contextList.end(); ++it) |
880 | | { |
881 | | int level = it.key(); |
882 | | QString curcontext = it.data(); |
883 | | addBindings(bindings, curcontext, context, level); |
884 | | } |
| 867 | for (size_t i = 0; i < contexts.size(); i++) |
| 868 | addBindings(bindings, contexts[i], context, i); |
885 | 869 | |
886 | | QStringList keys; |
887 | 870 | |
888 | 871 | for (QDictIterator<binding_t> it(bindings); it.current(); ++it) |
889 | 872 | { |