Commit graph

2004 commits

Author SHA1 Message Date
Chocobo1
be4a1e7fd7
Suppress wrong print specifier
By removing unimportant debug message.
2022-05-08 16:46:36 +08:00
Chocobo1
a0a45333f1
Don't use old style casts 2022-05-08 14:53:27 +08:00
Chocobo1
e9d3928fe0
Store WebUI port setting in human readable number
Previously it was wrapped in QVariant type.

PR #16977.
2022-05-04 12:11:17 +08:00
Chocobo1
a1903e5d67
Delete unreachable code 2022-05-01 13:55:26 +08:00
summer
7b608fd0c9
Reduce the number of hashing threads by default
This seems to be the culprit responsible for slower hash rate in RC2_0 releases.
https://github.com/qbittorrent/qBittorrent/issues/16043#issuecomment-1113774868

PR #16951.
2022-05-01 12:30:25 +08:00
Chocobo1
19cbffb5e2
Remove artificial max limits from "Torrent Queueing" related options
Closes #16936.

PR #16942.
2022-04-30 12:26:18 +08:00
Chocobo1
9351f66c26
Add support for exporting .torrent data to buffer
Related: https://github.com/qbittorrent/qBittorrent/pull/16886#discussion_r855882018
PR #16931.
2022-04-27 12:29:00 +08:00
Vladimir Golovnev (Glassez)
1069bea273
Cache native torrent info to avoid extra blocking calls 2022-04-25 09:25:45 +03:00
Vladimir Golovnev (Glassez)
c740d105c9
Don't force update torrent status 2022-04-25 08:32:49 +03:00
Vladimir Golovnev (Glassez)
66a5a9863f
Fill torrent status with initial values when reload 2022-04-25 08:32:44 +03:00
Vladimir Golovnev (Glassez)
7ca47b8916
Delay event processing until status updated 2022-04-25 08:31:50 +03:00
Vladimir Golovnev (Glassez)
bcfa4866fe
Cache indexes of completed files
This avoids extra blocking calls to libtorrent.
2022-04-25 08:31:39 +03:00
Chocobo1
eba5a48abd
Merge pull request #16886 from Chocobo1/export
Add "Export .torrent" action
2022-04-24 12:43:13 +08:00
Chocobo1
a90ade0446
Add "Export .torrent" action 2022-04-23 15:11:09 +08:00
Vladimir Golovnev
359c4fef9d
Avoid dereferencing null pointers
PR #16896.
Closes #16884 and similar issues.
2022-04-19 13:52:56 +03:00
Chocobo1
71b1cb3b9c
Remove unused header 2022-04-19 11:35:51 +08:00
Vladimir Golovnev
613e9866aa
Merge pull request #16876 from glassez/blocking
Avoid some blocking calls to libtorrent

Under some conditions (when libtorrent is doing heavy work), blocking calls can wait quite a long time, thereby suspending the main application thread. In some cases, we can avoid this, since we have enough data to make the job without call to libtorrent. Although in some cases it may require a little more work to be done in the main thread, but overall responsiveness still benefits greatly in the end, especially when the libtorrent working thread is heavily loaded.
2022-04-16 19:27:41 +03:00
Chocobo1
bc937d38a2
Allow to set "working set limit" on non-Windows OS
PR #16874.
2022-04-16 11:36:58 +08:00
Vladimir Golovnev (Glassez)
35fcf39fc8
Add additional trackers without extra blocking call 2022-04-15 11:45:10 +03:00
Vladimir Golovnev (Glassez)
bd45dc5d0f Avoid some blocking calls to libtorrent 2022-04-14 15:22:32 +03:00
Vladimir Golovnev
7377974731
Improve path extension handling
PR #16867.
2022-04-14 09:43:07 +03:00
Chocobo1
a2b85ba1fd
Provide interface for Application class
PR #16864.
2022-04-14 12:04:58 +08:00
Chocobo1
3f762a416d
Use proper method for deferred calls 2022-04-12 16:23:39 +08:00
Chocobo1
189514c6de
Fix wrong v2 hash string displayed in WebUI
Previously `0000...` was erroneously displayed when v2 hash is absent,
now it correctly shows the `N/A`.

PR #16846.
2022-04-10 12:46:24 +08:00
Vladimir Golovnev
dded874350
Correctly apply content layout when "Skip hash check" is enabled
PR #16825.
2022-04-06 14:01:41 +03:00
Chocobo1
e42fa0e027
Merge pull request #16820 from Chocobo1/comparisons
Move comparison operator out of class
2022-04-06 13:35:34 +08:00
Vladimir Golovnev
0657238ad1
Don't forget to create 'download_path' field
PR #16468.
2022-04-05 07:27:11 +03:00
Chocobo1
39c34078d6
Move comparison operator out of class 2022-04-04 16:32:14 +08:00
Chocobo1
0eb6967bb2
Migrate away from unsigned integer types
Signed integers should be preferred in these cases.
2022-04-03 13:34:29 +08:00
Chocobo1
2854630b1c
Use signed integer type for counters 2022-04-03 13:33:55 +08:00
Vladimir Golovnev
df2d449f9b
Revamp content layout handling
Apply content layout only if desired file names aren't provided.
Remove helpers with confusing signatures.
Don't remove root folder twice.

