Fix a stupid mistake.........

This commit is contained in:
ArsenArsen 2017-04-28 16:49:56 +02:00
parent ab39b32ea5
commit b71b0a0582
2 changed files with 3 additions and 6 deletions

View File

@ -1,5 +1,6 @@
#include "hotkeying.hpp"
#include <QDebug>
#include <QHotkey>
#include <QMap>
#include <settings.hpp>
@ -25,7 +26,7 @@ void hotkeying::load(QString seqName, std::function<void()> 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() : "";
}

View File

@ -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<void()>([&] { on_actionFullscreen_triggered(); }));