gui/test: Put createAction() to anonymous namespace
This commit is contained in:
parent
79d266d274
commit
a004cd8eba
|
@ -96,39 +96,42 @@ struct TestHotKey
|
||||||
std::vector<TestAction> actions;
|
std::vector<TestAction> actions;
|
||||||
};
|
};
|
||||||
|
|
||||||
Action createAction(const TestAction& test_action)
|
namespace {
|
||||||
{
|
|
||||||
Action action;
|
|
||||||
action.setType(test_action.type);
|
|
||||||
|
|
||||||
switch (test_action.type) {
|
Action createAction(const TestAction& test_action)
|
||||||
case Action::keyDown:
|
{
|
||||||
case Action::keyUp:
|
Action action;
|
||||||
case Action::keystroke: {
|
action.setType(test_action.type);
|
||||||
KeySequence sequence;
|
|
||||||
for (auto key : test_action.keys) {
|
switch (test_action.type) {
|
||||||
sequence.appendKey(key.key, key.modifier);
|
case Action::keyDown:
|
||||||
|
case Action::keyUp:
|
||||||
|
case Action::keystroke: {
|
||||||
|
KeySequence sequence;
|
||||||
|
for (auto key : test_action.keys) {
|
||||||
|
sequence.appendKey(key.key, key.modifier);
|
||||||
|
}
|
||||||
|
action.setKeySequence(sequence);
|
||||||
|
for (const auto& type_screen_name : test_action.type_screen_names) {
|
||||||
|
action.appendTypeScreenName(QString::fromStdString(type_screen_name));
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
action.setKeySequence(sequence);
|
case Action::switchToScreen:
|
||||||
for (const auto& type_screen_name : test_action.type_screen_names) {
|
action.setSwitchScreenName(QString::fromStdString(test_action.screen_name));
|
||||||
action.appendTypeScreenName(QString::fromStdString(type_screen_name));
|
break;
|
||||||
}
|
case Action::toggleScreen:
|
||||||
break;
|
break;
|
||||||
|
case Action::switchInDirection:
|
||||||
|
action.setSwitchDirection(test_action.switch_direction);
|
||||||
|
break;
|
||||||
|
case Action::lockCursorToScreen:
|
||||||
|
action.setLockCursorMode(test_action.lock_cursor_mode);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case Action::switchToScreen:
|
return action;
|
||||||
action.setSwitchScreenName(QString::fromStdString(test_action.screen_name));
|
|
||||||
break;
|
|
||||||
case Action::toggleScreen:
|
|
||||||
break;
|
|
||||||
case Action::switchInDirection:
|
|
||||||
action.setSwitchDirection(test_action.switch_direction);
|
|
||||||
break;
|
|
||||||
case Action::lockCursorToScreen:
|
|
||||||
action.setLockCursorMode(test_action.lock_cursor_mode);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return action;
|
} // namespace
|
||||||
}
|
|
||||||
|
|
||||||
void doHotkeyLoadSaveTest(const TestHotKey& test_hotkey, QSettings::Format format)
|
void doHotkeyLoadSaveTest(const TestHotKey& test_hotkey, QSettings::Format format)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue