From 9cb190ebe76d258fd2cfd8a0f5d4393a41725a08 Mon Sep 17 00:00:00 2001 From: thalieht Date: Sun, 15 Apr 2018 13:06:31 +0300 Subject: [PATCH] Replace the zeroing of pointers with nullptr --- src/base/bittorrent/session.cpp | 2 +- src/base/bittorrent/session.h | 2 +- src/base/bittorrent/torrenthandle.cpp | 2 +- src/base/http/connection.h | 2 +- src/base/iconprovider.cpp | 4 +- src/base/iconprovider.h | 2 +- src/base/logger.cpp | 4 +- src/base/net/downloadmanager.cpp | 6 +- src/base/net/downloadmanager.h | 2 +- src/base/net/private/geoipdatabase.cpp | 4 +- src/base/net/proxyconfigurationmanager.cpp | 2 +- src/base/net/reverseresolution.h | 2 +- src/base/preferences.cpp | 4 +- src/base/scanfoldersmodel.cpp | 6 +- src/base/scanfoldersmodel.h | 4 +- src/base/utils/fs.h | 2 +- src/gui/addnewtorrentdialog.cpp | 4 +- src/gui/autoexpandabledialog.h | 2 +- src/gui/guiiconprovider.h | 2 +- src/gui/hidabletabwidget.h | 2 +- src/gui/loglistwidget.h | 2 +- src/gui/mainwindow.cpp | 2 +- src/gui/mainwindow.h | 2 +- src/gui/messageboxraised.h | 2 +- src/gui/optionsdlg.h | 2 +- src/gui/powermanagement/powermanagement.h | 2 +- src/gui/powermanagement/powermanagement_x11.h | 2 +- src/gui/programupdater.h | 2 +- src/gui/properties/peerlistwidget.cpp | 4 +- src/gui/properties/propertieswidget.cpp | 8 +-- src/gui/properties/trackerlist.cpp | 6 +- src/gui/qtnotify/notifications.h | 2 +- src/gui/rss/automatedrssdownloader.cpp | 4 +- src/gui/rss/rsswidget.cpp | 6 +- src/gui/search/pluginselectdlg.h | 2 +- src/gui/search/pluginsourcedlg.h | 2 +- src/gui/search/searchsortmodel.h | 2 +- src/gui/torrentcontentfiltermodel.h | 2 +- src/gui/torrentcontentmodel.h | 2 +- src/gui/torrentcontentmodelfolder.cpp | 2 +- src/gui/torrentcontenttreeview.h | 2 +- src/gui/torrentcreatordlg.h | 2 +- src/gui/torrentmodel.h | 2 +- src/gui/transferlistfilterswidget.cpp | 6 +- src/gui/transferlistsortmodel.h | 2 +- src/gui/transferlistwidget.cpp | 62 +++++++++---------- src/webui/webapplication.cpp | 2 +- 47 files changed, 98 insertions(+), 98 deletions(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index f0bdda8e7..26a4eb518 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -1005,7 +1005,7 @@ void Session::freeInstance() { if (m_instance) { delete m_instance; - m_instance = 0; + m_instance = nullptr; } } diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h index 9b23f09cf..9cd2e2380 100644 --- a/src/base/bittorrent/session.h +++ b/src/base/bittorrent/session.h @@ -562,7 +562,7 @@ namespace BitTorrent bool requestedFileDeletion; }; - explicit Session(QObject *parent = 0); + explicit Session(QObject *parent = nullptr); ~Session(); bool hasPerTorrentRatioLimit() const; diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index 84413be48..7c125aea2 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -1639,7 +1639,7 @@ void TorrentHandle::handleSaveResumeDataFailedAlert(libtorrent::save_resume_data // if torrent has no metadata we should save dummy fastresume data // containing Magnet URI and qBittorrent own resume data only if (p->error.value() == libt::errors::no_metadata) - handleSaveResumeDataAlert(0); + handleSaveResumeDataAlert(nullptr); else m_session->handleTorrentResumeDataFailed(this); } diff --git a/src/base/http/connection.h b/src/base/http/connection.h index 7ca3ca845..1eb8297aa 100644 --- a/src/base/http/connection.h +++ b/src/base/http/connection.h @@ -50,7 +50,7 @@ namespace Http Q_DISABLE_COPY(Connection) public: - Connection(QTcpSocket *socket, IRequestHandler *requestHandler, QObject *parent = 0); + Connection(QTcpSocket *socket, IRequestHandler *requestHandler, QObject *parent = nullptr); ~Connection(); bool hasExpired(qint64 timeout) const; diff --git a/src/base/iconprovider.cpp b/src/base/iconprovider.cpp index 8d137556d..316ec67cf 100644 --- a/src/base/iconprovider.cpp +++ b/src/base/iconprovider.cpp @@ -47,7 +47,7 @@ void IconProvider::freeInstance() { if (m_instance) { delete m_instance; - m_instance = 0; + m_instance = nullptr; } } @@ -61,4 +61,4 @@ QString IconProvider::getIconPath(const QString &iconId) return ":/icons/qbt-theme/" + iconId + ".png"; } -IconProvider *IconProvider::m_instance = 0; +IconProvider *IconProvider::m_instance = nullptr; diff --git a/src/base/iconprovider.h b/src/base/iconprovider.h index f9c00d63c..98e204bd9 100644 --- a/src/base/iconprovider.h +++ b/src/base/iconprovider.h @@ -46,7 +46,7 @@ public: virtual QString getIconPath(const QString &iconId); protected: - explicit IconProvider(QObject *parent = 0); + explicit IconProvider(QObject *parent = nullptr); ~IconProvider(); static IconProvider *m_instance; diff --git a/src/base/logger.cpp b/src/base/logger.cpp index 53855fb10..faa7aeb53 100644 --- a/src/base/logger.cpp +++ b/src/base/logger.cpp @@ -3,7 +3,7 @@ #include #include "base/utils/string.h" -Logger* Logger::m_instance = 0; +Logger* Logger::m_instance = nullptr; Logger::Logger() : lock(QReadWriteLock::Recursive) @@ -29,7 +29,7 @@ void Logger::freeInstance() { if (m_instance) { delete m_instance; - m_instance = 0; + m_instance = nullptr; } } diff --git a/src/base/net/downloadmanager.cpp b/src/base/net/downloadmanager.cpp index 7abc7ebcc..50c31639e 100644 --- a/src/base/net/downloadmanager.cpp +++ b/src/base/net/downloadmanager.cpp @@ -51,7 +51,7 @@ namespace class NetworkCookieJar: public QNetworkCookieJar { public: - explicit NetworkCookieJar(QObject *parent = 0) + explicit NetworkCookieJar(QObject *parent = nullptr) : QNetworkCookieJar(parent) { QDateTime now = QDateTime::currentDateTime(); @@ -107,7 +107,7 @@ namespace using namespace Net; -DownloadManager *DownloadManager::m_instance = 0; +DownloadManager *DownloadManager::m_instance = nullptr; DownloadManager::DownloadManager(QObject *parent) : QObject(parent) @@ -128,7 +128,7 @@ void DownloadManager::freeInstance() { if (m_instance) { delete m_instance; - m_instance = 0; + m_instance = nullptr; } } diff --git a/src/base/net/downloadmanager.h b/src/base/net/downloadmanager.h index 35acc4777..e847dbd01 100644 --- a/src/base/net/downloadmanager.h +++ b/src/base/net/downloadmanager.h @@ -64,7 +64,7 @@ namespace Net #endif private: - explicit DownloadManager(QObject *parent = 0); + explicit DownloadManager(QObject *parent = nullptr); void applyProxySettings(); diff --git a/src/base/net/private/geoipdatabase.cpp b/src/base/net/private/geoipdatabase.cpp index 9594ac929..1a29fab71 100644 --- a/src/base/net/private/geoipdatabase.cpp +++ b/src/base/net/private/geoipdatabase.cpp @@ -91,7 +91,7 @@ GeoIPDatabase::GeoIPDatabase(quint32 size) GeoIPDatabase *GeoIPDatabase::load(const QString &filename, QString &error) { - GeoIPDatabase *db = 0; + GeoIPDatabase *db = nullptr; QFile file(filename); if (file.size() > MAX_FILE_SIZE) { error = tr("Unsupported database file size."); @@ -122,7 +122,7 @@ GeoIPDatabase *GeoIPDatabase::load(const QString &filename, QString &error) GeoIPDatabase *GeoIPDatabase::load(const QByteArray &data, QString &error) { - GeoIPDatabase *db = 0; + GeoIPDatabase *db = nullptr; if (data.size() > MAX_FILE_SIZE) { error = tr("Unsupported database file size."); return 0; diff --git a/src/base/net/proxyconfigurationmanager.cpp b/src/base/net/proxyconfigurationmanager.cpp index 234881fd3..e792df651 100644 --- a/src/base/net/proxyconfigurationmanager.cpp +++ b/src/base/net/proxyconfigurationmanager.cpp @@ -80,7 +80,7 @@ void ProxyConfigurationManager::freeInstance() { if (m_instance) { delete m_instance; - m_instance = 0; + m_instance = nullptr; } } diff --git a/src/base/net/reverseresolution.h b/src/base/net/reverseresolution.h index ef181762a..c0a39dede 100644 --- a/src/base/net/reverseresolution.h +++ b/src/base/net/reverseresolution.h @@ -47,7 +47,7 @@ namespace Net Q_DISABLE_COPY(ReverseResolution) public: - explicit ReverseResolution(QObject *parent = 0); + explicit ReverseResolution(QObject *parent = nullptr); ~ReverseResolution(); void resolve(const QString &ip); diff --git a/src/base/preferences.cpp b/src/base/preferences.cpp index 03b12e6bb..efb0e75d8 100644 --- a/src/base/preferences.cpp +++ b/src/base/preferences.cpp @@ -59,7 +59,7 @@ #include "utils/fs.h" #include "utils/misc.h" -Preferences *Preferences::m_instance = 0; +Preferences *Preferences::m_instance = nullptr; Preferences::Preferences() = default; @@ -78,7 +78,7 @@ void Preferences::freeInstance() { if (m_instance) { delete m_instance; - m_instance = 0; + m_instance = nullptr; } } diff --git a/src/base/scanfoldersmodel.cpp b/src/base/scanfoldersmodel.cpp index c35918797..2d327f8bb 100644 --- a/src/base/scanfoldersmodel.cpp +++ b/src/base/scanfoldersmodel.cpp @@ -56,7 +56,7 @@ struct ScanFoldersModel::PathData QString downloadPath; // valid for CUSTOM_LOCATION }; -ScanFoldersModel *ScanFoldersModel::m_instance = 0; +ScanFoldersModel *ScanFoldersModel::m_instance = nullptr; bool ScanFoldersModel::initInstance(QObject *parent) { @@ -72,7 +72,7 @@ void ScanFoldersModel::freeInstance() { if (m_instance) { delete m_instance; - m_instance = 0; + m_instance = nullptr; } } @@ -83,7 +83,7 @@ ScanFoldersModel *ScanFoldersModel::instance() ScanFoldersModel::ScanFoldersModel(QObject *parent) : QAbstractListModel(parent) - , m_fsWatcher(0) + , m_fsWatcher(nullptr) { configure(); connect(Preferences::instance(), SIGNAL(changed()), SLOT(configure())); diff --git a/src/base/scanfoldersmodel.h b/src/base/scanfoldersmodel.h index 41fd3a288..171996b1a 100644 --- a/src/base/scanfoldersmodel.h +++ b/src/base/scanfoldersmodel.h @@ -66,7 +66,7 @@ public: CUSTOM_LOCATION }; - static bool initInstance(QObject *parent = 0); + static bool initInstance(QObject *parent = nullptr); static void freeInstance(); static ScanFoldersModel* instance(); @@ -97,7 +97,7 @@ private slots: void addTorrentsToSession(const QStringList &pathList); private: - explicit ScanFoldersModel(QObject *parent = 0); + explicit ScanFoldersModel(QObject *parent = nullptr); ~ScanFoldersModel(); virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); diff --git a/src/base/utils/fs.h b/src/base/utils/fs.h index 9c70477d3..8561bb23a 100644 --- a/src/base/utils/fs.h +++ b/src/base/utils/fs.h @@ -52,7 +52,7 @@ namespace Utils , const QString &pad = QLatin1String(" ")); bool isValidFileSystemName(const QString &name, bool allowSeparators = false); qint64 freeDiskSpaceOnPath(const QString &path); - QString branchPath(const QString &filePath, QString *removed = 0); + QString branchPath(const QString &filePath, QString *removed = nullptr); bool sameFileNames(const QString &first, const QString &second); QString expandPath(const QString &path); QString expandPathAbs(const QString &path); diff --git a/src/gui/addnewtorrentdialog.cpp b/src/gui/addnewtorrentdialog.cpp index ce465d089..b51d7f31b 100644 --- a/src/gui/addnewtorrentdialog.cpp +++ b/src/gui/addnewtorrentdialog.cpp @@ -148,7 +148,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))); - QShortcut *editHotkey = new QShortcut(Qt::Key_F2, ui->contentTreeView, 0, 0, Qt::WidgetShortcut); + QShortcut *editHotkey = new QShortcut(Qt::Key_F2, ui->contentTreeView, nullptr, nullptr, Qt::WidgetShortcut); connect(editHotkey, SIGNAL(activated()), SLOT(renameSelectedFile())); connect(ui->contentTreeView, SIGNAL(doubleClicked(QModelIndex)), SLOT(renameSelectedFile())); @@ -605,7 +605,7 @@ void AddNewTorrentDialog::displayContentTreeMenu(const QPoint &) { QMenu myFilesLlistMenu; const QModelIndexList selectedRows = ui->contentTreeView->selectionModel()->selectedRows(0); - QAction *actRename = 0; + QAction *actRename = nullptr; if (selectedRows.size() == 1) { actRename = myFilesLlistMenu.addAction(GuiIconProvider::instance()->getIcon("edit-rename"), tr("Rename...")); myFilesLlistMenu.addSeparator(); diff --git a/src/gui/autoexpandabledialog.h b/src/gui/autoexpandabledialog.h index f3e5d0666..e12e61d92 100644 --- a/src/gui/autoexpandabledialog.h +++ b/src/gui/autoexpandabledialog.h @@ -48,7 +48,7 @@ public: static QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode = QLineEdit::Normal, const QString &text = QString(), - bool *ok = 0, Qt::InputMethodHints inputMethodHints = Qt::ImhNone); + bool *ok = nullptr, Qt::InputMethodHints inputMethodHints = Qt::ImhNone); protected: void showEvent(QShowEvent *e); diff --git a/src/gui/guiiconprovider.h b/src/gui/guiiconprovider.h index 665a7fabe..0acc13f92 100644 --- a/src/gui/guiiconprovider.h +++ b/src/gui/guiiconprovider.h @@ -52,7 +52,7 @@ private slots: void configure(); private: - explicit GuiIconProvider(QObject *parent = 0); + explicit GuiIconProvider(QObject *parent = nullptr); ~GuiIconProvider(); #if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) QIcon generateDifferentSizes(const QIcon &icon); diff --git a/src/gui/hidabletabwidget.h b/src/gui/hidabletabwidget.h index ec169da8f..b6aace6ae 100644 --- a/src/gui/hidabletabwidget.h +++ b/src/gui/hidabletabwidget.h @@ -41,7 +41,7 @@ class HidableTabWidget : public QTabWidget { public: - explicit HidableTabWidget(QWidget *parent = 0) + explicit HidableTabWidget(QWidget *parent = nullptr) : QTabWidget(parent) { } diff --git a/src/gui/loglistwidget.h b/src/gui/loglistwidget.h index 46147f204..37946538c 100644 --- a/src/gui/loglistwidget.h +++ b/src/gui/loglistwidget.h @@ -43,7 +43,7 @@ class LogListWidget: public QListWidget public: // -1 is the portable way to have all the bits set - explicit LogListWidget(int maxLines, const Log::MsgTypes &types = Log::ALL, QWidget *parent = 0); + explicit LogListWidget(int maxLines, const Log::MsgTypes &types = Log::ALL, QWidget *parent = nullptr); void showMsgTypes(const Log::MsgTypes &types); public slots: diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 0e9b3c3f0..05a0580a1 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -1047,7 +1047,7 @@ void MainWindow::notifyOfUpdate(QString) , Log::CRITICAL); // Delete the executable watcher delete m_executableWatcher; - m_executableWatcher = 0; + m_executableWatcher = nullptr; } #ifndef Q_OS_MAC diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index ebb3ce3fa..ecad73c70 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -75,7 +75,7 @@ class MainWindow: public QMainWindow Q_OBJECT public: - explicit MainWindow(QWidget *parent = 0); + explicit MainWindow(QWidget *parent = nullptr); ~MainWindow() override; QWidget *currentTabWidget() const; diff --git a/src/gui/messageboxraised.h b/src/gui/messageboxraised.h index d9be5ffbd..7e12b93cc 100644 --- a/src/gui/messageboxraised.h +++ b/src/gui/messageboxraised.h @@ -38,7 +38,7 @@ class MessageBoxRaised : public QMessageBox Q_OBJECT private: - MessageBoxRaised(QMessageBox::Icon icon, const QString &title, const QString &text, QMessageBox::StandardButtons buttons = NoButton, QWidget *parent = 0, Qt::WindowFlags f = Qt::Dialog|Qt::MSWindowsFixedSizeDialogHint); + MessageBoxRaised(QMessageBox::Icon icon, const QString &title, const QString &text, QMessageBox::StandardButtons buttons = NoButton, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::Dialog|Qt::MSWindowsFixedSizeDialogHint); MessageBoxRaised(); MessageBoxRaised(MessageBoxRaised const&); void operator=(MessageBoxRaised const&); diff --git a/src/gui/optionsdlg.h b/src/gui/optionsdlg.h index d503dc8ec..300a705e9 100644 --- a/src/gui/optionsdlg.h +++ b/src/gui/optionsdlg.h @@ -77,7 +77,7 @@ private: public: // Constructor / Destructor - OptionsDialog(QWidget *parent = 0); + OptionsDialog(QWidget *parent = nullptr); ~OptionsDialog(); public slots: diff --git a/src/gui/powermanagement/powermanagement.h b/src/gui/powermanagement/powermanagement.h index 435f76a2f..dca50d0f7 100644 --- a/src/gui/powermanagement/powermanagement.h +++ b/src/gui/powermanagement/powermanagement.h @@ -48,7 +48,7 @@ class PowerManagement : public QObject Q_OBJECT public: - PowerManagement(QObject *parent = 0); + PowerManagement(QObject *parent = nullptr); virtual ~PowerManagement(); void setActivityState(bool busy); diff --git a/src/gui/powermanagement/powermanagement_x11.h b/src/gui/powermanagement/powermanagement_x11.h index 963d57581..8e5f327f3 100644 --- a/src/gui/powermanagement/powermanagement_x11.h +++ b/src/gui/powermanagement/powermanagement_x11.h @@ -42,7 +42,7 @@ class PowerManagementInhibitor : public QObject Q_OBJECT public: - PowerManagementInhibitor(QObject *parent = 0); + PowerManagementInhibitor(QObject *parent = nullptr); virtual ~PowerManagementInhibitor(); void RequestIdle(); diff --git a/src/gui/programupdater.h b/src/gui/programupdater.h index cda228bbb..e24641d28 100644 --- a/src/gui/programupdater.h +++ b/src/gui/programupdater.h @@ -39,7 +39,7 @@ class ProgramUpdater: public QObject Q_OBJECT public: - explicit ProgramUpdater(QObject *parent = 0, bool invokedByUser = false); + explicit ProgramUpdater(QObject *parent = nullptr, bool invokedByUser = false); void checkForUpdates(); void updateProgram(); diff --git a/src/gui/properties/peerlistwidget.cpp b/src/gui/properties/peerlistwidget.cpp index 85ee18ed4..61ff67ee1 100644 --- a/src/gui/properties/peerlistwidget.cpp +++ b/src/gui/properties/peerlistwidget.cpp @@ -131,7 +131,7 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent) connect(header(), SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayToggleColumnsMenu(const QPoint&))); connect(header(), SIGNAL(sectionClicked(int)), SLOT(handleSortColumnChanged(int))); handleSortColumnChanged(header()->sortIndicatorSection()); - m_copyHotkey = new QShortcut(QKeySequence::Copy, this, SLOT(copySelectedPeers()), 0, Qt::WidgetShortcut); + m_copyHotkey = new QShortcut(QKeySequence::Copy, this, SLOT(copySelectedPeers()), nullptr, Qt::WidgetShortcut); // This hack fixes reordering of first column with Qt5. // https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777 @@ -225,7 +225,7 @@ void PeerListWidget::showPeerListMenu(const QPoint &) if (!torrent) return; // Add Peer Action - QAction *addPeerAct = 0; + QAction *addPeerAct = nullptr; if (!torrent->isQueued() && !torrent->isChecking()) { addPeerAct = menu.addAction(GuiIconProvider::instance()->getIcon("user-group-new"), tr("Add a new peer...")); emptyMenu = false; diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index db4de1d6b..64e79fe96 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -163,14 +163,14 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *mainWindow, Tran m_refreshTimer = new QTimer(this); connect(m_refreshTimer, SIGNAL(timeout()), this, SLOT(loadDynamicData())); m_refreshTimer->start(3000); // 3sec - m_editHotkeyFile = new QShortcut(Qt::Key_F2, m_ui->filesList, 0, 0, Qt::WidgetShortcut); + m_editHotkeyFile = new QShortcut(Qt::Key_F2, m_ui->filesList, nullptr, nullptr, Qt::WidgetShortcut); connect(m_editHotkeyFile, SIGNAL(activated()), SLOT(renameSelectedFile())); - m_editHotkeyWeb = new QShortcut(Qt::Key_F2, m_ui->listWebSeeds, 0, 0, Qt::WidgetShortcut); + m_editHotkeyWeb = new QShortcut(Qt::Key_F2, m_ui->listWebSeeds, nullptr, nullptr, Qt::WidgetShortcut); connect(m_editHotkeyWeb, SIGNAL(activated()), SLOT(editWebSeed())); connect(m_ui->listWebSeeds, SIGNAL(doubleClicked(QModelIndex)), SLOT(editWebSeed())); - m_deleteHotkeyWeb = new QShortcut(QKeySequence::Delete, m_ui->listWebSeeds, 0, 0, Qt::WidgetShortcut); + m_deleteHotkeyWeb = new QShortcut(QKeySequence::Delete, m_ui->listWebSeeds, nullptr, nullptr, Qt::WidgetShortcut); connect(m_deleteHotkeyWeb, SIGNAL(activated()), SLOT(deleteSelectedUrlSeeds())); - m_openHotkeyFile = new QShortcut(Qt::Key_Return, m_ui->filesList, 0, 0, Qt::WidgetShortcut); + m_openHotkeyFile = new QShortcut(Qt::Key_Return, m_ui->filesList, nullptr, nullptr, Qt::WidgetShortcut); connect(m_openHotkeyFile, SIGNAL(activated()), SLOT(openSelectedFile())); } diff --git a/src/gui/properties/trackerlist.cpp b/src/gui/properties/trackerlist.cpp index 1477f8f03..eeeb37ea2 100644 --- a/src/gui/properties/trackerlist.cpp +++ b/src/gui/properties/trackerlist.cpp @@ -112,10 +112,10 @@ TrackerList::TrackerList(PropertiesWidget *properties) headerItem()->setTextAlignment(COL_PEERS, (Qt::AlignRight | Qt::AlignVCenter)); headerItem()->setTextAlignment(COL_DOWNLOADED, (Qt::AlignRight | Qt::AlignVCenter)); // Set hotkeys - m_editHotkey = new QShortcut(Qt::Key_F2, this, SLOT(editSelectedTracker()), 0, Qt::WidgetShortcut); + m_editHotkey = new QShortcut(Qt::Key_F2, this, SLOT(editSelectedTracker()), nullptr, Qt::WidgetShortcut); connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(editSelectedTracker())); - m_deleteHotkey = new QShortcut(QKeySequence::Delete, this, SLOT(deleteSelectedTrackers()), 0, Qt::WidgetShortcut); - m_copyHotkey = new QShortcut(QKeySequence::Copy, this, SLOT(copyTrackerUrl()), 0, Qt::WidgetShortcut); + m_deleteHotkey = new QShortcut(QKeySequence::Delete, this, SLOT(deleteSelectedTrackers()), nullptr, Qt::WidgetShortcut); + m_copyHotkey = new QShortcut(QKeySequence::Copy, this, SLOT(copyTrackerUrl()), nullptr, Qt::WidgetShortcut); // This hack fixes reordering of first column with Qt5. // https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777 diff --git a/src/gui/qtnotify/notifications.h b/src/gui/qtnotify/notifications.h index fe975fd27..593dac047 100644 --- a/src/gui/qtnotify/notifications.h +++ b/src/gui/qtnotify/notifications.h @@ -31,7 +31,7 @@ public: { return "org.freedesktop.Notifications"; } public: - OrgFreedesktopNotificationsInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + OrgFreedesktopNotificationsInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNotificationsInterface(); diff --git a/src/gui/rss/automatedrssdownloader.cpp b/src/gui/rss/automatedrssdownloader.cpp index 9927a9990..38d8c0867 100644 --- a/src/gui/rss/automatedrssdownloader.cpp +++ b/src/gui/rss/automatedrssdownloader.cpp @@ -120,11 +120,11 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent) connect(m_ui->listRules, &QListWidget::itemSelectionChanged, this, &AutomatedRssDownloader::updateRuleDefinitionBox); connect(m_ui->listRules, &QListWidget::itemChanged, this, &AutomatedRssDownloader::handleRuleCheckStateChange); - m_editHotkey = new QShortcut(Qt::Key_F2, m_ui->listRules, 0, 0, Qt::WidgetShortcut); + m_editHotkey = new QShortcut(Qt::Key_F2, m_ui->listRules, nullptr, nullptr, Qt::WidgetShortcut); connect(m_editHotkey, &QShortcut::activated, this, &AutomatedRssDownloader::renameSelectedRule); connect(m_ui->listRules, &QAbstractItemView::doubleClicked, this, &AutomatedRssDownloader::renameSelectedRule); - m_deleteHotkey = new QShortcut(QKeySequence::Delete, m_ui->listRules, 0, 0, Qt::WidgetShortcut); + m_deleteHotkey = new QShortcut(QKeySequence::Delete, m_ui->listRules, nullptr, nullptr, Qt::WidgetShortcut); connect(m_deleteHotkey, &QShortcut::activated, this, &AutomatedRssDownloader::on_removeRuleBtn_clicked); loadFeedList(); diff --git a/src/gui/rss/rsswidget.cpp b/src/gui/rss/rsswidget.cpp index ef6dec28a..b243b4957 100644 --- a/src/gui/rss/rsswidget.cpp +++ b/src/gui/rss/rsswidget.cpp @@ -93,9 +93,9 @@ RSSWidget::RSSWidget(QWidget *parent) loadFoldersOpenState(); m_feedListWidget->setCurrentItem(m_feedListWidget->stickyUnreadItem()); - m_editHotkey = new QShortcut(Qt::Key_F2, m_feedListWidget, 0, 0, Qt::WidgetShortcut); + m_editHotkey = new QShortcut(Qt::Key_F2, m_feedListWidget, nullptr, nullptr, Qt::WidgetShortcut); connect(m_editHotkey, &QShortcut::activated, this, &RSSWidget::renameSelectedRSSItem); - m_deleteHotkey = new QShortcut(QKeySequence::Delete, m_feedListWidget, 0, 0, Qt::WidgetShortcut); + m_deleteHotkey = new QShortcut(QKeySequence::Delete, m_feedListWidget, nullptr, nullptr, Qt::WidgetShortcut); connect(m_deleteHotkey, &QShortcut::activated, this, &RSSWidget::deleteSelectedItems); // Feeds list actions @@ -388,7 +388,7 @@ void RSSWidget::renameSelectedRSSItem() QString error; if (!RSS::Session::instance()->moveItem(rssItem, RSS::Item::joinPath(parentPath, newName), &error)) { - QMessageBox::warning(0, tr("Rename failed"), error); + QMessageBox::warning(nullptr, tr("Rename failed"), error); ok = false; } } while (!ok); diff --git a/src/gui/search/pluginselectdlg.h b/src/gui/search/pluginselectdlg.h index c67c19cf0..4c1722a4a 100644 --- a/src/gui/search/pluginselectdlg.h +++ b/src/gui/search/pluginselectdlg.h @@ -50,7 +50,7 @@ class PluginSelectDlg: public QDialog Q_OBJECT public: - explicit PluginSelectDlg(SearchPluginManager *pluginManager, QWidget *parent = 0); + explicit PluginSelectDlg(SearchPluginManager *pluginManager, QWidget *parent = nullptr); ~PluginSelectDlg(); QList findItemsWithUrl(QString url); diff --git a/src/gui/search/pluginsourcedlg.h b/src/gui/search/pluginsourcedlg.h index f600e90f1..3ae0a4efd 100644 --- a/src/gui/search/pluginsourcedlg.h +++ b/src/gui/search/pluginsourcedlg.h @@ -43,7 +43,7 @@ class PluginSourceDlg: public QDialog Q_OBJECT public: - explicit PluginSourceDlg(QWidget *parent = 0); + explicit PluginSourceDlg(QWidget *parent = nullptr); ~PluginSourceDlg(); signals: diff --git a/src/gui/search/searchsortmodel.h b/src/gui/search/searchsortmodel.h index e3da49de8..75d80cff7 100644 --- a/src/gui/search/searchsortmodel.h +++ b/src/gui/search/searchsortmodel.h @@ -50,7 +50,7 @@ public: NB_SEARCH_COLUMNS }; - explicit SearchSortModel(QObject *parent = 0); + explicit SearchSortModel(QObject *parent = nullptr); void enableNameFilter(bool enabled); void setNameFilter(const QString& searchTerm = QString()); diff --git a/src/gui/torrentcontentfiltermodel.h b/src/gui/torrentcontentfiltermodel.h index ab9bd10d0..db7aa1bcf 100644 --- a/src/gui/torrentcontentfiltermodel.h +++ b/src/gui/torrentcontentfiltermodel.h @@ -40,7 +40,7 @@ class TorrentContentFilterModel: public QSortFilterProxyModel Q_OBJECT public: - TorrentContentFilterModel(QObject *parent = 0); + TorrentContentFilterModel(QObject *parent = nullptr); virtual ~TorrentContentFilterModel(); TorrentContentModel *model() const; diff --git a/src/gui/torrentcontentmodel.h b/src/gui/torrentcontentmodel.h index cd6ef3966..60f7f014f 100644 --- a/src/gui/torrentcontentmodel.h +++ b/src/gui/torrentcontentmodel.h @@ -47,7 +47,7 @@ class TorrentContentModel: public QAbstractItemModel Q_OBJECT public: - TorrentContentModel(QObject *parent = 0); + TorrentContentModel(QObject *parent = nullptr); ~TorrentContentModel(); void updateFilesProgress(const QVector &fp); diff --git a/src/gui/torrentcontentmodelfolder.cpp b/src/gui/torrentcontentmodelfolder.cpp index b74f89ded..63227fef6 100644 --- a/src/gui/torrentcontentmodelfolder.cpp +++ b/src/gui/torrentcontentmodelfolder.cpp @@ -43,7 +43,7 @@ TorrentContentModelFolder::TorrentContentModelFolder(const QString &name, Torren } TorrentContentModelFolder::TorrentContentModelFolder(const QList &data) - : TorrentContentModelItem(0) + : TorrentContentModelItem(nullptr) { Q_ASSERT(data.size() == NB_COL); m_itemData = data; diff --git a/src/gui/torrentcontenttreeview.h b/src/gui/torrentcontenttreeview.h index 0da6614fc..d5058006d 100644 --- a/src/gui/torrentcontenttreeview.h +++ b/src/gui/torrentcontenttreeview.h @@ -36,7 +36,7 @@ class TorrentContentTreeView: public QTreeView Q_OBJECT public: - explicit TorrentContentTreeView(QWidget *parent = 0); + explicit TorrentContentTreeView(QWidget *parent = nullptr); void keyPressEvent(QKeyEvent *event); private: diff --git a/src/gui/torrentcreatordlg.h b/src/gui/torrentcreatordlg.h index 48c9eacc3..7e6580009 100644 --- a/src/gui/torrentcreatordlg.h +++ b/src/gui/torrentcreatordlg.h @@ -49,7 +49,7 @@ class TorrentCreatorDlg: public QDialog Q_OBJECT public: - TorrentCreatorDlg(QWidget *parent = 0, const QString &defaultPath = QString()); + TorrentCreatorDlg(QWidget *parent = nullptr, const QString &defaultPath = QString()); ~TorrentCreatorDlg(); void updateInputPath(const QString &path); diff --git a/src/gui/torrentmodel.h b/src/gui/torrentmodel.h index fd9161ec8..e5cc24940 100644 --- a/src/gui/torrentmodel.h +++ b/src/gui/torrentmodel.h @@ -83,7 +83,7 @@ public: NB_COLUMNS }; - explicit TorrentModel(QObject *parent = 0); + explicit TorrentModel(QObject *parent = nullptr); int rowCount(const QModelIndex& index = QModelIndex()) const; int columnCount(const QModelIndex &parent=QModelIndex()) const; diff --git a/src/gui/transferlistfilterswidget.cpp b/src/gui/transferlistfilterswidget.cpp index f551c2511..423aa9c5b 100644 --- a/src/gui/transferlistfilterswidget.cpp +++ b/src/gui/transferlistfilterswidget.cpp @@ -229,7 +229,7 @@ TrackerFiltersList::~TrackerFiltersList() void TrackerFiltersList::addItem(const QString &tracker, const QString &hash) { QStringList tmp; - QListWidgetItem *trackerItem = 0; + QListWidgetItem *trackerItem = nullptr; QString host = getHost(tracker); bool exists = m_trackers.contains(host); @@ -460,7 +460,7 @@ void TrackerFiltersList::showMenu(QPoint) QAction *startAct = menu.addAction(GuiIconProvider::instance()->getIcon("media-playback-start"), tr("Resume torrents")); QAction *pauseAct = menu.addAction(GuiIconProvider::instance()->getIcon("media-playback-pause"), tr("Pause torrents")); QAction *deleteTorrentsAct = menu.addAction(GuiIconProvider::instance()->getIcon("edit-delete"), tr("Delete torrents")); - QAction *act = 0; + QAction *act = nullptr; act = menu.exec(QCursor::pos()); if (!act) @@ -559,7 +559,7 @@ QStringList TrackerFiltersList::getHashes(int row) TransferListFiltersWidget::TransferListFiltersWidget(QWidget *parent, TransferListWidget *transferList) : QFrame(parent) , m_transferList(transferList) - , m_trackerFilters(0) + , m_trackerFilters(nullptr) { Preferences* const pref = Preferences::instance(); diff --git a/src/gui/transferlistsortmodel.h b/src/gui/transferlistsortmodel.h index 1e092340d..a4ca13010 100644 --- a/src/gui/transferlistsortmodel.h +++ b/src/gui/transferlistsortmodel.h @@ -41,7 +41,7 @@ class TransferListSortModel: public QSortFilterProxyModel Q_OBJECT public: - TransferListSortModel(QObject *parent = 0); + TransferListSortModel(QObject *parent = nullptr); void setStatusFilter(TorrentFilter::Type filter); void setCategoryFilter(const QString &category); diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index 1d9062b00..9953df02c 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -288,11 +288,11 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *mainWindow) connect(header(), SIGNAL(sectionResized(int, int, int)), this, SLOT(saveSettings())); connect(header(), SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)), this, SLOT(saveSettings())); - m_editHotkey = new QShortcut(Qt::Key_F2, this, SLOT(renameSelectedTorrent()), 0, Qt::WidgetShortcut); - m_deleteHotkey = new QShortcut(QKeySequence::Delete, this, SLOT(softDeleteSelectedTorrents()), 0, Qt::WidgetShortcut); - m_permDeleteHotkey = new QShortcut(Qt::SHIFT + Qt::Key_Delete, this, SLOT(permDeleteSelectedTorrents()), 0, Qt::WidgetShortcut); - m_doubleClickHotkey = new QShortcut(Qt::Key_Return, this, SLOT(torrentDoubleClicked()), 0, Qt::WidgetShortcut); - m_recheckHotkey = new QShortcut(Qt::CTRL + Qt::Key_R, this, SLOT(recheckSelectedTorrents()), 0, Qt::WidgetShortcut); + m_editHotkey = new QShortcut(Qt::Key_F2, this, SLOT(renameSelectedTorrent()), nullptr, Qt::WidgetShortcut); + m_deleteHotkey = new QShortcut(QKeySequence::Delete, this, SLOT(softDeleteSelectedTorrents()), nullptr, Qt::WidgetShortcut); + m_permDeleteHotkey = new QShortcut(Qt::SHIFT + Qt::Key_Delete, this, SLOT(permDeleteSelectedTorrents()), nullptr, Qt::WidgetShortcut); + m_doubleClickHotkey = new QShortcut(Qt::Key_Return, this, SLOT(torrentDoubleClicked()), nullptr, Qt::WidgetShortcut); + m_recheckHotkey = new QShortcut(Qt::CTRL + Qt::Key_R, this, SLOT(recheckSelectedTorrents()), nullptr, Qt::WidgetShortcut); // This hack fixes reordering of first column with Qt5. // https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777 @@ -860,56 +860,56 @@ void TransferListWidget::displayListMenu(const QPoint&) if (selectedIndexes.size() == 0) return; // Create actions - QAction actionStart(GuiIconProvider::instance()->getIcon("media-playback-start"), tr("Resume", "Resume/start the torrent"), 0); + QAction actionStart(GuiIconProvider::instance()->getIcon("media-playback-start"), tr("Resume", "Resume/start the torrent"), nullptr); connect(&actionStart, SIGNAL(triggered()), this, SLOT(startSelectedTorrents())); - QAction actionPause(GuiIconProvider::instance()->getIcon("media-playback-pause"), tr("Pause", "Pause the torrent"), 0); + QAction actionPause(GuiIconProvider::instance()->getIcon("media-playback-pause"), tr("Pause", "Pause the torrent"), nullptr); connect(&actionPause, SIGNAL(triggered()), this, SLOT(pauseSelectedTorrents())); - QAction actionForceStart(GuiIconProvider::instance()->getIcon("media-seek-forward"), tr("Force Resume", "Force Resume/start the torrent"), 0); + QAction actionForceStart(GuiIconProvider::instance()->getIcon("media-seek-forward"), tr("Force Resume", "Force Resume/start the torrent"), nullptr); connect(&actionForceStart, SIGNAL(triggered()), this, SLOT(forceStartSelectedTorrents())); - QAction actionDelete(GuiIconProvider::instance()->getIcon("edit-delete"), tr("Delete", "Delete the torrent"), 0); + QAction actionDelete(GuiIconProvider::instance()->getIcon("edit-delete"), tr("Delete", "Delete the torrent"), nullptr); connect(&actionDelete, SIGNAL(triggered()), this, SLOT(softDeleteSelectedTorrents())); - QAction actionPreview_file(GuiIconProvider::instance()->getIcon("view-preview"), tr("Preview file..."), 0); + QAction actionPreview_file(GuiIconProvider::instance()->getIcon("view-preview"), tr("Preview file..."), nullptr); connect(&actionPreview_file, SIGNAL(triggered()), this, SLOT(previewSelectedTorrents())); - QAction actionSet_max_ratio(QIcon(QLatin1String(":/icons/skin/ratio.png")), tr("Limit share ratio..."), 0); + QAction actionSet_max_ratio(QIcon(QLatin1String(":/icons/skin/ratio.png")), tr("Limit share ratio..."), nullptr); connect(&actionSet_max_ratio, SIGNAL(triggered()), this, SLOT(setMaxRatioSelectedTorrents())); - QAction actionSet_upload_limit(GuiIconProvider::instance()->getIcon("kt-set-max-upload-speed"), tr("Limit upload rate..."), 0); + QAction actionSet_upload_limit(GuiIconProvider::instance()->getIcon("kt-set-max-upload-speed"), tr("Limit upload rate..."), nullptr); connect(&actionSet_upload_limit, SIGNAL(triggered()), this, SLOT(setUpLimitSelectedTorrents())); - QAction actionSet_download_limit(GuiIconProvider::instance()->getIcon("kt-set-max-download-speed"), tr("Limit download rate..."), 0); + QAction actionSet_download_limit(GuiIconProvider::instance()->getIcon("kt-set-max-download-speed"), tr("Limit download rate..."), nullptr); connect(&actionSet_download_limit, SIGNAL(triggered()), this, SLOT(setDlLimitSelectedTorrents())); - QAction actionOpen_destination_folder(GuiIconProvider::instance()->getIcon("inode-directory"), tr("Open destination folder"), 0); + QAction actionOpen_destination_folder(GuiIconProvider::instance()->getIcon("inode-directory"), tr("Open destination folder"), nullptr); connect(&actionOpen_destination_folder, SIGNAL(triggered()), this, SLOT(openSelectedTorrentsFolder())); - QAction actionIncreasePriority(GuiIconProvider::instance()->getIcon("go-up"), tr("Move up", "i.e. move up in the queue"), 0); + QAction actionIncreasePriority(GuiIconProvider::instance()->getIcon("go-up"), tr("Move up", "i.e. move up in the queue"), nullptr); connect(&actionIncreasePriority, SIGNAL(triggered()), this, SLOT(increasePrioSelectedTorrents())); - QAction actionDecreasePriority(GuiIconProvider::instance()->getIcon("go-down"), tr("Move down", "i.e. Move down in the queue"), 0); + QAction actionDecreasePriority(GuiIconProvider::instance()->getIcon("go-down"), tr("Move down", "i.e. Move down in the queue"), nullptr); connect(&actionDecreasePriority, SIGNAL(triggered()), this, SLOT(decreasePrioSelectedTorrents())); - QAction actionTopPriority(GuiIconProvider::instance()->getIcon("go-top"), tr("Move to top", "i.e. Move to top of the queue"), 0); + QAction actionTopPriority(GuiIconProvider::instance()->getIcon("go-top"), tr("Move to top", "i.e. Move to top of the queue"), nullptr); connect(&actionTopPriority, SIGNAL(triggered()), this, SLOT(topPrioSelectedTorrents())); - QAction actionBottomPriority(GuiIconProvider::instance()->getIcon("go-bottom"), tr("Move to bottom", "i.e. Move to bottom of the queue"), 0); + QAction actionBottomPriority(GuiIconProvider::instance()->getIcon("go-bottom"), tr("Move to bottom", "i.e. Move to bottom of the queue"), nullptr); connect(&actionBottomPriority, SIGNAL(triggered()), this, SLOT(bottomPrioSelectedTorrents())); - QAction actionSetTorrentPath(GuiIconProvider::instance()->getIcon("inode-directory"), tr("Set location..."), 0); + QAction actionSetTorrentPath(GuiIconProvider::instance()->getIcon("inode-directory"), tr("Set location..."), nullptr); connect(&actionSetTorrentPath, SIGNAL(triggered()), this, SLOT(setSelectedTorrentsLocation())); - QAction actionForce_recheck(GuiIconProvider::instance()->getIcon("document-edit-verify"), tr("Force recheck"), 0); + QAction actionForce_recheck(GuiIconProvider::instance()->getIcon("document-edit-verify"), tr("Force recheck"), nullptr); connect(&actionForce_recheck, SIGNAL(triggered()), this, SLOT(recheckSelectedTorrents())); - QAction actionForce_reannounce(GuiIconProvider::instance()->getIcon("document-edit-verify"), tr("Force reannounce"), 0); + QAction actionForce_reannounce(GuiIconProvider::instance()->getIcon("document-edit-verify"), tr("Force reannounce"), nullptr); connect(&actionForce_reannounce, SIGNAL(triggered()), this, SLOT(reannounceSelectedTorrents())); - QAction actionCopy_magnet_link(GuiIconProvider::instance()->getIcon("kt-magnet"), tr("Copy magnet link"), 0); + QAction actionCopy_magnet_link(GuiIconProvider::instance()->getIcon("kt-magnet"), tr("Copy magnet link"), nullptr); connect(&actionCopy_magnet_link, SIGNAL(triggered()), this, SLOT(copySelectedMagnetURIs())); - QAction actionCopy_name(GuiIconProvider::instance()->getIcon("edit-copy"), tr("Copy name"), 0); + QAction actionCopy_name(GuiIconProvider::instance()->getIcon("edit-copy"), tr("Copy name"), nullptr); connect(&actionCopy_name, SIGNAL(triggered()), this, SLOT(copySelectedNames())); - QAction actionCopyHash(GuiIconProvider::instance()->getIcon("edit-copy"), tr("Copy hash"), 0); + QAction actionCopyHash(GuiIconProvider::instance()->getIcon("edit-copy"), tr("Copy hash"), nullptr); connect(&actionCopyHash, &QAction::triggered, this, &TransferListWidget::copySelectedHashes); - QAction actionSuper_seeding_mode(tr("Super seeding mode"), 0); + QAction actionSuper_seeding_mode(tr("Super seeding mode"), nullptr); actionSuper_seeding_mode.setCheckable(true); connect(&actionSuper_seeding_mode, SIGNAL(triggered()), this, SLOT(toggleSelectedTorrentsSuperSeeding())); - QAction actionRename(GuiIconProvider::instance()->getIcon("edit-rename"), tr("Rename..."), 0); + QAction actionRename(GuiIconProvider::instance()->getIcon("edit-rename"), tr("Rename..."), nullptr); connect(&actionRename, SIGNAL(triggered()), this, SLOT(renameSelectedTorrent())); - QAction actionSequential_download(tr("Download in sequential order"), 0); + QAction actionSequential_download(tr("Download in sequential order"), nullptr); actionSequential_download.setCheckable(true); connect(&actionSequential_download, SIGNAL(triggered()), this, SLOT(toggleSelectedTorrentsSequentialDownload())); - QAction actionFirstLastPiece_prio(tr("Download first and last pieces first"), 0); + QAction actionFirstLastPiece_prio(tr("Download first and last pieces first"), nullptr); actionFirstLastPiece_prio.setCheckable(true); connect(&actionFirstLastPiece_prio, SIGNAL(triggered()), this, SLOT(toggleSelectedFirstLastPiecePrio())); - QAction actionAutoTMM(tr("Automatic Torrent Management"), 0); + QAction actionAutoTMM(tr("Automatic Torrent Management"), nullptr); actionAutoTMM.setCheckable(true); actionAutoTMM.setToolTip(tr("Automatic mode means that various torrent properties(eg save path) will be decided by the associated category")); connect(&actionAutoTMM, SIGNAL(triggered(bool)), this, SLOT(setSelectedAutoTMMEnabled(bool))); @@ -1112,7 +1112,7 @@ void TransferListWidget::displayListMenu(const QPoint&) listMenu.addAction(&actionCopyHash); listMenu.addAction(&actionCopy_magnet_link); // Call menu - QAction *act = 0; + QAction *act = nullptr; act = listMenu.exec(QCursor::pos()); if (act) { // Parse category & tag actions only (others have slots assigned) @@ -1147,7 +1147,7 @@ void TransferListWidget::displayListMenu(const QPoint&) void TransferListWidget::currentChanged(const QModelIndex& current, const QModelIndex&) { qDebug("CURRENT CHANGED"); - BitTorrent::TorrentHandle *torrent = 0; + BitTorrent::TorrentHandle *torrent = nullptr; if (current.isValid()) { torrent = m_listModel->torrentHandle(mapToSource(current)); // Scroll Fix diff --git a/src/webui/webapplication.cpp b/src/webui/webapplication.cpp index 1cdea3b63..0ad1ab1ac 100644 --- a/src/webui/webapplication.cpp +++ b/src/webui/webapplication.cpp @@ -114,7 +114,7 @@ namespace QString translation = word; if (isTranslationNeeded) { QString context = regex.cap(4); - translation = qApp->translate(context.toUtf8().constData(), word.constData(), 0, 1); + translation = qApp->translate(context.toUtf8().constData(), word.constData(), nullptr, 1); } // Remove keyboard shortcuts translation.replace(mnemonic, "");