Commit graph

140 commits

Author SHA1 Message Date
Vladimir Golovnev
dd1bd8ad10
Implement class for handling filesystem paths
PR #15915.
2022-02-08 06:03:48 +03:00
Vladimir Golovnev (Glassez)
fdbf8cb0ee
Correctly concatenate path components 2022-01-03 19:44:47 +03: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
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
6b06cc9216
Log error message in DownloadHandlerImpl class 2021-10-08 11:07:35 +08:00
Chocobo1
ecd23d0abd
Merge pull request #15459 from Chocobo1/i18n
Revise description wordings
2021-09-19 13:29:08 +08:00
Chocobo1
03012cc175
Revise description wordings 2021-09-18 12:59:07 +08: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
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
jagannatharjun
8b5db328ec Add DownloadRequest::destFileName 2021-09-04 12:02:38 +05:30
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 (Glassez)
97c7f3bc67
Raise minimum Qt version to 5.14 2021-06-03 08:56:41 +03:00
zhuangzi926
c9e2da5f53 Update dyndns register url 2021-04-15 21:41:42 +08:00
Vladimir Golovnev (Glassez)
09da6828b8 Use complete types in container declarations
Qt 6 disallows to use incomplete types in container declarations
in some cases, e.g. in parameters of signals/slots.
2021-03-24 14:31:28 +03:00
Vladimir Golovnev (Glassez)
349cc54c69
Don't use deprecated QTextCodec 2021-03-16 19:10:10 +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
FranciscoPombal
6152b83405 Use #pragma once instead of include guards 2020-12-12 19:41:32 +00:00
Vladimir Golovnev (Glassez)
c41df9ffbd
Improve coding style 2020-11-17 21:02:37 +03:00
FranciscoPombal
9b43d260a7 Fix GeoDB download in systems with non-C locales
Closes #13318.
2020-09-05 23:21:05 +01:00
Chocobo1
4971cb9a27
Don't use deprecated QAbstractSocket::error() 2020-06-04 20:20:50 +08:00
Vladimir Golovnev (Glassez)
a8c333ff25
Drop "private" subfolders
"private" subfolders violate the structure of the project,
since the existence of all other subfolders is based on a
different principle.
In addition, there is no clear line between "private" and
"non private".
2020-05-08 14:59:18 +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
Chocobo1
af430d6635
Initialize struct variables
clang static analyzer was emitting some warning about uninitialized
variable usage and this patch fixes it.
2020-03-27 16:01:01 +08:00
Mike Tzou
c0b0c6dcfc
Merge pull request #12259 from Chocobo1/dtor
Rely on Qt ownership to free resources
2020-03-27 01:06:39 +08:00
Chocobo1
9630e7b689
Rely on Qt ownership to free resources
The m_reply has already changed parent in
DownloadHandlerImpl::assignNetworkReply() and thus we can rely on Qt
ownership to delete the object.
2020-03-26 14:39:18 +08:00
Chocobo1
7de8a4d6e0
Construct QString more efficiently 2020-03-25 12:00:11 +08:00
sledgehammer999
ea1481beef
Use IP geolocation database by DB-IP instead of MaxMind
Closes #11792
2020-02-18 16:11:28 +02:00
Vladimir Golovnev (Glassez)
8bb34482ea
Handle HTTP redirections manually
Qt doesn't support Magnet protocol so we need to handle all redirections
manually to allow redirections to Magnet URIs.
2020-02-11 09:31:42 +03:00
NotTsunami
6748e8d787 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-02-03 16:38:51 -05:00
Chocobo1
b2ab6c1858
Let ReverseResolution always return/emit a result 2020-01-30 19:24:18 +08:00
Chocobo1
a2ebd77eac
Manually abort lookup on class destruction
Some lookup might take longer so instead of waiting them, we abort them
manually.
2020-01-30 14:11:03 +08:00
Chocobo1
86e3d0d816
Improve ReverseResolution class
* Use QHostAddress type for IP
* Avoid double lookup
* Use larger cache size
2020-01-30 14:11:03 +08:00
Chocobo1
5905c085c6
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-01-27 18:14:27 +08:00
Chocobo1
d936bca268
Move DownloadHandlerImpl class to its own file
This also resolves lupdate warning.
2019-11-11 19:41:10 +08:00
horgan
89d214bb8f
Fix country name misspelling 2019-11-03 00:17:04 +08:00
Vladimir Golovnev (Glassez)
73ef69526d
Allow to cancel download request 2019-09-14 11:31:07 +03: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
Chocobo1
6ac36368cd
Update user agent string 2019-08-09 13:12:11 +08:00
Chocobo1
7ab3479a34
Replace static_cast by qOverload 2019-07-26 22:32:18 +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
Chocobo1
3b015db77d
Add comparison operators for ProxyConfiguration 2019-06-19 18:52:24 +08:00
thalieht
9995967fbf Remove some unused #include 2019-06-04 17:48:55 +03:00
Vladimir Golovnev (Glassez)
05fd0b5859
Fix sequential downloading when redirected 2019-05-29 15:50:02 +03:00
Chocobo1
e288de7ec1
Forward declare as much as possible 2019-05-19 12:06:18 +08:00
Chocobo1
56434fc8b9
Replace obsoleted QDateTime::fromTime_t() 2019-05-06 20:26:15 +08:00
Vladimir Golovnev (Glassez)
ead078a38e
Add preliminary support of libtorrent v1.2
libtorrent v1.2 should be built with deprecated features enabled.
2019-03-18 15:17:03 +03:00