Commit graph

498 commits

Author SHA1 Message Date
sledgehammer999
702c79a92f
Don't delete old config keys yet
It will allow users to go back to previous versions without
losing their settings.
2022-01-05 01:01:10 +02:00
sledgehammer999
a27822b557
Correct the order of the migrated settings' mappings 2022-01-04 16:48:17 +02:00
Vladimir Golovnev (Glassez)
fdbf8cb0ee
Correctly concatenate path components 2022-01-03 19:44:47 +03:00
Chocobo1
e7ebbffbfd
Set appropriate migration version number for new installations 2021-12-24 14:50:06 +08:00
Chocobo1
39f054eef6
Migrate "setting key mappings" to upgrade code 2021-12-24 14:50:06 +08:00
Chocobo1
aa3da942cb
Use correct URL scheme when https is enabled
Closes #15844.
PR #15847.
2021-12-17 11:49:11 +08:00
Chocobo1
b8a7ecfe69
Introduce versioning on main configuration file 2021-12-11 01:45:49 +08:00
Chocobo1
cbc2de6b85
Use proper method for checking value existence 2021-12-09 15:57:01 +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
Chocobo1
71270260bf
Reformat code 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
a5c531f0a4
Create lock file in config folder instead of temp folder
Some linux distros seem to alter TMPDIR environment variable and
therefore hamper qbt ability to find the lock files. So use config
folder instead of TMPDIR folder to create/locate the lock files.
Note that this change will also make qbt become one instance per-user
instead of one instance per-system.

