Commit graph

10172 commits

Author SHA1 Message Date
Chocobo1
d6314b30a2
Merge pull request #17341 from Chocobo1/tray
Revise behavior of initializing checkboxes
2022-07-11 12:39:05 +08:00
Chocobo1
03da68b1cf
Add support for unit testing
* Downgraded macOS CI to Qt 6.2.0 due to a bug in Qt Test module
* Revised cmake build scripts
* For now, only building via cmake is supported

PR #17338.
2022-07-10 13:20:27 +08:00
Vladimir Golovnev
890630944d
Extract desktop integration stuff into separate class
PR #17313.
2022-07-09 08:06:22 +03:00
Chocobo1
8d73ab65b2
Don't needlessly hide Options dialog
The dialog should only close after all operations are done, not before.
2022-07-09 11:34:47 +08:00
Chocobo1
e54124fdb8
Add tooltip message when system tray icon isn't available
Also don't hide the sub-options as they are already in disabled state.
2022-07-09 11:34:47 +08:00
Chocobo1
e4fafb911a
Revise behavior of initializing checkboxes
The checkboxes initial value should not depend on parent state and
should be restored anyway.
2022-07-09 11:34:43 +08:00
Chocobo1
dba711d099
Use helper function for logging messages 2022-07-07 12:17:52 +08:00
Chocobo1
ec13bba4da
Revise classes startup sequence
1. Initialize Logger class earlier so that it can record messages from other classes (for
   debugging purpose).
2. Deprioritize WebUI port adjustment. It is not a high priority in here.
3. Slightly deprioritize file logger initialization.
2022-07-07 12:16:48 +08:00
luzpaz
8736c9ec4c
Fix various typos
Found via `codespell -q 3 -S *.ts,*.desktop,./src/base/3rdparty,./dist/windows/installer-translations -L ba,doas,ist,ro,ths`

PR #17317.
2022-07-06 13:11:11 +08:00
Chocobo1
286df8f560
Merge pull request #17311 from Chocobo1/memPrio
Work around application stuttering on Windows
2022-07-05 14:18:02 +08:00
Nowshed H. Imran
92afbd45e8
Remove option of using icons from system theme
PR #17292.
Closes #17150.
2022-07-05 12:32:35 +08:00
summer
c660c9df8e Try to recover missing tags
Tags can go missing from config/resume data. Try to recover them to avoid inconsistent behavior.
2022-07-04 18:18:56 +06:00
Chocobo1
ed2eadaf56
Work around application stuttering on Windows
This is observed by unusual high page faults when the stuttering occurs.
With this workaround, the high page faults still occurs but the GUI remains responsive.
2022-07-04 18:38:23 +08:00
Chocobo1
fa26333a5b
Move "memory priority" settings to Application class 2022-07-04 18:38:20 +08:00
Vladimir Golovnev
be7cfb78de
Restore BitTorrent session asynchronously
Reduce the total startup time of the application and maintain sufficient responsiveness of the UI during startup due to the following:
1. Load resume data from disk asynchronously in separate thread;
2. Split handling of loaded resume data in chunks;
3. Reduce the number of emitting signals.

PR #16840.
2022-07-04 12:48:21 +03:00
Chocobo1
ec1d2cba40
Merge pull request #17305 from Kolcha/fix/open-dest-dir
Fix "Open destination folder" on macOS
2022-07-04 08:38:10 +08:00
Nick Korotysh
a93cd20e4d
Open destination folders on macOS in separate thread
In some unknown way, the one line in Objective-C affects Qt's main
loop causing the crash in QApplication::exec() on processing next
event after that call.

Even crash doesn't happen exactly after this call, it will happen
on application exit. Call stack and disassembly are the same in
all cases.

But running that code in another thread solves the issue.
2022-07-02 09:16:22 +02:00
Chocobo1
25b3f2d1a6
Raise priority of the main "event loop" thread
The goal is to improve responsiveness of qbt when CPU resources are scarce.

Instead of lowering libtorrent threads priority, it is chosen to raise main event loop thread
priority to avoid getting messy with libtorrent internals.

