From 1d468ac35ad88d8c77cc83f25e3704d9bd7df01b Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 2 Aug 2023 18:35:35 +0200 Subject: chore: reformat Signed-off-by: Sefa Eyeoglu --- launcher/KonamiCode.cpp | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) (limited to 'launcher/KonamiCode.cpp') diff --git a/launcher/KonamiCode.cpp b/launcher/KonamiCode.cpp index 46a2a0b2..f9ec3b89 100644 --- a/launcher/KonamiCode.cpp +++ b/launcher/KonamiCode.cpp @@ -1,42 +1,26 @@ #include "KonamiCode.h" -#include #include +#include namespace { -const std::array konamiCode = -{ - { - Qt::Key_Up, Qt::Key_Up, - Qt::Key_Down, Qt::Key_Down, - Qt::Key_Left, Qt::Key_Right, - Qt::Key_Left, Qt::Key_Right, - Qt::Key_B, Qt::Key_A - } -}; -} - -KonamiCode::KonamiCode(QObject* parent) : QObject(parent) -{ +const std::array konamiCode = { { Qt::Key_Up, Qt::Key_Up, Qt::Key_Down, Qt::Key_Down, Qt::Key_Left, Qt::Key_Right, + Qt::Key_Left, Qt::Key_Right, Qt::Key_B, Qt::Key_A } }; } +KonamiCode::KonamiCode(QObject* parent) : QObject(parent) {} void KonamiCode::input(QEvent* event) { - if( event->type() == QEvent::KeyPress ) - { - QKeyEvent *keyEvent = static_cast( event ); + if (event->type() == QEvent::KeyPress) { + QKeyEvent* keyEvent = static_cast(event); auto key = Qt::Key(keyEvent->key()); - if(key == konamiCode[m_progress]) - { - m_progress ++; - } - else - { + if (key == konamiCode[m_progress]) { + m_progress++; + } else { m_progress = 0; } - if(m_progress == static_cast(konamiCode.size())) - { + if (m_progress == static_cast(konamiCode.size())) { m_progress = 0; emit triggered(); } -- cgit