Commit graph

4584 commits

Author SHA1 Message Date
Vladimir Golovnev (Glassez)
446a9efe9e Fix building with Qt5 (missing QObject decl). 2014-06-04 17:38:35 +04:00
Ivan Sorokin
510818d631 Replaced dynamic_cast with switch on alert type.
Conflicts:
	src/qtlibtorrent/qbtsession.cpp
2014-06-04 11:08:31 +04:00
Ivan Sorokin
1244a46cbb Extract alert handling to separate functions. 2014-06-04 11:08:31 +04:00
sledgehammer999
27c641ffaa Rework the GUI code for private torrents. 2014-06-04 00:49:03 +03:00
Ivan Sorokin
32c203d2e6 Copyright notices for alert dispatcher. 2014-06-04 01:40:00 +04:00
sledgehammer999
a6fa27467f Fix previous commits. 2014-06-03 21:19:25 +03:00
Ivan Sorokin
c2a23f2265 use stats_alert in TorrentSpeedMonitor
Conflicts:
	src/qtlibtorrent/qbtsession.cpp
2014-06-02 00:35:27 +04:00
Ivan Sorokin
6f38616193 extract torrent statistics from torrent speed monitor to separate file 2014-06-02 00:31:45 +04:00
Ivan Sorokin
b50d7331c7 use post_status_update()
Conflicts:
	src/qtlibtorrent/qbtsession.cpp
2014-06-02 00:31:45 +04:00
Ivan Sorokin
eb46326d23 use set_alert_dispatch instead of timer to get an alerts from libtorrent
libtorrent allows setting a custom dispatch handler that is invoked in
libtorrent thread when new alerts are incoming. QAlertDispatcher is a
class that allows to translate these alerts to UI thread.

The concept is very simple:

1. On initialization QAlertDispatcher constructor calls set_alert_dispatch() passing
 QAlertDispatcher::dispatch as argument.

2. On deinitialization destructor calls set_alert_dispatch() passing a empty
 function. (line 25) libtorrent handles thos and switches back to queuing
 alerts in queue.

3. QAlertDispatcher::dispatch() adds alert to queue and notifies UI thread that new
 alerts are incoming. Enqueuing is done in function enqueueToMainThread().
 The invariant of class is the following:

    if alert queue is not empty, in message loop of UI thread contains a queued
    invocation of deliverSignal().

