Browse Source

Replace the zeroing of pointers with nullptr

adaptive-webui-19844
thalieht 7 years ago
parent
commit
3e4099fe5b
  1. 2
      src/base/bittorrent/session.cpp
  2. 2
      src/base/bittorrent/session.h
  3. 2
      src/base/bittorrent/torrenthandle.cpp
  4. 2
      src/base/http/connection.h
  5. 4
      src/base/iconprovider.cpp
  6. 2
      src/base/iconprovider.h
  7. 4
      src/base/logger.cpp
  8. 6
      src/base/net/downloadmanager.cpp
  9. 2
      src/base/net/downloadmanager.h
  10. 4
      src/base/net/private/geoipdatabase.cpp
  11. 2
      src/base/net/proxyconfigurationmanager.cpp
  12. 2
      src/base/net/reverseresolution.h
  13. 4
      src/base/preferences.cpp
  14. 6
      src/base/scanfoldersmodel.cpp
  15. 4
      src/base/scanfoldersmodel.h
  16. 2
      src/base/utils/fs.h
  17. 4
      src/gui/addnewtorrentdialog.cpp
  18. 2
      src/gui/autoexpandabledialog.h
  19. 2
      src/gui/guiiconprovider.h
  20. 2
      src/gui/hidabletabwidget.h
  21. 2
      src/gui/loglistwidget.h
  22. 2
      src/gui/mainwindow.cpp
  23. 2
      src/gui/mainwindow.h
  24. 2
      src/gui/messageboxraised.h
  25. 2
      src/gui/optionsdlg.h
  26. 2
      src/gui/powermanagement/powermanagement.h
  27. 2
      src/gui/powermanagement/powermanagement_x11.h
  28. 2
      src/gui/programupdater.h
  29. 4
      src/gui/properties/peerlistwidget.cpp
  30. 8
      src/gui/properties/propertieswidget.cpp
  31. 6
      src/gui/properties/trackerlist.cpp
  32. 2
      src/gui/qtnotify/notifications.h
  33. 4
      src/gui/rss/automatedrssdownloader.cpp
  34. 6
      src/gui/rss/rsswidget.cpp
  35. 2
      src/gui/search/pluginselectdlg.h
  36. 2
      src/gui/search/pluginsourcedlg.h
  37. 2
      src/gui/search/searchsortmodel.h
  38. 2
      src/gui/torrentcontentfiltermodel.h
  39. 2
      src/gui/torrentcontentmodel.h
  40. 2
      src/gui/torrentcontentmodelfolder.cpp
  41. 2
      src/gui/torrentcontenttreeview.h
  42. 2
      src/gui/torrentcreatordlg.h
  43. 2
      src/gui/torrentmodel.h
  44. 6
      src/gui/transferlistfilterswidget.cpp
  45. 2
      src/gui/transferlistsortmodel.h
  46. 62
      src/gui/transferlistwidget.cpp
  47. 2
      src/webui/webapplication.cpp

2
src/base/bittorrent/session.cpp

@ -1005,7 +1005,7 @@ void Session::freeInstance() @@ -1005,7 +1005,7 @@ void Session::freeInstance()
{
if (m_instance) {
delete m_instance;
m_instance = 0;
m_instance = nullptr;
}
}

2
src/base/bittorrent/session.h

@ -562,7 +562,7 @@ namespace BitTorrent @@ -562,7 +562,7 @@ namespace BitTorrent
bool requestedFileDeletion;
};
explicit Session(QObject *parent = 0);
explicit Session(QObject *parent = nullptr);
~Session();
bool hasPerTorrentRatioLimit() const;

2
src/base/bittorrent/torrenthandle.cpp

@ -1641,7 +1641,7 @@ void TorrentHandle::handleSaveResumeDataFailedAlert(libtorrent::save_resume_data @@ -1641,7 +1641,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);
}

2
src/base/http/connection.h

@ -50,7 +50,7 @@ namespace Http @@ -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;

4
src/base/iconprovider.cpp

@ -47,7 +47,7 @@ void IconProvider::freeInstance() @@ -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) @@ -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;

2
src/base/iconprovider.h

@ -46,7 +46,7 @@ public: @@ -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;

4
src/base/logger.cpp

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
#include <QDateTime>
#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() @@ -29,7 +29,7 @@ void Logger::freeInstance()
{
if (m_instance) {
delete m_instance;
m_instance = 0;
m_instance = nullptr;
}
}

6
src/base/net/downloadmanager.cpp

