From 4ba93b819a21b9d98da1bc25607cae94a98652ce Mon Sep 17 00:00:00 2001 From: Steven Cherry Date: Thu, 23 Jun 2016 07:00:07 -0500 Subject: [PATCH] Cleanup --- src/citra_qt/configure_input.cpp | 2 ++ src/citra_qt/configure_input.h | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/citra_qt/configure_input.cpp b/src/citra_qt/configure_input.cpp index 900cbce27..dd78c463a 100644 --- a/src/citra_qt/configure_input.cpp +++ b/src/citra_qt/configure_input.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include "citra_qt/configure_input.h" @@ -45,6 +46,7 @@ ConfigureInput::ConfigureInput(QWidget* parent) : } connect(ui->btnRestoreDefaults, SIGNAL(released()), this, SLOT(restoreDefaults())); setFocusPolicy(Qt::ClickFocus); + timer = new QTimer(this); timer->setSingleShot(true); connect(timer, &QTimer::timeout, this, [&]() { key_pressed = Qt::Key_Escape; setKey(); }); this->setConfiguration(); diff --git a/src/citra_qt/configure_input.h b/src/citra_qt/configure_input.h index bf2780cd3..aa3d9ff4d 100644 --- a/src/citra_qt/configure_input.h +++ b/src/citra_qt/configure_input.h @@ -7,7 +7,6 @@ #include #include #include -#include #include "citra_qt/config.h" #include "core/settings.h" @@ -15,6 +14,7 @@ class QPushButton; class QString; +class QTimer; namespace Ui { class ConfigureInput; @@ -35,15 +35,15 @@ private: int key_pressed; QPushButton* changing_button = nullptr; /// button currently waiting for key press. QString previous_mapping; - QTimer* timer = new QTimer(this); + QTimer* timer; void setConfiguration(); void removeDuplicates(const QString& newValue); void keyPressEvent(QKeyEvent* event) override; QString getKeyName(int key_code) const; Qt::Key getKeyValue(const QString& text) const; - void setKey(); -private Q_SLOTS: + void setKey(); + private Q_SLOTS: void handleClick(); void restoreDefaults(); };