From 4d4097d8197e871139a9d0948559e29f30286643 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 9 May 2017 13:01:28 +0800 Subject: [PATCH] Move editHotkey out of class definition Also since parent is setup correctly, remove the redundant delete --- src/gui/addnewtorrentdialog.cpp | 3 +-- src/gui/addnewtorrentdialog.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/addnewtorrentdialog.cpp b/src/gui/addnewtorrentdialog.cpp index e0dc803e7..b87d4010a 100644 --- a/src/gui/addnewtorrentdialog.cpp +++ b/src/gui/addnewtorrentdialog.cpp @@ -138,7 +138,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP // Signal / slots connect(ui->adv_button, SIGNAL(clicked(bool)), SLOT(showAdvancedSettings(bool))); connect(ui->doNotDeleteTorrentCheckBox, SIGNAL(clicked(bool)), SLOT(doNotDeleteTorrentClicked(bool))); - editHotkey = new QShortcut(Qt::Key_F2, ui->contentTreeView, 0, 0, Qt::WidgetShortcut); + QShortcut *editHotkey = new QShortcut(Qt::Key_F2, ui->contentTreeView, 0, 0, Qt::WidgetShortcut); connect(editHotkey, SIGNAL(activated()), SLOT(renameSelectedFile())); connect(ui->contentTreeView, SIGNAL(doubleClicked(QModelIndex)), SLOT(renameSelectedFile())); @@ -151,7 +151,6 @@ AddNewTorrentDialog::~AddNewTorrentDialog() delete ui; if (m_contentModel) delete m_contentModel; - delete editHotkey; } bool AddNewTorrentDialog::isEnabled() diff --git a/src/gui/addnewtorrentdialog.h b/src/gui/addnewtorrentdialog.h index 7d9a153d2..ad28474d8 100644 --- a/src/gui/addnewtorrentdialog.h +++ b/src/gui/addnewtorrentdialog.h @@ -110,7 +110,6 @@ private: QString m_filePath; BitTorrent::InfoHash m_hash; BitTorrent::TorrentInfo m_torrentInfo; - QShortcut *editHotkey; QByteArray m_headerState; int m_oldIndex; QScopedPointer m_torrentGuard;