mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 16:58:06 -06:00
Use qt5 connect() syntax
This commit is contained in:
@@ -61,19 +61,20 @@ TorrentModel::TorrentModel(QObject *parent)
|
||||
: QAbstractListModel(parent)
|
||||
{
|
||||
// Load the torrents
|
||||
foreach (BitTorrent::TorrentHandle *const torrent, BitTorrent::Session::instance()->torrents())
|
||||
using namespace BitTorrent;
|
||||
foreach (TorrentHandle *const torrent, Session::instance()->torrents())
|
||||
addTorrent(torrent);
|
||||
|
||||
// Listen for torrent changes
|
||||
connect(BitTorrent::Session::instance(), SIGNAL(torrentAdded(BitTorrent::TorrentHandle * const)), SLOT(addTorrent(BitTorrent::TorrentHandle * const)));
|
||||
connect(BitTorrent::Session::instance(), SIGNAL(torrentAboutToBeRemoved(BitTorrent::TorrentHandle * const)), SLOT(handleTorrentAboutToBeRemoved(BitTorrent::TorrentHandle * const)));
|
||||
connect(BitTorrent::Session::instance(), SIGNAL(torrentsUpdated()), SLOT(handleTorrentsUpdated()));
|
||||
connect(Session::instance(), &Session::torrentAdded, this, &TorrentModel::addTorrent);
|
||||
connect(Session::instance(), &Session::torrentAboutToBeRemoved, this, &TorrentModel::handleTorrentAboutToBeRemoved);
|
||||
connect(Session::instance(), &Session::torrentsUpdated, this, &TorrentModel::handleTorrentsUpdated);
|
||||
|
||||
connect(BitTorrent::Session::instance(), SIGNAL(torrentFinished(BitTorrent::TorrentHandle * const)), SLOT(handleTorrentStatusUpdated(BitTorrent::TorrentHandle * const)));
|
||||
connect(BitTorrent::Session::instance(), SIGNAL(torrentMetadataLoaded(BitTorrent::TorrentHandle * const)), SLOT(handleTorrentStatusUpdated(BitTorrent::TorrentHandle * const)));
|
||||
connect(BitTorrent::Session::instance(), SIGNAL(torrentResumed(BitTorrent::TorrentHandle * const)), SLOT(handleTorrentStatusUpdated(BitTorrent::TorrentHandle * const)));
|
||||
connect(BitTorrent::Session::instance(), SIGNAL(torrentPaused(BitTorrent::TorrentHandle * const)), SLOT(handleTorrentStatusUpdated(BitTorrent::TorrentHandle * const)));
|
||||
connect(BitTorrent::Session::instance(), SIGNAL(torrentFinishedChecking(BitTorrent::TorrentHandle * const)), SLOT(handleTorrentStatusUpdated(BitTorrent::TorrentHandle * const)));
|
||||
connect(Session::instance(), &Session::torrentFinished, this, &TorrentModel::handleTorrentStatusUpdated);
|
||||
connect(Session::instance(), &Session::torrentMetadataLoaded, this, &TorrentModel::handleTorrentStatusUpdated);
|
||||
connect(Session::instance(), &Session::torrentResumed, this, &TorrentModel::handleTorrentStatusUpdated);
|
||||
connect(Session::instance(), &Session::torrentPaused, this, &TorrentModel::handleTorrentStatusUpdated);
|
||||
connect(Session::instance(), &Session::torrentFinishedChecking, this, &TorrentModel::handleTorrentStatusUpdated);
|
||||
}
|
||||
|
||||
int TorrentModel::rowCount(const QModelIndex &index) const
|
||||
|
||||
Reference in New Issue
Block a user