Use qt5 connect() syntax

This commit is contained in:
thalieht
2018-04-18 16:59:41 +03:00
parent 7af83ab704
commit 6b4455e13d
37 changed files with 198 additions and 175 deletions

View File

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