4. When message loop is pumped UI thread execute deliverSignal() function.
 It emit appropriate signal and if queue is still not empty (for example
 if slot doesn't grab alerts) rewind enqueuing to main thread.

This is a idea. But here is some details.

1. When QAlertDispatcher is destoyed, libtorrent still can call
QAlertDispatcher::dispatch a few times after destruction. This is
handled by passing a "tag". A tag is a object that references QAlertDispatch.
Tag could be invalidated. So on destruction QAlertDispatcher invalidates a tag
and then unsubscribes from alerts. When QAlertDispatcher::dispatch is called
with invalid tag it simply discard an alert.

    Therefore we could drop a few alerts during unsubscription. So we unsubscribe
    only at exit when missing some alerts is not a problem.

2. Another problem is in QBtSession::saveFastResumeData(). It pumps alert
queue synchronously. My first attempt was to destroy QAlertDispatcher
and then pump libtorrent queue. But as I was afraid of losing alerts I
supported synchronous querying of alerts in QAlertDispatcher.
(QAlertDispatcher::getPendingAlerts)

Conflicts:
	src/qtlibtorrent/qbtsession.cpp
2014-06-02 00:31:45 +04:00
Ivan Sorokin
329b754197 cache torrent_status 2014-06-02 00:31:42 +04:00
Ivan Sorokin
5af778bc93 don't make the same request to TorrentModelItem twice 2014-05-25 12:32:09 +04:00
Ivan Sorokin
1c98c11dd0 speed up icon loading 2014-05-25 12:32:09 +04:00
Ivan Sorokin
bbc4080a5d fewer calls to hash() 2014-05-25 12:32:09 +04:00
sledgehammer999
5d2663660d Count magnet links in the 'downloading' filter and make them prevent system inhibition. Closes #1558 2014-05-15 22:01:27 +03:00
sledgehammer999
659e0b7fef Fix tracker announcing problem(hit-and-run) when many torrents are being active. Closes #1571 2014-05-15 21:37:31 +03:00
sledgehammer999
c0b3ad7ee3 Fix crash when the selected torrent disappears from the transfer list. Closes #1661 2014-05-15 20:59:34 +03:00
sledgehammer999
81fa246687 Merge pull request #1685 from sorokin/fix-exception-in-prop-widget
Don't show availability bar for magnet links
2014-05-15 00:26:41 +03:00
Ivan Sorokin
765253234c Don't show availability bar for magnet links
This commit fixes an exception in PropertiesWidget:

"Caught exception in PropertiesWidget::loadDynamicData():  invalid
torrent handle used"

This exception occurs when an user clicks on a torrent that doesn't have
a metadata (when a magnet link is not resolved yet). One should not call
torrent_handle::get_torrent_info when torrent doesn't have a metadata.
2014-05-15 01:21:56 +04:00
sledgehammer999
e0ae505bb9 Fix nox build on MAC OSX. 2014-05-13 19:23:58 +03:00
sledgehammer999
5dea64ca16 Merge pull request #1676 from sorokin/fix-open-file
fix issue #1674: AddNewTorrentDialog is shown again and again even if checkbox "dont ask me again" is set
2014-05-12 14:52:47 +03:00
Ivan Sorokin
93bacc62f1 fix issue #1674: AddNewTorrentDialog is shown again and again even if checkbox "dont ask me again" is set 2014-05-11 19:37:33 +04:00
sledgehammer999
baaf575eee Fix libtorrent 1.0.0 compilation. Closes #1659 2014-05-10 00:13:20 +03:00
sledgehammer999
9714b2ede9 Fix weird ratio values when torrent was imported or downloaded history was lost due to crash. 2014-05-05 21:30:15 +03:00
sledgehammer999
f99f5f5c7e Enable system tray in MACOSX (Nick Korotysh). 2014-05-05 21:23:32 +03:00
sledgehammer999
32becf1fca Fix RSS feed icon. The tmp file gets deleted in the feed destructor. Closes #1639 2014-05-04 15:38:28 +03:00
sledgehammer999
4376e81f78 Fix autoupdater. Send our user-agent to sourceforge.net
Conflicts:
	src/programupdater.cpp
2014-05-04 15:38:12 +03:00
sledgehammer999
71e5c9e17b Fix code style.
(thanks to glassez)
2014-05-04 15:31:27 +03:00
sledgehammer999
e8c14f3507 Use the new Http classes. 2014-05-04 15:28:56 +03:00
sledgehammer999
6096506bd6 Implement alternatives to QHttpRequestHeader and QHttpResponseHeader. 2014-05-04 15:28:55 +03:00
sledgehammer999
ef3f7d18c9 Fix compilation with Qt5. 2014-05-04 15:28:54 +03:00
Vladimir Golovnev (Glassez)
ba1f4a9b7f Update QtSingleApplication. 2014-05-02 00:00:05 +03:00
Nick Tiskov
138c3dc3cb Fix translations bundled with Qt. 2014-05-02 00:00:04 +03:00
Vladimir Golovnev (Glassez)
ce3aac5f9d Fix functions and macros using to support both Qt4 and Qt5. 2014-05-02 00:00:03 +03:00
alfrix
85cfe464f9 Fix queue sorting order fixes #1120 2014-02-09 21:27:42 -03:00
sledgehammer999
33b0a2b55f Fix missing percentage signs. Closes #1392. 2014-02-06 00:49:17 +02:00
sledgehammer999
72ae2cb503 Pretty up last commit. 2014-02-05 21:22:14 +02:00
sledgehammer999
b2544f867c Merge pull request #1365 from alfrix/master
Add button for links in toolbar (fixes #450)
2014-02-05 21:19:57 +02:00
sledgehammer999
acb32d41fa Merge pull request #1375 from glassez/win-startup
Fix qBittorrent run on Windows startup.
2014-02-05 21:12:23 +02:00
bob23450
6b26adfed2 Fix nox build. Closes #1368 2014-02-05 09:17:27 +01:00
Vladimir Golovnev (Glassez)
64b06c4612 Fix qBittorrent run on Windows startup. 2014-02-03 21:12:47 +04:00
alfrix
494fc54e6f Add button for links in toolbar (fixes #450 2014-02-02 16:48:51 -03:00
sledgehammer999
f5cd39cfba Merge pull request #1328 from glassez/webui-sort
Fix WebUI sort by size/speed (part 2)
2014-02-02 10:12:01 -08:00
sledgehammer999
c59793b33f Correctly restore 'name' column width when loading magnet links in the 'Add new torrent dialog'. Closes #1334. 2014-02-02 20:05:51 +02:00
sledgehammer999
202006bdd1 Reuse code in AddNewTorrentDialog. #894. 2014-02-02 20:05:50 +02:00
sledgehammer999
7348b8903c Correctly resize 'name' column of the content tab. Closes #1360. 2014-02-02 20:05:14 +02:00
sledgehammer999
a27867ae2b Bring dialog boxes in the front when qbt doesn't have focus.
Code inspired by glassez patch.
2014-02-01 14:02:37 +02:00
Vladimir Golovnev (Glassez)
c3942fb0b3 Fix WebUI sort by ratio for some locales (with comma as decimal point). 2014-01-27 08:44:36 +04:00
Vladimir Golovnev (Glassez)
87d118e87c Fix WebUI sort by size/speed for some locales (with comma as decimal point). 2014-01-27 08:39:47 +04:00
sledgehammer999
a5a0ca7159 Don't re-announce to trackers when torrent is paused. Closes #1310. 2014-01-26 16:29:53 +02:00