Commit graph

1173 commits

Author SHA1 Message Date
Chocobo1
e7e5ee1ea2
Add const to TransactionalSettings class functions 2019-09-08 14:38:14 +08:00
Chocobo1
daf52a2610
Avoid double lookups 2019-09-08 14:28:38 +08:00
Mike Tzou
d2c21ce507
Merge pull request #11195 from Chocobo1/mac
Replace deprecated macro
2019-09-07 11:58:23 +08:00
Chocobo1
7113174593
Treat .magnet file extension as case insensitive
Closes #11200.
2019-09-06 12:30:50 +08:00
Chocobo1
0d5b0b9542
Replace deprecated macro
Q_OS_MAC is deprecated and the replacement is Q_OS_MACOS.
2019-09-05 20:16:18 +08:00
Chocobo1
9dc3b18178
Fix filename validation on non-Windows OS
Closes #11191.
2019-09-05 20:05:21 +08:00
Chocobo1
2396ef5bd6
Move error logging of adding peers to the proper place 2019-09-04 16:09:24 +08:00
Chocobo1
3104291734
Add check for null pointer
Fix up d657c87243.
2019-09-03 22:26:41 +08:00
Mike Tzou
4363082173
Merge pull request #11104 from Chocobo1/resume
Fix unable to remove web seeds
2019-09-03 12:12:56 +08:00
Chocobo1
2a66bb3127
Construct QHostAddress more efficiently 2019-09-01 22:33:01 +08:00
Chocobo1
4aab44e779
Always save info dict when saving fastresume
Otherwise torrents loaded from fastresume won't have it and needs
to redownload it from elsewhere and slowing down the startup process.
This is also required for the future where we will drop loading the
`info` dict from .torrent files.
2019-08-31 22:59:33 +08:00
Chocobo1
d657c87243
Fix unable to remove web seeds
As suggested in post [1] we don't need to assign the `ti` field anymore when fastresme
already contains the `info` dict.