@ -51,7 +51,7 @@ namespace @@ -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 @@ -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() @@ -128,7 +128,7 @@ void DownloadManager::freeInstance()
{
if (m_instance) {
delete m_instance;
m_instance = 0;
m_instance = nullptr;
}
}

2
src/base/net/downloadmanager.h

@ -64,7 +64,7 @@ namespace Net @@ -64,7 +64,7 @@ namespace Net
#endif
private:
explicit DownloadManager(QObject *parent = 0);
explicit DownloadManager(QObject *parent = nullptr);
void applyProxySettings();

4
src/base/net/private/geoipdatabase.cpp

@ -91,7 +91,7 @@ GeoIPDatabase::GeoIPDatabase(quint32 size) @@ -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) @@ -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;

2
src/base/net/proxyconfigurationmanager.cpp

@ -80,7 +80,7 @@ void ProxyConfigurationManager::freeInstance() @@ -80,7 +80,7 @@ void ProxyConfigurationManager::freeInstance()
{
if (m_instance) {
delete m_instance;
m_instance = 0;
m_instance = nullptr;
}
}

2
src/base/net/reverseresolution.h

@ -47,7 +47,7 @@ namespace Net @@ -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);

4
src/base/preferences.cpp

@ -59,7 +59,7 @@ @@ -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() @@ -78,7 +78,7 @@ void Preferences::freeInstance()
{
if (m_instance) {
delete m_instance;
m_instance = 0;
m_instance = nullptr;
}
}

6
src/base/scanfoldersmodel.cpp

@ -56,7 +56,7 @@ struct ScanFoldersModel::PathData @@ -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() @@ -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() @@ -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()));

4
src/base/scanfoldersmodel.h

@ -66,7 +66,7 @@ public: @@ -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: @@ -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);

2
src/base/utils/fs.h

@ -52,7 +52,7 @@ namespace Utils @@ -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);

4
src/gui/addnewtorrentdialog.cpp

@ -148,7 +148,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP @@ -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 &) @@ -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();

2
src/gui/autoexpandabledialog.h

@ -48,7 +48,7 @@ public: @@ -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);

2
src/gui/guiiconprovider.h

@ -52,7 +52,7 @@ private slots: @@ -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);

2
src/gui/hidabletabwidget.h

@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
class HidableTabWidget : public QTabWidget
{
public:
explicit HidableTabWidget(QWidget *parent = 0)
explicit HidableTabWidget(QWidget *parent = nullptr)
: QTabWidget(parent)
{
}

2
src/gui/loglistwidget.h

@ -43,7 +43,7 @@ class LogListWidget: public QListWidget @@ -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:

2
src/gui/mainwindow.cpp

@ -1045,7 +1045,7 @@ void MainWindow::notifyOfUpdate(QString) @@ -1045,7 +1045,7 @@ void MainWindow::notifyOfUpdate(QString)
, Log::CRITICAL);
// Delete the executable watcher
delete m_executableWatcher;
m_executableWatcher = 0;
m_executableWatcher = nullptr;
}
#ifndef Q_OS_MAC

2
src/gui/mainwindow.h

@ -75,7 +75,7 @@ class MainWindow: public QMainWindow @@ -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;

2
src/gui/messageboxraised.h

@ -38,7 +38,7 @@ class MessageBoxRaised : public QMessageBox @@ -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&);

2
src/gui/optionsdlg.h

@ -77,7 +77,7 @@ private: @@ -77,7 +77,7 @@ private:
public:
// Constructor / Destructor
OptionsDialog(QWidget *parent = 0);
OptionsDialog(QWidget *parent = nullptr);
~OptionsDialog();
public slots:

2
src/gui/powermanagement/powermanagement.h

@ -48,7 +48,7 @@ class PowerManagement : public QObject @@ -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);

2
src/gui/powermanagement/powermanagement_x11.h

@ -42,7 +42,7 @@ class PowerManagementInhibitor : public QObject @@ -42,7 +42,7 @@ class PowerManagementInhibitor : public QObject
Q_OBJECT
public:
PowerManagementInhibitor(QObject *parent = 0);
PowerManagementInhibitor(QObject *parent = nullptr);
virtual ~PowerManagementInhibitor();
void RequestIdle();

2
src/gui/programupdater.h

@ -39,7 +39,7 @@ class ProgramUpdater: public QObject @@ -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();

4
src/gui/properties/peerlistwidget.cpp