PR #16724.
Closes #16259.
2022-04-01 09:35:45 +03:00
Chocobo1
7c1a986e61
Implement stringable interface for Version type 2022-03-26 13:58:25 +08:00
Chocobo1
c6b772da11
Improve function interface
`SettingsStorage` methods require `QString` so make `SettingValue` follow it.
`Path::operator+` can use `QStringView` to accept wider audience.
2022-03-26 12:41:02 +08:00
Chocobo1
4ca6de2b54
Revise string literal usage
PR #16703.
2022-03-26 11:53:50 +08:00
Chocobo1
bbd936fdfa
Don't use explicit memory management
And avoid dangling pointers.
2022-03-24 14:44:38 +08:00
Chocobo1
8a708fd97e
Use proper type to represent a path 2022-03-23 22:04:05 +08:00
Chocobo1
6c10aa33e1
Provide interface for serialization to string type
PR #16685.
2022-03-23 12:55:41 +08:00
AbeniMatteo
baa8d2c326
Add option to toggle filters sidebar
PR #15409.
2022-03-21 12:41:06 +08:00
Chocobo1
e1ca0f3ff9
Merge pull request #16669 from Chocobo1/literal
Use QString literals
2022-03-21 12:09:43 +08:00
Vladimir Golovnev
ca2be2f499
Prevent Digest32 shared data from being detached
Delayed hash string generation should not cause detaching of shared data.

PR #16664.
2022-03-20 12:26:13 +03:00
Chocobo1
efc04645b7
Use QString literals
It covers src/webui and enables `QT_NO_CAST_FROM_ASCII`.
2022-03-20 13:33:40 +08:00
Chocobo1
802ec5a14e
Use QString literals
This patch covers src/gui and some leftovers from previous commit.
2022-03-18 12:46:01 +08:00
Vladimir Golovnev
b3ca2ea179
Merge pull request #16573 from glassez/resume-data
Prevent loading resume data with inconsistent ID
2022-03-16 20:30:04 +03:00
Vladimir Golovnev (Glassez)
ce42f7c9f1
Properly handle metadata download for an existing torrent 2022-03-15 18:17:24 +03:00
Chocobo1
154ee1a73e
Use hashing helpers provided by Qt6 2022-03-13 17:37:54 +08:00
Chocobo1
b3fb6bd990
Avoid redundant hashing
The return type of `std::hash()` is larger (or equal) than what
`qHash()` requires so we can omit hashing it again.
2022-03-13 17:37:54 +08:00
Chocobo1
926d51839f
Update function signature for Qt6 qHash()
Since the `qhash()` signature has changed in Qt6.
2022-03-13 16:05:11 +08:00
Chocobo1
8de966ea88
Merge pull request #16585 from Chocobo1/qstring
Use QString literals
2022-03-12 12:49:08 +08:00
Chocobo1
85b0a40a0e
Merge pull request #16587 from jagannatharjun/tracker-filter
Optimize torrent filters in GUI
2022-03-12 12:48:49 +08:00
Aleksandr Cupacenko
1b53c590f2
Allow blank lines in multipart form-data input
Fixes #11298.
PR #16579.
2022-03-11 13:40:22 +08:00
Chocobo1
f0dd7b7dae
Use QString literals
This patch covers src/app and src/base folders.
Follow up of ab64ee872b.
2022-03-11 00:11:30 +08:00
Chocobo1
9f32e6e50d
Fix wrong parentheses
Fix up 294ea17222.
2022-03-08 13:58:02 +08:00
An0n
801cfdbc24
Allow setting the number of maximum active checking torrents
This is to allow re-checking of multiple torrents simultaneously. This will benefit users who
have multiple disks or SSD.
Closes #15296.

Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
2022-03-08 13:24:12 +08:00
Prince Gupta
ad6e2b4b94 Create hash string of Digest on demand
most of the time hash string is not needed and InfoHash is often used as
temporaries for torrent searching in handling of torrent alerts. This
improves the creation time of Infohash
2022-03-08 01:14:36 +05:30
Prince Gupta
30319e51e5 Improve Status Filter
replaces quadratic update operation with linear
2022-03-08 01:12:06 +05:30
Chocobo1
294ea17222
Provide upstream documentation link for performance warning 2022-03-07 13:26:37 +08:00
Chocobo1
fad954df18
Add option for enable/disable performance warnings from libtorrent 2022-03-06 21:05:17 +08:00
Prince Gupta
cd9ed1706d Improve torrent event handling in TrackerFiltersList 2022-03-06 12:04:01 +05:30
Vladimir Golovnev (Glassez)
cbc0ef860b
Prevent loading resume data with inconsistent ID 2022-03-04 09:22:56 +03:00
Chocobo1
ab64ee872b
Use QString literals
The plan is to define `QT_NO_CAST_FROM_ASCII` eventually.
PR #16561.
2022-03-04 13:25:22 +08:00
Vladimir Golovnev
213b18e33b
Merge pull request #16531 from glassez/save-path
Correctly handle changing of global save path
2022-03-01 19:59:35 +03:00
Chocobo1
ac97ed685f
Add tuning options related to performance warnings
Related: #16462.
PR #16538.
2022-03-01 12:44:48 +08:00
Vladimir Golovnev (Glassez)
c5ff9b353c
Allow to disable Automatic mode when "temp" path changed 2022-02-28 09:41:44 +03:00
Vladimir Golovnev (Glassez)
04c1988665
Correctly handle changing of global save path 2022-02-28 09:04:37 +03:00
Chocobo1
a21bff1dbd
Merge pull request #16483 from Chocobo1/preference1
Convert to QString literals
2022-02-22 14:15:49 +08:00
Chocobo1
14fc3dc9b3
Suppress conversion warning 2022-02-21 13:58:51 +08:00
Chocobo1
5cb295341c
Convert to QString literals 2022-02-21 13:58:51 +08:00
Chocobo1
b854c3b00e
Unify log messages format
This improves readability and may allow users to match log message with
better accuracy.
Now log message is consisted of 2 parts:
The first part is a short sentence describing the event. It should avoid
writing out the specifics of the event as it will be described in the
next part of the message. The sentence should use correct tense of the
event.
The second part consist of `Name: Value` pairs which will provide
sufficient info for the event.

