WebUI: Change torrent model

Improvements:
- added functions, which may be used to reorder and hiding columns in torrents table
- new columns can be easily added to torrents table
This commit is contained in:
buinsky 2014-12-24 04:39:18 +03:00
parent 91ec84b317
commit 04f1c0c238
6 changed files with 593 additions and 341 deletions

View file

@ -218,12 +218,9 @@ static QVariantMap toMap(const QTorrentHandle& h)
ret[KEY_TORRENT_RATIO] = (ratio > QBtSession::MAX_RATIO) ? -1 : ratio;
ret[KEY_TORRENT_STATE] = h.torrentState().toString();
ret[KEY_TORRENT_ETA] = h.eta();
if (h.has_metadata()) {
if (status.sequential_download)
ret[KEY_TORRENT_SEQUENTIAL_DOWNLOAD] = true;
if (h.first_last_piece_first())
ret[KEY_TORRENT_FIRST_LAST_PIECE_PRIO] = true;
}
ret[KEY_TORRENT_SEQUENTIAL_DOWNLOAD] = status.sequential_download;
if (h.has_metadata())
ret[KEY_TORRENT_FIRST_LAST_PIECE_PRIO] = h.first_last_piece_first();
return ret;
}