From a70219eea04a1bd48e93e2461f78c558ab5e8730 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 21 Jul 2018 17:16:28 +0800 Subject: [PATCH] Move member variable initialization Move the initialization from constructor body to member initializer list. Remove superfluous initializer. --- src/gui/banlistoptionsdialog.cpp | 2 +- src/gui/executionlogwidget.cpp | 3 +-- src/gui/transferlistfilterswidget.cpp | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/banlistoptionsdialog.cpp b/src/gui/banlistoptionsdialog.cpp index 9b54a16f4..30c67ac03 100644 --- a/src/gui/banlistoptionsdialog.cpp +++ b/src/gui/banlistoptionsdialog.cpp @@ -41,10 +41,10 @@ BanListOptionsDialog::BanListOptionsDialog(QWidget *parent) : QDialog(parent) , m_ui(new Ui::BanListOptionsDialog) + , m_model(new QStringListModel(BitTorrent::Session::instance()->bannedIPs(), this)) , m_modified(false) { m_ui->setupUi(this); - m_model = new QStringListModel(BitTorrent::Session::instance()->bannedIPs(), this); m_sortFilter = new QSortFilterProxyModel(this); m_sortFilter->setDynamicSortFilter(true); diff --git a/src/gui/executionlogwidget.cpp b/src/gui/executionlogwidget.cpp index 305cf1074..2a74213c5 100644 --- a/src/gui/executionlogwidget.cpp +++ b/src/gui/executionlogwidget.cpp @@ -39,12 +39,11 @@ ExecutionLogWidget::ExecutionLogWidget(QWidget *parent, const Log::MsgTypes &types) : QWidget(parent) , m_ui(new Ui::ExecutionLogWidget) + , m_msgList(new LogListWidget(MAX_LOG_MESSAGES, Log::MsgTypes(types))) , m_peerList(new LogListWidget(MAX_LOG_MESSAGES)) { m_ui->setupUi(this); - m_msgList = new LogListWidget(MAX_LOG_MESSAGES, Log::MsgTypes(types)); - #ifndef Q_OS_MAC m_ui->tabConsole->setTabIcon(0, GuiIconProvider::instance()->getIcon("view-calendar-journal")); m_ui->tabConsole->setTabIcon(1, GuiIconProvider::instance()->getIcon("view-filter")); diff --git a/src/gui/transferlistfilterswidget.cpp b/src/gui/transferlistfilterswidget.cpp index 6613c68f0..e2d746903 100644 --- a/src/gui/transferlistfilterswidget.cpp +++ b/src/gui/transferlistfilterswidget.cpp @@ -561,7 +561,6 @@ QStringList TrackerFiltersList::getHashes(int row) TransferListFiltersWidget::TransferListFiltersWidget(QWidget *parent, TransferListWidget *transferList) : QFrame(parent) , m_transferList(transferList) - , m_trackerFilters(nullptr) { Preferences *const pref = Preferences::instance();