Commit graph

25 commits

Author SHA1 Message Date
Chocobo1
ad22237a2f Provide safe helper for converting to 'seconds since epoch' 2024-01-08 15:13:02 +08:00
Chocobo1
5b3b56c918
Improve natural sort algorithm
1. Use proper case folding function instead of `toLower()`.
2. Use locale aware comparison instead of comparing unicode code points.
   Now `a` comes before `A` which is the same as the result from QCollator. A nice side effect
   is now it properly compares locale specific characters (for example `C`, `Č`).
3. Improve testing. Now the test is runnable and stable on all platforms.

PR  #20208.
2024-01-08 14:47:00 +08:00
Chocobo1
073ca4267c
Introduce helper function to join values as string
PR #20130.
2023-12-19 00:08:37 +08:00
Victor Chernyakin
34d30ed031
Replace Q_UNUSED with [[maybe_unused]] attribute
PR #19471.
2023-08-18 07:09:40 +03:00
Chocobo1
69d60b5f1c
Specify interface requirements as an C++ concept
PR #19440.
2023-08-12 20:53:03 +08:00
Chocobo1
31fe327763
Move to separate headers
Hopefully this can speed up compilation times.
https://doc.qt.io/qt-6/qtglobal.html#details

PR #19430.
2023-08-11 13:47:55 +08:00
Chocobo1
5c06d0aa75
Replace template conditionals with C++20 requires clause
Related: https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-constraints.html

PR #19424.
2023-08-09 20:33:19 +08:00
Chocobo1
e31c3376bd
Use library provided erase_if()
`Algorithm::removeIf()` is still valuable as `QHash::removeIf()` predicate require an
iterator or a `std::pair`, which both require more code to unpack the variable and therefore
cumbersome to use.

PR #19353.
2023-07-24 20:29:02 +08:00
Vladimir Golovnev
10ee1ab7a2
Switch to C++20
PR #19336.
2023-07-21 15:38:49 +03:00
Vladimir Golovnev
dbe79484d2
Drop support of Qt 5
Also remove usage of some deprecated stuff.

PR #19338.
2023-07-20 11:17:27 +03:00
Chocobo1
80791e328d
Fix wrong behavior when reading text
Also add another 'file read error' status.

Closes #19254.
PR #19262.
2023-07-02 13:23:20 +08:00
Chocobo1
e780b3a9b7
Add unit test for string literal helper 2023-06-18 13:51:19 +08:00
Chocobo1
e6d85a468b
Rename literal operator
Qt 6.4 introduced `QString operator""_s()` and the previous `""_qs` is
deprecated since Qt 6.8.
2023-06-18 03:32:44 +08:00
Chocobo1
79ca2e145f
Don't read unlimited data from files
It now guards against reading infinite files such as `/dev/zero`.
And most readings are bound with a (lax) limit.
As a side effect, more checking are done when reading a file and
overall the reading procedure is more robust.

PR #19095.
2023-06-14 13:38:19 +08:00
Vladimir Golovnev
160af4feef
Show I2P peer addresses
PR #18845.
2023-06-01 17:16:03 +03:00
Vladimir Golovnev
d40be79c69
Implement torrent tags editing dialog
PR #18797.
2023-04-03 10:36:28 +03:00
Chocobo1
e692a191ed
Revise 'Add trackers' dialog
* Now it allow user to add tracker to different tier.
* The downloaded trackers are now displayed as is (without modifying).
* Now the dialog remember dialog size and last used URL.

Closes #17692.
2022-09-14 01:20:30 +08:00
Chocobo1
f5836c9fc9
Add unit testing for Path class 2022-08-14 13:31:22 +08:00
Chocobo1
33e6ca6778
Redesign Version class
PR #17484.
2022-08-06 11:06:16 +08:00
Chocobo1
a4c2363f43
Improve constructor of Version class
Now we can write `Version<int, 3, 1>(1)` and provide only 1 parameter
instead of all 3 parameters at once at the constructor. Note that for
this instance of `Version` 3 numbers were specified but only 1 is truly
mandatory.

The added code are required to specify conditions of the template
instantiation for the compiler.
2022-08-01 14:53:55 +08:00
Chocobo1
958929aa77
Improve command for running test
It enables `make check` command to build tests and run it
altogether.
2022-07-31 15:20:34 +08:00
Chocobo1
0802b6d506
Fix empty string parameter was omitted
`QProcess::splitCommand()` will omit empty strings like `""` so provide
our own replacement.

Closes #13124.
2022-07-30 00:17:31 +08:00
Chocobo1
60e62dc5ab
Add testing for various classes 2022-07-13 18:05:14 +08:00
Chocobo1
0d715d879d
Specify test files manually
So that cmake will detect file changes automatically and therefore we
don't need to re-invoke cmake manually.
2022-07-11 13:58:55 +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