Also on Windows, threads doesn't inherit thread priority from the parent thread and it always
use the default (normal) priority.

PR #17278.
2022-07-02 14:57:47 +08:00
Chocobo1
b44bdd21cb
Merge pull request #17281 from Chocobo1/creator
Fix filename not populated correctly
2022-07-02 14:41:50 +08:00
Nick Korotysh
53ea1843ab
Pass Torrent::contentPath() to MacUtils::openFiles()
it already provides absolute path, no additional manipulations
are required.
2022-07-01 23:23:26 +02:00
Chocobo1
34091176d5
Fix wrong root path generated on Windows
Fix cannot create torrent when the source file is at the root of a
drive.
Fix created torrent cannot be seeded when the source file is at the root
of a drive.

Fix up dd1bd8ad10.
Closes #17279.
2022-07-01 13:34:14 +08:00
Vladimir Golovnev
ac8a6887b6
Improve D-Bus notifications handling
Make notifications clickable on Linux by assigning "default" action.
Don't react to unrelated notifications clicked by keeping track of qBittorrent notifications IDs and filter out unrelated ones.
Make D-Bus Notifications interface proxy class to be maintained manually and fix coding style in it.
Closes #9084.
PR #17282.
2022-06-30 08:01:17 +03:00
summer
cc0a0b56ed
Make working set limit available only on libtorrent 2.0.x builds
You can already control the cache size in libtorrent 1.2.x so it doesn't make sense to implement this limit for all use cases. Also there are some downsides to using working set size to limit memory usage such as unresponsive GUI when limit gets hit.

PR #17275.
2022-06-30 11:23:48 +08:00
sledgehammer999
0e989185ce
Merge pull request #15769 from now-im/flow
Implement new icon/color theme
2022-06-28 23:23:25 +03:00
Chocobo1
aadf961184
Fix filename not populated correctly
Fix up dd1bd8ad10.
Related #17279.
2022-06-26 19:30:17 +08:00
summer
1abeac8811
Remove unnecessary force reannounce on interface alerts
This isn't necessary since it can cause issues by doing unnecessary reannounce during startup and network address refresh. This impact of this can be great if it happens on a regular basis and if someone has a lot of torrents.

PR #17261.
2022-06-26 07:26:21 +03:00
Vladimir Golovnev
f8a304abdc
Implement base classes for application components
PR #17219.
2022-06-25 15:46:55 +03:00
Chocobo1
41a38428fc
Merge pull request #17259 from Chocobo1/cleanup
Make use of chrono literals from std library
2022-06-25 13:23:27 +08:00
Mike Lei
d3850cf98f
Improve WebUI progress bar rendering
PR #17258.
2022-06-24 13:18:33 +08:00
Chocobo1
02d906d3ae
Initialize pointer to a default value 2022-06-23 21:31:16 +08:00
Chocobo1
6de72ecc77
Make use of chrono literals from std library 2022-06-23 21:31:16 +08:00
Chocobo1
2a5dbe840c
Clean up coding style 2022-06-23 13:40:42 +08:00
Li Z
86b6bcc1d9
Fix incorrect "max outgoing port" setting
PR #17252.
2022-06-23 11:49:45 +08:00
Chocobo1
f3a4764a1d
Merge pull request #17233 from Chocobo1/log
Add shutdown logging
2022-06-20 13:08:46 +08:00
Chocobo1
0d46a108b8
Revise Statistics class 2022-06-19 15:51:19 +08:00
Chocobo1
8114c11d58
Add shutdown logging 2022-06-18 17:14:54 +08:00
Chocobo1
e3425cfa9e
Defer closing logger instance
So that logger can still be used in shutdown stage.
2022-06-18 17:14:54 +08:00
Chocobo1
af78344e5d
Use coarse timestamp format
Since format in milliseconds doesn't add additional value and is
slower than just seconds.
2022-06-18 17:14:42 +08:00
Vladimir Golovnev
a2121f2483
Improve RSS subsystem initialization
PR #17227.
2022-06-18 09:56:49 +03:00
Vladimir Golovnev
7d97905716
WebAPI: Add endpoint to set speed limit mode 2022-06-18 06:12:43 +03:00
Chocobo1
61adfea196
Fix garbage text appeared in log file
Fix up fed969ed64.
2022-06-18 04:18:27 +08:00
Chocobo1
3dd616f6ff
Use proper method for manipulating text
`innerText` is too powerful for the job here, use a more
restricted/secure way to manipulate text.

