Fix inconsistencies with hotkeying
This commit is contained in:
parent
bde179df55
commit
13be43186b
4
cropeditor/drawing/drawitem.hpp
Normal file
4
cropeditor/drawing/drawitem.hpp
Normal file
@ -0,0 +1,4 @@
|
||||
#ifndef DRAWITEM_HPP
|
||||
#define DRAWITEM_HPP
|
||||
|
||||
#endif // DRAWITEM_HPP
|
@ -25,8 +25,10 @@ void hotkeying::hotkey(QString seqName, QKeySequence seq, std::function<void()>
|
||||
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).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() : "";
|
||||
}
|
||||
|
6
main.cpp
6
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user