14#include <KConfigGroup>
35 .filter(
"kritadefault.profile");
37 if (!profiles.empty()) {
42 qWarning() <<
"Default profile does not exist anywhere!";
61template <
typename Func>
64 auto it = shortcuts.begin();
65 while (it != shortcuts.end()) {
70 it = shortcuts.erase(it);
79 KConfig config(profile, KConfig::SimpleConfig);
82 for (
const auto action : actions) {
83 if (!config.hasGroup(action->id())) {
87 KConfigGroup group = config.group(action->id());
88 for (
const auto &groupEntry : group.entryMap()) {
93 shortcuts.append(shortcut);
136 for (
auto it = shortcuts.begin(); it != shortcuts.end();) {
138 it = shortcuts.erase(it);
144 for (
auto it = shortcuts.begin(); it != shortcuts.end();) {
147 it = shortcuts.erase(it);
169 shortcuts.append(newNativeGestureShortcut);
186 shortcuts.append(newNativeGestureShortcut);
@ PanModeShortcut
Toggle the pan mode.
A class encapsulating all settings for a single shortcut.
void setNativeGesture(NativeGestureAction type)
ShortcutType type() const
@ NativeGestureType
A macOS gesture.
@ MouseWheelType
Mouse wheel movement, possibly with key modifiers.
@ TouchGestureType
A touch gesture.
bool unserialize(const QString &serialized)
void setAction(KisAbstractInputAction *newAction)
void setType(ShortcutType newType)
@ TouchpadScroll
Two-dimensional pixel scrolling on a touchpad, supported on MacOS and Wayland only.
@ PinchGesture
Pinch gesture, a two finger gesture used for navigating the canvas.
void setMode(uint newMode)
@ WheelReserved_0
Do not use! Previously was used for TouchpadScroll shortcut.
@ PanAndZoomAndRotateMode
static QStringList findAllAssets(const QString &type, const QString &filter=QString(), SearchOptions options=NoSearchOptions)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
auto mem_equal_to(MemTypeNoRef Class::*ptr, MemType &&value)
mem_equal_to is an unary functor that compares a member of the object to a given value