Related: #17211.
PR #17212.
2022-06-17 13:00:32 +08:00
Prince Gupta
d5e6d161f2
Cache last traverse result while parsing file tree
PR #16376.
2022-06-15 20:14:53 +03:00
thalieht
d1515456bc
Add checkbox for "Excluded file names"
PR #17206.
2022-06-15 13:16:01 +08:00
brvphoenix
7faa8b7a02
Don't use QCollator when it works on posix mode
PR #17204.
2022-06-14 13:22:30 +08:00
Chocobo1
5b0cbf9eb1
Merge pull request #17187 from Chocobo1/names
Fix wrong file names displayed in tooltip
2022-06-11 12:27:41 +08:00
xavier2k6
74db0576af
Sync nonstd/expected with upstream
* Used  `commit: b78dd92cc92b0cfe4eedad823cfd411c13afeb66` (Release v0.6.0)
* Source https://github.com/martinmoene/expected-lite/releases/tag/v0.6.0

PR #17192.
2022-06-11 12:27:13 +08:00
Emil M George
29a964d5b7
Add support for custom SMTP ports
The port can be optionally specified by appending `:<port>` to the existing SMTP Server field in settings. If no port is specified, then the default port (25 for insecure or 465 for SSL) is used.

Closes #12212.
PR #17157.
2022-06-10 14:02:51 +08:00
mxtsdev
5e6174c087
Add file name filter/blacklist
Blacklist filtered file names from being downloaded from torrent(s).
Files matching any of the filters in this list will have their priority automatically set to "Do not download".
See Options > Downloads >Do not download.

Closes #3369.
PR #17106.
2022-06-10 13:37:46 +08:00
Nowshed H. Imran
199d770e15
Implement new icon/color theme
Co-authored-by: xavier2k6 <42386382+xavier2k6@users.noreply.github.com>
2022-06-09 18:18:14 +06:00
Prince Gupta
c47e29c7c8
Do RSS serializing on worker thread
PR #16357.
2022-06-09 15:16:37 +03:00
Chocobo1
fed969ed64
Avoid string encoding conversion
Use UTF-16 string literals to match QTextStream internal buffer
encoding.
2022-06-09 12:24:31 +08:00
Chocobo1
9cb686a6b7
Fix wrong file names displayed in tooltip
Also rename variable.
Closes #17179.
2022-06-09 12:24:31 +08:00
Chocobo1
eddeda7bab
Remove usage of QTextStream
Other classes already provide rich methods so avoid another
layer of QTextStream which slow things down (slightly).

PR #17180.
2022-06-09 11:18:41 +08:00
Vladimir Golovnev
ca07540675
Fix rate calculation when interval is too low
PR #17155.
2022-06-08 08:51:48 +03:00
Chocobo1
fb5f563537
Merge pull request #17148 from Chocobo1/gui
Fix wrong dialog sizes on first start up
2022-06-05 13:36:41 +08:00
thalieht
2f9c5cdb22
Add "Filter files" field in new torrent dialog
PR #16344.
2022-06-04 12:57:50 +08:00
Chocobo1
fcf50820e8
Don't resize dialog with invalid sizes
This fixes wrong dialog sizes on first startup.
2022-06-03 16:07:36 +08:00
Chocobo1
3fd0241abb
Set dialog properties at the caller site
Redundant `setModal(true)` are removed since the dialog is already opened via `open()`.
2022-06-02 23:53:30 +08:00
Vladimir Golovnev
ab0c82965c
Avoid redundant checks of category names
PR #17130.
2022-05-31 10:42:40 +03:00
Kacper Michajłow
5173a56ebd
Fix DHT/PeX/LSD status when it is globally disabled
Global status takes precedence over specific torrent private status.

