Browse Source

Cleanup

Use Qt5 connect syntax
Reorder include headers
adaptive-webui-19844
Chocobo1 7 years ago
parent
commit
cb929f7e59
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 107
      src/gui/mainwindow.cpp
  2. 6
      src/gui/optionsdlg.cpp

107
src/gui/mainwindow.cpp

@ -30,84 +30,83 @@ @@ -30,84 +30,83 @@
#include "mainwindow.h"
#ifdef Q_OS_MAC
#include <QtMacExtras>
#include <QtMac>
#endif
#include <QtGlobal>
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) && defined(QT_DBUS_LIB)
#include <QDBusConnection>
#include "notifications.h"
#endif
#include <QClipboard>
#include <QCloseEvent>
#include <QCryptographicHash>
#include <QDebug>
#include <QDesktopServices>
#include <QFileDialog>
#include <QFileSystemWatcher>
#include <QMessageBox>
#include <QTimer>
#include <QDesktopServices>
#include <QStatusBar>
#include <QClipboard>
#include <QCloseEvent>
#include <QShortcut>
#include <QMimeData>
#include <QProcess>
#include <QScrollBar>
#include <QShortcut>
#include <QSplitter>
#include <QStatusBar>
#include <QSysInfo>
#include <QMimeData>
#include <QCryptographicHash>
#include <QProcess>
#include <QtGlobal>
#include <QTimer>
#include "base/preferences.h"
#include "base/settingsstorage.h"
#include "base/logger.h"
#include "base/utils/misc.h"
#include "base/utils/fs.h"
#ifdef Q_OS_WIN
#include "base/net/downloadmanager.h"
#include "base/net/downloadhandler.h"
#ifdef Q_OS_MAC
#include <QtMac>
#include <QtMacExtras>
#endif
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) && defined(QT_DBUS_LIB)
#include <QDBusConnection>
#include "notifications.h"
#endif
#include "about_imp.h"
#include "addnewtorrentdialog.h"
#include "application.h"
#include "autoexpandabledialog.h"
#include "base/bittorrent/session.h"
#include "base/bittorrent/sessionstatus.h"
#include "base/bittorrent/torrenthandle.h"
#include "base/global.h"
#include "base/logger.h"
#include "base/preferences.h"
#include "base/rss/rss_folder.h"
#include "base/rss/rss_session.h"
#include "application.h"
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
#include "programupdater.h"
#endif
#include "powermanagement.h"
#include "guiiconprovider.h"
#include "torrentmodel.h"
#include "autoexpandabledialog.h"
#include "torrentcreatordlg.h"
#include "downloadfromurldlg.h"
#include "addnewtorrentdialog.h"
#include "statsdialog.h"
#include "base/settingsstorage.h"
#include "base/utils/fs.h"
#include "base/utils/misc.h"
#include "cookiesdialog.h"
#include "speedlimitdlg.h"
#include "transferlistwidget.h"
#include "search/searchwidget.h"
#include "trackerlist.h"
#include "downloadfromurldlg.h"
#include "executionlog.h"
#include "guiiconprovider.h"
#include "hidabletabwidget.h"
#include "lineedit.h"
#include "optionsdlg.h"
#include "peerlistwidget.h"
#include "transferlistfilterswidget.h"
#include "powermanagement.h"
#include "propertieswidget.h"
#include "statusbar.h"
#include "rss/rsswidget.h"
#include "about_imp.h"
#include "optionsdlg.h"
#if LIBTORRENT_VERSION_NUM < 10100
#include "trackerlogin.h"
#endif
#include "lineedit.h"
#include "executionlog.h"
#include "hidabletabwidget.h"
#include "search/searchwidget.h"
#include "speedlimitdlg.h"
#include "statsdialog.h"
#include "statusbar.h"
#include "torrentcreatordlg.h"
#include "torrentmodel.h"
#include "trackerlist.h"
#include "transferlistfilterswidget.h"
#include "transferlistwidget.h"
#include "ui_mainwindow.h"
#ifdef Q_OS_WIN
#include "base/net/downloadhandler.h"
#include "base/net/downloadmanager.h"
#endif
#ifdef Q_OS_MAC
#include "macutilities.h"
#endif
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
#include "programupdater.h"
#endif
#if LIBTORRENT_VERSION_NUM < 10100
#include "trackerlogin.h"
#endif
#ifdef Q_OS_MAC
void qt_mac_set_dock_menu(QMenu *menu);

6
src/gui/optionsdlg.cpp

@ -139,7 +139,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) @@ -139,7 +139,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
connect(ScanFoldersModel::instance(), &QAbstractListModel::dataChanged, this, &ThisType::enableApplyButton);
connect(m_ui->scanFoldersView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &ThisType::handleScanFolderViewSelectionChanged);
connect(m_ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(applySettings(QAbstractButton*)));
connect(m_ui->buttonBox, &QDialogButtonBox::clicked, this, &OptionsDialog::applySettings);
// Languages supported
initializeLanguageCombo();
@ -1578,7 +1578,7 @@ void OptionsDialog::on_IpFilterRefreshBtn_clicked() @@ -1578,7 +1578,7 @@ void OptionsDialog::on_IpFilterRefreshBtn_clicked()
session->setIPFilteringEnabled(true);
session->setIPFilterFile(""); // forcing Session reload filter file
session->setIPFilterFile(getFilter());
connect(session, SIGNAL(IPFilterParsed(bool, int)), SLOT(handleIPFilterParsed(bool, int)));
connect(session, &BitTorrent::Session::IPFilterParsed, this, &OptionsDialog::handleIPFilterParsed);
setCursor(QCursor(Qt::WaitCursor));
}
@ -1590,7 +1590,7 @@ void OptionsDialog::handleIPFilterParsed(bool error, int ruleCount) @@ -1590,7 +1590,7 @@ void OptionsDialog::handleIPFilterParsed(bool error, int ruleCount)
else
QMessageBox::information(this, tr("Successfully refreshed"), tr("Successfully parsed the provided IP filter: %1 rules were applied.", "%1 is a number").arg(ruleCount));
m_refreshingIpFilter = false;
disconnect(BitTorrent::Session::instance(), SIGNAL(IPFilterParsed(bool, int)), this, SLOT(handleIPFilterParsed(bool, int)));
disconnect(BitTorrent::Session::instance(), &BitTorrent::Session::IPFilterParsed, this, &OptionsDialog::handleIPFilterParsed);
}
QString OptionsDialog::languageToLocalizedString(const QLocale &locale)

Loading…
Cancel
Save