Commit graph

178 commits

Author SHA1 Message Date
Vladimir Golovnev
71af105a89
Avoid copying resume data when loading torrents
PR #22899.
2025-06-23 12:20:01 +03:00
Vladimir Golovnev
526abdf7ce
Avoid data copying when prepare resume data
PR #22812.
2025-06-06 08:59:39 +03:00
Vladimir Golovnev
0729c9a2f8
Handle libtorrent alerts in SessionImpl only
PR #22798.
2025-06-03 08:18:12 +03:00
Vladimir Golovnev
d29f47c36e
Revamp adding torrents to libtorrent session
PR #22648.
2025-05-08 16:31:02 +03:00
Vladimir Golovnev (Glassez)
ab04064adc
Store AddTorrentParams inside alert handlers 2025-05-07 06:52:33 +03:00
Vladimir Golovnev (Glassez)
9afbd47b52
Assign add_torrent_alert handler when adding torrent 2025-05-07 06:52:33 +03:00
Vladimir Golovnev (Glassez)
582dc99cae
Don't access libtorrent session directly from TorrentImpl 2025-05-07 06:52:33 +03:00
Vladimir Golovnev (Glassez)
3691eb948e
Join the similar code paths 2025-05-07 06:52:33 +03:00
Vladimir Golovnev (Glassez)
76bb4e5f98
Add helpers to get InfoHash from libtorrent classes 2025-05-07 06:52:23 +03:00
Vladimir Golovnev
6cd6267c26
Fix ratio handling
PR #22638.
2025-05-01 14:18:18 +03:00
Vladimir Golovnev
e7dee969e1
Remove dubious seeding time max value
PR #22624.
2025-05-01 08:57:10 +03:00
Vladimir Golovnev
c2f2a38582
Call QPromise::start() early to avoid race condition
PR #22617.
2025-04-28 18:04:35 +03:00
Vladimir Golovnev
732b2bcbdb
Provide asynchronous results via QFuture
Makes asynchronous logic to look more straightforward.
Allows caller to choose blocking or non-blocking way of obtaining asynchronous results via the same interface.

PR #22598.
2025-04-27 16:24:07 +03:00
Vladimir Golovnev
33aaa867b5
Drop support of Qt 6.5
PR #22599.
2025-04-27 16:21:20 +03:00
Kostiantyn Chernenok
fc5daf6e1d
Clamp seeding time limit in session
Add clamping for seeding and inactive seeding time limit on setting from dialog and loading from config.

Closes #21953.
PR #22558.

Signed-off-by: Kostiantyn <kos.chernenok@gmail.com>
2025-04-20 16:34:04 +08:00
Vladimir Golovnev
15069b2643
Fix the torrent relocates files when switching to "manual" mode
PR #22564.
Closes #22283.
Closes #22546.
2025-04-16 10:23:34 +03:00
Chocobo1
ff03eeab5b
Show info hash in log when added a duplicate torrent
Closes #22161.
PR #22505.
2025-04-08 16:31:04 +08:00
Vladimir Golovnev
4bd50672e8
Improve add torrent error handling
PR #22468.
2025-03-25 09:13:15 +03:00
Chocobo1
b28c229f85
Add control for 'hostname resolver cache expiry interval'
Also add a few missing units in WebUI.

Closes #22267.
PR #22439.
2025-03-17 19:40:06 +08:00
Chocobo1
5a4b3b25d3
Use slice method where applicable
These code segments already have its boundary checked and can thus be faster.

PR #22411.
2025-03-15 14:58:59 +08:00
Vladimir Golovnev
d174bc75e4
Show free disk space in status bar
PR #22407.
Closes #19607.
2025-03-13 14:47:10 +03:00
Chocobo1
8da43a4054
Use const accessor
This avoids an unnecessary check to the container internal atomic variable and prevents
potential detachment.

PR #22280.
2025-02-16 15:51:40 +08:00
Maxime Thiebaut
4406a3f173
Add announce_port support
The `announce_port` setting permits to overwrite the port passed along to trackers as the `&port=` parameter. If left as the default, the listening port is used. This setting is only meant for very special cases where a seed's listening port differs from the effectively exposed port (e.g., through external NAT-PMP). See https://github.com/arvidn/libtorrent/pull/7771 for an example use-case.

This PR adds the relevant setting alongside the existing `announce_ip` setting.

PR #21692.
2025-02-08 16:12:50 +08:00
Chocobo1
82d90e599c
Preserve allocated buffer capacity
PR #22138.
2025-01-12 21:01:39 +08:00
Hanabishi
68ecb13d14
Change URL seed error message
Current URL seed error message assumes that only possible error is DNS lookup failure, which is not true.
So replace it with a more generic message. Real reason is provided by the 'Error:' part.

PR #22119.
2025-01-10 08:31:28 +03:00
Thomas Piccirello
4fc36b9e99
Support fetching tracker list from URL
Trackers specified at the URL will be added to newly added public torrents.

This feature is adapted from qBittorrent-Enhanced-Edition to allow for automatically adding trackers retrieved from a URL. @ngosang's trackerlist repo is a good example, however I've opted not to include a default URL.

Partially addresses #14535.
PR #21828.
2025-01-08 14:51:09 +08:00
Chocobo1
22e156e0af
Simplify captured variable type
By capturing the specific data instead of torrent handle the lambda can become non-mutable.

