Changeset View
Changeset View
Standalone View
Standalone View
libs/widgetutils/xmlgui/KisShortcutsEditor_p.cpp
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Line(s) | 105 | { | |||
---|---|---|---|---|---|
111 | QString actionName = action->objectName(); | 111 | QString actionName = action->objectName(); | ||
112 | if (actionName.isEmpty() || actionName.startsWith(QStringLiteral("unnamed-"))) { | 112 | if (actionName.isEmpty() || actionName.startsWith(QStringLiteral("unnamed-"))) { | ||
113 | qCritical() << "Skipping action without name " << action->text() << "," << actionName << "!"; | 113 | qCritical() << "Skipping action without name " << action->text() << "," << actionName << "!"; | ||
114 | return false; | 114 | return false; | ||
115 | } | 115 | } | ||
116 | 116 | | |||
117 | // Construct the actual treeview items. The work happens here. | 117 | // Construct the actual treeview items. The work happens here. | ||
118 | // | 118 | // | ||
119 | // XXX: disentangle the confusing, dire warning left here previously: | 119 | // Don't feed the editor raw QActions. This code requires that the | ||
120 | // "This code doesn't allow editing of QAction. It can not distinguish | 120 | // "defaultShortcut" dynamic property be set. | ||
121 | // between default and active shortcuts. This breaks many assumptions the | | |||
122 | // editor makes." | | |||
123 | // | 121 | // | ||
124 | // Note: Krita never sets the property "isShortcutConfigurable" so we will | 122 | // Note: Krita never sets the property "isShortcutConfigurable". | ||
125 | // add every action here. | 123 | // Perhaps it could be useful. | ||
126 | const QVariant value = action->property("isShortcutConfigurable"); | 124 | const QVariant value = action->property("isShortcutConfigurable"); | ||
127 | if (!value.isValid() || value.toBool()) { | 125 | if (!value.isValid() || value.toBool()) { | ||
128 | new KisShortcutsEditorItem((hier[level]), action); | 126 | new KisShortcutsEditorItem((hier[level]), action); | ||
129 | return true; | 127 | return true; | ||
130 | } | 128 | } | ||
131 | 129 | | |||
132 | return false; | 130 | return false; | ||
133 | } | 131 | } | ||
▲ Show 20 Lines • Show All 239 Lines • Show Last 20 Lines |