change: change code style to Linux style except indent.

This commit is contained in:
Mike Solar
2025-08-03 03:09:40 +08:00
parent 65ab76edc8
commit 74f73ab3be
789 changed files with 77113 additions and 68888 deletions
+37 -30
View File
@@ -23,55 +23,62 @@
#include <QAction>
#include <QKeyEvent>
namespace olive {
namespace olive
{
#define super QKeySequenceEdit
KeySequenceEditor::KeySequenceEditor(QWidget* parent, QAction* a)
: super(parent), action(a) {
setKeySequence(action->shortcut());
KeySequenceEditor::KeySequenceEditor(QWidget *parent, QAction *a)
: super(parent)
, action(a)
{
setKeySequence(action->shortcut());
}
void KeySequenceEditor::set_action_shortcut() {
action->setShortcut(keySequence());
void KeySequenceEditor::set_action_shortcut()
{
action->setShortcut(keySequence());
}
void KeySequenceEditor::reset_to_default() {
setKeySequence(action->property("keydefault").toString());
void KeySequenceEditor::reset_to_default()
{
setKeySequence(action->property("keydefault").toString());
}
QString KeySequenceEditor::action_name() {
return action->property("id").toString();
QString KeySequenceEditor::action_name()
{
return action->property("id").toString();
}
QString KeySequenceEditor::export_shortcut() {
QKeySequence ks = keySequence();
if (ks != action->property("keydefault").value<QKeySequence>()) {
return action->property("id").toString() + "\t" + ks.toString();
}
return nullptr;
QString KeySequenceEditor::export_shortcut()
{
QKeySequence ks = keySequence();
if (ks != action->property("keydefault").value<QKeySequence>()) {
return action->property("id").toString() + "\t" + ks.toString();
}
return nullptr;
}
void KeySequenceEditor::keyPressEvent(QKeyEvent *e)
{
if (e->key() == Qt::Key_Backspace) {
clear();
} else if (e->key() == Qt::Key_Escape) {
e->ignore();
} else{
super::keyPressEvent(e);
}
if (e->key() == Qt::Key_Backspace) {
clear();
} else if (e->key() == Qt::Key_Escape) {
e->ignore();
} else {
super::keyPressEvent(e);
}
}
void KeySequenceEditor::keyReleaseEvent(QKeyEvent *e)
{
if (e->key() == Qt::Key_Backspace) {
// Do nothing
} else if (e->key() == Qt::Key_Escape) {
e->ignore();
} else {
super::keyReleaseEvent(e);
}
if (e->key() == Qt::Key_Backspace) {
// Do nothing
} else if (e->key() == Qt::Key_Escape) {
e->ignore();
} else {
super::keyReleaseEvent(e);
}
}
}