From 071d0325a3e1434936e602cbcc07e4a39067ce34 Mon Sep 17 00:00:00 2001 From: Steven Cherry Date: Wed, 22 Jun 2016 20:43:49 -0500 Subject: [PATCH] cleanup code --- src/citra_qt/configure_input.cpp | 1 - src/citra_qt/configure_input.h | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/citra_qt/configure_input.cpp b/src/citra_qt/configure_input.cpp index 64e16d0b5..900cbce27 100644 --- a/src/citra_qt/configure_input.cpp +++ b/src/citra_qt/configure_input.cpp @@ -52,7 +52,6 @@ ConfigureInput::ConfigureInput(QWidget* parent) : ConfigureInput::~ConfigureInput() { - delete timer; } /// Event handler for all button released() event. diff --git a/src/citra_qt/configure_input.h b/src/citra_qt/configure_input.h index 8aa27fa18..bf2780cd3 100644 --- a/src/citra_qt/configure_input.h +++ b/src/citra_qt/configure_input.h @@ -29,22 +29,21 @@ public: ~ConfigureInput(); void applyConfiguration(); - public Q_SLOTS: - void handleClick(); - void restoreDefaults(); private: std::unique_ptr ui; std::map input_mapping; int key_pressed; QPushButton* changing_button = nullptr; /// button currently waiting for key press. QString previous_mapping; - QTimer* timer = new QTimer(); + QTimer* timer = new QTimer(this); 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; - private Q_SLOTS: - void setKey(); + void setKey(); +private Q_SLOTS: + void handleClick(); + void restoreDefaults(); };