From 19bb6f5fe08cd343a4f906d88eb52ebd2c2c0d9e Mon Sep 17 00:00:00 2001 From: Tim Delaney Date: Sun, 12 Feb 2017 12:14:01 +1100 Subject: [PATCH] Follow project coding style. Issue #2192. --HG-- branch : magao-dev --- src/base/preferences.cpp | 2 +- src/base/torrentfilter.h | 6 ++---- src/gui/guiiconprovider.cpp | 3 +-- src/gui/mainwindow.cpp | 2 +- src/gui/optionsdlg.cpp | 3 +-- src/gui/optionsdlg.h | 6 +++--- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/base/preferences.cpp b/src/base/preferences.cpp index 18e644921..8f8e4f309 100644 --- a/src/base/preferences.cpp +++ b/src/base/preferences.cpp @@ -59,7 +59,7 @@ Preferences *Preferences::m_instance = 0; -Preferences::Preferences() {} +Preferences::Preferences() = default; Preferences *Preferences::instance() { diff --git a/src/base/torrentfilter.h b/src/base/torrentfilter.h index cb2c150ad..55b848e14 100644 --- a/src/base/torrentfilter.h +++ b/src/base/torrentfilter.h @@ -36,10 +36,8 @@ typedef QSet QStringSet; namespace BitTorrent { - -class TorrentHandle; -class TorrentState; - + class TorrentHandle; + class TorrentState; } class TorrentFilter diff --git a/src/gui/guiiconprovider.cpp b/src/gui/guiiconprovider.cpp index 1c58dd03c..98dead644 100644 --- a/src/gui/guiiconprovider.cpp +++ b/src/gui/guiiconprovider.cpp @@ -43,7 +43,7 @@ GuiIconProvider::GuiIconProvider(QObject *parent) connect(Preferences::instance(), SIGNAL(changed()), SLOT(configure())); } -GuiIconProvider::~GuiIconProvider() {} +GuiIconProvider::~GuiIconProvider() = default; void GuiIconProvider::initInstance() { @@ -138,7 +138,6 @@ QString GuiIconProvider::getIconPath(const QString &iconId) return IconProvider::getIconPath(iconId); } - void GuiIconProvider::configure() { #if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 1525f0a93..b65199b70 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -859,7 +859,7 @@ void MainWindow::createKeyboardShortcuts() m_ui->actionDocumentation->setShortcut(QKeySequence::HelpContents); m_ui->actionOptions->setShortcut(Qt::ALT + Qt::Key_O); m_ui->actionStart->setShortcut(Qt::CTRL + Qt::Key_S); - m_ui->actionStartAll->setShortcut(Qt::CTRL + Qt::SHIFT +Qt::Key_S); + m_ui->actionStartAll->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_S); m_ui->actionPause->setShortcut(Qt::CTRL + Qt::Key_P); m_ui->actionPauseAll->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_P); m_ui->actionBottomPriority->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Minus); diff --git a/src/gui/optionsdlg.cpp b/src/gui/optionsdlg.cpp index ba65f31b4..c40db1c97 100644 --- a/src/gui/optionsdlg.cpp +++ b/src/gui/optionsdlg.cpp @@ -312,8 +312,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) connect(m_ui->comboRatioLimitAct, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton); connect(m_ui->checkMaxSeedingMinutes, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkMaxSeedingMinutes, &QAbstractButton::toggled, this, &ThisType::toggleComboRatioLimitAct); - connect(m_ui->spinMaxSeedingMinutes, static_cast(&QSpinBox::valueChanged), - this, &ThisType::enableApplyButton); + connect(m_ui->spinMaxSeedingMinutes, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); // Proxy tab connect(m_ui->comboProxyType, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton); connect(m_ui->textProxyIP, &QLineEdit::textChanged, this, &ThisType::enableApplyButton); diff --git a/src/gui/optionsdlg.h b/src/gui/optionsdlg.h index b92a30407..efaaddf95 100644 --- a/src/gui/optionsdlg.h +++ b/src/gui/optionsdlg.h @@ -88,10 +88,10 @@ private slots: void on_buttonBox_accepted(); void closeEvent(QCloseEvent *e); void on_buttonBox_rejected(); - void applySettings(QAbstractButton* button); + void applySettings(QAbstractButton *button); void enableApplyButton(); void toggleComboRatioLimitAct(); - void changePage(QListWidgetItem*, QListWidgetItem*); + void changePage(QListWidgetItem *, QListWidgetItem *); void loadWindowState(); void loadSplitterState(); void saveWindowState() const; @@ -132,7 +132,7 @@ private: bool addTorrentsInPause() const; QString getTorrentExportDir() const; QString getFinishedTorrentExportDir() const; - QString askForExportDir(const QString& currentExportPath); + QString askForExportDir(const QString ¤tExportPath); int getActionOnDblClOnTorrentDl() const; int getActionOnDblClOnTorrentFn() const; // Connection options