Closes #15646.
2021-11-01 14:08:49 +08:00
Chocobo1
ca28fc27dc
Disable deprecated Qt functions
Also Qt6 by default set these attributes to our preferred value.
2021-10-13 12:00:21 +08:00
Vladimir Golovnev (Glassez)
86b1ac5d7c
CMake: Allow to build with Qt6 2021-10-02 09:23:49 +03:00
Chocobo1
ecd23d0abd
Merge pull request #15459 from Chocobo1/i18n
Revise description wordings
2021-09-19 13:29:08 +08:00
Chocobo1
46394a7c0f
Combine stream statements 2021-09-18 12:59:08 +08:00
Chocobo1
03012cc175
Revise description wordings 2021-09-18 12:59:07 +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
Chocobo1
81139c0098
Improve error detection when saving files 2021-09-05 12:20:22 +08:00
Chocobo1
11a063ea66
Merge pull request #15242 from Chocobo1/libt_version
Detect incompatible libtorrent v2 versions in build systems
2021-08-04 11:28:07 +08:00
Chocobo1
0a1865d0dd
Don't use old style cast 2021-08-01 13:48:46 +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
Vladimir Golovnev (Glassez)
399d3ad85a
Replace QStringRef with QStringView 2021-07-15 10:56:49 +03:00
Vladimir Golovnev (glassez)
27baa55443
Raise minimum Qt version to 5.15.2 2021-07-09 07:41:13 +03:00
Chocobo1
70d1cb86fd
Disable move constructor where it is sensible 2021-06-29 14:49:45 +08:00
Vladimir Golovnev
37f227ae74
Provide v1 and v2 infohashes in UI (#15097) 2021-06-25 20:44:23 +03:00
Vladimir Golovnev (Glassez)
50ddfea617 Remove lockfile only when last app instance is destroyed 2021-06-18 06:27:33 +03:00
Vladimir Golovnev (Glassez)
97c7f3bc67
Raise minimum Qt version to 5.14 2021-06-03 08:56:41 +03:00
brvphoenix
aebb9f89d1
Remove the lockfile on exit (#14997) 2021-05-23 14:29:41 +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
Chocobo1
fdc186c92f
Revise tag related implementations
Fix #12690.
2021-04-27 11:47:52 +08:00
Nick Korotysh
28ef33b0a0
Improve Info.plist generation with CMake
- drop configure_file() and file(GENERATE) calls
- fill missed MACOSX_DEPLOYMENT_TARGET variable
2021-04-23 20:59:09 +03:00
Nick Korotysh
29e6b229ac
Don't use executable name as CFBundleName value 2021-04-20 01:49:32 +03:00
Chocobo1
a64bb1a990
Simplify natural sort classes interface
Now the comparison function/class should be constructed before usage.
This change also make it easier to plug in into various containers which
will require a compare function type (such as std::set).
2021-04-10 14:18:18 +08:00
Vladimir Golovnev (Glassez)
135cad576c
Don't use removed QApplication attribute 2021-03-27 19:28:00 +03:00
Vladimir Golovnev (Glassez)
561fbf2cca
Don't use removed QTextStream::setCodec()
QTextStream encodes as UTF-8 by default.
2021-03-27 19:25:32 +03:00
Vladimir Golovnev (Glassez)
61d2ff359b
Use QRegularExpression instead of deprecated QRegExp
Now it follows closely the definition of wildcard for glob patterns.
The backslash (\) character is not an escape char in this context.
In order to match one of the special characters, place it in square
brackets (for example, [?]).
2021-03-22 07:50:47 +03:00
Vladimir Golovnev
a8ae97ba91
Merge pull request #14427 from glassez/qt-5.12
Raise minimum Qt version to 5.12
2021-03-14 20:43:39 +03:00
Chocobo1
d74df935f4
Replace parameters in one step
This would avoid the unwanted effect of replacing parameter coming from
another parameter.
2021-03-14 14:03:42 +08:00
Vladimir Golovnev (Glassez)
f022458383
Raise minimum supported Qt version to 5.12 2021-03-13 15:33:58 +03:00
Vladimir Golovnev (Glassez)
561b597031
Improve "info hash" handling
Define "torrent ID" concept, which is either a SHA1 hash for torrents of version 1,
or a SHA256 hash (truncated to SHA1 hash length) for torrents of version 2.
Add support for native libtorrent2 info hashes.
2021-03-12 12:43:14 +03:00
Vladimir Golovnev (Glassez)
166ec74ff9
Look for qbittorrent.pdb in installation directory
Pass application directory as PDB search path in SymInitialize.
Otherwise it searches in application working directory so when you
run qBittorrent with working directory other than its installation
one it can't find qbittorent.pdb file and produces broken stacktrace.
2021-03-07 17:41:51 +03:00
Vladimir Golovnev (Glassez)
8cfd803222
Drop implicit conversions between InfoHash and QString 2021-03-06 12:35:42 +03:00
Michał Kopeć
614376ed64 Add an option to disable icons in menus 2021-02-20 18:12:02 +01:00
Vladimir Golovnev (Glassez)
0b4fef19f6
Remove redundant suffix from TorrentHandle class
Originally, it was just a wrapper for libtorrent::torrent_handle class, so it mimicked its name.
It was then transformed into a more complex aggregate, but the name was retained (just by inertia).
Unlike libtorrent::torrent_handle class in whose name "handle" means the pattern used,
it does not matter for qBittorrent classes and just eats up space in the source code.
2021-01-06 16:28:17 +03:00
Mike Tzou
b79a1b5755
Merge pull request #14145 from Chocobo1/define
Generate version header when configuring project
2021-01-06 11:38:55 +08:00
Vladimir Golovnev (Glassez)
531ae501ad
Use std::optional<bool> instead of custom TriStateBool 2021-01-04 23:10:24 +03:00
Chocobo1
c669401767
Generate version header when configuring project
The basic idea is we create a version header template at
"src/base/version.h.in" and the build systems are expected to replace
strings that are enclosed with @ symbols and generate
"src/base/version.h" for other source files to consume/include.
2021-01-04 22:28:41 +08:00
Chocobo1
be5af2796d
Revise SettingsStorage store/load value interface 2021-01-02 12:48:26 +08:00
Chocobo1
e6cf186c23
Use function-pointer based signal-slot connection 2020-12-31 13:28:48 +08:00
Vladimir Golovnev (Glassez)
1d5dc283fe
Allow to add root folder to torrent content 2020-12-23 13:07:33 +03:00
FranciscoPombal
6152b83405 Use #pragma once instead of include guards 2020-12-12 19:41:32 +00:00
Chocobo1
498da509db
Use Qt provided forward declaration header 2020-12-09 18:21:02 +08:00
Vladimir Golovnev (Glassez)
c41df9ffbd
Improve coding style 2020-11-17 21:02:37 +03:00
Chocobo1
7e258bfe38
Fix typos 2020-10-20 18:56:30 +08:00
FranciscoPombal
776c1f1546 Always use multi-arg arg() overload when possible
Fixed clazy-qstring-arg Clazy warnings
2020-10-07 15:34:26 +01:00
Vladimir Golovnev (Glassez)
3d0543c444
Fix static build with Qt < 5.14 2020-09-28 07:10:49 +03:00
Vladimir Golovnev (Glassez)
aef8f4f465
Set target property before it is used 2020-09-27 22:17:50 +03:00
Chocobo1
da2a26fa01
Use silent flag when invoking lrelease via cmake 2020-09-21 12:16:47 +08:00
FranciscoPombal
46123b9989 CMake: overhaul and improve scripts
- Bump minimum required version and
make use of more modern language features
- Rely more on target_...() commands to establish dependency
relationships between targets rather than directory property commands
- Improve libtorrent package discovery
- Enable and handle application features more explicitly
- Improve user-facing output
- Fix various compilation issues on Windows (MSVC and MinGW) and macOS
- Improve handling of translations
- Add explanatory comments where relevant
- Make CMake scripts fully independent of qmake files/details
- Remove old functions/macros
2020-09-17 13:13:26 +01:00
jagannatharjun
5b4a940842 Load custom theme before initializing main window
Improves debug build startup time with custom themes
2020-08-02 14:02:18 +05:30
FranciscoPombal
8f8f7ebd15 Remove DISABLE_COUNTRIES_RESOLUTION define 2020-07-08 01:07:50 +01:00
Chocobo1
8ebb6dc559
Initialize variable at better place 2020-06-26 17:17:29 +08:00
Chocobo1
a1ea7a111e
Don't use deprecated QProcess::startDetached() overload 2020-06-04 20:20:50 +08:00
Chocobo1
c239568658
Don't use deprecated QTextStreamFunctions::flush()
Qt doc states: "If QTextStream operates on a string, this function does
nothing". So remove it.
2020-06-04 15:29:32 +08:00
jagannatharjun
ab91d546e5 Move all icon resources to icon folder root 2020-05-18 20:30:51 +05:30
Vladimir Golovnev (Glassez)
a22f921941
CMake: Fix optional features handling 2020-05-02 20:59:26 +03:00
Vladimir Golovnev (Glassez)
ad0ee0cd36
CMake: Enable/disable GUI application via option 2020-05-01 17:03:01 +03:00
Vladimir Golovnev (Glassez)
fb42434946
CMake: Put executable into top-level directory 2020-05-01 17:03:01 +03:00
Vladimir Golovnev (Glassez)
642bf7b8a6
CMake: Don't split GUI code into several libraries 2020-05-01 17:03:00 +03:00
Vladimir Golovnev (Glassez)
4a2d25b03b
Clean up header inclusion 2020-05-01 17:02:49 +03:00
Chocobo1
d3d3f7dbb3
Add final specifier to classes
This allow compilers to generate more efficient code.
2020-04-17 13:18:40 +08:00
Vladimir Golovnev
2681093d27
Merge pull request #12513 from glassez/torrent-impl
Split TorrentHandle interface and implementation
2020-04-17 07:40:28 +03:00
Mike Tzou
a5fe96f793
Merge pull request #12458 from jagannatharjun/log
Convert the Log widget to use custom View/Model
2020-04-17 11:27:35 +08:00
Vladimir Golovnev (Glassez)
1132b84548
Split TorrentHandle interface and implementation 2020-04-16 20:22:26 +03:00
jagannatharjun
fd89717330 Convert the Log widget to use custom View/Model
Co-authored-by: sledgehammer999 <hammered999@gmail.com>
2020-04-15 22:18:00 +05:30
Vladimir Golovnev (Glassez)
4e6790dfbb
Prevent multiple instances for the same app config 2020-03-31 17:16:47 +03:00
Mike Tzou
2408ce98e6
Merge pull request #12285 from Chocobo1/log
Save log file in UTF-8 encoding
2020-03-27 09:39:54 +08:00
Mike Tzou
6b5b5df90c
Merge pull request #12283 from Chocobo1/qtTr
Include translation resources with file globbing
2020-03-27 09:38:46 +08:00
Mike Tzou
185d8c97c1
Merge pull request #12273 from Kolcha/hidpif
Don't round scaling factor
2020-03-27 01:06:08 +08:00
Chocobo1
c52737e07c
Avoid log file excessive flushing
Excessive flushing could happen when a lot of logging happens in a short
time interval.
2020-03-26 16:12:24 +08:00
Chocobo1
12396a7582
Save log file in UTF-8 encoding
Otherwise it uses sytem defaults: usually UTF-8 on Linux and local 8-bit
encoding on Windows.
2020-03-26 16:00:57 +08:00
Chocobo1
d179c6d5a1
Rename variable 2020-03-26 15:49:14 +08:00
Chocobo1
1466c562e5
Include translation resources with file globbing
This will include all qtbase_*.qm files and only explicitly listed
qt_*.qm files will be included.
2020-03-26 14:10:20 +08:00
Nick Korotysh
a9b0d84df9
Don't round scaling factor
Qt 5.14 introduced new feature related to HighDPI screens support,
this parameter is called "scale factor rounding policy", and it is
intended to improve fractional scale factor support (like 150%).
Qt::PassThrough value guarantee that no any rounding will applied to
scale factor, and will be used as is.
2020-03-25 18:36:34 +03:00
Chocobo1
7de8a4d6e0
Construct QString more efficiently 2020-03-25 12:00:11 +08:00
Chocobo1
b7e7d8019c
Use helper function to construct QString
This is shorter and avoids the need of 2 constructors.
2020-03-16 21:27:42 +08:00
Mike Tzou
f80b7affd9
Merge pull request #12138 from Chocobo1/dist
Update Qt translations
2020-03-10 01:29:08 +08:00
Vladimir Golovnev
a7b342edcb
Merge pull request #12083 from glassez/app-instances
Allow single app instance per configuration
2020-03-09 07:40:48 +03:00
Chocobo1
7b25dd24d0
Update Qt translation files 2020-03-09 09:48:15 +08:00
Mike Tzou
095ef67e30
Merge pull request #12102 from Kolcha/hidpi
Delegate GUI scaling work to Qt
2020-03-07 10:05:21 +08:00
Nick Korotysh
d49d7c1d82
Delegate GUI scaling work to Qt
Set Qt::AA_EnableHighDpiScaling application attribute when Qt 5.14.x or
newer is used. This fixes a lot of scaling issues on HiDPI displays.

Unfortunately, this flag must be set only before QApllication object
creation, so the only one place where it can be done is main().
2020-03-06 12:04:57 +03:00
Vladimir Golovnev (Glassez)
38e54206d5
Allow single app instance per configuration 2020-03-06 08:59:59 +03:00
Chocobo1
2157e500ef
Use helper functions to construct smart pointers 2020-03-05 19:32:28 +08:00
FranciscoPombal
dc6a56afcb Revert using random port by default
Revert change introduced in https://github.com/qbittorrent/qBittorrent/pull/11637 and also revert the associated follow-up https://github.com/qbittorrent/qBittorrent/pull/12000.

Reason: https://github.com/arvidn/libtorrent/pull/4335
2020-02-21 14:47:37 +00:00
Mike Tzou
882978c80a
Merge pull request #12000 from an0n666/legacy-default-no-random-port
Keep legacy default for random port
2020-02-13 12:24:45 +08:00
Mike Tzou
316f34cbf5
Merge pull request #11994 from Chocobo1/profile
Unify singleton pattern in Profile class
2020-02-12 23:59:47 +08:00
an0n666
41d8585932 Keep legacy default for random port 2020-02-12 12:28:13 +00:00
Chocobo1
5de75eff05
Unify singleton pattern in Profile class
1. Use unified function names `initInstance()` and `freeInstance()` and
make them public.
2. Add `freeInstance()` to avoid noise from memory leak detectors.
3. Let `instance()`return a pointer directly to avoid unnecessary
indirections when invoking functions.
2020-02-11 15:30:59 +08:00
Vladimir Golovnev (Glassez)
0c6c65f6f8
Keep legacy defaults for existing users 2020-02-11 09:53:12 +03:00
Vladimir Golovnev (Glassez)
86c95db91d Perform settings upgrade for existing user only 2020-02-11 09:40:57 +03:00
Chocobo1
a6cdba17f0
Fix singleton class ownership
We shouldn't allow Qt parent ownership in here.
2020-02-07 15:34:04 +08:00
NotTsunami
b21ed0063b 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-01-19 15:08:45 -05:00
sledgehammer999
8fa6e372a2
Option to show console when external program is run
Windows only.
Closes #9592
2019-12-19 19:13:01 +02:00
sledgehammer999
4ae8e176dc
Use modern unique_ptr practices 2019-12-19 16:25:45 +02:00
Tester798
053ee48692 Enable portable mode if "profile" directory exists
Enable portable mode if "profile" directory exists in the app dir.
Remove "--portable" command line argument.
Add logging of current profile config directory.
Closes #9445.
2019-12-16 05:12:47 +02:00
Chocobo1
6fd678195c
Replace deprecated Qt functions
QSet::toList() is replaced by QSet::values()
2019-10-31 12:40:24 +08:00
Chocobo1
7276a79cef
Call Windows API directly
We already bumped the OS requirement to Windows 7 and those functions
can be called directly without the need to load them first.
2019-09-29 09:52:13 +08:00
Chocobo1
17e4902519
Don't define variable when not building GUI 2019-09-05 20:40:47 +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
7e0daf1663
Setup pixmap cache in a proper place
There is no need to reset the cache limit to previous value as
QPixmapCache is an application wide cache.
Also raise the cache size to 64MB.
2019-08-30 14:51:27 +08:00
Chocobo1
47b9d8dbc6
Clean up Application class constructor 2019-08-30 14:51:07 +08:00
Chocobo1
e3483c62ca
Remove explicit conversion to QVariant 2019-08-18 20:00:43 +08:00
Vladimir Golovnev (Glassez)
6bfa4370b7
CMake: Fix Windows build 2019-08-06 21:50:39 +03:00
Chocobo1
25c56d3b66
Make use of Utils::Misc::loadWinAPI 2019-07-31 02:10:22 +08:00
Chocobo1
5c015d573b
Forward declare types as much as possible 2019-07-31 02:10:22 +08:00
Mike Tzou
4f06c091c9
Merge pull request #10949 from Chocobo1/inject
Prevent command injection via "Run external program" function
2019-07-21 12:05:02 +08:00
Chocobo1
a610c8567e
Prevent command injection via "Run external program" function
Closes #10925.
2019-07-20 17:42:09 +08:00
Chocobo1
4a90716843
Add override keyword to functions 2019-07-19 11:58:56 +08:00
Chocobo1
07263d2d70
Move implementation to its own file 2019-07-18 00:30:44 +08:00
Prince Gupta
8267a4fef9 Incorporate GuiIconProvider inside UIThemeManager 2019-07-16 09:31:33 +05:30
Chocobo1
7b568b07e6
Clean up CMakeLists.txt 2019-07-13 19:55:13 +08:00
Prince Gupta
a24925c858 Allow styling with QSS stylesheets 2019-07-09 19:56:55 +05:30
Mike Tzou
4b25f87859
Merge pull request #10874 from Chocobo1/qt
Replace obsoleted Qt functions
2019-07-02 10:57:06 +08:00
Chocobo1
4eff268095
Replace obsoleted QFontMetrics::width()
Qt 5.13 marked QFontMetrics::width() obsolete.
2019-07-01 14:48:53 +08:00
Vladimir Golovnev (Glassez)
c7f3693ad1
Implement "Application instances manager" 2019-06-30 20:02:46 +03:00
Chocobo1
46ee193cd8
Restrict QLocalServer access
The default is world access which means even even unprivileged local
accounts can connect to it too.
2019-06-28 09:40:21 +08:00
Chocobo1
6119cb370f
Drop suspiciously large data
This is to avoid exhausting system memory.
2019-06-27 20:29:02 +08:00
Chocobo1
d0bfe9a661
Adjust open file descriptor limit on startup
This raises qbt's open file descriptor limit to the available maximum
(within user privileges) and thus users don't need to adjust it
manually anymore.
2019-06-26 14:08:43 +08:00
silverqx
4f4f435e76
Add zlib version to GUI & stackdump 2019-06-12 08:02:24 +02:00
Chocobo1
6738cdd715
Constify exception references 2019-05-19 12:06:18 +08:00
sledgehammer999
f403fdb2e8
Remove wrong ifdef 2019-03-17 14:15:50 +02:00
Chocobo1
b7d739ab3f
Fix build error
Apparently the function is not available on Windows platforms.
2019-03-15 14:29:54 +08:00
Chocobo1
874bc84efc
Remove excessive usage of pointer 2019-03-15 14:29:06 +08:00
Chocobo1
a3019f56b0
Clean up code 2019-03-15 14:29:06 +08:00
Vladimir Golovnev
36f6e9b288
Merge pull request #9702 from knackebrot/master
Fix building qbittorrent-nox on Windows
2019-03-13 18:35:44 +03:00
sledgehammer999
c2d1af9853
Merge pull request #10338 from sledgehammer999/raise_qt5_ver
Raise minimum Qt version to 5.9.0
2019-03-08 00:42:26 +02:00
knackebrot
c7b451b18f Allow headless builds on Windows
Daemonizing is disabled because no direct equivalent exists in win32.
2019-03-07 13:59:10 +01:00
Mike Tzou
ccd8f3e0f1
Merge pull request #10340 from Chocobo1/move
Move helper functions to Utils::Gui namespace
2019-03-07 15:11:58 +08:00
Chocobo1
adbd34c795
Move helper functions to Utils::Gui namespace 2019-03-05 14:55:22 +08:00
sledgehammer999
5c63ad3b95
Raise minimum Qt version to 5.9.0 2019-03-04 16:48:49 +02:00
Mike Tzou
4ce3cda676
Merge pull request #10319 from eszlari/patch-1
Linux/Wayland: make window title bar icon work
2019-03-03 12:40:59 +08:00
Mike Tzou
0f1fc7be9d
Merge pull request #10302 from Chocobo1/uptr
Replace QScopedPointer with std::unqiue_ptr
2019-03-02 12:26:14 +08:00
Peter Eszlari
9f250713d2 Linux/Wayland: make window title bar icon work 2019-02-28 22:41:08 +01:00
Mike Tzou
46bc1d12b9
Merge pull request #10314 from thalieht/const2
More const
2019-02-28 11:33:35 +08:00
thalieht
89dce36e98 Use uniform initialization on some default arguments 2019-02-25 17:05:15 +02:00
Chocobo1
e5dca50025
Convert to use private pointer for ui object 2019-02-25 01:22:40 +08:00
Chocobo1
5e3fddf456
Replace QScopedPointer with std::unqiue_ptr
These 2 types are very similar and we should prefer the one from C++
standard library, this reduces the number of types in our code base.

Also see:
https://stackoverflow.com/questions/40346393/should-i-use-qscopedpointer-or-stdunique-ptr#comment67966940_40346991
2019-02-18 16:06:40 +08:00
thalieht
9959a901fe Replace deprecated header 'signal.h' with 'csignal' 2019-02-16 18:54:17 +02:00