PR #17126.
2022-05-31 12:45:28 +08:00
Chocobo1
9cd993d1da
Merge pull request #17116 from Chocobo1/cleanup
Clean up usage of `static` keyword
2022-05-31 12:39:30 +08:00
Chocobo1
73faf67084
Clean up usage of static keyword
They are either misused or redundant, so remove it.
2022-05-30 13:25:34 +08:00
brvphoenix
fd51362545
Don't decompress the reply data for Qt 6.3
PR #17120.
2022-05-30 13:10:29 +08:00
sledgehammer999
56b99f4e19
Merge pull request #17125 from sledgehammer999/cmake_lupdate
Use CMake to update translation files
2022-05-29 20:46:15 +03:00
sledgehammer999
242874e705
Use CMake to update translation files
It uses lupdate directly.
Qt's `qt_add_lupdate()` cmake function doesn't help much.
First of all it is Qt6 only.
Secondly, our project is split into multiple targets but we need all
strings into a single .ts file per language.
Thirdly, it looks like it will skip source files that are added conditionally into the build
via cmake condition checking (eg DBUS source files). We need to gather all strings present
in the source files regardless of the build configuration.

On another note, this is a step towards reducing dependency on qmake/autoconf.
2022-05-29 02:49:57 +03:00
Vladimir Golovnev
a5caa807f5
Initialize torrent status using libtorrent extension
PR #17096.
2022-05-28 09:30:50 +03:00
Chocobo1
c2c17fd053
Revise icon cache look up
Find in `m_iconCache` first because it is cheaper than calling
`QIcon::fromTheme()`.
2022-05-27 16:23:19 +08:00
Chocobo1
f54cc5796e
Move function into anonymous namespace 2022-05-27 16:23:19 +08:00
Chocobo1
a9f99aed48
Revise code 2022-05-27 16:23:18 +08:00
Chocobo1
7eaaa8f92a
Turn static variable into class member 2022-05-27 04:01:37 +08:00
Chocobo1
ca9f5a18d4
Suppress type narrowing warnings 2022-05-27 04:01:34 +08:00
Vladimir Golovnev
4f62900cd3
Update torrent status filter counters consistently
PR #17097.
Closes #15981.
Closes #16490.
2022-05-26 19:55:00 +03:00
sledgehammer999
2c9e1d942b
Merge pull request #17091 from sledgehammer999/ts_newlines_fix
Sync translations from Transifex and run lupdate
2022-05-25 20:44:11 +03:00
Vladimir Golovnev
4032393c0e
Pause torrent in all "fastresume rejected" cases
PR #17087.
Addition to #17064.
2022-05-25 08:24:53 +03:00
xavier2k6
8e854062e8
Sync flag icons with upstream
Upstream commit 1f861ac27d8a3b46e78eaa8ac30d7de35279ab01
Upstream release v6.4.2

PR #17077.
2022-05-25 12:41:16 +08:00
sledgehammer999
cbf9c8ec1a
Sync translations from Transifex and run lupdate 2022-05-25 00:16:57 +03:00
Priit Uring
494593c745
Update clipboard.js to v2.0.11
https://github.com/zenorocha/clipboard.js/releases

PR #17073.
2022-05-24 12:55:30 +08:00
sledgehammer999
3af832ec18
Sync translations from Transifex and run lupdate 2022-05-22 19:14:00 +03:00
Vladimir Golovnev
7e0cd223fd
Revamp tracker entries handling
PR #17017.
2022-05-22 09:09:11 +03:00
Vladimir Golovnev
8c0cd09823
Handle all "fastresume rejected" cases consistently
PR #17064.
2022-05-22 07:23:52 +03:00
Chocobo1
c8b4611d8d
Disable copy, move constructors when inheriting from QObject 2022-05-19 19:07:23 +08:00
Chocobo1
7764169aa3
Disallow narrowing conversions in signal connection 2022-05-19 12:55:07 +08:00
Chocobo1
8d3c19c599
Merge pull request #17031 from Chocobo1/net
Fix wrong GUI behavior in "Optional IP address to bind to" setting
2022-05-19 12:52:35 +08:00
vlakoff
b84333f8a1
Consider brackets within wildcard as regular characters
In glob patterns, square brackets have a special meaning, that may be unexpected by the users.