@ -131,7 +131,7 @@ PeerListWidget::PeerListWidget(PropertiesWidget *parent) @@ -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 &) @@ -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;

8
src/gui/properties/propertieswidget.cpp

@ -163,14 +163,14 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *mainWindow, Tran @@ -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()));
}

6
src/gui/properties/trackerlist.cpp

@ -112,10 +112,10 @@ TrackerList::TrackerList(PropertiesWidget *properties) @@ -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

2
src/gui/qtnotify/notifications.h

@ -31,7 +31,7 @@ public: @@ -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();

4
src/gui/rss/automatedrssdownloader.cpp

@ -120,11 +120,11 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent) @@ -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();

6
src/gui/rss/rsswidget.cpp

@ -93,9 +93,9 @@ RSSWidget::RSSWidget(QWidget *parent) @@ -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() @@ -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);

2
src/gui/search/pluginselectdlg.h

@ -50,7 +50,7 @@ class PluginSelectDlg: public QDialog @@ -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<QTreeWidgetItem*> findItemsWithUrl(QString url);

2
src/gui/search/pluginsourcedlg.h

@ -43,7 +43,7 @@ class PluginSourceDlg: public QDialog @@ -43,7 +43,7 @@ class PluginSourceDlg: public QDialog
Q_OBJECT
public:
explicit PluginSourceDlg(QWidget *parent = 0);
explicit PluginSourceDlg(QWidget *parent = nullptr);
~PluginSourceDlg();
signals:

2
src/gui/search/searchsortmodel.h

@ -50,7 +50,7 @@ public: @@ -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());

2
src/gui/torrentcontentfiltermodel.h

@ -40,7 +40,7 @@ class TorrentContentFilterModel: public QSortFilterProxyModel @@ -40,7 +40,7 @@ class TorrentContentFilterModel: public QSortFilterProxyModel
Q_OBJECT
public:
TorrentContentFilterModel(QObject *parent = 0);
TorrentContentFilterModel(QObject *parent = nullptr);
virtual ~TorrentContentFilterModel();
TorrentContentModel *model() const;

2
src/gui/torrentcontentmodel.h

@ -47,7 +47,7 @@ class TorrentContentModel: public QAbstractItemModel @@ -47,7 +47,7 @@ class TorrentContentModel: public QAbstractItemModel
Q_OBJECT
public:
TorrentContentModel(QObject *parent = 0);
TorrentContentModel(QObject *parent = nullptr);
~TorrentContentModel();
void updateFilesProgress(const QVector<qreal> &fp);

2
src/gui/torrentcontentmodelfolder.cpp

@ -43,7 +43,7 @@ TorrentContentModelFolder::TorrentContentModelFolder(const QString &name, Torren @@ -43,7 +43,7 @@ TorrentContentModelFolder::TorrentContentModelFolder(const QString &name, Torren
}
TorrentContentModelFolder::TorrentContentModelFolder(const QList<QVariant> &data)
: TorrentContentModelItem(0)
: TorrentContentModelItem(nullptr)
{
Q_ASSERT(data.size() == NB_COL);
m_itemData = data;

2
src/gui/torrentcontenttreeview.h

@ -36,7 +36,7 @@ class TorrentContentTreeView: public QTreeView @@ -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:

2
src/gui/torrentcreatordlg.h

@ -49,7 +49,7 @@ class TorrentCreatorDlg: public QDialog @@ -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);

2
src/gui/torrentmodel.h

@ -83,7 +83,7 @@ public: @@ -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;

6
src/gui/transferlistfilterswidget.cpp

@ -229,7 +229,7 @@ TrackerFiltersList::~TrackerFiltersList() @@ -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) @@ -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) @@ -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();

2
src/gui/transferlistsortmodel.h

@ -41,7 +41,7 @@ class TransferListSortModel: public QSortFilterProxyModel @@ -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);

62
src/gui/transferlistwidget.cpp

@ -288,11 +288,11 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *mainWindow) @@ -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
@ -859,56 +859,56 @@ void TransferListWidget::displayListMenu(const QPoint&) @@ -859,56 +859,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)));
@ -1111,7 +1111,7 @@ void TransferListWidget::displayListMenu(const QPoint&) @@ -1111,7 +1111,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)
@ -1146,7 +1146,7 @@ void TransferListWidget::displayListMenu(const QPoint&) @@ -1146,7 +1146,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

2
src/webui/webapplication.cpp

@ -114,7 +114,7 @@ namespace @@ -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, "");

Loading…
Cancel
Save