You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-10-16 20:32:23 +02:00
Compare commits
136 Commits
release-5.
...
v5_1_x
Author | SHA1 | Date | |
---|---|---|---|
![]() |
202ff8a099 | ||
![]() |
c0585441fb | ||
![]() |
a8b6cbceb0 | ||
![]() |
6ad073e0bc | ||
![]() |
ad68813fe8 | ||
![]() |
22df0b45c5 | ||
![]() |
bb34444ddc | ||
![]() |
dd5c934103 | ||
![]() |
3fca180e98 | ||
![]() |
9b29d37d21 | ||
![]() |
206d5abf84 | ||
![]() |
101f35dcf2 | ||
![]() |
13282d94ef | ||
![]() |
1daa42e4fe | ||
![]() |
ea9f3800ce | ||
![]() |
af14584772 | ||
![]() |
7d51524251 | ||
![]() |
7a9aac79f9 | ||
![]() |
085ae0d1c4 | ||
![]() |
f748a682ca | ||
![]() |
df987cc954 | ||
![]() |
535fc42747 | ||
![]() |
1da31bc2e1 | ||
![]() |
9515ca59f2 | ||
![]() |
eaf9017aa4 | ||
![]() |
f51ad39ad9 | ||
![]() |
9133b16431 | ||
![]() |
909a3eb44e | ||
![]() |
778aa64c54 | ||
![]() |
7049f80a01 | ||
![]() |
87b90b7fd7 | ||
![]() |
b3690494ab | ||
![]() |
f4e6b515c2 | ||
![]() |
a721540e6c | ||
![]() |
3fd05d001f | ||
![]() |
f04b114b64 | ||
![]() |
da87be2b12 | ||
![]() |
891265b390 | ||
![]() |
f46e44d3ed | ||
![]() |
a4094a440d | ||
![]() |
46c3da21e1 | ||
![]() |
2f06ea2587 | ||
![]() |
cfbf6b73ff | ||
![]() |
c687a7d0d3 | ||
![]() |
009cc71f9b | ||
![]() |
de1cf208ce | ||
![]() |
5f49472fa4 | ||
![]() |
2076302170 | ||
![]() |
2a33e187eb | ||
![]() |
00149e03c0 | ||
![]() |
57d529c17a | ||
![]() |
d492fcf29a | ||
![]() |
d0caa35b39 | ||
![]() |
ec7a00af92 | ||
![]() |
76a3aba7e0 | ||
![]() |
7003ac3f4d | ||
![]() |
964be0fa1c | ||
![]() |
c1defceccf | ||
![]() |
260394623d | ||
![]() |
478c2d5b12 | ||
![]() |
49cfbd9a49 | ||
![]() |
d028f46fab | ||
![]() |
57b24a200e | ||
![]() |
269dfe87e0 | ||
![]() |
6a1c465d85 | ||
![]() |
bc7d5c1f8f | ||
![]() |
8aabef423c | ||
![]() |
bd564a99a3 | ||
![]() |
b052ad0923 | ||
![]() |
c65a68251e | ||
![]() |
93925042dd | ||
![]() |
e55b59d9ca | ||
![]() |
f8469d02f7 | ||
![]() |
dc10b88cec | ||
![]() |
4406a3f173 | ||
![]() |
9c2e698514 | ||
![]() |
463700b76d | ||
![]() |
86387fbe49 | ||
![]() |
a018cfa56c | ||
![]() |
b76054beba | ||
![]() |
f8536162f2 | ||
![]() |
af65ddd012 | ||
![]() |
fe9dc131bc | ||
![]() |
bb4a668ddd | ||
![]() |
3978137534 | ||
![]() |
3ef4d0d798 | ||
![]() |
e2341f5217 | ||
![]() |
abd3cd54bc | ||
![]() |
dc8ac38494 | ||
![]() |
e3eacf2bf7 | ||
![]() |
5098519d46 | ||
![]() |
82c36aea89 | ||
![]() |
05787d94ec | ||
![]() |
f8c48349a1 | ||
![]() |
1ee84033ec | ||
![]() |
f2eecf8a4e | ||
![]() |
76e1040232 | ||
![]() |
4686d6709e | ||
![]() |
2cc7ec90a8 | ||
![]() |
99adb16090 | ||
![]() |
c622d50814 | ||
![]() |
11991e62f5 | ||
![]() |
82d90e599c | ||
![]() |
45b7947cd0 | ||
![]() |
2e21cf76de | ||
![]() |
76151110e5 | ||
![]() |
5875d8bff3 | ||
![]() |
68ecb13d14 | ||
![]() |
f9f4b60b83 | ||
![]() |
4fc36b9e99 | ||
![]() |
4f3d77963f | ||
![]() |
d911928c59 | ||
![]() |
22e156e0af | ||
![]() |
6fe02895a8 | ||
![]() |
395dbaa5c6 | ||
![]() |
efe06f133d | ||
![]() |
9c0475ebfa | ||
![]() |
e740a42366 | ||
![]() |
cc31a90931 | ||
![]() |
90e457a671 | ||
![]() |
7487cd7e6d | ||
![]() |
bbc3c2832f | ||
![]() |
879c6bf9ff | ||
![]() |
f2097dc4b5 | ||
![]() |
166feb5bdf | ||
![]() |
a841fe9320 | ||
![]() |
9709672b34 | ||
![]() |
e2db0bc866 | ||
![]() |
fee45e4ba6 | ||
![]() |
257d928ab3 | ||
![]() |
34c8849f22 | ||
![]() |
1c82eb3dff | ||
![]() |
7886ca65f9 | ||
![]() |
85c4ddf616 | ||
![]() |
0a36171999 | ||
![]() |
c887a6f7d8 |
31
.github/workflows/ci_file_health.yaml
vendored
31
.github/workflows/ci_file_health.yaml
vendored
@@ -12,11 +12,15 @@ jobs:
|
||||
ci:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install tools
|
||||
- name: Setup python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "*"
|
||||
@@ -32,7 +36,7 @@ jobs:
|
||||
curl \
|
||||
-L \
|
||||
-o "${{ runner.temp }}/pandoc.tar.gz" \
|
||||
"https://github.com/jgm/pandoc/releases/download/3.4/pandoc-3.4-linux-amd64.tar.gz"
|
||||
"https://github.com/jgm/pandoc/releases/download/3.6/pandoc-3.6-linux-amd64.tar.gz"
|
||||
tar -xf "${{ runner.temp }}/pandoc.tar.gz" -C "${{ github.workspace }}/.."
|
||||
mv "${{ github.workspace }}/.."/pandoc-* "${{ env.pandoc_path }}"
|
||||
# run pandoc
|
||||
@@ -42,3 +46,26 @@ jobs:
|
||||
done
|
||||
# check diff, ignore "Automatically generated by ..." part
|
||||
git diff -I '\.\\".*' --exit-code
|
||||
|
||||
- name: Check GitHub Actions workflow
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
pip install zizmor
|
||||
IGNORE_RULEID='(.ruleId != "template-injection")
|
||||
and (.ruleId != "unpinned-uses")'
|
||||
IGNORE_ID='(.id != "template-injection")
|
||||
and (.id != "unpinned-uses")'
|
||||
zizmor \
|
||||
--format sarif \
|
||||
--pedantic \
|
||||
./ \
|
||||
| jq "(.runs[].results |= map(select($IGNORE_RULEID)))
|
||||
| (.runs[].tool.driver.rules |= map(select($IGNORE_ID)))" \
|
||||
> "${{ runner.temp }}/zizmor_results.sarif"
|
||||
|
||||
- name: Upload zizmor results
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
with:
|
||||
category: zizmor
|
||||
sarif_file: "${{ runner.temp }}/zizmor_results.sarif"
|
||||
|
13
.github/workflows/ci_macos.yaml
vendored
13
.github/workflows/ci_macos.yaml
vendored
@@ -2,8 +2,7 @@ name: CI - macOS
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
@@ -13,11 +12,13 @@ jobs:
|
||||
ci:
|
||||
name: Build
|
||||
runs-on: macos-latest
|
||||
permissions:
|
||||
actions: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
libt_version: ["2.0.10", "1.2.19"]
|
||||
libt_version: ["2.0.11", "1.2.20"]
|
||||
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
||||
qt_version: ["6.7.0"]
|
||||
|
||||
@@ -28,6 +29,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install dependencies
|
||||
uses: Wandalen/wretry.action@v3
|
||||
@@ -57,7 +60,7 @@ jobs:
|
||||
BOOST_MINOR_VERSION: "86"
|
||||
BOOST_PATCH_VERSION: "0"
|
||||
run: |
|
||||
boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
|
||||
boost_url="https://archives.boost.io/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
|
||||
boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
|
||||
set +e
|
||||
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
|
||||
@@ -90,7 +93,7 @@ jobs:
|
||||
-G "Ninja" \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_CXX_STANDARD=17 \
|
||||
-DCMAKE_CXX_STANDARD=20 \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-DBOOST_ROOT="${{ env.boost_path }}" \
|
||||
-Ddeprecated-functions=OFF
|
||||
|
6
.github/workflows/ci_python.yaml
vendored
6
.github/workflows/ci_python.yaml
vendored
@@ -16,6 +16,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup python (auxiliary scripts)
|
||||
uses: actions/setup-python@v5
|
||||
@@ -34,7 +36,7 @@ jobs:
|
||||
- name: Lint code (auxiliary scripts)
|
||||
run: |
|
||||
pyflakes $PY_FILES
|
||||
bandit --skip B314,B405 $PY_FILES
|
||||
bandit --skip B101,B314,B405 $PY_FILES
|
||||
|
||||
- name: Format code (auxiliary scripts)
|
||||
run: |
|
||||
@@ -61,7 +63,7 @@ jobs:
|
||||
echo $PY_FILES
|
||||
echo "PY_FILES=$PY_FILES" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Check typings (search engine)
|
||||
- name: Check typings (search engine)
|
||||
run: |
|
||||
MYPYPATH="src/searchengine/nova3" \
|
||||
mypy \
|
||||
|
31
.github/workflows/ci_ubuntu.yaml
vendored
31
.github/workflows/ci_ubuntu.yaml
vendored
@@ -2,9 +2,7 @@ name: CI - Ubuntu
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
security-events: write
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
@@ -14,22 +12,27 @@ jobs:
|
||||
ci:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: write
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
libt_version: ["2.0.10", "1.2.19"]
|
||||
libt_version: ["2.0.11", "1.2.20"]
|
||||
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
||||
qt_version: ["6.5.2"]
|
||||
|
||||
env:
|
||||
boost_path: "${{ github.workspace }}/../boost"
|
||||
harden_flags: "-D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS"
|
||||
harden_flags: "-D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS"
|
||||
libtorrent_path: "${{ github.workspace }}/../libtorrent"
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
@@ -49,10 +52,10 @@ jobs:
|
||||
- name: Install boost
|
||||
env:
|
||||
BOOST_MAJOR_VERSION: "1"
|
||||
BOOST_MINOR_VERSION: "76"
|
||||
BOOST_MINOR_VERSION: "77"
|
||||
BOOST_PATCH_VERSION: "0"
|
||||
run: |
|
||||
boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
|
||||
boost_url="https://archives.boost.io/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
|
||||
boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
|
||||
set +e
|
||||
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
|
||||
@@ -85,6 +88,7 @@ jobs:
|
||||
-G "Ninja" \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_CXX_STANDARD=20 \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-DBOOST_ROOT="${{ env.boost_path }}" \
|
||||
-Ddeprecated-functions=OFF
|
||||
@@ -134,16 +138,15 @@ jobs:
|
||||
|
||||
- name: Install AppImage
|
||||
run: |
|
||||
sudo apt install libfuse2
|
||||
curl \
|
||||
-L \
|
||||
-Z \
|
||||
-O https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-static-x86_64.AppImage \
|
||||
-O https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-static-x86_64.AppImage \
|
||||
-O https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage \
|
||||
-O https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage \
|
||||
-O https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage
|
||||
chmod +x \
|
||||
linuxdeploy-static-x86_64.AppImage \
|
||||
linuxdeploy-plugin-qt-static-x86_64.AppImage \
|
||||
linuxdeploy-x86_64.AppImage \
|
||||
linuxdeploy-plugin-qt-x86_64.AppImage \
|
||||
linuxdeploy-plugin-appimage-x86_64.AppImage
|
||||
|
||||
- name: Prepare files for AppImage
|
||||
@@ -156,12 +159,12 @@ jobs:
|
||||
|
||||
- name: Package AppImage
|
||||
run: |
|
||||
./linuxdeploy-static-x86_64.AppImage --appdir qbittorrent --plugin qt
|
||||
./linuxdeploy-x86_64.AppImage --appdir qbittorrent --plugin qt
|
||||
rm qbittorrent/apprun-hooks/*
|
||||
cp .github/workflows/helper/appimage/export_vars.sh qbittorrent/apprun-hooks/export_vars.sh
|
||||
NO_APPSTREAM=1 \
|
||||
OUTPUT=upload/qbittorrent-CI_Ubuntu_x86_64.AppImage \
|
||||
./linuxdeploy-static-x86_64.AppImage --appdir qbittorrent --output appimage
|
||||
./linuxdeploy-x86_64.AppImage --appdir qbittorrent --output appimage
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
|
12
.github/workflows/ci_webui.yaml
vendored
12
.github/workflows/ci_webui.yaml
vendored
@@ -2,8 +2,7 @@ name: CI - WebUI
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
permissions:
|
||||
security-events: write
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
@@ -13,6 +12,8 @@ jobs:
|
||||
ci:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
|
||||
defaults:
|
||||
run:
|
||||
@@ -21,6 +22,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup nodejs
|
||||
uses: actions/setup-node@v4
|
||||
@@ -28,7 +31,10 @@ jobs:
|
||||
node-version: 'lts/*'
|
||||
|
||||
- name: Install tools
|
||||
run: npm install
|
||||
run: |
|
||||
npm install
|
||||
npm ls
|
||||
npm ls --all
|
||||
|
||||
- name: Lint code
|
||||
run: npm run lint
|
||||
|
12
.github/workflows/ci_windows.yaml
vendored
12
.github/workflows/ci_windows.yaml
vendored
@@ -2,8 +2,7 @@ name: CI - Windows
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
@@ -13,11 +12,13 @@ jobs:
|
||||
ci:
|
||||
name: Build
|
||||
runs-on: windows-latest
|
||||
permissions:
|
||||
actions: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
libt_version: ["2.0.10", "1.2.19"]
|
||||
libt_version: ["2.0.11", "1.2.20"]
|
||||
|
||||
env:
|
||||
boost_path: "${{ github.workspace }}/../boost"
|
||||
@@ -27,6 +28,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup devcmd
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
@@ -81,7 +84,7 @@ jobs:
|
||||
BOOST_MINOR_VERSION: "86"
|
||||
BOOST_PATCH_VERSION: "0"
|
||||
run: |
|
||||
$boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
|
||||
$boost_url="https://archives.boost.io/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
|
||||
$boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
|
||||
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
|
||||
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."
|
||||
@@ -115,6 +118,7 @@ jobs:
|
||||
-B build `
|
||||
-G "Ninja" `
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
||||
-DCMAKE_CXX_STANDARD=20 `
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
|
||||
-DCMAKE_INSTALL_PREFIX="${{ env.libtorrent_path }}/install" `
|
||||
-DCMAKE_TOOLCHAIN_FILE="${{ env.vcpkg_path }}/scripts/buildsystems/vcpkg.cmake" `
|
||||
|
7
.github/workflows/coverity-scan.yaml
vendored
7
.github/workflows/coverity-scan.yaml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
libt_version: ["2.0.10"]
|
||||
libt_version: ["2.0.11"]
|
||||
qbt_gui: ["GUI=ON"]
|
||||
qt_version: ["6.5.2"]
|
||||
|
||||
@@ -26,6 +26,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
@@ -40,7 +42,7 @@ jobs:
|
||||
BOOST_MINOR_VERSION: "86"
|
||||
BOOST_PATCH_VERSION: "0"
|
||||
run: |
|
||||
boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
|
||||
boost_url="https://archives.boost.io/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
|
||||
boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
|
||||
set +e
|
||||
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
|
||||
@@ -71,6 +73,7 @@ jobs:
|
||||
-B build \
|
||||
-G "Ninja" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_CXX_STANDARD=20 \
|
||||
-DBOOST_ROOT="${{ env.boost_path }}" \
|
||||
-Ddeprecated-functions=OFF
|
||||
cmake --build build
|
||||
|
95
.github/workflows/helper/pre-commit/check_grid_items_order.py
vendored
Executable file
95
.github/workflows/helper/pre-commit/check_grid_items_order.py
vendored
Executable file
@@ -0,0 +1,95 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# A pre-commit hook for checking items order in grid layouts
|
||||
# Copyright (C) 2024 Mike Tzou (Chocobo1)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# In addition, as a special exception, the copyright holders give permission to
|
||||
# link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||
# modified versions of it that use the same license as the "OpenSSL" library),
|
||||
# and distribute the linked executables. You must obey the GNU General Public
|
||||
# License in all respects for all of the code used other than "OpenSSL". If you
|
||||
# modify file(s), you may extend this exception to your version of the file(s),
|
||||
# but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
# exception statement from your version.
|
||||
|
||||
from collections.abc import Callable, Sequence
|
||||
from typing import Optional
|
||||
import argparse
|
||||
import re
|
||||
import xml.etree.ElementTree as ElementTree
|
||||
import sys
|
||||
|
||||
|
||||
def traversePostOrder(root: ElementTree.Element, visitFunc: Callable[[ElementTree.Element], None]) -> None:
|
||||
stack = [(root, False)]
|
||||
|
||||
while len(stack) > 0:
|
||||
(element, visit) = stack.pop()
|
||||
if visit:
|
||||
visitFunc(element)
|
||||
else:
|
||||
stack.append((element, True))
|
||||
stack.extend((child, False) for child in reversed(element))
|
||||
|
||||
|
||||
def modifyElement(element: ElementTree.Element) -> None:
|
||||
def getSortKey(e: ElementTree.Element) -> tuple[int, int]:
|
||||
if e.tag == 'item':
|
||||
return (int(e.attrib['row']), int(e.attrib['column']))
|
||||
return (-1, -1) # don't care
|
||||
|
||||
if element.tag == 'layout' and element.attrib['class'] == 'QGridLayout' and len(element) > 0:
|
||||
element[:] = sorted(element, key=getSortKey)
|
||||
|
||||
# workaround_2a: ElementTree will unescape `"` and we need to escape it back
|
||||
if element.tag == 'string' and element.text is not None:
|
||||
element.text = element.text.replace('"', '"')
|
||||
|
||||
|
||||
def main(argv: Optional[Sequence[str]] = None) -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('filenames', nargs='*', help='Filenames to check')
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
for filename in args.filenames:
|
||||
with open(filename, 'r+') as f:
|
||||
orig = f.read()
|
||||
root = ElementTree.fromstring(orig)
|
||||
traversePostOrder(root, modifyElement)
|
||||
ElementTree.indent(root, ' ')
|
||||
|
||||
# workaround_1: cannot use `xml_declaration=True` since it uses single quotes instead of Qt preferred double quotes
|
||||
ret = f'<?xml version="1.0" encoding="UTF-8"?>\n{ElementTree.tostring(root, 'unicode')}\n'
|
||||
|
||||
# workaround_2b: ElementTree will turn `"` into `&quot;`, so revert it back
|
||||
ret = ret.replace('&quot;', '"')
|
||||
|
||||
# workaround_3: Qt prefers no whitespaces in self-closing tags
|
||||
ret = re.sub('<(.+) +/>', r'<\1/>', ret)
|
||||
|
||||
if ret != orig:
|
||||
print(f'Tip: run this script to apply the fix: `python {__file__} {filename}`', file=sys.stderr)
|
||||
|
||||
f.seek(0)
|
||||
f.write(ret)
|
||||
f.truncate()
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
@@ -26,9 +26,11 @@
|
||||
# but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
# exception statement from your version.
|
||||
|
||||
from typing import Optional, Sequence
|
||||
from collections.abc import Sequence
|
||||
from typing import Optional
|
||||
import argparse
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
||||
def main(argv: Optional[Sequence[str]] = None) -> int:
|
||||
@@ -67,4 +69,4 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
exit(main())
|
||||
sys.exit(main())
|
||||
|
5
.github/workflows/stale_bot.yaml
vendored
5
.github/workflows/stale_bot.yaml
vendored
@@ -4,12 +4,13 @@ on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Mark and close stale PRs
|
||||
uses: actions/stale@v9
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -41,7 +41,3 @@ src/icons/skin/build-icons/icons/*.png
|
||||
|
||||
# CMake build directory
|
||||
build/
|
||||
|
||||
# Web UI tools
|
||||
node_modules
|
||||
package-lock.json
|
||||
|
@@ -1,6 +1,12 @@
|
||||
repos:
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: check-grid-order
|
||||
name: Check items order in grid layouts
|
||||
entry: .github/workflows/helper/pre-commit/check_grid_items_order.py
|
||||
language: script
|
||||
files: \.ui$
|
||||
|
||||
- id: check-translation-tag
|
||||
name: Check newline characters in <translation> tag
|
||||
entry: .github/workflows/helper/pre-commit/check_translation_tag.py
|
||||
@@ -13,7 +19,7 @@ repos:
|
||||
- ts
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks.git
|
||||
rev: v4.6.0
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: check-json
|
||||
name: Check JSON files
|
||||
@@ -63,7 +69,7 @@ repos:
|
||||
- ts
|
||||
|
||||
- repo: https://github.com/codespell-project/codespell.git
|
||||
rev: v2.3.0
|
||||
rev: v2.4.0
|
||||
hooks:
|
||||
- id: codespell
|
||||
name: Check spelling (codespell)
|
||||
@@ -82,7 +88,7 @@ repos:
|
||||
- ts
|
||||
|
||||
- repo: https://github.com/crate-ci/typos.git
|
||||
rev: v1.25.0
|
||||
rev: v1.29.4
|
||||
hooks:
|
||||
- id: typos
|
||||
name: Check spelling (typos)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[o:sledgehammer999:p:qbittorrent:r:qbittorrent_master]
|
||||
[o:sledgehammer999:p:qbittorrent:r:qbittorrent_v51x]
|
||||
file_filter = src/lang/qbittorrent_<lang>.ts
|
||||
source_file = src/lang/qbittorrent_en.ts
|
||||
source_lang = en
|
||||
@@ -9,7 +9,7 @@ type = QT
|
||||
minimum_perc = 23
|
||||
lang_map = pt: pt_PT, zh: zh_CN
|
||||
|
||||
[o:sledgehammer999:p:qbittorrent:r:qbittorrent_webui]
|
||||
[o:sledgehammer999:p:qbittorrent:r:qbittorrent_webui_v51x]
|
||||
file_filter = src/webui/www/translations/webui_<lang>.ts
|
||||
source_file = src/webui/www/translations/webui_en.ts
|
||||
source_lang = en
|
||||
|
119
Changelog
119
Changelog
@@ -1,4 +1,121 @@
|
||||
Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v5.1.0
|
||||
Wed Jul 02nd 2025 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v5.1.2
|
||||
- BUGFIX: Don't expose palette colors in UI theme editor since they are not customizable (glassez)
|
||||
- BUGFIX: Add fallback to update mechanism (sledgehammer999)
|
||||
- WEBUI: Fix incorrectly backported changes (glassez)
|
||||
- WEBAPI: Trim leading whitespaces on Run External Program fields (Chocobo1)
|
||||
- RSS/SEARCH: Prevent opening local files if web page is expected (glassez)
|
||||
- MACOS: Make qBittorrent quit on MacOS with main window closed (Ryu481)
|
||||
|
||||
Mon Jun 23rd 2025 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v5.1.1
|
||||
- BUGFIX: Don't interpret wildcard pattern as filepath globbing (glassez)
|
||||
- BUGFIX: Fix appearance of search history length spinbox (glassez)
|
||||
- BUGFIX: Remove dubious seeding time max value (glassez)
|
||||
- BUGFIX: Fix ratio handling (glassez)
|
||||
- BUGFIX: Fix compilation with Qt 6.6.0 (glassez)
|
||||
- WEBUI: Make General tab text selectable by default (dezza)
|
||||
- WEBUI: Add versioning to local preferences (Chocobo1)
|
||||
- WEBUI: Make multi-rename search & replace fields use a monospace font (Atk)
|
||||
- WEBUI: Fix wrong replacement sequence in IPv6 string (Chocobo1)
|
||||
- WEBUI: Fix memory leak (bolshoytoster)
|
||||
- WEBUI: Fix path autofill in set location and new category (tehcneko)
|
||||
- RSS: Mark matched article as "read" if it refers to a duplicate torrent (glassez)
|
||||
- WINDOWS: Update command line help message (KanishkaHalder1771)
|
||||
- WINDOWS: NSIS: Don't require agreement on the license page (Chocobo1)
|
||||
- LINUX: Fix preview not opening on Wayland (Isak05)
|
||||
- LINUX: Add fallback for random number generator (Chocobo1)
|
||||
|
||||
Sun Apr 27th 2025 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v5.1.0
|
||||
- FEATURE: Enable customizing the save statistics time interval (Burnerelu)
|
||||
- FEATURE: Add drag support to torrent content widget (Chocobo1)
|
||||
- FEATURE: Display External IP Address in status bar (Thomas Piccirello)
|
||||
- FEATURE: Use modern functions to get random numbers under Linux/Windows (security related) (Chocobo1)
|
||||
- FEATURE: Add eXact Length parameter when creating magnet URI (antanilol)
|
||||
- FEATURE: Support fetching tracker list from URL (Thomas Piccirello)
|
||||
- FEATURE: Add `announce_port` support (Maxime Thiebaut)
|
||||
- BUGFIX: Enable adaptive step size for upload and download limits (Harald Nordgren)
|
||||
- BUGFIX: Add URL link for reverse proxy setup examples (Chocobo1)
|
||||
- BUGFIX: Allow drop action only on transfer list (Chocobo1)
|
||||
- BUGFIX: Fix the tab order in dialogs (thalieht)
|
||||
- BUGFIX: Fix filesize sorting in preview dialog (DoubleSpicy)
|
||||
- BUGFIX: Improve the speed icons in the status bar (Mahdi Hosseinzadeh)
|
||||
- BUGFIX: Update link to news (tinyboxvk)
|
||||
- BUGFIX: Fix tab stop order in various dialogs and UI elements (Chocobo1)
|
||||
- BUGFIX: Make links accessible by keyboard (Chocobo1)
|
||||
- BUGFIX: Make tab key switch focus (Chocobo1)
|
||||
- BUGFIX: Revise DHT bootstrap node list (stalkerok, Chocobo1)
|
||||
- BUGFIX: Return first tracker as fallback for "current tracker" (glassez)
|
||||
- BUGFIX: Prevent crash when exiting app with `Add torrent` dialogs opened (glassez)
|
||||
- BUGFIX: Fix torrent relocating files when switching to "manual" mode (glassez)
|
||||
- BUGFIX: Prevent crash due to corrupted resume data (glassez)
|
||||
- WEBUI: Improvements that should help with assistive technologies (Chocobo1)
|
||||
- WEBUI: Internal refactoring to migrate away from MooTools and towards native browser APIs (Chocobo1, skomerko)
|
||||
- WEBUI: Implement path autocompletion (Paweł Kotiuk)
|
||||
- WEBUI: Implement double-click behavior controls (Hanabishi)
|
||||
- WEBUI: Add ability to toggle alternating row colors in tables (skomerko)
|
||||
- WEBUI: Improve visibility of unread RSS articles (skomerko)
|
||||
- WEBUI: Remove deleted torrents even if they are currently filtered out (Carmelo Scandaliato)
|
||||
- WEBUI: Highlight torrent category in context menu (skomerko)
|
||||
- WEBUI: Implement 'Auto hide zero status filters' (skomerko)
|
||||
- WEBUI: Allow to filter torrent list by save path (skomerko)
|
||||
- WEBUI: Handle regex syntax error for torrent filtering (HamletDuFromage)
|
||||
- WEBUI: Add missing icons (skomerko)
|
||||
- WEBUI: Add link to 'List of alternative WebUI' wiki page in Options (Chocobo1)
|
||||
- WEBUI: Improve properties panel, torrent deletion dialog, filter list, subcategories, torrent deletion, statistics window (skomerko)
|
||||
- WEBUI: Allow to display only hostname in the Tracker column (skomerko)
|
||||
- WEBUI: Show country/region name next to its flag (skomerko)
|
||||
- WEBUI: Improve hash copy actions in context menu (skomerko)
|
||||
- WEBUI: Support removing tracker from all torrents in WebUI/WebAPI (Thomas Piccirello)
|
||||
- WEBUI: Display DHT information in the Status bar only when DHT is enabled (skomerko)
|
||||
- WEBUI: Add 'Confirm torrent recheck' option (skomerko)
|
||||
- WEBUI: Support managing web seeds (Thomas Piccirello)
|
||||
- WEBUI: Add colors to log table rows (skomerko)
|
||||
- WEBUI: Prevent text selection within tabs, menu items (skomerko)
|
||||
- WEBUI: Use correct text and background colors in RSS details view (skomerko)
|
||||
- WEBUI: Reduce padding in torrents table (skomerko)
|
||||
- WEBUI: Add WebAPI/WebUI for managing cookies (Thomas Piccirello)
|
||||
- WEBUI: Support updating RSS feed URL (Thomas Piccirello)
|
||||
- WEBUI: Add 'Engine' column to Search table (skomerko)
|
||||
- WEBUI: Add confirm dialog for Auto TMM (skomerko)
|
||||
- WEBUI: Add context menu to search tabs (skomerko)
|
||||
- WEBUI: Show file filter when Content tab selected on load (Thomas Piccirello)
|
||||
- WEBUI: DHT, PeX and LSD rows are now always on top in Trackers table (skomerko)
|
||||
- WEBUI: Clear properties panel when torrent no longer selected (skomerko)
|
||||
- WEBUI: Support auto resizing table columns (Thomas Piccirello)
|
||||
- WEBUI: Fix displaying RSS panel on load (Thomas Piccirello)
|
||||
- WEBUI: Add tooltip to regex filter button (Patrik Elfström)
|
||||
- WEBUI: Hide context menu when clicking on a table row (Patrik Elfström)
|
||||
- WEBUI: Display torrent progress percentage in General tab (skomerko)
|
||||
- WEBUI: Use thin scrollbars (skomerko)
|
||||
- WEBUI: Show 'Rename...' context menu item only when one torrent is selected (skomerko)
|
||||
- WEBUI: Display error when download fails (Thomas Piccirello)
|
||||
- WEBUI: Add colors to 'Status' column in Trackers table (skomerko)
|
||||
- WEBUI: Add missing icon to 'Queue' context menu item (skomerko)
|
||||
- WEBUI: Change filter inputs to type search (Patrik Elfström)
|
||||
- WEBUI: Allow to move state icon to name column in torrents table (skomerko)
|
||||
- WEBUI: Fix bug where the 'Tracker editing' dialog displays incorrect data (skomerko)
|
||||
- WEBUI: Maintain row highlight after rearranging table columns (skomerko)
|
||||
- WEBUI: Fix preferences not applied in magnet handler (Chocobo1)
|
||||
- WEBUI: Update sort icon after changing column order (skomerko)
|
||||
- WEBUI: Show 'Edit tracker URL...' only when one tracker is selected (skomerko)
|
||||
- WEBUI: Set status filter to 'All' if selected filter is no longer visible (skomerko)
|
||||
- WEBAPI: Don't reannounce when removing tracker via WebAPI (Thomas Piccirello)
|
||||
- WEBAPI: Add WebAPI for managing torrent webseeds (Thomas Piccirello)
|
||||
- WEBAPI: Add `forced` parameter to `torrents/add` (Chris B)
|
||||
- WEBAPI: Optionally include trackers list in torrent info response (ze0s)
|
||||
- WEBAPI: Add new method `setTags` to upsert tags on torrents (ze0s)
|
||||
- RSS: Resolve relative URLs within RSS article description (Zentino)
|
||||
- SEARCH: Provide SSL context field (Chocobo1)
|
||||
- SEARCH: Allow to refresh existing search (glassez)
|
||||
- SEARCH: Allow multiple simultaneous searches (glassez)
|
||||
- SEARCH: Store opened search tabs (glassez)
|
||||
- SEARCH: Store search history (glassez)
|
||||
- SEARCH: Migrate socks.py from SocksiPy to PySocks 1.7.1 (FredBill1)
|
||||
- SEARCH: Bump Python version minimum requirement (Chocobo1)
|
||||
- WINDOWS: Opt into Windows SegmentHeap (Andarwinux)
|
||||
- WINDOWS: Allow to choose color scheme on Windows (glassez)
|
||||
- WINDOWS: Verify hash of Python installer (Chocobo1)
|
||||
- LINUX: Add support for Thunar file manager (algebnaly)
|
||||
- MACOS: Fix shift-click selection on macOS (Luke Memet)
|
||||
|
||||
Mon Oct 28th 2024 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v5.0.1
|
||||
- FEATURE: Add "Simple pread/pwrite" disk IO type (Hanabishi)
|
||||
|
@@ -47,6 +47,9 @@ find_package(Boost ${minBoostVersion} REQUIRED)
|
||||
find_package(OpenSSL ${minOpenSSLVersion} REQUIRED)
|
||||
find_package(ZLIB ${minZlibVersion} REQUIRED)
|
||||
find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS Core Network Sql Xml LinguistTools)
|
||||
if (Qt6_FOUND AND (Qt6_VERSION VERSION_GREATER_EQUAL 6.10))
|
||||
find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS CorePrivate)
|
||||
endif()
|
||||
if (DBUS)
|
||||
find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS DBus)
|
||||
set_package_properties(Qt6DBus PROPERTIES
|
||||
|
4
dist/mac/Info.plist
vendored
4
dist/mac/Info.plist
vendored
@@ -55,7 +55,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.1.0</string>
|
||||
<string>5.1.2</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@@ -67,7 +67,7 @@
|
||||
<key>NSAppleScriptEnabled</key>
|
||||
<string>YES</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2006-2024 The qBittorrent project</string>
|
||||
<string>Copyright © 2006-2025 The qBittorrent project</string>
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
146
dist/unix/org.qbittorrent.qBittorrent.desktop
vendored
146
dist/unix/org.qbittorrent.qBittorrent.desktop
vendored
File diff suppressed because it is too large
Load Diff
@@ -62,6 +62,6 @@
|
||||
<url type="contribute">https://github.com/qbittorrent/qBittorrent/blob/master/CONTRIBUTING.md</url>
|
||||
<content_rating type="oars-1.1"/>
|
||||
<releases>
|
||||
<release version="5.1.0~beta1" date="2024-12-16"/>
|
||||
<release version="5.1.2" date="2025-07-02"/>
|
||||
</releases>
|
||||
</component>
|
||||
|
7
dist/windows/config.nsh
vendored
7
dist/windows/config.nsh
vendored
@@ -14,7 +14,7 @@
|
||||
; 4.5.1.3 -> good
|
||||
; 4.5.1.3.2 -> bad
|
||||
; 4.5.0beta -> bad
|
||||
!define /ifndef QBT_VERSION "5.1.0"
|
||||
!define /ifndef QBT_VERSION "5.1.2"
|
||||
|
||||
; Option that controls the installer's window name
|
||||
; If set, its value will be used like this:
|
||||
@@ -86,7 +86,7 @@ OutFile "qbittorrent_${QBT_INSTALLER_FILENAME}_setup.exe"
|
||||
;Installer Version Information
|
||||
VIAddVersionKey "ProductName" "qBittorrent"
|
||||
VIAddVersionKey "CompanyName" "The qBittorrent project"
|
||||
VIAddVersionKey "LegalCopyright" "Copyright ©2006-2024 The qBittorrent project"
|
||||
VIAddVersionKey "LegalCopyright" "Copyright ©2006-2025 The qBittorrent project"
|
||||
VIAddVersionKey "FileDescription" "qBittorrent - A Bittorrent Client"
|
||||
VIAddVersionKey "FileVersion" "${QBT_VERSION}"
|
||||
|
||||
@@ -111,7 +111,8 @@ RequestExecutionLevel user
|
||||
!define MUI_HEADERIMAGE
|
||||
!define MUI_COMPONENTSPAGE_NODESC
|
||||
;!define MUI_ICON "qbittorrent.ico"
|
||||
!define MUI_LICENSEPAGE_CHECKBOX
|
||||
!define MUI_LICENSEPAGE_BUTTON $(^NextBtn)
|
||||
!define MUI_LICENSEPAGE_TEXT_BOTTOM "$_CLICK"
|
||||
!define MUI_LANGDLL_ALLLANGUAGES
|
||||
|
||||
;--------------------------------
|
||||
|
@@ -7,7 +7,7 @@ LangString inst_desktop ${LANG_PORTUGUESE} "Criar atalho no ambiente de trabalho
|
||||
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
|
||||
LangString inst_startmenu ${LANG_PORTUGUESE} "Criar atalho no menu Iniciar"
|
||||
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
|
||||
LangString inst_startup ${LANG_PORTUGUESE} "Iniciar o qBittorrent na inicialização do Windows"
|
||||
LangString inst_startup ${LANG_PORTUGUESE} "Iniciar o qBittorrent no arranque do Windows"
|
||||
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
|
||||
LangString inst_torrent ${LANG_PORTUGUESE} "Abrir ficheiros .torrent com o qBittorrent"
|
||||
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
|
||||
@@ -29,7 +29,7 @@ LangString launch_qbt ${LANG_PORTUGUESE} "Iniciar qBittorrent."
|
||||
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
|
||||
LangString inst_requires_64bit ${LANG_PORTUGUESE} "Este instalador funciona apenas em versões Windows de 64 bits."
|
||||
;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
|
||||
LangString inst_requires_win10 ${LANG_PORTUGUESE} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
|
||||
LangString inst_requires_win10 ${LANG_PORTUGUESE} "Este instalador requer, pelo menos, o Windows 10 (1809) / Windows Server 2019."
|
||||
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
|
||||
LangString inst_uninstall_link_description ${LANG_PORTUGUESE} "Desinstalar qBittorrent"
|
||||
|
||||
|
12
dist/windows/installer-translations/swedish.nsh
vendored
12
dist/windows/installer-translations/swedish.nsh
vendored
@@ -7,21 +7,21 @@ LangString inst_desktop ${LANG_SWEDISH} "Skapa skrivbordsgenväg"
|
||||
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
|
||||
LangString inst_startmenu ${LANG_SWEDISH} "Skapa startmenygenväg"
|
||||
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
|
||||
LangString inst_startup ${LANG_SWEDISH} "Starta qBittorrent vid Windows start"
|
||||
LangString inst_startup ${LANG_SWEDISH} "Starta qBittorrent vid Windows-uppstart"
|
||||
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
|
||||
LangString inst_torrent ${LANG_SWEDISH} "Öppna .torrent-filer med qBittorrent"
|
||||
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
|
||||
LangString inst_magnet ${LANG_SWEDISH} "Öppna magnetlänkar med qBittorrent"
|
||||
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
|
||||
LangString inst_firewall ${LANG_SWEDISH} "Lägg till Windows-brandväggregel"
|
||||
LangString inst_firewall ${LANG_SWEDISH} "Lägg till Windows-brandväggsregel"
|
||||
;LangString inst_pathlimit ${LANG_ENGLISH} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)"
|
||||
LangString inst_pathlimit ${LANG_SWEDISH} "Inaktivera gränsen för Windows-sökvägslängd (260 tecken MAX_PATH-begränsning, kräver Windows 10 1607 eller senare)"
|
||||
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
|
||||
LangString inst_firewallinfo ${LANG_SWEDISH} "Lägger till Windows-brandväggregel"
|
||||
LangString inst_firewallinfo ${LANG_SWEDISH} "Lägger till Windows-brandväggsregel"
|
||||
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
|
||||
LangString inst_warning ${LANG_SWEDISH} "qBittorrent körs. Vänligen stäng programmet innan du installerar."
|
||||
LangString inst_warning ${LANG_SWEDISH} "qBittorrent körs. Stäng programmet innan du installerar."
|
||||
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
|
||||
LangString inst_uninstall_question ${LANG_SWEDISH} "Nuvarande version avinstalleras. Användarinställningar och torrenter kommer att förbli intakta."
|
||||
LangString inst_uninstall_question ${LANG_SWEDISH} "Aktuell version avinstalleras. Användarinställningar och torrenter kommer att förbli intakta."
|
||||
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
|
||||
LangString inst_unist ${LANG_SWEDISH} "Avinstallerar tidigare version."
|
||||
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
|
||||
@@ -53,7 +53,7 @@ LangString remove_firewallinfo ${LANG_SWEDISH} "Tar bort Windows-brandväggsrege
|
||||
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
|
||||
LangString remove_cache ${LANG_SWEDISH} "Ta bort torrenter och cachade data"
|
||||
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
|
||||
LangString uninst_warning ${LANG_SWEDISH} "qBittorrent körs. Vänligen stäng programmet innan du avinstallerar."
|
||||
LangString uninst_warning ${LANG_SWEDISH} "qBittorrent körs. Stäng programmet innan du avinstallerar."
|
||||
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
|
||||
LangString uninst_tor_warn ${LANG_SWEDISH} "Tar inte bort .torrent-association. Den är associerad med:"
|
||||
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2015-2024 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2015-2025 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2006 Christophe Dumez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -124,6 +124,28 @@ namespace
|
||||
const int PIXMAP_CACHE_SIZE = 64 * 1024 * 1024; // 64MiB
|
||||
#endif
|
||||
|
||||
const QString PARAM_ADDSTOPPED = u"@addStopped"_s;
|
||||
const QString PARAM_CATEGORY = u"@category"_s;
|
||||
const QString PARAM_FIRSTLASTPIECEPRIORITY = u"@firstLastPiecePriority"_s;
|
||||
const QString PARAM_SAVEPATH = u"@savePath"_s;
|
||||
const QString PARAM_SEQUENTIAL = u"@sequential"_s;
|
||||
const QString PARAM_SKIPCHECKING = u"@skipChecking"_s;
|
||||
const QString PARAM_SKIPDIALOG = u"@skipDialog"_s;
|
||||
|
||||
QString bindParamValue(const QStringView paramName, const QStringView paramValue)
|
||||
{
|
||||
return paramName + u'=' + paramValue;
|
||||
}
|
||||
|
||||
std::pair<QStringView, QStringView> parseParam(const QStringView param)
|
||||
{
|
||||
const qsizetype sepIndex = param.indexOf(u'=');
|
||||
if (sepIndex >= 0)
|
||||
return {param.first(sepIndex), param.sliced(sepIndex + 1)};
|
||||
|
||||
return {param, {}};
|
||||
}
|
||||
|
||||
QString serializeParams(const QBtCommandLineParameters ¶ms)
|
||||
{
|
||||
QStringList result;
|
||||
@@ -138,85 +160,86 @@ namespace
|
||||
const BitTorrent::AddTorrentParams &addTorrentParams = params.addTorrentParams;
|
||||
|
||||
if (!addTorrentParams.savePath.isEmpty())
|
||||
result.append(u"@savePath=" + addTorrentParams.savePath.data());
|
||||
result.append(bindParamValue(PARAM_SAVEPATH, addTorrentParams.savePath.data()));
|
||||
|
||||
if (addTorrentParams.addStopped.has_value())
|
||||
result.append(*addTorrentParams.addStopped ? u"@addStopped=1"_s : u"@addStopped=0"_s);
|
||||
result.append(bindParamValue(PARAM_ADDSTOPPED, (*addTorrentParams.addStopped ? u"1" : u"0")));
|
||||
|
||||
if (addTorrentParams.skipChecking)
|
||||
result.append(u"@skipChecking"_s);
|
||||
result.append(PARAM_SKIPCHECKING);
|
||||
|
||||
if (!addTorrentParams.category.isEmpty())
|
||||
result.append(u"@category=" + addTorrentParams.category);
|
||||
result.append(bindParamValue(PARAM_CATEGORY, addTorrentParams.category));
|
||||
|
||||
if (addTorrentParams.sequential)
|
||||
result.append(u"@sequential"_s);
|
||||
result.append(PARAM_SEQUENTIAL);
|
||||
|
||||
if (addTorrentParams.firstLastPiecePriority)
|
||||
result.append(u"@firstLastPiecePriority"_s);
|
||||
result.append(PARAM_FIRSTLASTPIECEPRIORITY);
|
||||
|
||||
if (params.skipDialog.has_value())
|
||||
result.append(*params.skipDialog ? u"@skipDialog=1"_s : u"@skipDialog=0"_s);
|
||||
result.append(bindParamValue(PARAM_SKIPDIALOG, (*params.skipDialog ? u"1" : u"0")));
|
||||
|
||||
result += params.torrentSources;
|
||||
|
||||
return result.join(PARAMS_SEPARATOR);
|
||||
}
|
||||
|
||||
QBtCommandLineParameters parseParams(const QString &str)
|
||||
QBtCommandLineParameters parseParams(const QStringView str)
|
||||
{
|
||||
QBtCommandLineParameters parsedParams;
|
||||
BitTorrent::AddTorrentParams &addTorrentParams = parsedParams.addTorrentParams;
|
||||
|
||||
for (QString param : asConst(str.split(PARAMS_SEPARATOR, Qt::SkipEmptyParts)))
|
||||
for (QStringView param : asConst(str.split(PARAMS_SEPARATOR, Qt::SkipEmptyParts)))
|
||||
{
|
||||
param = param.trimmed();
|
||||
const auto [paramName, paramValue] = parseParam(param);
|
||||
|
||||
// Process strings indicating options specified by the user.
|
||||
|
||||
if (param.startsWith(u"@savePath="))
|
||||
if (paramName == PARAM_SAVEPATH)
|
||||
{
|
||||
addTorrentParams.savePath = Path(param.mid(10));
|
||||
addTorrentParams.savePath = Path(paramValue.toString());
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param.startsWith(u"@addStopped="))
|
||||
if (paramName == PARAM_ADDSTOPPED)
|
||||
{
|
||||
addTorrentParams.addStopped = (QStringView(param).mid(11).toInt() != 0);
|
||||
addTorrentParams.addStopped = (paramValue.toInt() != 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param == u"@skipChecking")
|
||||
if (paramName == PARAM_SKIPCHECKING)
|
||||
{
|
||||
addTorrentParams.skipChecking = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param.startsWith(u"@category="))
|
||||
if (paramName == PARAM_CATEGORY)
|
||||
{
|
||||
addTorrentParams.category = param.mid(10);
|
||||
addTorrentParams.category = paramValue.toString();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param == u"@sequential")
|
||||
if (paramName == PARAM_SEQUENTIAL)
|
||||
{
|
||||
addTorrentParams.sequential = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param == u"@firstLastPiecePriority")
|
||||
if (paramName == PARAM_FIRSTLASTPIECEPRIORITY)
|
||||
{
|
||||
addTorrentParams.firstLastPiecePriority = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (param.startsWith(u"@skipDialog="))
|
||||
if (paramName == PARAM_SKIPDIALOG)
|
||||
{
|
||||
parsedParams.skipDialog = (QStringView(param).mid(12).toInt() != 0);
|
||||
parsedParams.skipDialog = (paramValue.toInt() != 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
parsedParams.torrentSources.append(param);
|
||||
parsedParams.torrentSources.append(param.toString());
|
||||
}
|
||||
|
||||
return parsedParams;
|
||||
@@ -579,7 +602,7 @@ void Application::runExternalProgram(const QString &programTemplate, const BitTo
|
||||
const QString logMsg = tr("Running external program. Torrent: \"%1\". Command: `%2`");
|
||||
const QString logMsgError = tr("Failed to run external program. Torrent: \"%1\". Command: `%2`");
|
||||
|
||||
// The processing sequenece is different for Windows and other OS, this is intentional
|
||||
// The processing sequence is different for Windows and other OS, this is intentional
|
||||
#if defined(Q_OS_WIN)
|
||||
const QString program = replaceVariables(programTemplate);
|
||||
const std::wstring programWStr = program.toStdWString();
|
||||
@@ -897,10 +920,10 @@ int Application::exec()
|
||||
m_desktopIntegration->showNotification(tr("Torrent added"), tr("'%1' was added.", "e.g: xxx.avi was added.").arg(torrent->name()));
|
||||
});
|
||||
connect(m_addTorrentManager, &AddTorrentManager::addTorrentFailed, this
|
||||
, [this](const QString &source, const QString &reason)
|
||||
, [this](const QString &source, const BitTorrent::AddTorrentError &reason)
|
||||
{
|
||||
m_desktopIntegration->showNotification(tr("Add torrent failed")
|
||||
, tr("Couldn't add torrent '%1', reason: %2.").arg(source, reason));
|
||||
, tr("Couldn't add torrent '%1', reason: %2.").arg(source, reason.message));
|
||||
});
|
||||
|
||||
disconnect(m_desktopIntegration, &DesktopIntegration::activationRequested, this, &Application::createStartupProgressDialog);
|
||||
|
@@ -491,6 +491,12 @@ QString makeUsage(const QString &prgName)
|
||||
{
|
||||
const QString indentation {USAGE_INDENTATION, u' '};
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
const QString noSplashCommand = u"set QBT_NO_SPLASH=1 && " + prgName;
|
||||
#else
|
||||
const QString noSplashCommand = u"QBT_NO_SPLASH=1 " + prgName;
|
||||
#endif
|
||||
|
||||
const QString text = QCoreApplication::translate("CMD Options", "Usage:") + u'\n'
|
||||
+ indentation + prgName + u' ' + QCoreApplication::translate("CMD Options", "[options] [(<filename> | <url>)...]") + u'\n'
|
||||
|
||||
@@ -542,7 +548,7 @@ QString makeUsage(const QString &prgName)
|
||||
"'parameter-name', environment variable name is 'QBT_PARAMETER_NAME' (in upper "
|
||||
"case, '-' replaced with '_'). To pass flag values, set the variable to '1' or "
|
||||
"'TRUE'. For example, to disable the splash screen: "), 0) + u'\n'
|
||||
+ u"QBT_NO_SPLASH=1 " + prgName + u'\n'
|
||||
+ noSplashCommand + u'\n'
|
||||
+ wrapText(QCoreApplication::translate("CMD Options", "Command line parameters take precedence over environment variables"), 0) + u'\n';
|
||||
|
||||
return text;
|
||||
|
@@ -6,6 +6,7 @@ add_library(qbt_base STATIC
|
||||
applicationcomponent.h
|
||||
asyncfilestorage.h
|
||||
bittorrent/abstractfilestorage.h
|
||||
bittorrent/addtorrenterror.h
|
||||
bittorrent/addtorrentparams.h
|
||||
bittorrent/announcetimepoint.h
|
||||
bittorrent/bandwidthscheduler.h
|
||||
|
@@ -140,7 +140,7 @@ void AddTorrentManager::onSessionTorrentAdded(BitTorrent::Torrent *torrent)
|
||||
}
|
||||
}
|
||||
|
||||
void AddTorrentManager::onSessionAddTorrentFailed(const BitTorrent::InfoHash &infoHash, const QString &reason)
|
||||
void AddTorrentManager::onSessionAddTorrentFailed(const BitTorrent::InfoHash &infoHash, const BitTorrent::AddTorrentError &reason)
|
||||
{
|
||||
if (const QString source = m_sourcesByInfoHash.take(infoHash); !source.isEmpty())
|
||||
{
|
||||
@@ -154,7 +154,7 @@ void AddTorrentManager::onSessionAddTorrentFailed(const BitTorrent::InfoHash &in
|
||||
void AddTorrentManager::handleAddTorrentFailed(const QString &source, const QString &reason)
|
||||
{
|
||||
LogMsg(tr("Failed to add torrent. Source: \"%1\". Reason: \"%2\"").arg(source, reason), Log::WARNING);
|
||||
emit addTorrentFailed(source, reason);
|
||||
emit addTorrentFailed(source, {BitTorrent::AddTorrentError::Other, reason});
|
||||
}
|
||||
|
||||
void AddTorrentManager::handleDuplicateTorrent(const QString &source
|
||||
@@ -187,7 +187,7 @@ void AddTorrentManager::handleDuplicateTorrent(const QString &source
|
||||
|
||||
LogMsg(tr("Detected an attempt to add a duplicate torrent. Source: %1. Existing torrent: %2. Result: %3")
|
||||
.arg(source, existingTorrent->name(), message));
|
||||
emit addTorrentFailed(source, message);
|
||||
emit addTorrentFailed(source, {BitTorrent::AddTorrentError::DuplicateTorrent, message});
|
||||
}
|
||||
|
||||
void AddTorrentManager::setTorrentFileGuard(const QString &source, std::shared_ptr<TorrentFileGuard> torrentFileGuard)
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include <QObject>
|
||||
|
||||
#include "base/applicationcomponent.h"
|
||||
#include "base/bittorrent/addtorrenterror.h"
|
||||
#include "base/bittorrent/addtorrentparams.h"
|
||||
#include "base/torrentfileguard.h"
|
||||
|
||||
@@ -66,7 +67,7 @@ public:
|
||||
|
||||
signals:
|
||||
void torrentAdded(const QString &source, BitTorrent::Torrent *torrent);
|
||||
void addTorrentFailed(const QString &source, const QString &reason);
|
||||
void addTorrentFailed(const QString &source, const BitTorrent::AddTorrentError &reason);
|
||||
|
||||
protected:
|
||||
bool addTorrentToSession(const QString &source, const BitTorrent::TorrentDescriptor &torrentDescr
|
||||
@@ -79,7 +80,7 @@ protected:
|
||||
private:
|
||||
void onDownloadFinished(const Net::DownloadResult &result);
|
||||
void onSessionTorrentAdded(BitTorrent::Torrent *torrent);
|
||||
void onSessionAddTorrentFailed(const BitTorrent::InfoHash &infoHash, const QString &reason);
|
||||
void onSessionAddTorrentFailed(const BitTorrent::InfoHash &infoHash, const BitTorrent::AddTorrentError &reason);
|
||||
bool processTorrent(const QString &source, const BitTorrent::TorrentDescriptor &torrentDescr
|
||||
, const BitTorrent::AddTorrentParams &addTorrentParams);
|
||||
|
||||
|
49
src/base/bittorrent/addtorrenterror.h
Normal file
49
src/base/bittorrent/addtorrenterror.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2025 Vladimir Golovnev <glassez@yandex.ru>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
||||
* and distribute the linked executables. You must obey the GNU General Public
|
||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QMetaType>
|
||||
#include <QString>
|
||||
|
||||
namespace BitTorrent
|
||||
{
|
||||
struct AddTorrentError
|
||||
{
|
||||
enum Kind
|
||||
{
|
||||
DuplicateTorrent,
|
||||
Other
|
||||
};
|
||||
|
||||
Kind kind = Other;
|
||||
QString message;
|
||||
};
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(BitTorrent::AddTorrentError)
|
@@ -147,7 +147,7 @@ BitTorrent::LoadResumeDataResult BitTorrent::BencodeResumeDataStorage::load(cons
|
||||
const Path torrentFilePath = path() / Path(idString + u".torrent");
|
||||
const qint64 torrentSizeLimit = Preferences::instance()->getTorrentFileSizeLimit();
|
||||
|
||||
const auto resumeDataReadResult = Utils::IO::readFile(fastresumePath, torrentSizeLimit);
|
||||
const auto resumeDataReadResult = Utils::IO::readFile(fastresumePath, -1);
|
||||
if (!resumeDataReadResult)
|
||||
return nonstd::make_unexpected(resumeDataReadResult.error().message);
|
||||
|
||||
@@ -290,6 +290,8 @@ BitTorrent::LoadResumeDataResult BitTorrent::BencodeResumeDataStorage::loadTorre
|
||||
lt::add_torrent_params &p = torrentParams.ltAddTorrentParams;
|
||||
|
||||
p = lt::read_resume_data(resumeDataRoot, ec);
|
||||
if (ec)
|
||||
return nonstd::make_unexpected(tr("Cannot parse resume data: %1").arg(QString::fromStdString(ec.message())));
|
||||
|
||||
if (!metadata.isEmpty())
|
||||
{
|
||||
@@ -320,6 +322,8 @@ BitTorrent::LoadResumeDataResult BitTorrent::BencodeResumeDataStorage::loadTorre
|
||||
|
||||
p.save_path = Profile::instance()->fromPortablePath(
|
||||
Path(fromLTString(p.save_path))).toString().toStdString();
|
||||
if (p.save_path.empty())
|
||||
return nonstd::make_unexpected(tr("Corrupted resume data: %1").arg(tr("save_path is invalid")));
|
||||
|
||||
torrentParams.stopped = (p.flags & lt::torrent_flags::paused) && !(p.flags & lt::torrent_flags::auto_managed);
|
||||
torrentParams.operatingMode = (p.flags & lt::torrent_flags::paused) || (p.flags & lt::torrent_flags::auto_managed)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2021-2023 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2021-2025 Vladimir Golovnev <glassez@yandex.ru>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -217,80 +217,6 @@ namespace
|
||||
{
|
||||
return u"%1 %2"_s.arg(quoted(column.name), definition);
|
||||
}
|
||||
|
||||
LoadTorrentParams parseQueryResultRow(const QSqlQuery &query)
|
||||
{
|
||||
LoadTorrentParams resumeData;
|
||||
resumeData.name = query.value(DB_COLUMN_NAME.name).toString();
|
||||
resumeData.category = query.value(DB_COLUMN_CATEGORY.name).toString();
|
||||
const QString tagsData = query.value(DB_COLUMN_TAGS.name).toString();
|
||||
if (!tagsData.isEmpty())
|
||||
{
|
||||
const QStringList tagList = tagsData.split(u',');
|
||||
resumeData.tags.insert(tagList.cbegin(), tagList.cend());
|
||||
}
|
||||
resumeData.hasFinishedStatus = query.value(DB_COLUMN_HAS_SEED_STATUS.name).toBool();
|
||||
resumeData.firstLastPiecePriority = query.value(DB_COLUMN_HAS_OUTER_PIECES_PRIORITY.name).toBool();
|
||||
resumeData.ratioLimit = query.value(DB_COLUMN_RATIO_LIMIT.name).toInt() / 1000.0;
|
||||
resumeData.seedingTimeLimit = query.value(DB_COLUMN_SEEDING_TIME_LIMIT.name).toInt();
|
||||
resumeData.inactiveSeedingTimeLimit = query.value(DB_COLUMN_INACTIVE_SEEDING_TIME_LIMIT.name).toInt();
|
||||
resumeData.shareLimitAction = Utils::String::toEnum<ShareLimitAction>(
|
||||
query.value(DB_COLUMN_SHARE_LIMIT_ACTION.name).toString(), ShareLimitAction::Default);
|
||||
resumeData.contentLayout = Utils::String::toEnum<TorrentContentLayout>(
|
||||
query.value(DB_COLUMN_CONTENT_LAYOUT.name).toString(), TorrentContentLayout::Original);
|
||||
resumeData.operatingMode = Utils::String::toEnum<TorrentOperatingMode>(
|
||||
query.value(DB_COLUMN_OPERATING_MODE.name).toString(), TorrentOperatingMode::AutoManaged);
|
||||
resumeData.stopped = query.value(DB_COLUMN_STOPPED.name).toBool();
|
||||
resumeData.stopCondition = Utils::String::toEnum(
|
||||
query.value(DB_COLUMN_STOP_CONDITION.name).toString(), Torrent::StopCondition::None);
|
||||
resumeData.sslParameters =
|
||||
{
|
||||
.certificate = QSslCertificate(query.value(DB_COLUMN_SSL_CERTIFICATE.name).toByteArray()),
|
||||
.privateKey = Utils::SSLKey::load(query.value(DB_COLUMN_SSL_PRIVATE_KEY.name).toByteArray()),
|
||||
.dhParams = query.value(DB_COLUMN_SSL_DH_PARAMS.name).toByteArray()
|
||||
};
|
||||
|
||||
resumeData.savePath = Profile::instance()->fromPortablePath(
|
||||
Path(query.value(DB_COLUMN_TARGET_SAVE_PATH.name).toString()));
|
||||
resumeData.useAutoTMM = resumeData.savePath.isEmpty();
|
||||
if (!resumeData.useAutoTMM)
|
||||
{
|
||||
resumeData.downloadPath = Profile::instance()->fromPortablePath(
|
||||
Path(query.value(DB_COLUMN_DOWNLOAD_PATH.name).toString()));
|
||||
}
|
||||
|
||||
const QByteArray bencodedResumeData = query.value(DB_COLUMN_RESUMEDATA.name).toByteArray();
|
||||
const auto *pref = Preferences::instance();
|
||||
const int bdecodeDepthLimit = pref->getBdecodeDepthLimit();
|
||||
const int bdecodeTokenLimit = pref->getBdecodeTokenLimit();
|
||||
|
||||
lt::error_code ec;
|
||||
const lt::bdecode_node resumeDataRoot = lt::bdecode(bencodedResumeData, ec
|
||||
, nullptr, bdecodeDepthLimit, bdecodeTokenLimit);
|
||||
|
||||
lt::add_torrent_params &p = resumeData.ltAddTorrentParams;
|
||||
|
||||
p = lt::read_resume_data(resumeDataRoot, ec);
|
||||
|
||||
if (const QByteArray bencodedMetadata = query.value(DB_COLUMN_METADATA.name).toByteArray()
|
||||
; !bencodedMetadata.isEmpty())
|
||||
{
|
||||
const lt::bdecode_node torentInfoRoot = lt::bdecode(bencodedMetadata, ec
|
||||
, nullptr, bdecodeDepthLimit, bdecodeTokenLimit);
|
||||
p.ti = std::make_shared<lt::torrent_info>(torentInfoRoot, ec);
|
||||
}
|
||||
|
||||
p.save_path = Profile::instance()->fromPortablePath(Path(fromLTString(p.save_path)))
|
||||
.toString().toStdString();
|
||||
|
||||
if (p.flags & lt::torrent_flags::stop_when_ready)
|
||||
{
|
||||
p.flags &= ~lt::torrent_flags::stop_when_ready;
|
||||
resumeData.stopCondition = Torrent::StopCondition::FilesChecked;
|
||||
}
|
||||
|
||||
return resumeData;
|
||||
}
|
||||
}
|
||||
|
||||
namespace BitTorrent
|
||||
@@ -688,6 +614,90 @@ void BitTorrent::DBResumeDataStorage::enableWALMode() const
|
||||
throw RuntimeError(tr("WAL mode is probably unsupported due to filesystem limitations."));
|
||||
}
|
||||
|
||||
LoadResumeDataResult DBResumeDataStorage::parseQueryResultRow(const QSqlQuery &query) const
|
||||
{
|
||||
LoadTorrentParams resumeData;
|
||||
resumeData.name = query.value(DB_COLUMN_NAME.name).toString();
|
||||
resumeData.category = query.value(DB_COLUMN_CATEGORY.name).toString();
|
||||
const QString tagsData = query.value(DB_COLUMN_TAGS.name).toString();
|
||||
if (!tagsData.isEmpty())
|
||||
{
|
||||
const QStringList tagList = tagsData.split(u',');
|
||||
resumeData.tags.insert(tagList.cbegin(), tagList.cend());
|
||||
}
|
||||
resumeData.hasFinishedStatus = query.value(DB_COLUMN_HAS_SEED_STATUS.name).toBool();
|
||||
resumeData.firstLastPiecePriority = query.value(DB_COLUMN_HAS_OUTER_PIECES_PRIORITY.name).toBool();
|
||||
resumeData.ratioLimit = query.value(DB_COLUMN_RATIO_LIMIT.name).toInt() / 1000.0;
|
||||
resumeData.seedingTimeLimit = query.value(DB_COLUMN_SEEDING_TIME_LIMIT.name).toInt();
|
||||
resumeData.inactiveSeedingTimeLimit = query.value(DB_COLUMN_INACTIVE_SEEDING_TIME_LIMIT.name).toInt();
|
||||
resumeData.shareLimitAction = Utils::String::toEnum<ShareLimitAction>(
|
||||
query.value(DB_COLUMN_SHARE_LIMIT_ACTION.name).toString(), ShareLimitAction::Default);
|
||||
resumeData.contentLayout = Utils::String::toEnum<TorrentContentLayout>(
|
||||
query.value(DB_COLUMN_CONTENT_LAYOUT.name).toString(), TorrentContentLayout::Original);
|
||||
resumeData.operatingMode = Utils::String::toEnum<TorrentOperatingMode>(
|
||||
query.value(DB_COLUMN_OPERATING_MODE.name).toString(), TorrentOperatingMode::AutoManaged);
|
||||
resumeData.stopped = query.value(DB_COLUMN_STOPPED.name).toBool();
|
||||
resumeData.stopCondition = Utils::String::toEnum(
|
||||
query.value(DB_COLUMN_STOP_CONDITION.name).toString(), Torrent::StopCondition::None);
|
||||
resumeData.sslParameters =
|
||||
{
|
||||
.certificate = QSslCertificate(query.value(DB_COLUMN_SSL_CERTIFICATE.name).toByteArray()),
|
||||
.privateKey = Utils::SSLKey::load(query.value(DB_COLUMN_SSL_PRIVATE_KEY.name).toByteArray()),
|
||||
.dhParams = query.value(DB_COLUMN_SSL_DH_PARAMS.name).toByteArray()
|
||||
};
|
||||
|
||||
resumeData.savePath = Profile::instance()->fromPortablePath(
|
||||
Path(query.value(DB_COLUMN_TARGET_SAVE_PATH.name).toString()));
|
||||
resumeData.useAutoTMM = resumeData.savePath.isEmpty();
|
||||
if (!resumeData.useAutoTMM)
|
||||
{
|
||||
resumeData.downloadPath = Profile::instance()->fromPortablePath(
|
||||
Path(query.value(DB_COLUMN_DOWNLOAD_PATH.name).toString()));
|
||||
}
|
||||
|
||||
const QByteArray bencodedResumeData = query.value(DB_COLUMN_RESUMEDATA.name).toByteArray();
|
||||
const auto *pref = Preferences::instance();
|
||||
const int bdecodeDepthLimit = pref->getBdecodeDepthLimit();
|
||||
const int bdecodeTokenLimit = pref->getBdecodeTokenLimit();
|
||||
|
||||
lt::error_code ec;
|
||||
const lt::bdecode_node resumeDataRoot = lt::bdecode(bencodedResumeData, ec, nullptr, bdecodeDepthLimit, bdecodeTokenLimit);
|
||||
if (ec)
|
||||
return nonstd::make_unexpected(tr("Cannot parse resume data: %1").arg(QString::fromStdString(ec.message())));
|
||||
|
||||
lt::add_torrent_params &p = resumeData.ltAddTorrentParams;
|
||||
|
||||
p = lt::read_resume_data(resumeDataRoot, ec);
|
||||
if (ec)
|
||||
return nonstd::make_unexpected(tr("Cannot parse resume data: %1").arg(QString::fromStdString(ec.message())));
|
||||
|
||||
if (const QByteArray bencodedMetadata = query.value(DB_COLUMN_METADATA.name).toByteArray()
|
||||
; !bencodedMetadata.isEmpty())
|
||||
{
|
||||
const lt::bdecode_node torentInfoRoot = lt::bdecode(bencodedMetadata, ec
|
||||
, nullptr, bdecodeDepthLimit, bdecodeTokenLimit);
|
||||
if (ec)
|
||||
return nonstd::make_unexpected(tr("Cannot parse torrent info: %1").arg(QString::fromStdString(ec.message())));
|
||||
|
||||
p.ti = std::make_shared<lt::torrent_info>(torentInfoRoot, ec);
|
||||
if (ec)
|
||||
return nonstd::make_unexpected(tr("Cannot parse torrent info: %1").arg(QString::fromStdString(ec.message())));
|
||||
}
|
||||
|
||||
p.save_path = Profile::instance()->fromPortablePath(Path(fromLTString(p.save_path)))
|
||||
.toString().toStdString();
|
||||
if (p.save_path.empty())
|
||||
return nonstd::make_unexpected(tr("Corrupted resume data: %1").arg(tr("save_path is invalid")));
|
||||
|
||||
if (p.flags & lt::torrent_flags::stop_when_ready)
|
||||
{
|
||||
p.flags &= ~lt::torrent_flags::stop_when_ready;
|
||||
resumeData.stopCondition = Torrent::StopCondition::FilesChecked;
|
||||
}
|
||||
|
||||
return resumeData;
|
||||
}
|
||||
|
||||
BitTorrent::DBResumeDataStorage::Worker::Worker(const Path &dbPath, QReadWriteLock &dbLock, QObject *parent)
|
||||
: QThread(parent)
|
||||
, m_path {dbPath}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2021-2022 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2021-2025 Vladimir Golovnev <glassez@yandex.ru>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -31,9 +31,10 @@
|
||||
#include <QReadWriteLock>
|
||||
|
||||
#include "base/pathfwd.h"
|
||||
#include "base/utils/thread.h"
|
||||
#include "resumedatastorage.h"
|
||||
|
||||
class QSqlQuery;
|
||||
|
||||
namespace BitTorrent
|
||||
{
|
||||
class DBResumeDataStorage final : public ResumeDataStorage
|
||||
@@ -58,6 +59,7 @@ namespace BitTorrent
|
||||
void createDB() const;
|
||||
void updateDB(int fromVersion) const;
|
||||
void enableWALMode() const;
|
||||
LoadResumeDataResult parseQueryResultRow(const QSqlQuery &query) const;
|
||||
|
||||
class Worker;
|
||||
Worker *m_asyncWorker = nullptr;
|
||||
|
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "base/pathfwd.h"
|
||||
#include "base/tagset.h"
|
||||
#include "addtorrenterror.h"
|
||||
#include "addtorrentparams.h"
|
||||
#include "categoryoptions.h"
|
||||
#include "sharelimitaction.h"
|
||||
@@ -237,6 +238,12 @@ namespace BitTorrent
|
||||
virtual Path finishedTorrentExportDirectory() const = 0;
|
||||
virtual void setFinishedTorrentExportDirectory(const Path &path) = 0;
|
||||
|
||||
virtual bool isAddTrackersFromURLEnabled() const = 0;
|
||||
virtual void setAddTrackersFromURLEnabled(bool enabled) = 0;
|
||||
virtual QString additionalTrackersURL() const = 0;
|
||||
virtual void setAdditionalTrackersURL(const QString &url) = 0;
|
||||
virtual QString additionalTrackersFromURL() const = 0;
|
||||
|
||||
virtual int globalDownloadSpeedLimit() const = 0;
|
||||
virtual void setGlobalDownloadSpeedLimit(int limit) = 0;
|
||||
virtual int globalUploadSpeedLimit() const = 0;
|
||||
@@ -386,6 +393,8 @@ namespace BitTorrent
|
||||
virtual void setIncludeOverheadInLimits(bool include) = 0;
|
||||
virtual QString announceIP() const = 0;
|
||||
virtual void setAnnounceIP(const QString &ip) = 0;
|
||||
virtual int announcePort() const = 0;
|
||||
virtual void setAnnouncePort(int port) = 0;
|
||||
virtual int maxConcurrentHTTPAnnounces() const = 0;
|
||||
virtual void setMaxConcurrentHTTPAnnounces(int value) = 0;
|
||||
virtual bool isReannounceWhenAddressChangedEnabled() const = 0;
|
||||
@@ -473,7 +482,7 @@ namespace BitTorrent
|
||||
|
||||
signals:
|
||||
void startupProgressUpdated(int progress);
|
||||
void addTorrentFailed(const InfoHash &infoHash, const QString &reason);
|
||||
void addTorrentFailed(const InfoHash &infoHash, const AddTorrentError &reason);
|
||||
void allTorrentsFinished();
|
||||
void categoryAdded(const QString &categoryName);
|
||||
void categoryRemoved(const QString &categoryName);
|
||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user