mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Call TorrentModelItem::state() directly in getTorrentStatusReport
There is no point in wraping/unwraping QVariant.
This commit is contained in:
parent
80297697dd
commit
2d98b8f192
2 changed files with 2 additions and 2 deletions
|
@ -504,7 +504,7 @@ TorrentStatusReport TorrentModel::getTorrentStatusReport() const
|
||||||
QList<TorrentModelItem*>::const_iterator it = m_torrents.constBegin();
|
QList<TorrentModelItem*>::const_iterator it = m_torrents.constBegin();
|
||||||
QList<TorrentModelItem*>::const_iterator itend = m_torrents.constEnd();
|
QList<TorrentModelItem*>::const_iterator itend = m_torrents.constEnd();
|
||||||
for ( ; it != itend; ++it) {
|
for ( ; it != itend; ++it) {
|
||||||
switch((*it)->data(TorrentModelItem::TR_STATUS).toInt()) {
|
switch((*it)->state()) {
|
||||||
case TorrentModelItem::STATE_DOWNLOADING:
|
case TorrentModelItem::STATE_DOWNLOADING:
|
||||||
++report.nb_active;
|
++report.nb_active;
|
||||||
++report.nb_downloading;
|
++report.nb_downloading;
|
||||||
|
|
|
@ -58,6 +58,7 @@ public:
|
||||||
QVariant data(int column, int role = Qt::DisplayRole) const;
|
QVariant data(int column, int role = Qt::DisplayRole) const;
|
||||||
bool setData(int column, const QVariant &value, int role = Qt::DisplayRole);
|
bool setData(int column, const QVariant &value, int role = Qt::DisplayRole);
|
||||||
inline QString hash() const { return m_hash; }
|
inline QString hash() const { return m_hash; }
|
||||||
|
State state() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void labelChanged(QString previous, QString current);
|
void labelChanged(QString previous, QString current);
|
||||||
|
@ -65,7 +66,6 @@ signals:
|
||||||
private:
|
private:
|
||||||
static QIcon getIconByState(State state);
|
static QIcon getIconByState(State state);
|
||||||
static QColor getColorByState(State state);
|
static QColor getColorByState(State state);
|
||||||
State state() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTorrentHandle m_torrent;
|
QTorrentHandle m_torrent;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue