From b71b0a0582302f963e1a7c555df36dd5d7e32b9f Mon Sep 17 00:00:00 2001 From: ArsenArsen Date: Fri, 28 Apr 2017 16:49:56 +0200 Subject: [PATCH] Fix a stupid mistake......... --- hotkeying.cpp | 5 +++-- mainwindow.cpp | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/hotkeying.cpp b/hotkeying.cpp index 4066c68..a2a316a 100644 --- a/hotkeying.cpp +++ b/hotkeying.cpp @@ -1,5 +1,6 @@ #include "hotkeying.hpp" +#include #include #include #include @@ -25,7 +26,7 @@ void hotkeying::load(QString seqName, std::function func) { QHotkey *h; if (settings::settings().contains(seqName.prepend("hotkey_"))) - h = new QHotkey(QKeySequence(settings::settings().value(seqName.prepend("hotkey_")).toString()), true); + h = new QHotkey(QKeySequence(settings::settings().value(seqName).toString()), true); else h = new QHotkey; QObject::connect(h, &QHotkey::activated, func); @@ -39,5 +40,5 @@ bool hotkeying::valid(QString seq) QString hotkeying::sequence(QString seqName) { - return hotkeys.contains(seqName) ? hotkeys.value(seqName)->shortcut().toString() : ""; + return hotkeys.contains(seqName.prepend("hotkey_")) ? hotkeys.value(seqName)->shortcut().toString() : ""; } diff --git a/mainwindow.cpp b/mainwindow.cpp index 2c07b56..a7dfe63 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -79,10 +79,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi else ui->delay->setValue(0.25); - // keys are hot, wait what - hotkeying::load("fullscreen", [this] { on_actionFullscreen_triggered(); }); - hotkeying::load("area", [this] { on_actionArea_triggered(); }); - ui->hotkeys->setSelectionMode(QListWidget::SingleSelection); addHotkeyItem("Fullscreen image", "fullscreen", new std::function([&] { on_actionFullscreen_triggered(); }));