Note that none of the message parts is mandatory, one of them can be
omitted when the resulting log message is clear enough.

PR #16437.
2022-02-21 13:07:04 +08:00
Vladimir Golovnev
2d3ff6a97c
Use std::optional to represent "any value" filters
PR #16460.
2022-02-20 13:17:34 +03:00
Vladimir Golovnev
70ec183fca
Merge pull request #16444 from glassez/path-has-ext
Improve performance of checking path extension
2022-02-19 07:08:54 +03:00
Vladimir Golovnev (Glassez)
1e45b7f50b
Add fast way of removing suggested extension 2022-02-18 11:37:51 +03:00
Vladimir Golovnev (Glassez)
293479a1f2
Improve performance of checking path extension 2022-02-18 11:37:51 +03:00
Chocobo1
852a14992c
Add literal operator to efficiently construct QString in Qt5
PR #16448.
2022-02-18 11:28:04 +08:00
Vladimir Golovnev
b3f5bf1583
Try to recover missing categories
PR #16430.
2022-02-16 10:27:36 +03:00
Chocobo1
bc94de5626
Merge pull request #16428 from Chocobo1/path
Improve Path constructor
2022-02-14 14:02:50 +08:00
Vladimir Golovnev
c3a64b3d6c
Cache file priorities
Speedup access to file priorities by avoiding extra blocking call to libtorrent thread.
Improve the Torrent interface by hiding the asynchrony of file priority changes behind the scenes.

PR #16425.
2022-02-13 08:07:30 +03:00
Chocobo1
70eed10a34
Fix wrong size
Fix up cf96e6c642.
2022-02-12 16:54:38 +08:00
Chocobo1
56c3983885
Improve Path constructor performance 2022-02-12 16:54:38 +08:00
Vladimir Golovnev
78eaa49cd6
Correctly register PathList alias
PR #16411.
2022-02-10 08:12:33 +03:00
Chocobo1
2668a42f0c
Merge pull request #16408 from Chocobo1/vararray
Use QVarLengthArray whenever applicable
2022-02-10 12:44:41 +08:00
Vladimir Golovnev
4a7f1116ac
Improve tracker status handling
PR #16383.
2022-02-09 18:23:41 +03:00
Chocobo1
610009fb7f
Make Path::operator== a free function 2022-02-09 19:00:27 +08:00
Chocobo1
4cb075b168
Use "table look-up" method for reversing byte
This method takes constant time and is less prone to (CPU) pipeline stalling due to less
computation. Also it is slightly faster than the previous method.
2022-02-09 19:00:27 +08:00
Chocobo1
cf96e6c642
Use QVarLengthArray whenever applicable 2022-02-09 19:00:24 +08:00
Vladimir Golovnev
dd1bd8ad10
Implement class for handling filesystem paths
PR #15915.
2022-02-08 06:03:48 +03:00
Vladimir Golovnev
facfa26eed
Allow to use Category paths in "Manual" mode
If the option is enabled any relative save path will be resolved against an appropriate Category path instead of Global default one.

PR #16330.
2022-02-02 09:24:09 +03:00
Prince Gupta
0012a3ede7
Optimize completed files handling
PR #16329.

Co-authored-by: Vladimir Golovnev (Glassez) <glassez@yandex.ru>
2022-02-01 08:29:54 +03:00
Prince Gupta
414361a3db
Improve tracker error handling
* Improve tracker error handling
* Fix typo in function name

PR  #16298.
2022-01-30 08:56:31 +03:00
Prince Gupta
1d4071d6d8
Don't rename file because of difference in path separator
PR #16317.
2022-01-30 08:54:37 +03:00
Chocobo1
7a910a8cc1
Merge pull request #16256 from Chocobo1/bitarray
Speed up bitfields conversion
2022-01-28 11:59:57 +08:00
Vladimir Golovnev
ca9e5e8531
Change torrent moving state when it is cancelled
PR #16267.
2022-01-27 07:40:17 +03:00
Chocobo1
aafee60033
Allocate memory on stack whenever feasible
The fast path gives another 20% speed up than the slower path.
2022-01-27 03:36:06 +08:00
Vladimir Golovnev (Glassez)
7a539d9890
Store hybrid torrents using "torrent ID" as basename 2022-01-25 11:39:32 +03:00
Vladimir Golovnev (Glassez)
c40408b337
Make Digest32 implicitly shared class 2022-01-25 10:18:23 +03:00
Chocobo1
4e2daf117b
Speed up bitfields conversion
The old code took 3~5 times longer than the newer version.
2022-01-25 12:19:50 +08:00
Chocobo1
9553afc3c2
Merge pull request #16247 from Chocobo1/count_bits
Speed up piece relevance calculation
2022-01-25 12:11:36 +08:00
Vladimir Golovnev
26352c9eb4
Cache pieces info
PR #16238.
2022-01-25 06:05:16 +03:00
Chocobo1
53992bf0d5
Initialize class variable in initializer list 2022-01-24 13:47:34 +08:00
Chocobo1
ff99e5ac9a
Speed up piece relevance calculation
For ~800 pieces, this roughly cuts the run time (of this function) in
half.
2022-01-24 12:04:26 +08:00
Vladimir Golovnev
4d54fb675f
Correctly handle received metadata
It did not work correctly, since it assumed that 'lt::torrent_plugin' is created at an earlier stage and is able to track all changes in the torrent state, but in reality it turned out that it was created after the torrent moved to the `downloading_metadata` state, so we had to additionally handle it in the constructor.

