Commit graph

9937 commits

Author SHA1 Message Date
Vladimir Golovnev (Glassez)
f978b3a002
Perform settings upgrade for existing user only 2020-03-24 16:14:30 +02:00
Nick Korotysh
2f70d273b4
Use SVG image for WebUI favicon
This will allow browsers to get high quality icon with required
resolution instead of resizing some small raster image.
Browsers can have even more benefit from it. For example, Firefox uses
high resolution icon to display it in "Top Sites" instead of page
preview.

Nothing changes for browsers which doesn't support SVG favicons, older
PNG icon will be used in such case.
2020-03-24 16:14:29 +02:00
Chocobo1
2289bf4005
Fix singleton class ownership
We shouldn't allow Qt parent ownership in here.
2020-03-24 16:14:28 +02:00
NotTsunami
0cd4900e92
Remove redundant null checks
Attempting to delete a null pointer is a noop in C++.

Closes #2864.

[1] https://isocpp.org/wiki/faq/freestore-mgmt#delete-handles-null
2020-03-24 16:14:28 +02:00
Chocobo1
0ad8dc39e5
Let ReverseResolution always return/emit a result 2020-03-24 16:14:27 +02:00
Chocobo1
60d133ca6d
Speed up lookup time
By adding another variable we can get O(1) lookup time instead of O(n).
Fix up 5f415c292d.
2020-03-24 16:14:26 +02:00
Chocobo1
000a726e20
Manually abort lookup on class destruction
Some lookup might take longer so instead of waiting them, we abort them
manually.
2020-03-24 16:14:26 +02:00
Chocobo1
4006818520
Improve ReverseResolution class
* Use QHostAddress type for IP
* Avoid double lookup
* Use larger cache size
2020-03-24 16:14:25 +02:00
thalieht
756bc3da54
Show any multiple connections from the same IP in peer list
The uniqueness of peers is now determined by their
IP, port and connection type (uTP etc.) instead of just their IP
2020-03-24 16:14:24 +02:00
Chocobo1
fbb01a36e6
Use systematic approach to generate hash
The basic idea is to hash each class member and then mix them with xor
operation.
However the `seed` must be handled with care, it should only be
introduced once when mixing the hashes of each class member, otherwise
under some circumstances the `seed` might xor with itself and thus break
the intended effect.
2020-03-24 16:14:24 +02:00
Chocobo1
21922ed3b4
Revise qHash function
Instead of xor and narrowing the integers ourselves, now we let qHash()
from Qt do the job properly.
2020-03-24 16:14:23 +02:00
Chocobo1
43fe5214d2
Use faster hash function
qHash(QString) will need to hash/loop through all the data while the new
code will only need one memcpy() and a few bit manipulations.
2020-03-24 16:14:22 +02:00
Vladimir Golovnev (Glassez)
ab6079e0d5
Track settings changed event in TransferListModel 2020-03-24 16:14:22 +02:00
Vladimir Golovnev (Glassez)
dc0b1ce227
Fix hide zero values 2020-03-24 16:14:21 +02:00
Sakib-Abrar
1db12e4421
Show "∞" instead of " -1" in Preferences 2020-03-24 16:14:20 +02:00
Vladimir Golovnev (Glassez)
b160b56306
Redesign torrent startup handling 2020-03-24 16:14:20 +02:00
NotTsunami
0e6627b0f6
CMake: Fix WebUI checks
When the CMake system was last revamped, the configure variable was
changed from WEBUI to DISABLE_WEBUI, but we are still checking
against WEBUI. This behavior was changed in fa770871e9
2020-03-24 16:14:19 +02:00
NotTsunami
33390bf463
CMake: Remove glibc version detection
If we were conditionally enabling _BSD_SOURCE or _SVID_SOURCE, I can
understand trying to play nice with the compiler and only pass as
needed, however this is not the case and glibc <= 2.19 will not care
that we are passing _DEFAULT_SOURCE. This removes an unnecessary
build step and gives us less to maintain from a build system
perspective.

Small cosmetic changes to MacroQbtCompilerSettings are included.
2020-03-24 16:14:18 +02:00
NotTsunami
2a6ddffb22
CMake: Remove duplicate MSVC check
As of this commit, L98 of winconf.cmake already checks for MSVC
before winconf-msvc calls this macro, so we are guaranteed to be
satisfy the check.
2020-03-24 16:14:17 +02:00
Prince Gupta
06c09f0113
Reorganize UI theme selection 2020-03-24 16:14:17 +02:00
Chocobo1
db258f7461
Migrate away from deprecated settings
Libtorrent has deprecated `upnp_ignore_nonrouters` in
https://github.com/arvidn/libtorrent/pull/4251
2020-03-24 16:14:16 +02:00
NotTsunami
81cec1930b
CMake: Remove additional debugging compiler flags
Our previous setup lead to two unintended consequences:

* Debug flags were included in both release and debug builds instead
of just debug builds
* Clang doesn't support -gX (where X is the level of debugging
optimization), but we checked for -Og support instead