Thus we escape these brackets, so that the only remaining special characters are the * and ? wildcards.

PR #16965.
2022-05-18 08:33:14 +03:00
thalieht
acdd08e9a2
Consistently emit signal when file "ignored" state is changed
PR #17042.
Closes #17037.
2022-05-18 07:47:48 +03:00
Chocobo1
dbfd6a2368
WebUI: enforce coding style
Actually, not all of them but some that can be enforced by eslint.
The changes are made by eslint with minor manual tweaking.

PR #17046.
2022-05-18 11:37:05 +08:00
Chocobo1
9d858d5cd7
Fix compilation with qmake
Fix up 7c35904062.
2022-05-16 01:15:19 +08:00
Chocobo1
e82c50ed73
Clean up code 2022-05-16 01:15:08 +08:00
Chocobo1
4ce98d57dd
Fix wrong GUI behavior in "Optional IP address to bind to" setting
Previously the address field got erroneously reset to "All addresses"
when the network interface is down.
2022-05-14 18:42:13 +08:00
Chocobo1
114c6d36d1
Clean up code
Add const.
Move template implementation to .cpp file.
2022-05-14 18:30:10 +08:00
Chocobo1
538c88ced4
Improve logic when interfacing settings with combobox
PR #17023.
2022-05-13 12:13:04 +08:00
Chocobo1
7c35904062
Use stacktrace dialog when GUI is enabled
PR #17022.
2022-05-13 12:12:36 +08:00
Chocobo1
5c3c6b63ba
Migrate to Boost.Stacktrace
PR #17014.
2022-05-12 11:06:05 +08:00
Coda
e698c09298
Allow to use POSIX-compliant disk IO type
This patch allows user to switch disk IO type between memory mapped files based type (default in libtorrent 2, and seems causing memory issues) and POSIX-compliant type which is more conservative on memory usage.

Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
Co-authored-by: Vladimir Golovnev (Glassez) <glassez@yandex.ru>

PR #16895.
2022-05-11 21:28:06 +03:00
Vladimir Golovnev
a048ea668f
Use uniform way to export .torrent files
PR #17013.
2022-05-10 15:36:05 +03:00
Vladimir Golovnev
5af78ad2cd
Preserve "skip hash check" when there is no metadata
When torrent is added without metadata libtorrent doesn't honor "seed mode" and doesn't save it in resume data so when metadata is available torrent will still check file hashes. This patch will add a logic that preserves originally enabled "seed mode" until the metadata is received.
PR #17009.
2022-05-10 15:34:38 +03:00
Vladimir Golovnev
338e89176d
Mark all files as complete if torrent is in "seed mode"
Fixes regression of bcfa486.
Closes #16999.
PR #17008.
2022-05-10 15:29:46 +03:00
itlezy
a266599118
Add keyboard navigation keys
* Added keyboard navigation keys for context menu with `&`
* Added `CTRL+M` for force resume.

PR #16988.

Co-authored-by: itLezy <itLezy@users.noreply.github.com>
Co-authored-by: Vladimir Golovnev <glassez@yandex.ru>
2022-05-10 11:34:43 +08:00
Chocobo1
002d56d8b3
Fix type mismatch
msys2 was reporting the following error:
```
D:/a/qbittorent_msys2/qbittorent_msys2/src/qBittorrent/src/app/application.cpp: In member function 'void Application::applyMemoryWorkingSetLimit()':
D:/a/qbittorent_msys2/qbittorent_msys2/src/qBittorrent/src/app/application.cpp:777:36: error: no matching function for call to 'min(unsigned int, long unsigned int)'
  777 |     const SIZE_T minSize = std::min((64 * MiB), (maxSize / 2));
      |                            ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2022-05-08 16:48:29 +08:00