[1]: https://github.com/arvidn/libtorrent/issues/3946#issuecomment-523300003
2019-08-31 22:52:22 +08:00
Mike Tzou
62a3938480
Merge pull request #11085 from Chocobo1/model
Better on-demand reloading of torrent data
2019-08-30 12:45:57 +08:00
Mike Tzou
7ce26435bd
Merge pull request #11126 from Chocobo1/addedTime
Fix wrong "added on" date
2019-08-28 12:04:23 +08:00
Chocobo1
09503b58fa
Clean up loadTorrentResumeData() 2019-08-27 15:01:50 +08:00
Chocobo1
f3ce76110b
Simplify code
Instead of using dict_find_list() now we use the simpler dict_find()
since we are going to check its validness anyway.
2019-08-27 15:01:50 +08:00
Chocobo1
3a11c23efd
Fix wrong "added on" date
This only happens for magnet links when its metadata has yet to be retrieved.
Closes #11124.
2019-08-27 15:01:50 +08:00
Chocobo1
0891cd4878
Avoid unecessary copying the parameter
Using forwarding reference here so that we won't get unnecessary copies
of the parameter passed to `slot`, for example a lambda function.
2019-08-27 14:30:03 +08:00
Mike Tzou
5c7f9530ee
Merge pull request #11060 from Chocobo1/tracker
Improve embedded tracker
2019-08-22 12:18:56 +08:00
Chocobo1
8d0d8e4dcb
Improve embedded tracker
Now it conforms to BEPs more closely.
2019-08-21 18:05:50 +08:00
Chocobo1
bbecf87292
Handle invalid time activity properly
When there is no activity before m_nativeStatus.last_upload will be 0
and this commit will map it to -1 which retain the expected behavior as
before (libtorrent < 1.2 era).
2019-08-21 17:45:04 +08:00
Chocobo1
1f3bf75fff
Better on-demand reloading of torrent data 2019-08-17 15:44:16 +08:00
Chocobo1
94f7a095bb
Implement proper equal operators 2019-08-16 01:35:41 +08:00
Mike Tzou
767f024585
Merge pull request #7475 from thalieht/ratiosuperseed
Add option to enable Super Seeding mode once ratio/time limit is reached. Closes #7160.
2019-08-10 11:33:09 +08:00
thalieht
1f6f1716ad Enable Super Seeding mode once ratio/time limit is reached 2019-08-09 13:06:34 +03:00
Chocobo1
6ac36368cd
Update user agent string 2019-08-09 13:12:11 +08:00
Mike Tzou
2427f5d324
Merge pull request #11041 from Chocobo1/splitRef
Revise operations in TorrentHandle class
2019-08-09 12:27:44 +08:00
Chocobo1
c420ff29af
Revise operations in TorrentHandle class 2019-08-08 18:57:54 +08:00
Chocobo1
b5b678c58f
Replace QString::split() by faster alternatives 2019-08-08 18:57:54 +08:00
Chocobo1
672b44acba
Let OS assign listening port
This applies when "Use different port on startup" option is selected.
2019-08-08 13:14:25 +08:00
Chocobo1
c19f8f6b5e
Use a randomized port number for the first run 2019-08-08 13:14:23 +08:00
Mike Tzou
7f1bff4eb4
Merge pull request #11017 from Chocobo1/apictrl
Improvements to APIController class
2019-08-06 10:17:27 +08:00
Chocobo1
d92bf13706
Use a QString directly instead of QStringList 2019-08-05 20:56:16 +08:00
Chocobo1
e90a2c00a5
Replace QList by QVector 2019-08-05 20:56:15 +08:00
Chocobo1
f4e7b8c6bf
Replace QMap with QHash 2019-08-05 09:51:39 +08:00
Mike Tzou
3811612f80
Merge pull request #10982 from Chocobo1/cleanup
Code base cleanup
2019-07-31 14:24:42 +08:00
Chocobo1
c1659a189b
Fix messed up symbols in log 2019-07-31 02:10:22 +08:00
Chocobo1
3ab2fe907f
Remove Windows XP remnants 2019-07-31 02:10:22 +08:00
Chocobo1
38fa6d2aee
Fix incomplete file extension not applied for new torrents 2019-07-28 13:05:46 +08:00
Chocobo1
7ab3479a34
Replace static_cast by qOverload 2019-07-26 22:32:18 +08:00
Chocobo1
ca44b40222
Move variables to the proper scope 2019-07-26 22:32:18 +08:00
Chocobo1
ccec50e18e
Improve parsing in BitTorrent::PeerAddress::parse 2019-07-24 22:22:02 +08:00
Vladimir Golovnev
02ab77053e
Merge pull request #10961 from glassez/fastresume
Save updated resume data for completed torrents
2019-07-23 18:47:30 +03:00
Vladimir Golovnev
cf2e7d77d6
Merge pull request #10950 from glassez/drop-deprecated
Don't use deprecated libtorrent features
2019-07-23 09:19:15 +03:00
Vladimir Golovnev (Glassez)
4021a0c7ce
Store libtorrent native file index in QHash 2019-07-23 06:43:39 +03:00
Vladimir Golovnev (Glassez)
3d70ebfc46
Save updated resume data for completed torrents
If fastresume data was rejected we need to save updated
resume data after torrent finishes rechecking.
2019-07-23 06:32:13 +03:00
Vladimir Golovnev (Glassez)
ad6a40d5f4
Extract PeerAddress class into separate file 2019-07-23 06:27:35 +03:00
Vladimir Golovnev (Glassez)
b822d2c380
Fix requested torrent resume data handling
Session should increase an appropriate counter each time
the torrent resume data is requested to save.
2019-07-22 14:22:26 +03:00
Vladimir Golovnev (Glassez)
60ffa3030e
Don't use deprecated libtorrent features 2019-07-21 19:28:28 +03:00
Chocobo1
4a90716843
Add override keyword to functions 2019-07-19 11:58:56 +08:00
Chocobo1
7a5e883cd2
Revise inline keyword usage
And let compiler decide whether to inline functions.
2019-07-16 18:42:55 +08:00
Chocobo1
f6f8aaf3db
Put internal function into anonymous namespace 2019-07-16 18:42:26 +08:00
Chocobo1
f993230582
Use uniform initialization 2019-07-16 18:42:26 +08:00
Vladimir Golovnev
17541b0d34
Merge pull request #10921 from glassez/ignore-actions
Ignore some actions on uninitialized torrents
2019-07-15 08:44:42 +03:00
Vladimir Golovnev (Glassez)
87d98403f4
Don't break torrent checking 2019-07-14 12:34:50 +03:00
Vladimir Golovnev (Glassez)
9462685c78
Ignore some actions on uninitialized torrents
Some actions can lead to an inconsistent state if applied
to an uninitialized torrent, so we just ignore them.
2019-07-14 12:34:28 +03:00
Vladimir Golovnev
b9da9ebfdf
Merge pull request #10910 from glassez/fix-add-torrent
Avoid race conditions when adding torrent
2019-07-14 10:45:05 +03:00
thalieht
7b31868e3c Rename priority to queue in the context of torrents 2019-07-13 14:04:16 +03:00
Vladimir Golovnev (Glassez)
644dc9792d
Avoid race conditions when adding torrent 2019-07-13 12:06:07 +03:00
Mike Tzou
24932f6cb6
Merge pull request #10895 from Chocobo1/tracker
Add dialog to mass edit torrent's tracker
2019-07-12 10:59:50 +08:00
Chocobo1
9e7f50517e
Add "Tracker entries" dialog 2019-07-11 12:10:19 +08:00
Mike Tzou
51fa98aa0b
Merge pull request #10702 from jagannatharjun/qss-styling
Allow Styling through QSS
2019-07-10 19:32:19 +08:00
Prince Gupta
a24925c858 Allow styling with QSS stylesheets 2019-07-09 19:56:55 +05:30
Vladimir Golovnev (Glassez)
9399b876eb
Fix torrent checking issues
Start all torrents auto-managed to prevent simultaneous checking
of multiple torrents.
Handle checking state of paused torrent to prevent it from being
resumed when qBittorrent is closed until checking isn't complete.
2019-07-09 08:54:50 +03:00
Chocobo1
b9094ff8a5
Use proper log message when there are no error 2019-07-05 23:46:12 +08:00
Chocobo1
664cfe7d69
Fix torrent properties not saved for paused torrents 2019-07-05 23:46:12 +08:00
Chocobo1
c4dbe84832
Use newer libtorrent API 2019-07-05 23:46:12 +08:00
Chocobo1
ed2199b91c
Add "File pool size" option 2019-07-03 18:06:07 +08:00
Chocobo1
6286bc716c
Add "Socket backlog size" option
The default value in libtorrent is 5 which is too small nowadays.
The new default value 30 is chosen to be in line with
QTcpServer::maxPendingConnections().
2019-07-03 17:36:56 +08:00
Chocobo1
73cf3fb68f
Use LogMsg() helper 2019-07-02 22:34:22 +08:00
Chocobo1
e6c448aa4f
Replace obsoleted QProcess::finished(int)
It is replaced by QProcess::finished(int, QProcess::ExitStatus).
2019-07-01 19:08:37 +08:00
Chocobo1
2bc91fba3e
Use newer libtorrent API 2019-06-28 20:36:31 +08:00
Chocobo1
0b1b3c1f84
Use numeric_limits instead of constants from C
In C++, using numeric_limits is more idiomatic compared to using constants.
2019-06-23 11:16:58 +08:00
Chocobo1
042cd4267f
Remove upper limit of "Disk cache" setting 2019-06-22 17:13:24 +08:00
Mike Tzou
1831f71cc4
Merge pull request #10833 from Chocobo1/invokeMethod
Use functor based QMetaObject::invokeMethod
2019-06-22 11:24:47 +08:00
Prince Gupta
ece70daaa5 Fix CMake Windows compilation 2019-06-21 18:05:19 +05:30
Chocobo1
11fdf91196
Suppress compiler warning
The debug message is emitting a format mismatch warning.
Fixup 4880dc812c.

