Replace the zeroing of pointers with nullptr

This commit is contained in:
thalieht 2018-04-15 13:06:31 +03:00 committed by sledgehammer999
parent 667f84995c
commit 9cb190ebe7
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
47 changed files with 98 additions and 98 deletions

View file

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

View file

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

View file

@ -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);
}

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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()
{
if (m_instance) {
delete m_instance;
m_instance = 0;
m_instance = nullptr;
}
}

View file

@ -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;
}
}

View file

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

View file

@ -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;

View file

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

View file

@ -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);

View file

@ -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;
}
}

View file

@ -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()));

View file

@ -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);

View file

@ -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);

View file

@ -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();

View file

@ -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);

View file

@ -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);

View file

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

View file

@ -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:

View file

@ -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

View file

@ -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;

View file

@ -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&);

View file

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

View file

@ -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);

View file

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

View file

@ -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();

View file

@ -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;

View file

@ -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()));
}

View file

@ -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

View file

@ -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();

View file

@ -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();

View file

@ -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);

View file

@ -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);

View file

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

View file

@ -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());

View file

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

View file

@ -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);

View file

@ -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;

View file

@ -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:

View file

@ -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);

View file

@ -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;

View file

@ -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();

View file

@ -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);

View file

@ -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

View file

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