PR #16121.
2022-01-16 16:06:15 +03:00
Chocobo1
e93de54eb5
Merge pull request #16099 from Chocobo1/errormsg
Revise error message
2022-01-15 12:01:55 +08:00
Vladimir Golovnev
43441d8291
Handle missing torrent alerts
PR #16085.
2022-01-14 15:18:18 +03:00
Chocobo1
5ebbed8160
Revise error message
Remove the period mark at the end of error message since
`errc.message()` already contains one.
2022-01-14 14:48:41 +08:00
Vladimir Golovnev
5f623e32c4
Correctly handle XML parsing errors
PR #16071.
2022-01-13 09:36:08 +03:00
Chocobo1
e4a67183bd
Update default value of "Type of service for peers"
Upstream change:
3d701c7380
PR #16036.
2022-01-12 11:53:07 +08:00
Vladimir Golovnev
a3be239a60
Keep "torrent info" alive while generating .torrent file
PR #16018.
2022-01-11 07:29:42 +03:00
Vladimir Golovnev
709a053c7c
Merge pull request #16009 from glassez/dont-move-into-itself
Don't try to move storage into its current location
2022-01-11 07:26:22 +03:00
Vladimir Golovnev
d39c6bef4b
Correctly handle Auto TMM in Torrent Files Watcher
PR #13690.
2022-01-11 07:25:30 +03:00
Vladimir Golovnev
84a8158aa2
Correctly track the root folder name change
PR #16004.
2022-01-11 07:24:24 +03:00
Vladimir Golovnev (Glassez)
fbc85bed64
Move torrent immediately when "save path" is changed 2022-01-10 08:18:34 +03:00
Vladimir Golovnev (Glassez)
52b54fe154
Don't try to move storage into its current location 2022-01-09 21:14:49 +03:00
Vladimir Golovnev
f44341a8e2
Handle .!qB extension behind the scenes
PR #15920.
2022-01-08 08:45:50 +03:00
thalieht
d3bdeaab3f
Replace "seeding_duration" with "finished_duration" everywhere
Closes #10223.
PR #13601.
2022-01-07 15:22:51 +08:00
sledgehammer999
d6fc020ba7
Bump to 4.5.0alpha1 2022-01-06 20:47:06 +02:00
sledgehammer999
ac5a485651
Disambiguate the data type 2022-01-04 01:39:01 +02:00
sledgehammer999
0a1c61d9d3
Merge pull request #15922 from glassez/fix-paths
Correctly concatenate path components
2022-01-04 00:17:54 +02:00
Chocobo1
01a0fff4c2 Add missing field initial value
Suppresses the following warning:
qBittorrent/src/base/bittorrent/categoryoptions.cpp: In static member function ‘static BitTorrent::CategoryOptions BitTorrent::CategoryOptions::fromJSON(const QJsonObject&)’:
qBittorrent/src/base/bittorrent/categoryoptions.cpp:44:59: warning: missing initializer for member ‘BitTorrent::CategoryOptions::DownloadPathOption::path’ [-Wmissing-field-initializers]
   44 |         options.downloadPath = {downloadPathValue.toBool()};
2022-01-03 23:42:48 +02:00
Vladimir Golovnev (Glassez)
fdbf8cb0ee
Correctly concatenate path components 2022-01-03 19:44:47 +03:00
Vladimir Golovnev
61504ae3b1
Merge pull request #15793 from glassez/save-path
Redesign "Incomplete folder" feature
2022-01-02 22:25:00 +03:00
Vladimir Golovnev (Glassez)
1c0f8b4289
Redesign "Incomplete folder" feature
Change "Incomplete/temp folder" term with "download folder".
Allow to set "download folder" per torrent (in manual mode) and per category (in automatic mode).
2022-01-01 20:58:49 +03:00
Chocobo1
63043b4927
Replace min, max, clamp functions with std counterparts 2022-01-01 15:22:07 +08:00
Chocobo1
3ea4c66d41
Replace QPair with std::pair 2022-01-01 15:22:07 +08:00
Chocobo1
781d7fbf1a
Merge pull request #15884 from Chocobo1/migrate
Migrate "setting key mappings" to upgrade code
2021-12-25 14:05:52 +08:00
Chocobo1
39f054eef6
Migrate "setting key mappings" to upgrade code 2021-12-24 14:50:06 +08:00
Chocobo1
7a620c794d
Fix garbage message when reporting error
PR #15883.
2021-12-24 12:28:22 +08:00
Vladimir Golovnev
5347897b7d
Merge pull request #15852 from glassez/torrent-info
Improve torrent content handling
2021-12-20 08:54:46 +03:00
Vladimir Golovnev (Glassez)
62b50d1475
Make TorrentInfo immutable 2021-12-19 16:16:16 +03:00
Chocobo1
aedd997604
Don't expire connection when there are data in buffer
For writing, this ensures expire handler won't be executed in a small
time window, that is after `m_socket->write()` and before
`QIODevice::bytesWritten()` signal.
For reading, this let the socket to have the chance to process the
received data instead of dropping it.