And add curly brackets to if statement.
2019-06-21 00:32:12 +08:00
Chocobo1
e31c1ca780
Use functor based QMetaObject::invokeMethod 2019-06-20 11:36:38 +08:00
Chocobo1
4880dc812c
Use appropriate type 2019-06-19 18:52:24 +08:00
Chocobo1
516c968373
Support year unit in userFriendlyDuration() 2019-06-19 18:52:24 +08:00
Chocobo1
a6c5a90630
Remove redundant variable 2019-06-19 18:52:24 +08:00
Chocobo1
3b015db77d
Add comparison operators for ProxyConfiguration 2019-06-19 18:52:24 +08:00
Chocobo1
623210df58
Improve handleFileErrorAlert error message 2019-06-19 18:52:23 +08:00
Vladimir Golovnev (Glassez)
8e65317d61
Rename "fromNativePath" to "toUniformPath"
Unlike "toNativePath" which name clearly reflects the function result
"fromNativePath" has no such clear meaning.
Since this function converts path into uniform format "toUniformPath"
is better name.
2019-06-17 15:55:49 +03:00
Mike Tzou
206bb018dd
Merge pull request #10801 from Chocobo1/timeout
Add WebAPI session timeout settings
2019-06-17 00:18:01 +08:00
Mike Tzou
46d445d042
Merge pull request #10792 from Chocobo1/rename2
Remove empty leftover folders after rename properly
2019-06-16 12:22:22 +08:00
Chocobo1
a64f3bbc6a
Reorder if conditions slightly 2019-06-15 19:08:24 +08:00
Chocobo1
9893a415c0
Fix updated save path not saved for paused torrents 2019-06-15 19:08:23 +08:00
Chocobo1
7d860b6c24
Log save_resume_data_failed_alert 2019-06-15 19:08:23 +08:00
Chocobo1
4e87aebf55
Don't remove parent directories
QDir::rmpath removes *all* parent directories while QDir::rmdir removes
the specified directory.
2019-06-15 19:08:23 +08:00
Chocobo1
440860c4a9
Properly remove empty leftover folders after rename
TorrentInfo::origFilePath will return the very original path from
.torrent file, not the most recent file path before the rename operation
and thus the code would not be working as we expected.
2019-06-15 19:08:23 +08:00
Chocobo1
89124bdcc8
Add WebAPI session timeout settings
Raise default timeout to 1 hour.
2019-06-15 18:57:19 +08:00
silverqx
4f4f435e76
Add zlib version to GUI & stackdump 2019-06-12 08:02:24 +02:00
Chocobo1
8191f1498a
Log file rename failed errors 2019-06-09 19:07:43 +08:00
Mike Tzou
63b0a5b78c
Merge pull request #10775 from Chocobo1/speed
Misc. improvements
2019-06-09 01:57:20 +08:00
Mike Tzou
c95650c4f3
Merge pull request #10752 from thalieht/fw-declare
Forward declare and remove some unused #include
2019-06-06 10:18:26 +08:00
Chocobo1
431e7179ac
Remove redundant variable 2019-06-06 00:20:57 +08:00
Chocobo1
fbd5699786
Use switch statement 2019-06-06 00:15:09 +08:00
thalieht
70f8882f87 Group Qt forward declarations separately from the others 2019-06-04 17:48:55 +03:00
thalieht
9995967fbf Remove some unused #include 2019-06-04 17:48:55 +03:00
thalieht
4370a7eb12 Forward declare in a few places 2019-06-04 17:48:55 +03:00
Vladimir Golovnev
6f6033cf1c
Merge pull request #10754 from glassez/fix-magnet
Disable "Upload mode" when start preloaded torrent. Closes #10751
2019-06-04 10:56:11 +03:00
Vladimir Golovnev (Glassez)
b644d6685f
Disable "Upload mode" when start preloaded torrent 2019-06-04 07:14:21 +03:00
Vladimir Golovnev (Glassez)
4ae4ae3cfc
Fix wrong indentation 2019-06-04 06:55:45 +03:00
Vladimir Golovnev (Glassez)
2c145fa57c
Fix incorrectly set torrent startup flag 2019-06-04 06:53:17 +03:00
Mike Tzou
b8e205c048
Merge pull request #10741 from Chocobo1/limit
Fix speed limit not applying to IPv6 peers
2019-06-04 11:09:16 +08:00
Vladimir Golovnev
ecb4a76db7
Merge pull request #10742 from glassez/fix-rss
Ignore RSS articles with non-unique identifiers
2019-06-03 17:26:57 +03:00
Vladimir Golovnev (Glassez)
68ee071331
Ignore RSS articles with non-unique identifiers 2019-06-02 13:30:00 +03:00
Vladimir Golovnev (Glassez)
d710bbd9ef
Perform more RSS parsing in working thread 2019-06-02 13:29:41 +03:00
Chocobo1
411b956009
Fix speed limit not applying to IPv6 peers
`TORRENT_USE_IPV6` is not used by libtorrent 1.2 anymore.
2019-06-02 15:00:27 +08:00
Chocobo1
3f2ce8a2b7
Remove unused stats_alert handler
Fixup 0fe9cd05c4.
2019-06-01 11:43:00 +08:00
Chocobo1
39830986c2
Use alert's timestamp
This way has better accuracy than running our own timer.
2019-06-01 11:40:23 +08:00
Chocobo1
0fe9cd05c4
Avoid using deprecated stats_alert
From libtorrent doc:
This alert has been superseded by calling post_torrent_updates() regularly on the session object.
2019-05-31 10:58:23 +08:00
Mike Tzou
db88c2d6a5
Merge pull request #10721 from Chocobo1/sort
Fix wrong comparison result
2019-05-31 10:50:55 +08:00
Mike Tzou
bb3634c382
Merge pull request #10711 from Chocobo1/alert
Log performance alerts from libtorrent
2019-05-31 10:50:03 +08:00
Vladimir Golovnev (Glassez)
05fd0b5859
Fix sequential downloading when redirected 2019-05-29 15:50:02 +03:00
Chocobo1
36cf689432
Fix wrong comparison result
The QString::toInt() might overflow when the string is long.

