summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-11-18 20:16:54 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-11-18 20:16:54 +0100
commit5eed9fba17110f5a0e36ff71458c9ebd96090b66 (patch)
tree60a4531dcdc0785c01fcc9cf65e343ca69a63ce4
parent93a1bfcdd795b436cb41d419a1aa8064b9f2987d (diff)
gui/options-dialog: fix logic error in keybinding friendly name
-rw-r--r--gui/options-dialog.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp
index 8cf67e6d..bafddb57 100644
--- a/gui/options-dialog.cpp
+++ b/gui/options-dialog.cpp
@@ -16,24 +16,19 @@
QString OptionsDialog::kopts_to_string(const key_opts& kopts)
{
- const QString str = kopts.keycode;
- if (!str.isEmpty())
+ if (static_cast<QString>(kopts.guid) != "")
{
- if (str.startsWith("Num+"))
- return tr("Num+") + str.mid(4);
-
const int btn = kopts.button & ~Qt::KeyboardModifierMask;
const int mods = kopts.button & Qt::KeyboardModifierMask;
QString mm;
-
- if (mods & Qt::ControlModifier) mm += tr("Control+");
- if (mods & Qt::AltModifier) mm += tr("Alt+");
- if (mods & Qt::ShiftModifier) mm += tr("Shift+");
-
+ if (mods & Qt::ControlModifier) mm += "Control+";
+ if (mods & Qt::AltModifier) mm += "Alt+";
+ if (mods & Qt::ShiftModifier) mm += "Shift+";
return mm + tr("Joy button %1").arg(QString::number(btn));
}
- else
+ if (static_cast<QString>(kopts.keycode) == "")
return tr("None");
+ return kopts.keycode;
}
void OptionsDialog::set_disable_translation_state(bool value)