PR #22102.
2025-01-06 18:22:43 +08:00
Chocobo1
efe06f133d
Revise DHT bootstrap node list
Discussion:
https://github.com/qbittorrent/qBittorrent/pull/21296#issuecomment-2562341328
https://github.com/qbittorrent/qBittorrent/pull/21296#issuecomment-2561373010

PR #22081.
2024-12-31 13:34:08 +08:00
Vladimir Golovnev
eb2eea8d34
Avoid race condition when update tracker entries
PR #21995.
2024-12-15 14:07:36 +03:00
Chocobo1
a311c259cc
Use proper data type for elapsed time
PR #21963.
2024-12-08 17:02:20 +08:00
Vladimir Golovnev
a180162405
Avoid redundant requests of announce entries from libtorrent
PR #21949.
2024-12-06 19:59:45 +03:00
Vladimir Golovnev
d90a9d15ac
Avoid using QDateTime for announce timestamps
PR #21906.
2024-11-27 21:03:54 +03:00
Vladimir Golovnev
15ea836bb9
Avoid repeatedly creating the same QDateTime values
PR #21904.
2024-11-26 09:04:59 +03:00
Chocobo1
92daca1fef
Avoid redundant string length scan
PR #21807.
2024-11-11 19:19:10 +08:00
Thomas Piccirello
f89c4c32ed
Display External IP Address in status bar
This change displays the last detected IPv4 and/or IPv6 address(es) in the GUI and WebUI's status bar. This does not yet handle systems with multiple addresses of the same type (e.g. multiple IPv6 addresses).

PR #21383.

---------

Co-authored-by: Odin Vex <44311901+OdinVex@users.noreply.github.com>
2024-11-09 15:58:13 +08:00
Vladimir Golovnev
33e3fb2f46
Correctly handle "torrent finished" events
PR #21786.
Closes #21699.
2024-11-08 11:45:57 +03:00
Vladimir Golovnev
75d1ac8889
Optimize conversion of time points from libtorrent to Qt clocks
Obtain current date time of Qt and libtorrent clocks only once
for processing entire current libtorrent alerts bunch.

PR #21764.
2024-11-05 16:43:43 +03:00
Chocobo1
051d7137ea
Use proper macro for unreachable switch cases
Those are the `default` cases which are not expected to hit (nor reachable) normally.

When the code is compiled with release mode and it reaches `Q_UNREACHABLE()`, it becomes
undefined behavior. So it rely on the developers to catch the errors in debug mode.
The upside of this is that the `switch` statement will be more optimized than not using it.
This also means the statements after `Q_UNREACHABLE()` isn't important. It allow anything to
preserve the intention of the code.

This macro is preferred over C++23 `std::unreachable` because it will automatically insert a
`Q_ASSERT(false)` with it.

PR #21752.
2024-11-05 11:55:55 +08:00
Vladimir Golovnev
b462a2bf0c
Reset tracker entries when pause the session
PR #21738.
2024-11-04 16:27:21 +03:00
Vladimir Golovnev
4805afc1a2
Correctly apply filename filter when !qB extension is enabled
PR #21628.
Closes #21624.
2024-10-19 13:36:03 +03:00
Vladimir Golovnev
8e941a06f1
Correctly handle "torrent finished after move" event
PR #21596.
Closes #21576.
2024-10-14 11:51:30 +03:00
Chocobo1
21b0367629
Avoid heavy weight function object
Also, by switching to template we can avoid the cost of converting to some specific type and
perfectly forward the parameter to the final function.

PR #21572.
2024-10-12 15:15:39 +08:00
Vladimir Golovnev
2d857b6200
Disable "Move to trash" option by default
PR #21528.
2024-10-10 14:13:40 +03:00
Chocobo1
9e5433bcf8
Add name to threads
This help identifying threads when debugging.
The naming scheme is using 'class/function name + variable name'.
Note that the length limitaion is 16 chars on linux. On Windows, the limit is 32767 chars.

PR #21403.
2024-10-06 15:23:50 +08:00
stalkerok
e75bcbed6d
Remove non-working DHT bootstrap nodes
router.utorrent.com has been dead for a long time. router.bittorrent.com died about a month or two ago. dht.aelitis.com doesn't work either. It is no longer possible to get DHT nodes from them.
Added router.silotis.us. Only ipv6!

PR #21296.
2024-10-05 16:45:29 +08:00
Hanabishi
b5b34c9ff4
Add "Simple pread/pwrite" disk IO type
PR #21300.
2024-10-01 19:58:35 +03:00
Burnerelu
e06b7f8f4d
Enable customizing the save statistics time interval
This change extends the Advanced section of the Preferences menu with a new field, allowing changing the time statistics save interval. A zero value will prevent recurrent saving.

This aims to provide the feature requested in issue #21285.

PR #21291.
2024-09-16 17:16:59 +08:00
Vladimir Golovnev
d9bc7935eb
Apply "merge trackers" logic regardless of way the torrent is added
PR #21299.
2024-09-06 16:28:22 +03:00
Vladimir Golovnev
5ef2a1df07
Use QList explicitly
PR #21016.
2024-07-04 08:30:39 +03:00
Vladimir Golovnev
4e27e88f6a
Allow to move content files to Trash instead of deleting them
PR #20252.
2024-06-29 08:21:35 +03:00