Closes #10706.
2019-05-29 00:03:04 +08:00
Chocobo1
45bafab4e0
Log performance alerts from libtorrent 2019-05-27 14:46:33 +08:00
Chocobo1
9232dd30dc
Sort function declarations 2019-05-27 09:29:59 +08:00
Chocobo1
1b0ffd7781
Fix wrong logic
The error is caused by silly copy-paste error.
Fixup 09ff735007.
2019-05-25 14:55:27 +08:00
Chocobo1
09ff735007
Use newer libtorrent API
This commit covers trackerentry.cpp only.
2019-05-25 11:22:57 +08:00
Chocobo1
ed6bb0efdc
Replace QList by QVector for tracker related operations 2019-05-22 12:57:22 +08:00
Chocobo1
cb4c53c848
Follow the type used in libtorrent 2019-05-19 18:51:09 +08:00
Chocobo1
e92209475e
Use range-based for loops 2019-05-19 18:51:09 +08:00
Chocobo1
10e1c35998
Avoid unnecessary double lookup 2019-05-19 12:06:18 +08:00
Chocobo1
c75500670d
Use forwarding reference when passing function objects
So instead of passing every function objects by value (a copy is made), now function objects
will be handled properly by reference (for lvalues) or by value (for rvalues).
2019-05-19 12:06:18 +08:00
Chocobo1
6738cdd715
Constify exception references 2019-05-19 12:06:18 +08:00
Chocobo1
e288de7ec1
Forward declare as much as possible 2019-05-19 12:06:18 +08:00
Chocobo1
401bdbf3d9
Remove unused functions 2019-05-19 12:06:18 +08:00
Chocobo1
ff707ea5af
Change splitToViews() return type to QVector 2019-05-19 12:06:18 +08:00
Mike Tzou
3d6dccc689
Merge pull request #10627 from Chocobo1/alg
Improve removeIf() to support other types
2019-05-16 10:45:55 +08:00
Chocobo1
459cdf6071
Fix assertion fail
When fileSize == 0, the second index could be smaller than the first index,
thus trigger the assert check in IndexInterval constructor.

