mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 21:52:32 -06:00
Minor code clean up
This commit is contained in:
@@ -37,14 +37,15 @@
|
||||
using namespace libtorrent;
|
||||
|
||||
TorrentModelItem::TorrentModelItem(const QTorrentHandle &h)
|
||||
: m_torrent(h)
|
||||
, m_addedTime(TorrentPersistentData::getAddedDate(h.hash()))
|
||||
, m_seedTime(TorrentPersistentData::getSeedDate(h.hash()))
|
||||
, m_label(TorrentPersistentData::getLabel(h.hash()))
|
||||
, m_name(TorrentPersistentData::getName(h.hash()))
|
||||
, m_hash(h.hash())
|
||||
{
|
||||
m_torrent = h;
|
||||
m_hash = h.hash();
|
||||
m_name = TorrentPersistentData::getName(h.hash());
|
||||
if (m_name.isEmpty()) m_name = h.name();
|
||||
m_addedTime = TorrentPersistentData::getAddedDate(h.hash());
|
||||
m_seedTime = TorrentPersistentData::getSeedDate(h.hash());
|
||||
m_label = TorrentPersistentData::getLabel(h.hash());
|
||||
if (m_name.isEmpty())
|
||||
m_name = h.name();
|
||||
}
|
||||
|
||||
TorrentModelItem::State TorrentModelItem::state() const
|
||||
|
||||
@@ -40,13 +40,19 @@ public:
|
||||
unsigned long num_peers;
|
||||
|
||||
//TrackerInfos() {}
|
||||
TrackerInfos(const TrackerInfos &b) {
|
||||
name_or_url = b.name_or_url;
|
||||
TrackerInfos(const TrackerInfos &b)
|
||||
: name_or_url(b.name_or_url)
|
||||
, last_message(b.last_message)
|
||||
, num_peers(b.num_peers)
|
||||
{
|
||||
Q_ASSERT(!name_or_url.isEmpty());
|
||||
last_message = b.last_message;
|
||||
num_peers = b.num_peers;
|
||||
}
|
||||
TrackerInfos(QString name_or_url): name_or_url(name_or_url), last_message(""), num_peers(0) {
|
||||
|
||||
TrackerInfos(QString name_or_url)
|
||||
: name_or_url(name_or_url)
|
||||
, last_message("")
|
||||
, num_peers(0)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user