PR #15849.
2021-12-18 12:28:30 +08:00
Chocobo1
87e1a14a4b
Merge pull request #15831 from Chocobo1/server
Improvements for WebAPI server
2021-12-16 13:38:05 +08:00
Chocobo1
ad9d0608d4
Avoid needless string-bytes conversion
This saves a few microseconds.
2021-12-14 13:52:34 +08:00
Chocobo1
3c5688c6f6
Reserve enough buffer space according to response content size 2021-12-14 13:52:34 +08:00
Chocobo1
ece92a886a
Restart idle timer on sending network response 2021-12-14 13:52:33 +08:00
Chocobo1
85777ea491
Simplify tray icon related code 2021-12-13 15:56:20 +08:00
Chocobo1
1c52fff1cc
Unify value loading paths
The idea is to try load every intermediate value from the base case and
then convert them to their respective type.
2021-12-11 01:45:49 +08:00
Chocobo1
2d48581570
Move main window setting to its own section 2021-12-11 01:45:49 +08:00
Chocobo1
b8a7ecfe69
Introduce versioning on main configuration file 2021-12-11 01:45:49 +08:00
Vladimir Golovnev
3d7ff9765a
Make meaning of "torrent root path" consistent
PR #15816.
2021-12-09 06:12:47 +03:00
Chocobo1
28f2def21f
Remove redundant layer of QVariant in Preferences class
PR #15812.
2021-12-07 12:17:37 +08:00
Chocobo1
e3fe66d3ec
Store enum type in settings directly
Affected settings will be migrated to new keys so nothing should break.

PR #15800.
2021-12-06 13:53:52 +08:00
OctopusET
ab5605d54b
Use proper string for Korean language
PR #15799.
2021-12-01 12:06:05 +08:00
Chocobo1
19d95ebd10
Add comment for qHash implementation requirements
As clazy report false-positive on this.
2021-11-29 01:28:49 +08:00
Chocobo1
c8b66b25e8
Avoid potential container detachment
Suppress clazy warning:
warning: Don't call QList::operator[]() on temporary [-Wclazy-detaching-temporary]
2021-11-29 00:31:03 +08:00
Chocobo1
e6f07a6fe4
Use implicit copy-constructor generated by compiler
This also suppresses the following clang warning:
warning: definition of implicit copy assignment operator for 'Version<unsigned short, 2>' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy]
2021-11-29 00:30:17 +08:00
Chocobo1
d78b2a569f
Fix handling when Content-Length field is absent
Closes #15754.
PR #15757.
2021-11-21 11:48:49 +08:00
Chocobo1
71270260bf
Reformat code 2021-11-08 13:34:21 +08:00
Chocobo1
22abbc1d41
Store Qt6 table header states under a different key 2021-11-08 13:34:21 +08:00
Chocobo1
32698fe0be
Migrate away from low-level SettingsStorage class
Also add `QFlags<T>` support to `SettingsStorage`.
PR #15693.
2021-11-08 13:23:33 +08:00
Chocobo1
49976bcd83
Merge pull request #15648 from Chocobo1/lockfile
Create lock file in config folder instead of temp folder
2021-11-03 12:15:22 +08:00
Chocobo1
7aa859a442
Don't use deprecated statfs64() on macOS (#15661)
Co-authored-by: Nick Korotysh <kolchaprogrammer@list.ru>
Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
2021-11-02 10:41:09 +08:00
Chocobo1
180deb867a
Use char array directly
This eliminates the possibility of reassigning the pointer to another
address.
2021-11-01 14:08:49 +08:00
Vladimir Golovnev
cc61ad01b6
Explicitly set "added time" when adding new torrent
Don't overwrite "added time" with possibly incorrect value.
Explicitly set "added time" when adding new torrent.

PR #15644.
2021-10-31 12:08:19 +03:00
sledgehammer999
8a44c1f6d5
Bump to 4.4.0rc1 2021-10-31 02:56:25 +03:00
Vladimir Golovnev
4f20769a6c
Use respective subcategory for "watched" torrents
Assign respective Subcategory of configured Category to torrents
if Automatic Torrent Management Mode is set for Watched folder.

PR #15603.
2021-10-22 05:51:11 +03:00
Chocobo1
e45e29b431
Avoid type specifier mismatch
Qt5 uses `int` and Qt6 uses `qsizetype`, so use the stream version of
`qDebug()` to avoid specifying types.
2021-10-14 00:24:41 +08:00
Vladimir Golovnev
5d5b0d572e
Merge pull request #15536 from glassez/expected
Don't use output parameters for error handling
2021-10-10 15:04:55 +03:00
Vladimir Golovnev (Glassez)
78459fcb31
Don't throw exception in TorrentInfo::saveToFile() 2021-10-09 08:54:20 +03:00
Vladimir Golovnev (Glassez)
41fc0fd084
Don't use output parameters for error handling 2021-10-09 08:54:03 +03:00
Chocobo1
03cb51844b
Remove redundant define
NOMINMAX is already defined in build scripts.
2021-10-08 11:11:02 +08:00
Chocobo1
6b06cc9216
Log error message in DownloadHandlerImpl class 2021-10-08 11:07:35 +08:00
Chocobo1
6b49323f05
Improve error message reporting 2021-10-08 11:01:48 +08:00
Chocobo1
4a11fab2b1
Add constexpr to Sample class functions 2021-10-08 01:04:58 +08:00
Vladimir Golovnev
bc71827c01
Improve torrent content handling
Hide .pad files.

