From 13be43186b911fcd0e3d93d07dc3a5cd0b1481c3 Mon Sep 17 00:00:00 2001 From: ArsenArsen Date: Sat, 29 Apr 2017 11:29:50 +0200 Subject: [PATCH] Fix inconsistencies with hotkeying --- cropeditor/drawing/drawitem.hpp | 4 ++++ hotkeying.cpp | 8 +++++--- main.cpp | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 cropeditor/drawing/drawitem.hpp diff --git a/cropeditor/drawing/drawitem.hpp b/cropeditor/drawing/drawitem.hpp new file mode 100644 index 0000000..b3dc745 --- /dev/null +++ b/cropeditor/drawing/drawitem.hpp @@ -0,0 +1,4 @@ +#ifndef DRAWITEM_HPP +#define DRAWITEM_HPP + +#endif // DRAWITEM_HPP diff --git a/hotkeying.cpp b/hotkeying.cpp index a2a316a..c8942d3 100644 --- a/hotkeying.cpp +++ b/hotkeying.cpp @@ -25,8 +25,10 @@ void hotkeying::hotkey(QString seqName, QKeySequence seq, std::function 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).toString()), true); + QString name = seqName; + name.prepend("hotkey_"); + if (settings::settings().contains(name)) + h = new QHotkey(QKeySequence(settings::settings().value(name).toString()), true); else h = new QHotkey; QObject::connect(h, &QHotkey::activated, func); @@ -40,5 +42,5 @@ bool hotkeying::valid(QString seq) QString hotkeying::sequence(QString seqName) { - return hotkeys.contains(seqName.prepend("hotkey_")) ? hotkeys.value(seqName)->shortcut().toString() : ""; + return hotkeys.contains(seqName) ? hotkeys.value(seqName)->shortcut().toString() : ""; } diff --git a/main.cpp b/main.cpp index 5eb0c00..20549a0 100644 --- a/main.cpp +++ b/main.cpp @@ -20,13 +20,13 @@ void handler(QtMsgType type, const QMessageLogContext &context, const QString &m fprintf(stdout, "INFO %s:%s(%d): %s\n", context.file, context.function, context.line, localMsg.constData()); break; case QtWarningMsg: - fprintf(stderr, "WARN %s:%s(%d): %s\n", context.file, context.function, context.line, localMsg.constData()); + fprintf(stdout, "WARN %s:%s(%d): %s\n", context.file, context.function, context.line, localMsg.constData()); break; case QtCriticalMsg: - fprintf(stderr, "CRIT %s:%s(%d): %s\n", context.file, context.function, context.line, localMsg.constData()); + fprintf(stdout, "CRIT %s:%s(%d): %s\n", context.file, context.function, context.line, localMsg.constData()); break; case QtFatalMsg: - fprintf(stderr, "FATAL %s:%s(%d): %s\n", context.file, context.function, context.line, localMsg.constData()); + fprintf(stdout, "FATAL %s:%s(%d): %s\n", context.file, context.function, context.line, localMsg.constData()); break; } }