Closes #10611.
2019-05-15 10:22:21 +08:00
Evgeny Lensky
62c72091ce
Change "Add new torrent" dialog to horizontal layout 2019-05-14 11:03:56 +08:00
Chocobo1
c6f3da1097
Improve removeIf() to support set types
We can now replace QMutable*Iterator by removeIf() which usage is more consistent with other
algorithm functions.
2019-05-14 01:26:01 +08:00
Chocobo1
5aaf040300
Remove libtorrentfwd.h 2019-05-13 11:20:42 +08:00
Chocobo1
3955eef50d
Change to lt namespace
Quoting from libtorrent doc:
> In the future, libtorrent will be the alias and lt the namespace name.
2019-05-13 11:20:41 +08:00
Chocobo1
4b263f057d
Use newer libtorrent API
This commit covers session.cpp only.
2019-05-13 11:20:41 +08:00
Chocobo1
677a419f0b
Use upstream defined namespace
`lt` namespace is defined since libtorrent 1.1.6 and our master branch requires >= 1.1.10,
so there is no need to add #if condition for it.
2019-05-13 11:20:41 +08:00
Vladimir Golovnev
af7d8f6a43
Merge pull request #10514 from Mataniko/rss-enclosure-type
Download RSS "enclosure" element if no proper MIME type is found
2019-05-11 13:31:46 +03:00
Chocobo1
bd8d70bf60
Refactor HTTP query parsing 2019-05-09 12:41:30 +08:00
Chocobo1
69d29af097
Fix '+' char not decoded to space correctly
Closes #10606.
2019-05-09 11:17:41 +08:00
Matan Bareket
bd2d636bb5 Download RSS enclosure element if no proper MIME type is found
In the case where an RSS feed doesn't have the "enclosure" element
with type "application/x-bittorrent", fallback to the last enclosure
element which has no "type" attribute.
2019-05-08 13:46:13 -04:00
Chocobo1
ae793b7395
Use upstream defined namespace alias 2019-05-06 20:26:15 +08:00
Chocobo1
56434fc8b9
Replace obsoleted QDateTime::fromTime_t() 2019-05-06 20:26:15 +08:00
Chocobo1
3f962ba336
Fix displaying invalid creation date
The bug is only observed when using libtorrent 1.2.
2019-05-06 20:26:14 +08:00
Chocobo1
3f10ac55a3
Migrate to update-to-date libtorrent functions 2019-05-06 20:26:14 +08:00
Chocobo1
aaed5f7fe0
Remove unused headers 2019-05-01 11:09:25 +08:00
Chocobo1
44e4a5b13a
Avoid performance penalty from type erasure
On average the affected code path is 0.1% faster and the result binary
is 10 KB smaller.
2019-05-01 11:09:25 +08:00
Mike Tzou
7db2d1b8cf
Merge pull request #10492 from Chocobo1/server
Remove closed connections immediately
2019-04-16 12:25:40 +08:00
Mike Tzou
c7f89f55d0
Merge pull request #10473 from Chocobo1/warning
Fix unsafe type narrowing (MSVC C4267 warning)
2019-04-16 12:23:30 +08:00