PR #15468.
2021-10-02 21:42:58 +03:00
Vladimir Golovnev (Glassez)
86b1ac5d7c
CMake: Allow to build with Qt6 2021-10-02 09:23:49 +03:00
Chocobo1
5cf39a2970
Reuse code path
`buf.f_type` should be compatible across platforms.
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/statfs.2.html
2021-09-27 22:40:25 +08:00
Chocobo1
1c9321d5a1
Add remote filesystem magic numbers 2021-09-27 22:22:36 +08:00
Chocobo1
1c343a444b
Remove redundant const specifier 2021-09-21 17:19:38 +08:00
Chocobo1
1c9696b68e
Suppress function unused warning 2021-09-21 17:18:50 +08:00
Chocobo1
ecd23d0abd
Merge pull request #15459 from Chocobo1/i18n
Revise description wordings
2021-09-19 13:29:08 +08:00
Chocobo1
010d1b5ff8
Merge pull request #15419 from Chocobo1/file
Improve error detection when saving files
2021-09-19 13:28:47 +08:00
Chocobo1
03012cc175
Revise description wordings 2021-09-18 12:59:07 +08:00
Vladimir Golovnev
b2e0e25f1c
Merge pull request #15451 from glassez/profile
Improve Profile handling
2021-09-15 19:11:22 +03:00
Chocobo1
9673be17cb
Improve handling when writing to temporary files
Let QTemporaryFile remove incomplete written file when error occurs.
"XXXXXX" template is not strictly required according to Qt doc.
2021-09-15 23:25:27 +08:00
Chocobo1
fa8786e230
Flush manually when saving a file
This is to work around https://bugreports.qt.io/browse/QTBUG-75077
2021-09-15 23:15:33 +08:00
Chocobo1
21f72baae2
Use QSaveFile wherever applicable
expected.hpp was fetched from:
b803e3c07b/include/nonstd/expected.hpp
2021-09-15 21:54:44 +08:00
jagannatharjun
a734199383
Fix startup with different profiles 2021-09-12 10:59:20 +03:00
Vladimir Golovnev (Glassez)
046b741700
Improve Profile handling
Add Profile::rootPath and Profile::configurationName properties.
2021-09-12 10:58:48 +03:00
Chocobo1
ce0b6f0d56
Merge pull request #15450 from Chocobo1/pr_15303
Fix code defects
2021-09-12 12:56:33 +08:00
Chocobo1
6de0622c1a
Merge pull request #15444 from Chocobo1/guard
Prevent self-assignment in assignment operator
2021-09-12 12:56:17 +08:00
gxcreator
307f5e6e56
Initialize member fields 2021-09-11 11:53:41 +08:00
Chocobo1
2efd4f2a77
Prevent self-assignment in assignment operator 2021-09-09 21:42:46 +08:00
Vladimir Golovnev
90296b3ef0
Add "Skip hash check" option for watched folders
Closes #15388.
PR #15433.
2021-09-09 07:00:51 +03:00
Chocobo1
81139c0098
Improve error detection when saving files 2021-09-05 12:20:22 +08:00
jagannatharjun
314f92f2d8 Use DownloadRequest::destFileName for downloading RSS feed icons 2021-09-04 12:02:38 +05:30
jagannatharjun
8b5db328ec Add DownloadRequest::destFileName 2021-09-04 12:02:38 +05:30
sledgehammer999
2b501904cf
Bump to 4.4.0beta3 2021-08-29 01:53:02 +03:00
Vladimir Golovnev
b823d74ac3
Use "old file path" provided by libtorrent
Until libtorrent provided an "old_name" field in `file_renamed_alert` we relied
on a workaround with storing old file names to remove empty leftover folders.
PR #15356.
2021-08-23 07:29:50 +03:00
sledgehammer999
3e92e716b2
Merge pull request #15294 from sledgehammer999/accept_v2_infohash
Accept v2 infohashes for download
2021-08-08 12:29:04 +03:00
Chocobo1
138c911ef4
Add compile definition to indicate using of libtorrent 2.0 (#15297)
The compile definition is temporary which will be removed when qbt
ditches libtorrent 1.x.
2021-08-08 13:27:22 +08:00
sledgehammer999
e5fe6401a0
Accept v2 infohashes for download
Partially fixes #15287
2021-08-07 17:25:13 +03:00
Vladimir Golovnev
bed643e627
Delay processing of watched folders (#15282)
Fixes regression of #14882.
Closes #15272.
2021-08-07 12:33:29 +03:00
Sylvain Finot
e87f8f5b93
Expose SSRF mitigation (#15247) 2021-08-04 11:28:36 +08:00
sledgehammer999
1d26f4c5f7
Bump to 4.4.0beta2 2021-08-03 23:15:27 +03:00
Chocobo1
ce554e6c77
Merge pull request #15229 from Chocobo1/port
Use spinbox special value to represent "Use any available port"
2021-07-30 15:19:08 +08:00
AbeniMatteo
e4730191db
Set default file priorities when not specified (#15190) 2021-07-29 12:20:03 +08:00
Chocobo1
49aab492e0
Use spinbox special value to represent "Use any available port"
WebAPI functionality is preserved (deprecated) for now and should be
removed in the future.
2021-07-29 11:50:52 +08:00
Chocobo1
09e558ae0b
Revise checkbox label for "Use any available ports" functionality
Also reorder the checkboxes a bit.
2021-07-27 13:35:18 +08:00
Vladimir Golovnev
1eb246c98b
Merge pull request #15181 from glassez/qt5
Raise minimum Qt version to 5.15.2
2021-07-23 06:22:57 +03:00
Chocobo1
96e0c0df20
Improve handling for magnet URI (#15209)
This add support for magnets URI in v2 hash format.
2021-07-22 13:05:59 +08:00
Vladimir Golovnev
ed4570cb4d
Store minimal metadata for "restore torrent" purposes (#15191)
We can no longer save valid torrent files in the general case, because
for torrents of version 2, we need a full merkle tree to do it, but if
a torrent is added from magnet link, full merkle tree may not be available
even before the end of downloading all the data. Actually, we don't need
the full torrent file for the purposes of resuming the torrent, so we can
allow libtorrent to produce only a minimal part of the metadata as part
complete resume data, but we still want to store it in a separate file,
so we extract the resulting metadata from the complete resume data before
saving and merge it together before loading.
2021-07-19 07:59:06 +03:00
AbeniMatteo
01d851440b
Add "Forced metadata downloading" state (#15185) 2021-07-17 21:33:14 +03:00
AbeniMatteo
e5943b64c1
Add filter "Checking" to side panel (#15166) 2021-07-16 14:08:10 +03:00
Vladimir Golovnev (Glassez)
399d3ad85a
Replace QStringRef with QStringView 2021-07-15 10:56:49 +03:00
Vladimir Golovnev
699b91ab8d
Properly create "clean path" for watched folder (#15179) 2021-07-12 11:44:52 +03:00
Vladimir Golovnev (glassez)
27baa55443
Raise minimum Qt version to 5.15.2 2021-07-09 07:41:13 +03:00
Chocobo1
fd3d4d479a
Suppress type narrowing warning on MSVC
Fix up 45e31a153c.
2021-07-08 14:25:39 +08:00
Chocobo1
45e31a153c
Reserve space for vector 2021-07-07 14:20:27 +08:00
Chocobo1
7c23d800e6
Use underlying_type member directly
`LTUnderlyingType` served as a intermediate type for libtorrent 1.1 and
1.2 and is obsoleted now.
Also add helper to convert to underlying type.
2021-07-07 14:19:17 +08:00
Vladimir Golovnev
5d03917877
Use torrent info with hashes for creating .torrent file (#15138) 2021-07-04 09:29:34 +03:00
Vladimir Golovnev (Glassez)
d2f975a0f3 Don't forget to start "watch timer" 2021-07-02 08:34:31 +03:00
Chocobo1
eedd47860a
Merge pull request #15142 from Chocobo1/warning
Use proper signed number type
2021-07-01 11:35:04 +08:00
Chocobo1
365554d064
Use proper signed number type
This also suppress the compiler warning:
src/base/bittorrent/torrentimpl.cpp:228:36: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const size_t’ {aka ‘const long unsigned int’} [-Wsign-compare]
2021-06-29 18:04:33 +08:00
Chocobo1
70d1cb86fd
Disable move constructor where it is sensible 2021-06-29 14:49:45 +08:00
FranciscoPombal
ccb7c0d579 Raise minimum libtorrent version to 1.2.14 (2.0.4)
- Also update vcpkg to latest commit: includes libtorrent 1.2.14,
Qt 5.15.2, and Qt 6.1.1
2021-06-28 23:04:47 +01:00
Andrei Stepanov
5157e4965a
Remove excess space 2021-06-27 13:01:03 +04:00
sledgehammer999
3ffd25f9e1
Bump to 4.4.0beta1 2021-06-26 21:05:44 +03:00
Vladimir Golovnev
37f227ae74
Provide v1 and v2 infohashes in UI (#15097) 2021-06-25 20:44:23 +03:00
HiFiPhile
f5315d9ba7
Add WebUI reverse proxy source IP resolution (#15047)
Co-authored-by: qix67
Co-authored-by: HiFiPhile <admin@hifiphile.com>
2021-06-23 09:01:36 +03:00
Vladimir Golovnev (Glassez)
124cc9621d Delete LoadTorrentParams when load torrent failed 2021-06-22 21:36:42 +03:00
Vladimir Golovnev (Glassez)
3faa7226e7 Handle exception when torrent file cannot be exported
Both `lt::create_torrent` constructor and `lt::create_torrent::generate()`
can throw an exception so we need to handle it to prevent the app from crashing.
2021-06-22 21:36:42 +03:00
Vladimir Golovnev (Glassez)
6070b41c9b Properly add torrent with new tags
First, an attempt is made to add new tags to the Session.
Closes #15105.
2021-06-18 06:29:15 +03:00
Vladimir Golovnev
5c0378a684
Merge pull request #15029 from glassez/qt-5.14
Raise minimum Qt version to 5.14
2021-06-14 16:48:15 +03:00
Kacper Michajłow
ccb59fbad3
Suppress C4267 conversion warnings (#13307)
- warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data

Caused by mismatch between size_type of std and Qt containers. It is safe to cast to int as all of those containers hold low number of objects.
2021-06-11 08:51:06 +03:00
Vladimir Golovnev (Glassez)
6c66d02aff Declare AbstractFileStorage destructor virtual 2021-06-10 09:19:04 +03:00
Vladimir Golovnev (Glassez)
97c7f3bc67
Raise minimum Qt version to 5.14 2021-06-03 08:56:41 +03:00
LoneDev
d335f263f3
Fix comment typo in algorithm.h (#15030) 2021-05-29 11:30:47 +08:00
Vladimir Golovnev (Glassez)
b6a35e9477
Don't log any error when "queue" file doesn't exist 2021-05-27 18:27:41 +03:00
Vladimir Golovnev (Glassez)
6aa8251b98
Provide correct error description in "upload mode" 2021-05-27 18:27:40 +03:00
sledgehammer999
34be8c9213
Merge pull request #14934 from sledgehammer999/translations
Update Qt translations and add new qbt translations
2021-05-23 21:59:29 +03:00
Chocobo1
40f6201509
Merge pull request #14976 from Chocobo1/options
Add `connection_speed` to advanced settings
2021-05-23 14:27:34 +08:00
zhuangzi926
2e8e2b04a1
Announce to all trackers if IP changed (#15001)
Closes #14545.
2021-05-23 14:26:54 +08:00
Chocobo1
c64e433a69
Remove unused parameter 2021-05-21 14:44:19 +08:00
Chocobo1
e21f46d824
Avoid data duplication 2021-05-21 14:38:06 +08:00
Chocobo1
ef79546508
Add connection_speed to advanced settings
Now we follow libtorrent current default value 30.
Closes #6973.

Also bump WebAPI version.
2021-05-21 14:37:57 +08:00
Vladimir Golovnev (Glassez)
2993fdb169
Improve "Watched folders" feature
Make "file system watcher" an application core component
and separate it from its presentation model.
2021-05-19 15:42:41 +03:00
Vladimir Golovnev (Glassez)
9565b695ef
Unify custom exceptions 2021-05-18 08:40:05 +03:00
Vladimir Golovnev (Glassez)
89cedd411e
Allow add torrents with relative save path
The relative save path will be resoloved against the default one.
2021-05-18 07:43:53 +03:00
An0n
ea3b897d5d
Bump file pool size (#14966) 2021-05-14 08:57:01 +08:00
sledgehammer999
2c47cfbe25
Add new languages
* Mongolian
* Persian
* Thai
2021-05-07 22:53:13 +03:00
Chocobo1
a82ca6adb2
Fix potential data race
This case could be considered benign however it could still be an
undefined behavior to the compiler, so remove it.

Ref:
https://hacks.mozilla.org/2021/04/eliminating-data-races-in-firefox-a-technical-report/
2021-05-07 15:50:33 +08:00
Chocobo1
05e3e46f5a
Throw the exact (same) exception 2021-05-07 15:49:19 +08:00
Chocobo1
c9a552c89c
Merge pull request #14861 from Chocobo1/warnings
Initialize struct members by default
2021-05-02 11:26:30 +08:00
Vladimir Golovnev (Glassez)
383eaf44ac
Implement DBResumeDataStorage class 2021-05-01 12:30:53 +03:00
Chocobo1
bdf2f6c3e1
Initialize struct members by default
This is to suppress the following compilation warnings:
base/bittorrent/magneturi.cpp: In constructor ‘BitTorrent::MagnetUri::MagnetUri(const QString&)’:
base/bittorrent/magneturi.cpp:87:60: warning: missing initializer for member ‘BitTorrent::TrackerEntry::message’ [-Wmissing-field-initializers]
   87 |         m_trackers.append({QString::fromStdString(tracker)});
2021-04-27 11:48:13 +08:00
Chocobo1
fdc186c92f
Revise tag related implementations
Fix #12690.
2021-04-27 11:47:52 +08:00
Vladimir Golovnev
376dedebb1
Merge pull request #14816 from glassez/tracker-entry
Improve "tracker entries" handling
2021-04-22 19:03:49 +03:00
Vladimir Golovnev (Glassez)
75e0990eb3
Provide tracker peers count via TrackerEntry
Don't expose additional accessor in Torrent interface.
2021-04-21 08:46:05 +03:00
Vladimir Golovnev (Glassez)
62a6c725d6
Don't overwrite tracker message
Use one of the tracker endpoint messages.
2021-04-21 08:45:09 +03:00
Vladimir Golovnev (Glassez)
d4554c2e5c
Correctly handle "no enough disk space" error
If torrent failed to write, it stops downloading and goes to
"upload mode" instead of errored state so it just keeps seeding.
Now qBittorrent indicates this state as "errored" and allows
the user to manually bring the torrent out of this state.
2021-04-21 08:27:56 +03:00
Chocobo1
cb8d6a0939
Reorder peer flags
Now we group related flags nearby.
2021-04-18 12:46:07 +08:00
Chocobo1
e38128119c
Capitalize "peer flags" descriptions
And use a helper function to build the descriptions.
2021-04-18 12:45:18 +08:00