This commit avoids both of these scenarios by removing the additional
flags altogether. Partial resolution to #11856.
2020-03-24 16:14:15 +02:00
NotTsunami
7444227c9a
WebUI: Use correct operators in logical expressions
As suggested in https://github.com/qbittorrent/qBittorrent/pull/11825#discussion_r365557626
2020-03-24 16:14:15 +02:00
FranciscoPombal
07196571e8
Add piece_extent_affinity to AdvancedSettings
Expose option in WebUI settings and WebAPI.

Requires WebAPI version bump.

Closes #11436.
2020-03-24 16:14:14 +02:00
Denis
b083bd78e7
WebUI: Fix first row renaming in files tab
Ids started from zero and first row converts to false.
Closes #11826.
2020-03-24 16:14:13 +02:00
Vladimir Golovnev (Glassez)
e75a65d798
Fix Transfer list sorting 2020-03-24 16:14:13 +02:00
Chocobo1
e1a10a0375
Fix missing string 2020-03-24 16:14:12 +02:00
Chocobo1
080c542953
Bump python version for new installation 2020-03-24 16:14:11 +02:00
Chocobo1
d7ab472363
Bump copyright year 2020-03-24 16:14:10 +02:00
An0n
c4eb6eccaf
Change placement of stop tracker timeout 2020-03-24 16:14:10 +02:00
an0n666
1c091cef76
Expose stop_tracker_timeout in advanced settings 2020-03-24 16:14:09 +02:00
Chocobo1
e37b08a879
Remove unused variable 2020-03-24 16:14:08 +02:00
Chocobo1
39018ef1db
Add explicit semicolon 2020-03-24 16:14:07 +02:00
Chocobo1
c6cadb6800
Remove duplicate line 2020-03-24 16:14:06 +02:00
sledgehammer999
0898196a5f
Tracker is errored only if all local endpoints fail
Closes #11691
2020-03-24 16:14:06 +02:00
thalieht
4b40b80145
Allow double-click in preview dialog 2020-03-24 16:14:05 +02:00
Vladimir Golovnev (Glassez)
6ade38400e
Save resume data after recheck
Closes #11774.
2020-03-24 16:14:04 +02:00
FranciscoPombal
71ca3a5cc9
WebUI: fix populating statistics window
Closes #11665
2020-03-24 16:14:04 +02:00
Vladimir Golovnev (Glassez)
2a3fc0ede1
Use QStyledItemDelegate instead of QItemDelegate 2020-03-24 16:14:03 +02:00
Vladimir Golovnev (Glassez)
1b9fd85497
Fix transfer list architecture
Model returns string for DisplayRole.
Text alignment is set by Model (using TextAlignmentRole).
Delegate performs custom painting only where necessary
(i.e. for Progress bar).
2020-03-24 16:14:02 +02:00
Chocobo1
c73f61c8d4
Remove unused variable 2020-03-24 16:14:02 +02:00
Chocobo1
4205e99479
Migrate away from deprecated API in Qt 5.14 2020-03-24 16:14:01 +02:00
FranciscoPombal
35c7e6bf2c
WebUI: Prevent excessive sync requests
Don't sync main data if a request to do so is already in progress.

This prevents piling up of requests and bogging down slow/busy machines, since the current implementation of `/api/v2/sync/maindata` is very computationally intensive, especially with lots of torrents.

Everything gets updated on the next scheduled request anyway (via the timeout mechanism).
2020-03-24 16:13:59 +02:00
FranciscoPombal
37bc47ee04
WebUI: remove unused/deprecated option
Fixup 8200ef6
Remove "Listen on IPv6 address" option.
2020-03-24 16:13:58 +02:00
FranciscoPombal
c5dc361213
WebUI: Implement "Secure" flag for session cookie
Closes #11724.

Option is enabled by default for users using qBittorrent's built-in HTTPS capabilities. This flag will never be set if qBittorrent is using plain HTTP.

Users using HTTPS reverse proxies, like "qbt <-> (http) <-> proxy <-> (https) <-> user" should override the flag in the proxy in order to set it, if they wish to do so.
2020-03-24 16:13:56 +02:00
FranciscoPombal
0c83b3e3a3
Change some settings defaults for better behaviour out of the box
- CheckingMemUsageSize (16 MiB -> 32 MiB): a 16 MiB increase in memory consumption seems worthwhile for a nice performance boost in most cases.
- DiskCacheSize (64 MiB -> Auto): auto yields the best performance without committing to a huge fixed value.
- UseRandomPort (false -> true): The initial port chosen by qBittorrent may clash with something else the user already has that is aways using that port (low probability, but still). Thus, qBittorrent will always fail listening on that port, causing unexpected problems for the user. Users who know they want a fixed port will go to the settings anyway.
2020-03-24 16:13:56 +02:00
Thomas Piccirello
63c9e29419
Rename Country column to "Country / Region"
Not all flags displayed strictly belong to countries.
2020-03-24 16:13:55 +02:00
sledgehammer999
7389dc082f
Delete unnecessary explicit return 2020-03-24 16:13:54 +02:00
sledgehammer999
1e05e6a842
Option to show console when external program is run
Windows only.
Closes #9592
2020-03-24 16:13:54 +02:00
sledgehammer999
03550a0932
Use modern unique_ptr practices 2020-03-24 16:13:53 +02:00