You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-10-09 18:32:15 +02:00
Compare commits
59 Commits
release-4.
...
release-4.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2b501904cf | ||
![]() |
ea986a1f1b | ||
![]() |
b924357ea9 | ||
![]() |
b823d74ac3 | ||
![]() |
d1e2019cd7 | ||
![]() |
70573eba2c | ||
![]() |
cf46653333 | ||
![]() |
8d3fcbd897 | ||
![]() |
1900538315 | ||
![]() |
a9feae6110 | ||
![]() |
8d822f2cb4 | ||
![]() |
c12e486f59 | ||
![]() |
d0d0bed333 | ||
![]() |
8799321312 | ||
![]() |
00d2997971 | ||
![]() |
69f7f233fd | ||
![]() |
793e8643bf | ||
![]() |
521ef8e28f | ||
![]() |
7433d85418 | ||
![]() |
ba1cf12817 | ||
![]() |
7dc7b95bfd | ||
![]() |
59352e4ca7 | ||
![]() |
011d026d76 | ||
![]() |
89a8184ad2 | ||
![]() |
a23e10dff5 | ||
![]() |
535603fac4 | ||
![]() |
fb6282da57 | ||
![]() |
23766cd01d | ||
![]() |
44b2afb218 | ||
![]() |
9e82e59fc8 | ||
![]() |
e006538514 | ||
![]() |
fad5dfa4f4 | ||
![]() |
b737ee0240 | ||
![]() |
9d9f774dad | ||
![]() |
526ee9c9db | ||
![]() |
671eff324d | ||
![]() |
a93cf04aca | ||
![]() |
e93a67e644 | ||
![]() |
b29a52dfa8 | ||
![]() |
4ed99ba851 | ||
![]() |
3e92e716b2 | ||
![]() |
c6c8f6563d | ||
![]() |
138c911ef4 | ||
![]() |
e5fe6401a0 | ||
![]() |
bed643e627 | ||
![]() |
4ac25a50ed | ||
![]() |
d9cf189ef6 | ||
![]() |
6e19878973 | ||
![]() |
9f9c4d6ed0 | ||
![]() |
567848e94f | ||
![]() |
221cbcc1ac | ||
![]() |
dc2086dab4 | ||
![]() |
7be2a03c86 | ||
![]() |
e87f8f5b93 | ||
![]() |
11a063ea66 | ||
![]() |
0a1865d0dd | ||
![]() |
3d94c70c48 | ||
![]() |
7d7f967d5e | ||
![]() |
e47d90b5a6 |
254
.github/workflows/ci.yaml
vendored
254
.github/workflows/ci.yaml
vendored
@@ -1,254 +0,0 @@
|
||||
name: GitHub Actions CI
|
||||
|
||||
# Cache is used for all Windows and macOS dependencies (size approx. 1230 * 2 + 1850 = 4310 MiB)
|
||||
# Cache is not used for Ubuntu builds, because it already has all dependencies except
|
||||
# the appropriate libtorrent version, which only takes 3-5 minutes to build from source anyway
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
env:
|
||||
VCPKG_COMMIT: 8dddc6c899ce6fdbeab38b525a31e7f23cb2d5bb
|
||||
VCPKG_DEST_MACOS: /Users/runner/qbt_tools/vcpkg
|
||||
VCPKG_DEST_WIN: C:\qbt_tools\vcpkg
|
||||
LIBTORRENT_VERSION_TAG: v1.2.14
|
||||
|
||||
jobs:
|
||||
|
||||
ci_ubuntu:
|
||||
name: Ubuntu
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04]
|
||||
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
||||
fail-fast: false
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: install all build dependencies except libtorrent from Ubuntu repos
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install \
|
||||
build-essential cmake git ninja-build pkg-config \
|
||||
libssl-dev libgeoip-dev zlib1g-dev \
|
||||
libboost-dev libboost-chrono-dev libboost-random-dev libboost-system-dev
|
||||
# sudo apt install libqt5svg5-dev qtbase5-dev qttools5-dev # the Qt version in the standard repositories is too old...
|
||||
|
||||
# this will be installed under /opt/qt515. CMake will still find it automatically without additional hints
|
||||
# to speed up the process, only the required components are installed rather than the full qt515-meta-full metapackage
|
||||
- name: install Qt 5.15.2 from an external PPA
|
||||
run: |
|
||||
sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-focal
|
||||
sudo apt install qt515base qt515svg qt515tools
|
||||
|
||||
- name: install libtorrent from source
|
||||
run: |
|
||||
git clone https://github.com/arvidn/libtorrent && cd libtorrent
|
||||
git checkout ${{ env.LIBTORRENT_VERSION_TAG }}
|
||||
cmake -B cmake-build-dir -G "Ninja" \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-Ddeprecated-functions=OFF \
|
||||
--graphviz=cmake-build-dir/target_graph.dot
|
||||
cmake --build cmake-build-dir
|
||||
sudo cmake --install cmake-build-dir --prefix /usr/local
|
||||
|
||||
- name: build qBittorrent
|
||||
run: |
|
||||
cmake -B build -G "Ninja" \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-D${{ matrix.qbt_gui }} \
|
||||
-DVERBOSE_CONFIGURE=ON \
|
||||
--graphviz=build/target_graph.dot
|
||||
cmake --build build
|
||||
|
||||
- name: install qBittorrent
|
||||
run: sudo cmake --install build --prefix /usr/local
|
||||
|
||||
- name: upload artifact as zip
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: qBittorrent-CI_${{ matrix.os }}-x64_${{ matrix.qbt_gui }}
|
||||
path: |
|
||||
build/compile_commands.json
|
||||
build/install_manifest.txt
|
||||
build/target_graph.dot
|
||||
build/qbittorrent
|
||||
build/qbittorrent-nox
|
||||
libtorrent/cmake-build-dir/compile_commands.json
|
||||
libtorrent/cmake-build-dir/target_graph.dot
|
||||
|
||||
ci_windows:
|
||||
name: Windows + vcpkg
|
||||
|
||||
runs-on: windows-2019
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# - ninja is needed for building qBittorrent (because it's preferable, not a hard requirement)
|
||||
- name: install additional required packages with chocolatey
|
||||
run: |
|
||||
choco install ninja
|
||||
|
||||
- name: setup vcpkg (cached, if possible)
|
||||
uses: lukka/run-vcpkg@v7
|
||||
with:
|
||||
vcpkgDirectory: ${{ env.VCPKG_DEST_WIN }}
|
||||
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
|
||||
setupOnly: true
|
||||
|
||||
# Tell vcpkg to only build Release variants of the dependencies
|
||||
- name: configure vcpkg triplet overlay for release builds only
|
||||
run: |
|
||||
New-Item -Path ${{ github.workspace }} -Name "triplets_overlay" -ItemType Directory
|
||||
Copy-Item ${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-windows-static.cmake `
|
||||
${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake
|
||||
Add-Content ${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake `
|
||||
-Value "set(VCPKG_BUILD_TYPE release)"
|
||||
|
||||
# clear buildtrees after each package installation to reduce disk space requirements
|
||||
- name: install dependencies via vcpkg
|
||||
run: |
|
||||
$packages = `
|
||||
"boost-circular-buffer:x64-windows-static-release",
|
||||
"libtorrent:x64-windows-static-release",
|
||||
"qt5-base:x64-windows-static-release",
|
||||
"qt5-svg:x64-windows-static-release",
|
||||
"qt5-tools:x64-windows-static-release",
|
||||
"qt5-winextras:x64-windows-static-release"
|
||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe upgrade `
|
||||
--overlay-triplets=${{ github.workspace }}/triplets_overlay `
|
||||
--no-dry-run
|
||||
foreach($package in $packages)
|
||||
{
|
||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe install $package `
|
||||
--overlay-triplets=${{ github.workspace }}/triplets_overlay `
|
||||
--clean-after-build
|
||||
}
|
||||
|
||||
# NOTE: this is necessary to correctly find and use cl.exe with the Ninja generator for now
|
||||
- name: setup devcmd
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: build qBittorrent
|
||||
shell: cmd
|
||||
run: |
|
||||
cmake -B build -G "Ninja" ^
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ^
|
||||
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DEST_WIN }}\scripts\buildsystems\vcpkg.cmake ^
|
||||
-DVCPKG_TARGET_TRIPLET=x64-windows-static-release ^
|
||||
-DVERBOSE_CONFIGURE=ON ^
|
||||
-DMSVC_RUNTIME_DYNAMIC=OFF ^
|
||||
--graphviz=build\target_graph.dot
|
||||
cmake --build build
|
||||
|
||||
- name: upload artifact as zip
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: qBittorrent-CI_Windows-x64
|
||||
path: |
|
||||
build/compile_commands.json
|
||||
build/target_graph.dot
|
||||
build/qbittorrent.exe
|
||||
build/qbittorrent.pdb
|
||||
dist/windows/qt.conf
|
||||
|
||||
ci_macos:
|
||||
name: macOS + vcpkg
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
||||
fail-fast: false
|
||||
|
||||
runs-on: macos-10.15
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# - ninja is needed for building qBittorrent (because it's preferable, not a hard requirement)
|
||||
# - automake is needed for the installation the vcpkg installation of fontconfig, a dependency of qt5-base
|
||||
- name: install additional required packages with homebrew
|
||||
shell: bash
|
||||
run: |
|
||||
brew install automake ninja
|
||||
|
||||
- name: setup vcpkg (cached, if possible)
|
||||
uses: lukka/run-vcpkg@v7
|
||||
with:
|
||||
vcpkgDirectory: ${{ env.VCPKG_DEST_MACOS }}
|
||||
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
|
||||
setupOnly: true
|
||||
|
||||
- name: configure vcpkg triplet overlay for release builds only
|
||||
run: |
|
||||
New-Item -Path ${{ github.workspace }} -Name "triplets_overlay" -ItemType Directory
|
||||
Copy-Item ${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-osx.cmake `
|
||||
${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake
|
||||
Add-Content ${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake `
|
||||
-Value "set(VCPKG_BUILD_TYPE release)","set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15)"
|
||||
|
||||
# NOTE: Avoids a libtorrent ABI issue. See https://github.com/arvidn/libtorrent/issues/4965
|
||||
- name: force AppleClang to compile libtorrent with the same C++ standard as qBittorrent
|
||||
run: |
|
||||
(Get-Content -path ${{ env.RUNVCPKG_VCPKG_ROOT }}/ports/libtorrent/portfile.cmake).Replace( `
|
||||
'${FEATURE_OPTIONS}', '${FEATURE_OPTIONS} -DCMAKE_CXX_STANDARD=17') `
|
||||
| Set-Content -Path ${{ env.RUNVCPKG_VCPKG_ROOT }}/ports/libtorrent/portfile.cmake
|
||||
|
||||
- name: install dependencies via vcpkg
|
||||
run: |
|
||||
$packages = `
|
||||
"boost-circular-buffer:x64-osx-release",
|
||||
"libtorrent:x64-osx-release",
|
||||
"qt5-base:x64-osx-release",
|
||||
"qt5-svg:x64-osx-release",
|
||||
"qt5-tools:x64-osx-release",
|
||||
"qt5-macextras:x64-osx-release"
|
||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg upgrade `
|
||||
--overlay-triplets=${{ github.workspace }}/triplets_overlay `
|
||||
--no-dry-run
|
||||
foreach($package in $packages)
|
||||
{
|
||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg install $package `
|
||||
--overlay-triplets=${{ github.workspace }}/triplets_overlay `
|
||||
--clean-after-build
|
||||
}
|
||||
|
||||
- name: build qBittorrent
|
||||
shell: bash
|
||||
run: |
|
||||
cmake -B build -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DEST_MACOS }}/scripts/buildsystems/vcpkg.cmake \
|
||||
-DVCPKG_TARGET_TRIPLET=x64-osx-release \
|
||||
-D${{ matrix.qbt_gui }} \
|
||||
-DVERBOSE_CONFIGURE=ON \
|
||||
--graphviz=build/target_graph.dot
|
||||
cmake --build build
|
||||
|
||||
- name: upload artifact as zip
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}
|
||||
path: |
|
||||
build/compile_commands.json
|
||||
build/target_graph.dot
|
||||
build/qbittorrent.app
|
||||
build/qbittorrent-nox.app
|
20
.github/workflows/ci_file_health.yaml
vendored
Normal file
20
.github/workflows/ci_file_health.yaml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: CI - File health
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install tools
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install zsh
|
||||
|
||||
- name: Check files
|
||||
run: |
|
||||
./.github/workflows/file_health.sh
|
73
.github/workflows/ci_macos.yaml
vendored
Normal file
73
.github/workflows/ci_macos.yaml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
name: CI - macOS
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: Build
|
||||
runs-on: macos-10.15
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
libt_version: ["v2.0.4", "v1.2.14"]
|
||||
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
||||
fail-fast: false
|
||||
|
||||
env:
|
||||
openssl_root: /usr/local/opt/openssl@1.1
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup ccache
|
||||
uses: hendrikmuhs/ccache-action@v1
|
||||
with:
|
||||
key: ${{ runner.os }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew update > /dev/null
|
||||
brew install \
|
||||
cmake ninja \
|
||||
boost openssl@1.1 qt@5 zlib
|
||||
brew link --force \
|
||||
qt@5
|
||||
# workaround for cmake + Qt
|
||||
sudo ln -s /usr/local/opt/qt@5/mkspecs /usr/local/mkspecs
|
||||
sudo ln -s /usr/local/opt/qt@5/plugins /usr/local/plugins
|
||||
|
||||
- name: Install libtorrent
|
||||
run: |
|
||||
git clone --branch ${{ matrix.libt_version }} --depth 1 https://github.com/arvidn/libtorrent.git
|
||||
cd libtorrent
|
||||
git submodule update --init --recursive
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
cmake \
|
||||
-B build \
|
||||
-G "Ninja" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_CXX_STANDARD=17 \
|
||||
-Ddeprecated-functions=OFF \
|
||||
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
|
||||
cmake --build build
|
||||
sudo cmake --install build
|
||||
|
||||
- name: Build qBittorrent
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
cmake \
|
||||
-B build \
|
||||
-G "Ninja" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-D${{ matrix.qbt_gui }} \
|
||||
-DVERBOSE_CONFIGURE=ON \
|
||||
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
|
||||
cmake --build build
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}
|
||||
path: |
|
||||
build/qbittorrent.app
|
||||
build/qbittorrent-nox.app
|
84
.github/workflows/ci_ubuntu.yaml
vendored
Normal file
84
.github/workflows/ci_ubuntu.yaml
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
name: CI - Ubuntu
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: Build
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
libt_version: ["v2.0.4", "v1.2.14"]
|
||||
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup ccache
|
||||
uses: hendrikmuhs/ccache-action@v1
|
||||
with:
|
||||
key: ${{ runner.os }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install \
|
||||
build-essential cmake git ninja-build pkg-config \
|
||||
libssl-dev libgeoip-dev zlib1g-dev \
|
||||
libboost-dev libboost-chrono-dev libboost-random-dev libboost-system-dev
|
||||
# sudo apt install libqt5svg5-dev qtbase5-dev qttools5-dev # the Qt version in the standard repositories is too old...
|
||||
|
||||
# this will be installed under /opt/qt515. CMake will still find it automatically without additional hints
|
||||
# to speed up the process, only the required components are installed rather than the full qt515-meta-full metapackage
|
||||
- name: Install Qt
|
||||
run: |
|
||||
sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-focal
|
||||
sudo apt install \
|
||||
qt515base qt515svg qt515tools
|
||||
|
||||
- name: Install libtorrent
|
||||
run: |
|
||||
git clone --branch ${{ matrix.libt_version }} --depth 1 https://github.com/arvidn/libtorrent.git
|
||||
cd libtorrent
|
||||
git submodule update --init --recursive
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
cmake \
|
||||
-B build \
|
||||
-G "Ninja" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-Ddeprecated-functions=OFF \
|
||||
--graphviz=cmake-build-dir/target_graph.dot
|
||||
cmake --build build
|
||||
sudo cmake --install build
|
||||
|
||||
- name: Build qBittorrent
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
cmake \
|
||||
-B build \
|
||||
-G "Ninja" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-D${{ matrix.qbt_gui }} \
|
||||
-DVERBOSE_CONFIGURE=ON \
|
||||
--graphviz=build/target_graph.dot
|
||||
cmake --build build
|
||||
|
||||
- name: Install qBittorrent
|
||||
run: sudo cmake --install build
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: qBittorrent-CI_ubuntu-20.04-x64_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}
|
||||
path: |
|
||||
build/compile_commands.json
|
||||
build/install_manifest.txt
|
||||
build/target_graph.dot
|
||||
build/qbittorrent
|
||||
build/qbittorrent-nox
|
||||
libtorrent/cmake-build-dir/compile_commands.json
|
||||
libtorrent/cmake-build-dir/target_graph.dot
|
32
.github/workflows/ci_webui.yaml
vendored
Normal file
32
.github/workflows/ci_webui.yaml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: CI - WebUI
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: src/webui/www
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup nodejs
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
|
||||
- name: Install tools
|
||||
run: npm install
|
||||
|
||||
- name: Lint code
|
||||
run: npm run lint
|
||||
|
||||
- name: Format code
|
||||
run: |
|
||||
npm run format
|
||||
git diff --exit-code
|
85
.github/workflows/ci_windows.yaml
vendored
Normal file
85
.github/workflows/ci_windows.yaml
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
name: CI - Windows
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: Build
|
||||
runs-on: windows-2019
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install build tools
|
||||
run: |
|
||||
choco install ninja
|
||||
|
||||
# use the preinstalled vcpkg from image
|
||||
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#package-management
|
||||
- name: Setup vcpkg
|
||||
uses: lukka/run-vcpkg@v7
|
||||
with:
|
||||
vcpkgDirectory: C:/vcpkg
|
||||
doNotUpdateVcpkg: true # the preinstalled vcpkg is updated regularly
|
||||
setupOnly: true
|
||||
|
||||
# tell vcpkg to only build Release variants of the dependencies
|
||||
- name: Configure vcpkg triplet overlay
|
||||
run: |
|
||||
New-Item `
|
||||
-Path "${{ github.workspace }}" `
|
||||
-Name "triplets_overlay" `
|
||||
-ItemType Directory
|
||||
Copy-Item `
|
||||
"${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-windows-static.cmake" `
|
||||
"${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake"
|
||||
Add-Content `
|
||||
"${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake" `
|
||||
-Value "set(VCPKG_BUILD_TYPE release)"
|
||||
|
||||
# clear buildtrees after each package installation to reduce disk space requirements
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
$packages = `
|
||||
"boost-circular-buffer:x64-windows-static-release",
|
||||
"libtorrent:x64-windows-static-release",
|
||||
"qt5-base:x64-windows-static-release",
|
||||
"qt5-svg:x64-windows-static-release",
|
||||
"qt5-tools:x64-windows-static-release",
|
||||
"qt5-winextras:x64-windows-static-release"
|
||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe upgrade `
|
||||
--overlay-triplets="${{ github.workspace }}/triplets_overlay" `
|
||||
--no-dry-run
|
||||
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe install `
|
||||
--overlay-triplets="${{ github.workspace }}/triplets_overlay" `
|
||||
--clean-after-build `
|
||||
$packages
|
||||
|
||||
# this is necessary to correctly find and use cl.exe with the Ninja generator for now
|
||||
- name: Setup devcmd
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Build qBittorrent
|
||||
run: |
|
||||
cmake `
|
||||
-B build `
|
||||
-G "Ninja" `
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
|
||||
-DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
|
||||
-DMSVC_RUNTIME_DYNAMIC=OFF `
|
||||
-DVCPKG_TARGET_TRIPLET=x64-windows-static-release `
|
||||
-DVERBOSE_CONFIGURE=ON `
|
||||
--graphviz=build/target_graph.dot
|
||||
cmake --build build
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: qBittorrent-CI_Windows-x64
|
||||
path: |
|
||||
build/compile_commands.json
|
||||
build/qbittorrent.exe
|
||||
build/qbittorrent.pdb
|
||||
build/target_graph.dot
|
||||
dist/windows/qt.conf
|
85
.github/workflows/coverity-scan.yml
vendored
Normal file
85
.github/workflows/coverity-scan.yml
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
name: Coverity Scan
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 1 * *' # Monthly (1st day of month at midnight)
|
||||
workflow_dispatch: # Mainly for testing. Don't forget the Coverity usage limits.
|
||||
|
||||
env:
|
||||
LIBTORRENT_VERSION_TAG: v1.2.14
|
||||
|
||||
jobs:
|
||||
coverity_scan:
|
||||
name: Scan
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install \
|
||||
build-essential cmake git ninja-build pkg-config \
|
||||
libssl-dev zlib1g-dev libboost-dev libboost-system-dev
|
||||
# sudo apt install libqt5svg5-dev qtbase5-dev qttools5-dev # the Qt version in the standard repositories is too old...
|
||||
|
||||
# this will be installed under /opt/qt515. CMake will still find it automatically without additional hints
|
||||
# to speed up the process, only the required components are installed rather than the full qt515-meta-full metapackage
|
||||
- name: Install Qt
|
||||
run: |
|
||||
sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-focal
|
||||
sudo apt install \
|
||||
qt515base qt515svg qt515tools
|
||||
|
||||
- name: Install libtorrent
|
||||
run: |
|
||||
git clone https://github.com/arvidn/libtorrent
|
||||
cd libtorrent
|
||||
git checkout ${{ env.LIBTORRENT_VERSION_TAG }}
|
||||
cmake \
|
||||
-B build \
|
||||
-G "Ninja" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-Ddeprecated-functions=OFF
|
||||
cmake --build build
|
||||
sudo cmake --install build --prefix /usr/local
|
||||
|
||||
- name: Download Coverity Build Tool
|
||||
run: |
|
||||
wget \
|
||||
-q \
|
||||
https://scan.coverity.com/download/linux64 \
|
||||
--post-data "token=$TOKEN&project=qbittorrent%2FqBittorrent" \
|
||||
-O coverity_tool.tgz
|
||||
mkdir coverity_tool
|
||||
tar xzf coverity_tool.tgz --strip 1 -C coverity_tool
|
||||
env:
|
||||
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
||||
|
||||
- name: Configure qBittorrent
|
||||
run: |
|
||||
cmake \
|
||||
-B build \
|
||||
-G "Ninja" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DGUI=ON \
|
||||
-DVERBOSE_CONFIGURE=ON
|
||||
|
||||
- name: Build qBittorrent
|
||||
run: |
|
||||
export PATH="$(pwd)/coverity_tool/bin:$PATH"
|
||||
cov-build --dir cov-int cmake --build build
|
||||
|
||||
- name: Submit the result to Coverity Scan
|
||||
run: |
|
||||
tar caf qbittorrent.xz cov-int
|
||||
curl \
|
||||
--form token=$TOKEN \
|
||||
--form email=sledgehammer999@qbittorrent.org \
|
||||
--form file=@qbittorrent.tgz \
|
||||
--form version="$(git rev-parse --short HEAD)" \
|
||||
--form description="master" \
|
||||
https://scan.coverity.com/builds?project=qbittorrent%2FqBittorrent
|
||||
env:
|
||||
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
4
.github/workflows/file_health.sh
vendored
4
.github/workflows/file_health.sh
vendored
@@ -11,9 +11,9 @@ regressions=0
|
||||
# exclusions (these are just grep extended regular expressions to match against paths relative to the root of the repository)
|
||||
exclusions_nonutf8='(.*(7z|gif|ic(ns|o)|png|qm|zip))'
|
||||
exclusions_bom='src/base/unicodestrings.h'
|
||||
exclusions_tw='(*.ts)|src/webui/www/private/scripts/lib/mootools-1.2-more.js'
|
||||
exclusions_tw='(*.ts)|src/webui/www/private/scripts/lib/*'
|
||||
exclusions_trailing_newline='configure'
|
||||
exclusions_no_lf='(*.ts)|(.*svg)|compile_commands.json|src/webui/www/private/scripts/lib/mootools-1.2-(core-yc.js|more.js)'
|
||||
exclusions_no_lf='(*.ts)|(.*svg)|compile_commands.json|src/webui/www/private/scripts/lib/*'
|
||||
|
||||
echo -e "\n*** Detect files not encoded in UTF-8 ***\n"
|
||||
|
||||
|
22
.github/workflows/file_health.yaml
vendored
22
.github/workflows/file_health.yaml
vendored
@@ -1,22 +0,0 @@
|
||||
name: GitHub Actions file health check
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
check_file_health:
|
||||
name: Check file health
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: install zsh
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install zsh
|
||||
|
||||
- name: run check file health script
|
||||
run: |
|
||||
./.github/workflows/file_health.sh
|
22
.github/workflows/stale_bot.yaml
vendored
Normal file
22
.github/workflows/stale_bot.yaml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Stale bot
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Mark and close stale PRs
|
||||
uses: actions/stale@v4
|
||||
with:
|
||||
stale-pr-message: "This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity."
|
||||
close-pr-message: "This PR was closed because it has been stalled for some time with no activity."
|
||||
days-before-stale: -1 # avoid marking issues
|
||||
days-before-pr-stale: 60
|
||||
days-before-close: -1 # avoid closing issues
|
||||
days-before-pr-close: 7
|
||||
exempt-all-pr-assignees: true # avoid stale for all PR with assignees
|
||||
exempt-all-pr-milestones: true # avoid stale for all PR with milestones
|
||||
operations-per-run: 200
|
31
.github/workflows/webui_ci.yaml
vendored
31
.github/workflows/webui_ci.yaml
vendored
@@ -1,31 +0,0 @@
|
||||
name: WebUI CI
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
check_webui:
|
||||
name: Check WebUI
|
||||
runs-on: ubuntu-20.04
|
||||
defaults:
|
||||
run:
|
||||
working-directory: src/webui/www
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: setup nodejs
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
|
||||
- name: install tools
|
||||
run: npm install
|
||||
|
||||
- name: lint code
|
||||
run: npm run lint
|
||||
|
||||
- name: format code
|
||||
run: |
|
||||
npm run format
|
||||
git diff --exit-code
|
@@ -10,11 +10,12 @@ project(qBittorrent
|
||||
|
||||
# use CONFIG mode first in find_package
|
||||
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
|
||||
# version requirements - older vesions may work, but you are on your own
|
||||
# version requirements - older versions may work, but you are on your own
|
||||
set(minBoostVersion 1.65)
|
||||
set(minQtVersion 5.15.2)
|
||||
set(minOpenSSLVersion 1.1.1)
|
||||
set(minLibtorrentVersion 1.2.14)
|
||||
set(minLibtorrent1Version 1.2.14)
|
||||
set(minLibtorrentVersion 2.0.4)
|
||||
set(minZlibVersion 1.2.11)
|
||||
|
||||
# features (some are platform-specific)
|
||||
|
65
COPYING
65
COPYING
@@ -18,8 +18,8 @@ See also the AUTHORS file
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
@@ -32,7 +32,7 @@ software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
@@ -295,3 +295,62 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
14
INSTALL
14
INSTALL
@@ -5,20 +5,22 @@ qBittorrent - A BitTorrent client in C++ / Qt
|
||||
|
||||
- Boost >= 1.65
|
||||
|
||||
- libtorrent-rasterbar >= 1.2.14 (by Arvid Norberg)
|
||||
* https://www.libtorrent.org/
|
||||
- libtorrent-rasterbar 1.2.14 - 1.2.x || 2.0.4 - 2.0.x
|
||||
* By Arvid Norberg, https://www.libtorrent.org/
|
||||
* Be careful: another library (the one used by rTorrent) uses a similar name
|
||||
|
||||
- OpenSSL >= 1.1.1
|
||||
|
||||
- Qt >= 5.15.2
|
||||
- Qt 5.15.2 - 5.x
|
||||
|
||||
- zlib >= 1.2.11
|
||||
|
||||
- pkg-config (compile-time only on *nix systems)
|
||||
- pkg-config *
|
||||
* Compile-time only on *nix systems
|
||||
|
||||
- Python >= 3.5.0 (optional, runtime only)
|
||||
* Required by the internal search engine
|
||||
- Python >= 3.5.0
|
||||
* Optional, run-time only
|
||||
* Used by the bundled search engine
|
||||
|
||||
Dependency version numbers are bumped every once in a while to keep the range of properly tested configurations manageable, even if not strictly required to build.
|
||||
You may be able to build with older versions of (some of) the dependencies other than the minimum versions specified in the build scripts, but support for such builds is not provided - you are on your own.
|
||||
|
@@ -45,8 +45,8 @@ http://forum.qbittorrent.org
|
||||
Please report any bug (or feature request) to:
|
||||
http://bugs.qbittorrent.org
|
||||
|
||||
You can also meet me (sledgehammer_999) on IRC:
|
||||
`#qbittorrent on irc.freenode.net`
|
||||
Official IRC channel:
|
||||
`#qbittorrent on irc.libera.chat`
|
||||
|
||||
------------------------------------------
|
||||
sledgehammer999 <sledgehammer999@qbittorrent.org>
|
||||
|
@@ -90,4 +90,7 @@ macro(qbt_common_config)
|
||||
)
|
||||
endif()
|
||||
|
||||
if (LibtorrentRasterbar_VERSION VERSION_GREATER_EQUAL ${minLibtorrentVersion})
|
||||
target_compile_definitions(qbt_common_cfg INTERFACE QBT_USES_LIBTORRENT2)
|
||||
endif()
|
||||
endmacro(qbt_common_config)
|
||||
|
@@ -45,6 +45,9 @@ DEFINES += BOOST_SYSTEM_STATIC_LINK
|
||||
# Enable if linking dynamically against libtorrent
|
||||
#DEFINES += TORRENT_LINKING_SHARED
|
||||
|
||||
# Enable this if compiling with libtorrent 2.x
|
||||
#DEFINES += QBT_USES_LIBTORRENT2
|
||||
|
||||
# Enable stack trace support
|
||||
CONFIG += stacktrace
|
||||
|
||||
|
@@ -177,9 +177,11 @@ AC_COMPILE_IFELSE([DETECT_BOOST_VERSION_PROGRAM(106000)], [],
|
||||
[QBT_ADD_DEFINES="$QBT_ADD_DEFINES BOOST_NO_CXX11_RVALUE_REFERENCES"])
|
||||
|
||||
PKG_CHECK_MODULES(libtorrent,
|
||||
[libtorrent-rasterbar >= 1.2.14],
|
||||
[CXXFLAGS="$libtorrent_CFLAGS $CXXFLAGS"
|
||||
LIBS="$libtorrent_LIBS $LIBS"])
|
||||
[libtorrent-rasterbar >= 2.0.4],
|
||||
[CXXFLAGS="$libtorrent_CFLAGS $CXXFLAGS" LIBS="$libtorrent_LIBS $LIBS" QBT_ADD_DEFINES="$QBT_ADD_DEFINES QBT_USES_LIBTORRENT2"],
|
||||
[PKG_CHECK_MODULES(libtorrent,
|
||||
[libtorrent-rasterbar >= 1.2.14 libtorrent-rasterbar < 2],
|
||||
[CXXFLAGS="$libtorrent_CFLAGS $CXXFLAGS" LIBS="$libtorrent_LIBS $LIBS"])])
|
||||
|
||||
PKG_CHECK_MODULES(openssl,
|
||||
[openssl >= 1.1.1],
|
||||
|
54
dist/windows/installer-translations/polish.nsi
vendored
54
dist/windows/installer-translations/polish.nsi
vendored
@@ -1,60 +1,60 @@
|
||||
;Installer strings
|
||||
|
||||
;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)"
|
||||
LangString inst_qbt_req ${LANG_POLISH} "qBittorrent (required)"
|
||||
LangString inst_qbt_req ${LANG_POLISH} "qBittorrent (wymagany)"
|
||||
;LangString inst_dekstop ${LANG_ENGLISH} "Create Desktop Shortcut"
|
||||
LangString inst_dekstop ${LANG_POLISH} "Create Desktop Shortcut"
|
||||
LangString inst_dekstop ${LANG_POLISH} "Utwórz skrót na pulpicie"
|
||||
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
|
||||
LangString inst_startmenu ${LANG_POLISH} "Create Start Menu Shortcut"
|
||||
LangString inst_startmenu ${LANG_POLISH} "Utwórz skrót w menu Start"
|
||||
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
|
||||
LangString inst_startup ${LANG_POLISH} "Start qBittorrent on Windows start up"
|
||||
LangString inst_startup ${LANG_POLISH} "Uruchamiaj qBittorrent wraz z systemem Windows"
|
||||
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
|
||||
LangString inst_torrent ${LANG_POLISH} "Open .torrent files with qBittorrent"
|
||||
LangString inst_torrent ${LANG_POLISH} "Otwieraj pliki .torrent za pomocą qBittorrent"
|
||||
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
|
||||
LangString inst_magnet ${LANG_POLISH} "Open magnet links with qBittorrent"
|
||||
LangString inst_magnet ${LANG_POLISH} "Otwieraj odnośniki magnet za pomocą qBittorrent"
|
||||
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
|
||||
LangString inst_firewall ${LANG_POLISH} "Add Windows Firewall rule"
|
||||
LangString inst_firewall ${LANG_POLISH} "Dodaj regułę Zapory systemu Windows"
|
||||
;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_POLISH} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)"
|
||||
LangString inst_pathlimit ${LANG_POLISH} "Wyłącz ograniczenie długości ścieżki systemu Windows (ograniczenie MAX_PATH do 260 znaków, wymaga systemu Windows 10 1607 lub nowszego)"
|
||||
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
|
||||
LangString inst_firewallinfo ${LANG_POLISH} "Adding Windows Firewall rule"
|
||||
LangString inst_firewallinfo ${LANG_POLISH} "Dodawanie reguły Zapory systemu Windows"
|
||||
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
|
||||
LangString inst_warning ${LANG_POLISH} "qBittorrent is running. Please close the application before installing."
|
||||
LangString inst_warning ${LANG_POLISH} "qBittorrent jest uruchomiony. Proszę zamknąć aplikację przed instalacją."
|
||||
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
|
||||
LangString inst_uninstall_question ${LANG_POLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
|
||||
LangString inst_uninstall_question ${LANG_POLISH} "Obecna wersja zostanie odinstalowana. Ustawienia użytkownika i torrenty pozostaną nienaruszone."
|
||||
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
|
||||
LangString inst_unist ${LANG_POLISH} "Uninstalling previous version."
|
||||
LangString inst_unist ${LANG_POLISH} "Odinstalowywanie poprzedniej wersji."
|
||||
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
|
||||
LangString launch_qbt ${LANG_POLISH} "Launch qBittorrent."
|
||||
LangString launch_qbt ${LANG_POLISH} "Uruchom qBittorrent."
|
||||
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
|
||||
LangString inst_requires_64bit ${LANG_POLISH} "This installer works only in 64-bit Windows versions."
|
||||
LangString inst_requires_64bit ${LANG_POLISH} "Ten instalator działa tylko w 64-bitowych wersjach systemu Windows."
|
||||
;LangString inst_requires_win7 ${LANG_ENGLISH} "This qBittorrent version requires at least Windows 7."
|
||||
LangString inst_requires_win7 ${LANG_POLISH} "This qBittorrent version requires at least Windows 7."
|
||||
LangString inst_requires_win7 ${LANG_POLISH} "Ta wersja qBittorrent wymaga co najmniej systemu Windows 7."
|
||||
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
|
||||
LangString inst_uninstall_link_description ${LANG_POLISH} "Uninstall qBittorrent"
|
||||
LangString inst_uninstall_link_description ${LANG_POLISH} "Odinstaluj qBittorrent"
|
||||
|
||||
;------------------------------------
|
||||
;Uninstaller strings
|
||||
|
||||
;LangString remove_files ${LANG_ENGLISH} "Remove files"
|
||||
LangString remove_files ${LANG_POLISH} "Remove files"
|
||||
LangString remove_files ${LANG_POLISH} "Usuń pliki"
|
||||
;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts"
|
||||
LangString remove_shortcuts ${LANG_POLISH} "Remove shortcuts"
|
||||
LangString remove_shortcuts ${LANG_POLISH} "Usuń skróty"
|
||||
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
|
||||
LangString remove_associations ${LANG_POLISH} "Remove file associations"
|
||||
LangString remove_associations ${LANG_POLISH} "Usuń skojarzenia plików"
|
||||
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
|
||||
LangString remove_registry ${LANG_POLISH} "Remove registry keys"
|
||||
LangString remove_registry ${LANG_POLISH} "Usuń klucze rejestru"
|
||||
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
|
||||
LangString remove_conf ${LANG_POLISH} "Remove configuration files"
|
||||
LangString remove_conf ${LANG_POLISH} "Usuń pliki konfiguracyjne"
|
||||
;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule"
|
||||
LangString remove_firewall ${LANG_POLISH} "Remove Windows Firewall rule"
|
||||
LangString remove_firewall ${LANG_POLISH} "Usuń regułę Zapory systemu Windows"
|
||||
;LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule"
|
||||
LangString remove_firewallinfo ${LANG_POLISH} "Removing Windows Firewall rule"
|
||||
LangString remove_firewallinfo ${LANG_POLISH} "Usuwanie reguły Zapory systemu Windows"
|
||||
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
|
||||
LangString remove_cache ${LANG_POLISH} "Remove torrents and cached data"
|
||||
LangString remove_cache ${LANG_POLISH} "Usuń torrenty i dane z pamięci podręcznej"
|
||||
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
|
||||
LangString uninst_warning ${LANG_POLISH} "qBittorrent is running. Please close the application before uninstalling."
|
||||
LangString uninst_warning ${LANG_POLISH} "qBittorrent jest uruchomiony. Zamknij aplikację przed odinstalowaniem."
|
||||
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
|
||||
LangString uninst_tor_warn ${LANG_POLISH} "Not removing .torrent association. It is associated with:"
|
||||
LangString uninst_tor_warn ${LANG_POLISH} "Bez usuwania skojarzenia .torrent. Skojarzono z:"
|
||||
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
|
||||
LangString uninst_mag_warn ${LANG_POLISH} "Not removing magnet association. It is associated with:"
|
||||
LangString uninst_mag_warn ${LANG_POLISH} "Bez usuwania skojarzenia magnet. Skojarzono z:"
|
||||
|
@@ -1,35 +1,43 @@
|
||||
if (UNIX AND (NOT APPLE) AND (NOT CYGWIN))
|
||||
find_package(LibtorrentRasterbar QUIET ${minLibtorrentVersion} COMPONENTS torrent-rasterbar)
|
||||
if (NOT LibtorrentRasterbar_FOUND)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(LIBTORRENT_RASTERBAR IMPORTED_TARGET GLOBAL "libtorrent-rasterbar>=${minLibtorrentVersion}")
|
||||
if (NOT LIBTORRENT_RASTERBAR_FOUND)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Package LibtorrentRasterbar >= ${minLibtorrentVersion} not found"
|
||||
" with CMake or pkg-config.\n- Set LibtorrentRasterbar_DIR to a directory containing"
|
||||
" a LibtorrentRasterbarConfig.cmake file or add the installation prefix of LibtorrentRasterbar"
|
||||
" to CMAKE_PREFIX_PATH.\n- Alternatively, make sure there is a valid libtorrent-rasterbar.pc"
|
||||
" file in your system's pkg-config search paths (use the system environment variable PKG_CONFIG_PATH"
|
||||
" to specify additional search paths if needed)."
|
||||
macro(find_libtorrent version)
|
||||
if (UNIX AND (NOT APPLE) AND (NOT CYGWIN))
|
||||
find_package(LibtorrentRasterbar QUIET ${version} COMPONENTS torrent-rasterbar)
|
||||
if (NOT LibtorrentRasterbar_FOUND)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(LibtorrentRasterbar IMPORTED_TARGET GLOBAL "libtorrent-rasterbar>=${version}")
|
||||
if (NOT LibtorrentRasterbar_FOUND)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Package LibtorrentRasterbar >= ${version} not found"
|
||||
" with CMake or pkg-config.\n- Set LibtorrentRasterbar_DIR to a directory containing"
|
||||
" a LibtorrentRasterbarConfig.cmake file or add the installation prefix of LibtorrentRasterbar"
|
||||
" to CMAKE_PREFIX_PATH.\n- Alternatively, make sure there is a valid libtorrent-rasterbar.pc"
|
||||
" file in your system's pkg-config search paths (use the system environment variable PKG_CONFIG_PATH"
|
||||
" to specify additional search paths if needed)."
|
||||
)
|
||||
endif()
|
||||
add_library(LibtorrentRasterbar::torrent-rasterbar ALIAS PkgConfig::LibtorrentRasterbar)
|
||||
# force a fake package to show up in the feature summary
|
||||
set_property(GLOBAL APPEND PROPERTY
|
||||
PACKAGES_FOUND
|
||||
"LibtorrentRasterbar via pkg-config (version >= ${version})"
|
||||
)
|
||||
set_package_properties("LibtorrentRasterbar via pkg-config (version >= ${version})"
|
||||
PROPERTIES
|
||||
TYPE REQUIRED
|
||||
)
|
||||
else()
|
||||
set_package_properties(LibtorrentRasterbar PROPERTIES TYPE REQUIRED)
|
||||
endif()
|
||||
add_library(LibtorrentRasterbar::torrent-rasterbar ALIAS PkgConfig::LIBTORRENT_RASTERBAR)
|
||||
# force a fake package to show up in the feature summary
|
||||
set_property(GLOBAL APPEND PROPERTY
|
||||
PACKAGES_FOUND
|
||||
"LibtorrentRasterbar via pkg-config (version >= ${minLibtorrentVersion})"
|
||||
)
|
||||
set_package_properties("LibtorrentRasterbar via pkg-config (version >= ${minLibtorrentVersion})"
|
||||
PROPERTIES
|
||||
TYPE REQUIRED
|
||||
)
|
||||
else()
|
||||
set_package_properties(LibtorrentRasterbar PROPERTIES TYPE REQUIRED)
|
||||
find_package(LibtorrentRasterbar ${version} REQUIRED COMPONENTS torrent-rasterbar)
|
||||
endif()
|
||||
else()
|
||||
find_package(LibtorrentRasterbar ${minLibtorrentVersion} REQUIRED COMPONENTS torrent-rasterbar)
|
||||
endmacro()
|
||||
|
||||
find_libtorrent(${minLibtorrent1Version})
|
||||
if (LibtorrentRasterbar_FOUND AND (LibtorrentRasterbar_VERSION VERSION_GREATER_EQUAL 2.0))
|
||||
find_libtorrent(${minLibtorrentVersion})
|
||||
endif()
|
||||
|
||||
# force variable type so that it always shows up in ccmake/cmake-gui frontends
|
||||
set_property(CACHE LibtorrentRasterbar_DIR PROPERTY TYPE PATH)
|
||||
find_package(Boost ${minBoostVersion} REQUIRED)
|
||||
|
@@ -89,7 +89,7 @@ Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate)
|
||||
|
||||
Qt::HANDLE mutex;
|
||||
if (doCreate) {
|
||||
QT_WA( { mutex = CreateMutexW(NULL, FALSE, (TCHAR*)mname.utf16()); },
|
||||
QT_WA( { mutex = CreateMutexW(NULL, FALSE, reinterpret_cast<const TCHAR *>(mname.utf16())); },
|
||||
{ mutex = CreateMutexA(NULL, FALSE, mname.toLocal8Bit().constData()); } );
|
||||
if (!mutex) {
|
||||
qErrnoWarning("QtLockedFile::lock(): CreateMutex failed");
|
||||
@@ -97,7 +97,7 @@ Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate)
|
||||
}
|
||||
}
|
||||
else {
|
||||
QT_WA( { mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, (TCHAR*)mname.utf16()); },
|
||||
QT_WA( { mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, reinterpret_cast<const TCHAR *>(mname.utf16())); },
|
||||
{ mutex = OpenMutexA(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, mname.toLocal8Bit().constData()); } );
|
||||
if (!mutex) {
|
||||
if (GetLastError() != ERROR_FILE_NOT_FOUND)
|
||||
|
@@ -73,7 +73,7 @@ void straceWin::loadHelpStackFrame(IMAGEHLP_STACK_FRAME& ihsf, const STACKFRAME6
|
||||
BOOL CALLBACK straceWin::EnumSymbolsCB(PSYMBOL_INFO symInfo, ULONG size, PVOID user)
|
||||
{
|
||||
Q_UNUSED(size)
|
||||
QStringList* params = (QStringList*)user;
|
||||
auto params = static_cast<QStringList *>(user);
|
||||
if (symInfo->Flags & SYMFLAG_PARAMETER)
|
||||
params->append(symInfo->Name);
|
||||
return TRUE;
|
||||
@@ -91,7 +91,7 @@ BOOL CALLBACK straceWin::EnumModulesCB(LPCSTR ModuleName, DWORD64 BaseOfDll, PVO
|
||||
{
|
||||
Q_UNUSED(ModuleName)
|
||||
IMAGEHLP_MODULE64 mod;
|
||||
EnumModulesContext* context = (EnumModulesContext*)UserContext;
|
||||
auto context = static_cast<EnumModulesContext *>(UserContext);
|
||||
mod.SizeOfStruct = sizeof(IMAGEHLP_MODULE64);
|
||||
if(SymGetModuleInfo64(context->hProcess, BaseOfDll, &mod))
|
||||
{
|
||||
@@ -264,7 +264,7 @@ const QString straceWin::getBacktrace()
|
||||
ULONG64 buffer[(sizeof(SYMBOL_INFO) +
|
||||
MAX_SYM_NAME * sizeof(TCHAR) +
|
||||
sizeof(ULONG64) - 1) / sizeof(ULONG64)];
|
||||
PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)buffer;
|
||||
auto pSymbol = reinterpret_cast<PSYMBOL_INFO>(buffer);
|
||||
pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO);
|
||||
pSymbol->MaxNameLen = MAX_SYM_NAME;
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#include "base/utils/fs.h"
|
||||
#include "common.h"
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
#include <libtorrent/session.hpp>
|
||||
|
||||
std::unique_ptr<lt::disk_interface> customDiskIOConstructor(
|
||||
|
@@ -30,11 +30,10 @@
|
||||
|
||||
#include <libtorrent/aux_/vector.hpp>
|
||||
#include <libtorrent/fwd.hpp>
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
#include <QString>
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
#include <libtorrent/disk_interface.hpp>
|
||||
#include <libtorrent/file_storage.hpp>
|
||||
#include <libtorrent/io_context.hpp>
|
||||
@@ -46,7 +45,7 @@
|
||||
#include <libtorrent/storage.hpp>
|
||||
#endif
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
std::unique_ptr<lt::disk_interface> customDiskIOConstructor(
|
||||
lt::io_context &ioContext, lt::settings_interface const &settings, lt::counters &counters);
|
||||
|
||||
|
@@ -43,7 +43,7 @@ bool BitTorrent::InfoHash::isValid() const
|
||||
|
||||
SHA1Hash BitTorrent::InfoHash::v1() const
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
return (m_nativeHash.has_v1() ? SHA1Hash(m_nativeHash.v1) : SHA1Hash());
|
||||
#else
|
||||
return {m_nativeHash};
|
||||
@@ -52,7 +52,7 @@ SHA1Hash BitTorrent::InfoHash::v1() const
|
||||
|
||||
SHA256Hash BitTorrent::InfoHash::v2() const
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
return (m_nativeHash.has_v2() ? SHA256Hash(m_nativeHash.v2) : SHA256Hash());
|
||||
#else
|
||||
return {};
|
||||
@@ -61,7 +61,7 @@ SHA256Hash BitTorrent::InfoHash::v2() const
|
||||
|
||||
BitTorrent::TorrentID BitTorrent::InfoHash::toTorrentID() const
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
return m_nativeHash.get_best();
|
||||
#else
|
||||
return {m_nativeHash};
|
||||
|
@@ -28,8 +28,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libtorrent/version.hpp>
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
#include <libtorrent/info_hash.hpp>
|
||||
#endif
|
||||
|
||||
@@ -58,7 +57,7 @@ namespace BitTorrent
|
||||
class InfoHash
|
||||
{
|
||||
public:
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
using WrappedType = lt::info_hash_t;
|
||||
#else
|
||||
using WrappedType = lt::sha1_hash;
|
||||
|
@@ -80,7 +80,7 @@ MagnetUri::MagnetUri(const QString &source)
|
||||
if (source.isEmpty()) return;
|
||||
|
||||
if (isV2Hash(source))
|
||||
m_url = QString::fromLatin1("magnet:?xt=urn:btmh:") + source;
|
||||
m_url = QString::fromLatin1("magnet:?xt=urn:btmh:1220") + source; // 0x12 0x20 is the "multihash format" tag for the SHA-256 hashing scheme.
|
||||
else if (isV1Hash(source))
|
||||
m_url = QString::fromLatin1("magnet:?xt=urn:btih:") + source;
|
||||
|
||||
@@ -90,7 +90,7 @@ MagnetUri::MagnetUri(const QString &source)
|
||||
|
||||
m_valid = true;
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
m_infoHash = m_addTorrentParams.info_hashes;
|
||||
#else
|
||||
m_infoHash = m_addTorrentParams.info_hash;
|
||||
|
@@ -29,11 +29,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <libtorrent/extensions.hpp>
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
class NativeSessionExtension final : public lt::plugin
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
using ClientData = lt::client_data_t;
|
||||
#else
|
||||
using ClientData = void *;
|
||||
|
@@ -210,7 +210,7 @@ namespace
|
||||
{
|
||||
switch (socketType)
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
case lt::socket_type_t::http:
|
||||
return QLatin1String("HTTP");
|
||||
case lt::socket_type_t::http_ssl:
|
||||
@@ -220,7 +220,7 @@ namespace
|
||||
return QLatin1String("I2P");
|
||||
case lt::socket_type_t::socks5:
|
||||
return QLatin1String("SOCKS5");
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
case lt::socket_type_t::socks5_ssl:
|
||||
return QLatin1String("SOCKS5_SSL");
|
||||
#endif
|
||||
@@ -228,7 +228,7 @@ namespace
|
||||
return QLatin1String("TCP");
|
||||
case lt::socket_type_t::tcp_ssl:
|
||||
return QLatin1String("TCP_SSL");
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
case lt::socket_type_t::utp:
|
||||
return QLatin1String("UTP");
|
||||
#else
|
||||
@@ -388,6 +388,7 @@ Session::Session(QObject *parent)
|
||||
, m_IDNSupportEnabled(BITTORRENT_SESSION_KEY("IDNSupportEnabled"), false)
|
||||
, m_multiConnectionsPerIpEnabled(BITTORRENT_SESSION_KEY("MultiConnectionsPerIp"), false)
|
||||
, m_validateHTTPSTrackerCertificate(BITTORRENT_SESSION_KEY("ValidateHTTPSTrackerCertificate"), true)
|
||||
, m_SSRFMitigationEnabled(BITTORRENT_SESSION_KEY("SSRFMitigation"), true)
|
||||
, m_blockPeersOnPrivilegedPorts(BITTORRENT_SESSION_KEY("BlockPeersOnPrivilegedPorts"), false)
|
||||
, m_isAddTrackersEnabled(BITTORRENT_SESSION_KEY("AddTrackersEnabled"), false)
|
||||
, m_additionalTrackers(BITTORRENT_SESSION_KEY("AdditionalTrackers"))
|
||||
@@ -1076,14 +1077,14 @@ void Session::initializeNativeSession()
|
||||
pack.set_bool(lt::settings_pack::enable_upnp, false);
|
||||
pack.set_bool(lt::settings_pack::enable_natpmp, false);
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM > 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
// preserve the same behavior as in earlier libtorrent versions
|
||||
pack.set_bool(lt::settings_pack::enable_set_file_valid_data, true);
|
||||
#endif
|
||||
|
||||
loadLTSettings(pack);
|
||||
lt::session_params sessionParams {pack, {}};
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
sessionParams.disk_io_constructor = customDiskIOConstructor;
|
||||
#endif
|
||||
m_nativeSession = new lt::session {sessionParams};
|
||||
@@ -1175,7 +1176,7 @@ void Session::initMetrics()
|
||||
|
||||
m_metricIndices.disk.diskBlocksInUse = findMetricIndex("disk.disk_blocks_in_use");
|
||||
m_metricIndices.disk.numBlocksRead = findMetricIndex("disk.num_blocks_read");
|
||||
#if (LIBTORRENT_VERSION_NUM < 20000)
|
||||
#ifndef QBT_USES_LIBTORRENT2
|
||||
m_metricIndices.disk.numBlocksCacheHits = findMetricIndex("disk.num_blocks_cache_hits");
|
||||
#endif
|
||||
m_metricIndices.disk.writeJobs = findMetricIndex("disk.num_write_ops");
|
||||
@@ -1262,7 +1263,7 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
||||
settingsPack.set_int(lt::settings_pack::peer_turnover_interval, peerTurnoverInterval());
|
||||
|
||||
settingsPack.set_int(lt::settings_pack::aio_threads, asyncIOThreads());
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
settingsPack.set_int(lt::settings_pack::hashing_threads, hashingThreads());
|
||||
#endif
|
||||
settingsPack.set_int(lt::settings_pack::file_pool_size, filePoolSize());
|
||||
@@ -1270,7 +1271,7 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
||||
const int checkingMemUsageSize = checkingMemUsage() * 64;
|
||||
settingsPack.set_int(lt::settings_pack::checking_mem_usage, checkingMemUsageSize);
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM < 20000)
|
||||
#ifndef QBT_USES_LIBTORRENT2
|
||||
const int cacheSize = (diskCacheSize() > -1) ? (diskCacheSize() * 64) : -1;
|
||||
settingsPack.set_int(lt::settings_pack::cache_size, cacheSize);
|
||||
settingsPack.set_int(lt::settings_pack::cache_expiry, diskCacheTTL());
|
||||
@@ -1281,7 +1282,7 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
||||
settingsPack.set_int(lt::settings_pack::disk_io_read_mode, mode);
|
||||
settingsPack.set_int(lt::settings_pack::disk_io_write_mode, mode);
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM < 20000)
|
||||
#ifndef QBT_USES_LIBTORRENT2
|
||||
settingsPack.set_bool(lt::settings_pack::coalesce_reads, isCoalesceReadWriteEnabled());
|
||||
settingsPack.set_bool(lt::settings_pack::coalesce_writes, isCoalesceReadWriteEnabled());
|
||||
#endif
|
||||
@@ -1381,6 +1382,8 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
||||
|
||||
settingsPack.set_bool(lt::settings_pack::validate_https_trackers, validateHTTPSTrackerCertificate());
|
||||
|
||||
settingsPack.set_bool(lt::settings_pack::ssrf_mitigation, isSSRFMitigationEnabled());
|
||||
|
||||
settingsPack.set_bool(lt::settings_pack::no_connect_privileged_ports, blockPeersOnPrivilegedPorts());
|
||||
|
||||
settingsPack.set_bool(lt::settings_pack::apply_ip_filter_to_trackers, isTrackerFilteringEnabled());
|
||||
@@ -2212,7 +2215,7 @@ bool Session::loadTorrent(LoadTorrentParams params)
|
||||
{
|
||||
lt::add_torrent_params &p = params.ltAddTorrentParams;
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM < 20000)
|
||||
#ifndef QBT_USES_LIBTORRENT2
|
||||
p.storage = customStorageConstructor;
|
||||
#endif
|
||||
// Limits
|
||||
@@ -2220,7 +2223,7 @@ bool Session::loadTorrent(LoadTorrentParams params)
|
||||
p.max_uploads = maxUploadsPerTorrent();
|
||||
|
||||
const bool hasMetadata = (p.ti && p.ti->is_valid());
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const auto id = TorrentID::fromInfoHash(hasMetadata ? p.ti->info_hashes() : p.info_hashes);
|
||||
#else
|
||||
const auto id = TorrentID::fromInfoHash(hasMetadata ? p.ti->info_hash() : p.info_hash);
|
||||
@@ -2287,7 +2290,7 @@ bool Session::downloadMetadata(const MagnetUri &magnetUri)
|
||||
// Solution to avoid accidental file writes
|
||||
p.flags |= lt::torrent_flags::upload_mode;
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM < 20000)
|
||||
#ifndef QBT_USES_LIBTORRENT2
|
||||
p.storage = customStorageConstructor;
|
||||
#endif
|
||||
|
||||
@@ -3748,6 +3751,19 @@ void Session::setValidateHTTPSTrackerCertificate(const bool enabled)
|
||||
configureDeferred();
|
||||
}
|
||||
|
||||
bool Session::isSSRFMitigationEnabled() const
|
||||
{
|
||||
return m_SSRFMitigationEnabled;
|
||||
}
|
||||
|
||||
void Session::setSSRFMitigationEnabled(const bool enabled)
|
||||
{
|
||||
if (enabled == m_SSRFMitigationEnabled) return;
|
||||
|
||||
m_SSRFMitigationEnabled = enabled;
|
||||
configureDeferred();
|
||||
}
|
||||
|
||||
bool Session::blockPeersOnPrivilegedPorts() const
|
||||
{
|
||||
return m_blockPeersOnPrivilegedPorts;
|
||||
@@ -3889,7 +3905,7 @@ void Session::handleTorrentMetadataReceived(TorrentImpl *const torrent)
|
||||
// Copy the torrent file to the export folder
|
||||
if (!torrentExportDirectory().isEmpty())
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const TorrentInfo torrentInfo {torrent->nativeHandle().torrent_file_with_hashes()};
|
||||
#else
|
||||
const TorrentInfo torrentInfo {torrent->nativeHandle().torrent_file()};
|
||||
@@ -3947,7 +3963,7 @@ void Session::handleTorrentFinished(TorrentImpl *const torrent)
|
||||
// Move .torrent file to another folder
|
||||
if (!finishedTorrentExportDirectory().isEmpty())
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const TorrentInfo torrentInfo {torrent->nativeHandle().torrent_file_with_hashes()};
|
||||
#else
|
||||
const TorrentInfo torrentInfo {torrent->nativeHandle().torrent_file()};
|
||||
@@ -4032,7 +4048,7 @@ bool Session::addMoveTorrentStorageJob(TorrentImpl *torrent, const QString &newP
|
||||
|
||||
void Session::moveTorrentStorage(const MoveStorageJob &job) const
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const auto id = TorrentID::fromInfoHash(job.torrentHandle.info_hashes());
|
||||
#else
|
||||
const auto id = TorrentID::fromInfoHash(job.torrentHandle.info_hash());
|
||||
@@ -4331,7 +4347,7 @@ void Session::handleAlert(const lt::alert *a)
|
||||
{
|
||||
switch (a->type())
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20003)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
case lt::file_prio_alert::alert_type:
|
||||
#endif
|
||||
case lt::file_renamed_alert::alert_type:
|
||||
@@ -4433,7 +4449,7 @@ void Session::dispatchTorrentAlert(const lt::alert *a)
|
||||
|
||||
void Session::createTorrent(const lt::torrent_handle &nativeHandle)
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const auto torrentID = TorrentID::fromInfoHash(nativeHandle.info_hashes());
|
||||
#else
|
||||
const auto torrentID = TorrentID::fromInfoHash(nativeHandle.info_hash());
|
||||
@@ -4499,7 +4515,7 @@ void Session::handleAddTorrentAlert(const lt::add_torrent_alert *p)
|
||||
|
||||
const lt::add_torrent_params ¶ms = p->params;
|
||||
const bool hasMetadata = (params.ti && params.ti->is_valid());
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const auto id = TorrentID::fromInfoHash(hasMetadata ? params.ti->info_hashes() : params.info_hashes);
|
||||
#else
|
||||
const auto id = TorrentID::fromInfoHash(hasMetadata ? params.ti->info_hash() : params.info_hash);
|
||||
@@ -4514,7 +4530,7 @@ void Session::handleAddTorrentAlert(const lt::add_torrent_alert *p)
|
||||
|
||||
void Session::handleTorrentRemovedAlert(const lt::torrent_removed_alert *p)
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const auto id = TorrentID::fromInfoHash(p->info_hashes);
|
||||
#else
|
||||
const auto id = TorrentID::fromInfoHash(p->info_hash);
|
||||
@@ -4533,7 +4549,7 @@ void Session::handleTorrentRemovedAlert(const lt::torrent_removed_alert *p)
|
||||
|
||||
void Session::handleTorrentDeletedAlert(const lt::torrent_deleted_alert *p)
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const auto id = TorrentID::fromInfoHash(p->info_hashes);
|
||||
#else
|
||||
const auto id = TorrentID::fromInfoHash(p->info_hash);
|
||||
@@ -4551,7 +4567,7 @@ void Session::handleTorrentDeletedAlert(const lt::torrent_deleted_alert *p)
|
||||
|
||||
void Session::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed_alert *p)
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const auto id = TorrentID::fromInfoHash(p->info_hashes);
|
||||
#else
|
||||
const auto id = TorrentID::fromInfoHash(p->info_hash);
|
||||
@@ -4581,7 +4597,7 @@ void Session::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed_ale
|
||||
|
||||
void Session::handleMetadataReceivedAlert(const lt::metadata_received_alert *p)
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const auto id = TorrentID::fromInfoHash(p->handle.info_hashes());
|
||||
#else
|
||||
const auto id = TorrentID::fromInfoHash(p->handle.info_hash());
|
||||
@@ -4784,7 +4800,7 @@ void Session::handleSessionStatsAlert(const lt::session_stats_alert *p)
|
||||
m_cacheStatus.totalUsedBuffers = stats[m_metricIndices.disk.diskBlocksInUse];
|
||||
m_cacheStatus.jobQueueLength = stats[m_metricIndices.disk.queuedDiskJobs];
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM < 20000)
|
||||
#ifndef QBT_USES_LIBTORRENT2
|
||||
const int64_t numBlocksRead = stats[m_metricIndices.disk.numBlocksRead];
|
||||
const int64_t numBlocksCacheHits = stats[m_metricIndices.disk.numBlocksCacheHits];
|
||||
m_cacheStatus.readRatio = static_cast<qreal>(numBlocksCacheHits) / std::max<int64_t>((numBlocksCacheHits + numBlocksRead), 1);
|
||||
@@ -4819,7 +4835,7 @@ void Session::handleStorageMovedAlert(const lt::storage_moved_alert *p)
|
||||
const QString newPath {p->storage_path()};
|
||||
Q_ASSERT(newPath == currentJob.path);
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const auto id = TorrentID::fromInfoHash(currentJob.torrentHandle.info_hashes());
|
||||
#else
|
||||
const auto id = TorrentID::fromInfoHash(currentJob.torrentHandle.info_hash());
|
||||
@@ -4839,7 +4855,7 @@ void Session::handleStorageMovedFailedAlert(const lt::storage_moved_failed_alert
|
||||
const MoveStorageJob ¤tJob = m_moveStorageQueue.first();
|
||||
Q_ASSERT(currentJob.torrentHandle == p->handle);
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const auto id = TorrentID::fromInfoHash(currentJob.torrentHandle.info_hashes());
|
||||
#else
|
||||
const auto id = TorrentID::fromInfoHash(currentJob.torrentHandle.info_hash());
|
||||
@@ -4862,7 +4878,7 @@ void Session::handleStateUpdateAlert(const lt::state_update_alert *p)
|
||||
|
||||
for (const lt::torrent_status &status : p->status)
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 20000)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
const auto id = TorrentID::fromInfoHash(status.info_hashes);
|
||||
#else
|
||||
const auto id = TorrentID::fromInfoHash(status.info_hash);
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#include <libtorrent/add_torrent_params.hpp>
|
||||
#include <libtorrent/fwd.hpp>
|
||||
#include <libtorrent/torrent_handle.hpp>
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
#include <QHash>
|
||||
#include <QPointer>
|
||||
@@ -191,7 +190,7 @@ namespace BitTorrent
|
||||
{
|
||||
int diskBlocksInUse = -1;
|
||||
int numBlocksRead = -1;
|
||||
#if (LIBTORRENT_VERSION_NUM < 20000)
|
||||
#ifndef QBT_USES_LIBTORRENT2
|
||||
int numBlocksCacheHits = -1;
|
||||
#endif
|
||||
int writeJobs = -1;
|
||||
@@ -427,6 +426,8 @@ namespace BitTorrent
|
||||
void setMultiConnectionsPerIpEnabled(bool enabled);
|
||||
bool validateHTTPSTrackerCertificate() const;
|
||||
void setValidateHTTPSTrackerCertificate(bool enabled);
|
||||
bool isSSRFMitigationEnabled() const;
|
||||
void setSSRFMitigationEnabled(bool enabled);
|
||||
bool blockPeersOnPrivilegedPorts() const;
|
||||
void setBlockPeersOnPrivilegedPorts(bool enabled);
|
||||
bool isTrackerFilteringEnabled() const;
|
||||
@@ -700,6 +701,7 @@ namespace BitTorrent
|
||||
CachedSettingValue<bool> m_IDNSupportEnabled;
|
||||
CachedSettingValue<bool> m_multiConnectionsPerIpEnabled;
|
||||
CachedSettingValue<bool> m_validateHTTPSTrackerCertificate;
|
||||
CachedSettingValue<bool> m_SSRFMitigationEnabled;
|
||||
CachedSettingValue<bool> m_blockPeersOnPrivilegedPorts;
|
||||
CachedSettingValue<bool> m_isAddTrackersEnabled;
|
||||
CachedSettingValue<QString> m_additionalTrackers;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user