Fix empty hotkeys being loaded
This commit is contained in:
parent
7d5be857ff
commit
159720d9fa
@ -28,10 +28,14 @@ void hotkeying::load(QString seqName, std::function<void()> func, QString def) {
|
|||||||
QString name = seqName;
|
QString name = seqName;
|
||||||
name.prepend("hotkey_");
|
name.prepend("hotkey_");
|
||||||
if (hotkeys.contains(seqName)) return;
|
if (hotkeys.contains(seqName)) return;
|
||||||
if (settings::settings().contains(name))
|
if (settings::settings().contains(name)) {
|
||||||
h = new QHotkey(QKeySequence(settings::settings().value(name).toString()), true);
|
QString k = settings::settings().value(name).toString();
|
||||||
|
if (!k.isEmpty())
|
||||||
|
h = new QHotkey(QKeySequence(settings::settings().value(k).toString()), true);
|
||||||
else
|
else
|
||||||
h = new QHotkey(def.isNull() ? "" : def, true);
|
h = new QHotkey(def.isNull() ? "" : def, true);
|
||||||
|
} else
|
||||||
|
h = new QHotkey(def.isNull() ? "" : def, true);
|
||||||
QObject::connect(h, &QHotkey::activated, func);
|
QObject::connect(h, &QHotkey::activated, func);
|
||||||
hotkeys.insert(seqName, h);
|
hotkeys.insert(seqName, h);
|
||||||
if (!h->isRegistered() && (settings::settings().contains(name) || !def.isEmpty()))
|
if (!h->isRegistered() && (settings::settings().contains(name) || !def.isEmpty()))
|
||||||
|
Loading…
Reference in New Issue
Block a user