New GET methods:
* version/api: current API version
* version/api_min: min API version supported
The API version is an integer and it's returned as plain text.
Whenever the API is changed, the api version is increased.
Whenever the API is changed in a way that is not backward compatible,
api_min is increased.
Only few file managers are able to select files when started from the
command line.
xdg-mime is required to retrieve the default file manager. If it's not
available or the file manager is not able to automatically select files,
the containing directory will be opened as usual.
Definitions:
Selection in QTreeView consist of two things:
currentIndex -- is a (dotted) cell where user clicked last time. Note
that it is a cell
selectedIndexes -- is a set of cells (blue) of current selection.
Checkboxes in torrent content lists are belong to COL_NAME column.
Problem:
The problem is that spacebar toggled checkbox only in currentIndex
index. This has two consequences:
1. It is impossible to toggle checkboxes on multiple rows
simultaneously.
2. If currentIndex is not in COL_NAME column a space key doesn't work
at all. This problem is amplifyed by the fact that SelectionBehavior
is set to SelectRows. So visually it is impossible to tell which
column does it belong to. For end user it looks like "space doesn't
work sometimes".
This patch addresses the problem by implementing TorrentContentTreeView
derived from QTreeView and overridding keyPressEvent(QKeyEvent*).
The code of TorrentContentTreeView::keyPressEvent is written under
inspiration from QAbstractItemView::keyPressEvent and
QItemDelegate::editorEvent.
It was reported (#2161) that enabling/disabling a downloading of a file
is considerably slow on libtorrent 1.0.3, but not on 0.16.x. The problem
is that a function torrent_file() in libttorrent 1.0.3 does a deep copy
of torrent_info, while get_torrent_info() in libtorrent 0.16.x only
returns a reference.
Sizes are now given in bytes.
Dates are Unix timestamps and converted to ISO 8601 in the web UI.
Numbers are not converted to strings.
-1 is returned for undefined values.
Some keys have been splitted:
Torrent list (json/torrents)
* num_seeds: Torrent seeds connected to
* num_complete: Torrent seeds in the swarm
* num_leechs: Torrent leechers connected to
* num_incomplete: Torrent leechers in the swarm
Torrent generic properties (propertiesGeneral/hash)
* total_uploaded: Total data uploaded
* total_uploaded_session: Total data uploaded this session
* total_downloaded: Total data dowloaded
* total_downloaded_session: Total data downloaded this session
* time_elapsed: Torrent elapsed time
* seeding_time: Torrent elapsed time while complete
* nb_connections: Torrent connection count
* nb_connections_limit: Torrent connection count limit
Global transfer info (json/transferInfo)
* dl_info_speed: Global downalod rate
* dl_info_data: Data downloaded this session
* up_info_speed: Global upload rate
* up_info_data: Data uploaded this session
Closes#1524.
This commit should improve performance when user navigating through
torrent list using up/down keys. A scrolling through all the list
(276 torrents) took:
Total wall time: 18.813s
Total CPU time: 3.210s
misc::parseHtmlLinks(): 0.096s
misc::parseHtmlLinks() is 8th most hottest function on
this use case.
This commit caches icons in TorrentContentModel in the same way they are
cached in TorrentModel.
This commit should improve performance when user navigating through
torrent list using up/down keys. A scrolling through all the list
(276 torrents) took:
Total wall time: 18.813s
Total CPU time: 3.210s
IconProvider::generateDifferentSizes(): 0.170s
IconProvider::generateDifferentSizes is 5th most hottest function on
this use case.
I thought merging all 3 sort-filter proxy models into one should
speedup dataChanged() signal. As turned out this is not the case. The
time difference is within inaccuracy range, so this doesn't affect
performance.
But I still think it is good to merge them into one proxy model as it
simplifies code.
Torrent numbers were recalculated on every dataChanged() signal. The previous commit
greatly increases the number of dataChanged() signals.
HEAD^^:
Total wall clock: 97.069s
updateTorrentNumbers() time: 0.033s
HEAD^:
Total wall clock: 96.132s
updateTorrentNumbers() time: 0.179s
HEAD:
Total wall clock: 95.535s
updateTorrentNumbers() time: 0.047s
After this commit the time of updateTorrentNumbers() is (almost) back to
the level that it was in HEAD^^.