mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Compare commits
54 Commits
release-4.
...
release-4.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abb854a1e6 | ||
|
|
4ee17a73d0 | ||
|
|
faf6e82274 | ||
|
|
c08ec1ac5e | ||
|
|
cd0b6d9a43 | ||
|
|
b8f1142abe | ||
|
|
78859415d6 | ||
|
|
ef92c17192 | ||
|
|
22f3abc4b5 | ||
|
|
a56e6294c1 | ||
|
|
77909e0093 | ||
|
|
2c2bb14b2a | ||
|
|
73c8b77464 | ||
|
|
042238db87 | ||
|
|
6e267f8e81 | ||
|
|
fdc64d9b38 | ||
|
|
0b42425db5 | ||
|
|
e5d7738127 | ||
|
|
422489e2a1 | ||
|
|
7de983b4e5 | ||
|
|
e4e55d2a80 | ||
|
|
926012ce71 | ||
|
|
487eb554c9 | ||
|
|
5a96e1fc7a | ||
|
|
2fe698ee60 | ||
|
|
177ac32a5e | ||
|
|
5f34d1555b | ||
|
|
7cfe68f46c | ||
|
|
f94f4d2391 | ||
|
|
73b18d7ef3 | ||
|
|
817e9c4747 | ||
|
|
28844eff44 | ||
|
|
389664213b | ||
|
|
953b6fd6f8 | ||
|
|
9b4f3fcbf8 | ||
|
|
80743180be | ||
|
|
b2847b2381 | ||
|
|
eb657ec032 | ||
|
|
fc2be601df | ||
|
|
5786c7ff11 | ||
|
|
4a183dd968 | ||
|
|
7c10dba10c | ||
|
|
894446d308 | ||
|
|
47e9c5ac08 | ||
|
|
7f47ac11f1 | ||
|
|
67b17891fa | ||
|
|
dd5b7ba05b | ||
|
|
61aa4d9f1c | ||
|
|
6e924b668e | ||
|
|
618ce33fa0 | ||
|
|
ac413c76b9 | ||
|
|
f266184514 | ||
|
|
8c48bf4a70 | ||
|
|
8bee69c9fc |
14
.github/workflows/ci.yaml
vendored
14
.github/workflows/ci.yaml
vendored
@@ -12,12 +12,12 @@ on:
|
|||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Qt: 5.15.0
|
# Qt: 5.15.1
|
||||||
# libtorrent: RC_1_2 HEAD, 1.2.10
|
# libtorrent: RC_1_2 HEAD, 1.2.11
|
||||||
VCPKG_COMMIT: 32eccc18191fbb57b159784a1724d2d00613ae82
|
VCPKG_COMMIT: 133051b793486ef14e67e9d1f48c9cfe64dc127e
|
||||||
VCPKG_DEST_MACOS: /Users/runner/qbt_tools/vcpkg
|
VCPKG_DEST_MACOS: /Users/runner/qbt_tools/vcpkg
|
||||||
VCPKG_DEST_WIN: C:\qbt_tools\vcpkg
|
VCPKG_DEST_WIN: C:\qbt_tools\vcpkg
|
||||||
LIBTORRENT_VERSION_TAG: libtorrent-1.2.10
|
LIBTORRENT_VERSION_TAG: v1.2.11
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@@ -178,11 +178,11 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
# - ninja is needed for building qBittorrent (because it's preferrable, not a hard requirement)
|
# - ninja is needed for building qBittorrent (because it's preferrable, not a hard requirement)
|
||||||
# - pkg-config is needed for some vcpkg installations
|
# - automake is needed for the installation the vcpkg installation of fontconfig, a dependency of qt5-base
|
||||||
- name: install additional required packages with homebrew
|
- name: install additional required packages with homebrew
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
brew install ninja pkg-config
|
brew install automake ninja
|
||||||
|
|
||||||
- name: setup vcpkg (cached, if possible)
|
- name: setup vcpkg (cached, if possible)
|
||||||
uses: lukka/run-vcpkg@v4
|
uses: lukka/run-vcpkg@v4
|
||||||
@@ -197,7 +197,7 @@ jobs:
|
|||||||
Copy-Item ${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-osx.cmake `
|
Copy-Item ${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-osx.cmake `
|
||||||
${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake
|
${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake
|
||||||
Add-Content ${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake `
|
Add-Content ${{ github.workspace }}/triplets_overlay/x64-osx-release.cmake `
|
||||||
-Value "set(VCPKG_BUILD_TYPE release)"
|
-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
|
# NOTE: Avoids a libtorrent ABI issue. See https://github.com/arvidn/libtorrent/issues/4965
|
||||||
- name: force AppleClang to compile libtorrent with C++14
|
- name: force AppleClang to compile libtorrent with C++14
|
||||||
|
|||||||
34
.github/workflows/file_health.sh
vendored
34
.github/workflows/file_health.sh
vendored
@@ -14,60 +14,68 @@ 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/mootools-1.2-more.js'
|
||||||
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/mootools-1.2-(core-yc.js|more.js)'
|
||||||
|
|
||||||
echo -e "*** Detect files not encoded in UTF-8 ***\n"
|
echo -e "\n*** Detect files not encoded in UTF-8 ***\n"
|
||||||
|
|
||||||
find . -path ./build -prune -false -o -path ./.git -prune -false -o -type f -exec file --mime {} \; | sort \
|
find . -path ./build -prune -false -o -path ./.git -prune -false -o -type f -exec file --mime {} \; | sort \
|
||||||
| grep -v -e "charset=us-ascii" -e "charset=utf-8" | cut -d ":" -f 1 \
|
| grep -v -e "charset=us-ascii" -e "charset=utf-8" | cut -d ":" -f 1 \
|
||||||
| grep -E -v -e "${exclusions_nonutf8}" \
|
| grep -E -v -e "${exclusions_nonutf8}" \
|
||||||
| tee >(echo -e "\n--> Files not encoded in UTF-8: found" "$(wc -l < /dev/stdin)" "regression(s)") \
|
| tee >(echo -e "--> Files not encoded in UTF-8: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
||||||
regressions=$((regressions+$?))
|
regressions=$((regressions+$?))
|
||||||
|
|
||||||
echo -e "*** Detect files encoded in UTF-8 with BOM ***\n"
|
echo -e "\n*** Detect files encoded in UTF-8 with BOM ***\n"
|
||||||
|
|
||||||
grep --exclude-dir={.git,build} -rIl $'\xEF\xBB\xBF' | sort \
|
grep --exclude-dir={.git,build} -rIl $'\xEF\xBB\xBF' | sort \
|
||||||
| grep -E -v -e "${exclusions_bom}" \
|
| grep -E -v -e "${exclusions_bom}" \
|
||||||
| tee >(echo -e "\n--> Files encoded in UTF-8 with BOM: found" "$(wc -l < /dev/stdin)" "regression(s)") \
|
| tee >(echo -e "--> Files encoded in UTF-8 with BOM: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
||||||
regressions=$((regressions+$?))
|
regressions=$((regressions+$?))
|
||||||
|
|
||||||
echo -e "*** Detect usage of CR byte ***\n"
|
echo -e "\n*** Detect usage of CR byte ***\n"
|
||||||
|
|
||||||
grep --exclude-dir={.git,build} -rIlU $'\x0D' | sort \
|
grep --exclude-dir={.git,build} -rIlU $'\x0D' | sort \
|
||||||
| tee >(echo -e "\n--> Usage of CR byte: found" "$(wc -l < /dev/stdin)" "regression(s)") \
|
| tee >(echo -e "--> Usage of CR byte: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
||||||
regressions=$((regressions+$?))
|
regressions=$((regressions+$?))
|
||||||
|
|
||||||
echo -e "*** Detect trailing whitespace in lines ***\n"
|
echo -e "\n*** Detect trailing whitespace in lines ***\n"
|
||||||
|
|
||||||
grep --exclude-dir={.git,build} -rIl "[[:blank:]]$" | sort \
|
grep --exclude-dir={.git,build} -rIl "[[:blank:]]$" | sort \
|
||||||
| grep -E -v -e "${exclusions_tw}" \
|
| grep -E -v -e "${exclusions_tw}" \
|
||||||
| tee >(echo -e "\n--> Trailing whitespace in lines: found" "$(wc -l < /dev/stdin)" "regression(s)") \
|
| tee >(echo -e "--> Trailing whitespace in lines: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0';
|
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0';
|
||||||
regressions=$((regressions+$?))
|
regressions=$((regressions+$?))
|
||||||
|
|
||||||
echo -e "*** Detect too many trailing newlines ***\n"
|
echo -e "\n*** Detect too many trailing newlines ***\n"
|
||||||
|
|
||||||
find . -path ./build -prune -false -o -path ./.git -prune -false -o -type f -exec file --mime {} \; | sort \
|
find . -path ./build -prune -false -o -path ./.git -prune -false -o -type f -exec file --mime {} \; | sort \
|
||||||
| grep -e "charset=us-ascii" -e "charset=utf-8" | cut -d ":" -f 1 \
|
| grep -e "charset=us-ascii" -e "charset=utf-8" | cut -d ":" -f 1 \
|
||||||
| xargs -L1 -I my_input bash -c 'test "$(tail -q -c2 "my_input" | hexdump -C | grep "0a 0a")" && echo "my_input"' \
|
| xargs -L1 -I my_input bash -c 'test "$(tail -q -c2 "my_input" | hexdump -C | grep "0a 0a")" && echo "my_input"' \
|
||||||
| tee >(echo -e "\n--> Too many trailing newlines: found" "$(wc -l < /dev/stdin)" "regression(s)") \
|
| tee >(echo -e "--> Too many trailing newlines: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
||||||
regressions=$((regressions+$?))
|
regressions=$((regressions+$?))
|
||||||
|
|
||||||
echo -e "*** Detect no trailing newline ***\n"
|
echo -e "\n*** Detect no trailing newline ***\n"
|
||||||
|
|
||||||
find . -path ./build -prune -false -o -path ./.git -prune -false -o -type f -exec file --mime {} \; | sort \
|
find . -path ./build -prune -false -o -path ./.git -prune -false -o -type f -exec file --mime {} \; | sort \
|
||||||
| grep -e "charset=us-ascii" -e "charset=utf-8" | cut -d ":" -f 1 \
|
| grep -e "charset=us-ascii" -e "charset=utf-8" | cut -d ":" -f 1 \
|
||||||
| grep -E -v -e "${exclusions_no_lf}" \
|
| grep -E -v -e "${exclusions_no_lf}" \
|
||||||
| xargs -L1 -I my_input bash -c 'test "$(tail -q -c1 "my_input" | hexdump -C | grep "0a")" || echo "my_input"' \
|
| xargs -L1 -I my_input bash -c 'test "$(tail -q -c1 "my_input" | hexdump -C | grep "0a")" || echo "my_input"' \
|
||||||
| tee >(echo -e "\n--> No trailing newline: found" "$(wc -l < /dev/stdin)" "regression(s)") \
|
| tee >(echo -e "--> No trailing newline: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||||
|
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
||||||
|
regressions=$((regressions+$?))
|
||||||
|
|
||||||
|
echo -e "\n*** Detect translation closing tag in new line ***\n"
|
||||||
|
|
||||||
|
grep --exclude-dir={.git,build} -nri "^</translation>" | sort \
|
||||||
|
| cut -d ":" -f 1,2 \
|
||||||
|
| tee >(echo -e "--> Translation closing tag in new line: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \
|
||||||
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
| xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'
|
||||||
regressions=$((regressions+$?))
|
regressions=$((regressions+$?))
|
||||||
|
|
||||||
if [ "$regressions" -ne 0 ]; then
|
if [ "$regressions" -ne 0 ]; then
|
||||||
regressions=1
|
regressions=1
|
||||||
echo "File health regressions found. Please fix them (or add them as exclusions)."
|
echo "\nFile health regressions found. Please fix them (or add them as exclusions)."
|
||||||
else
|
else
|
||||||
echo "All OK, no file health regressions found."
|
echo "All OK, no file health regressions found."
|
||||||
fi
|
fi
|
||||||
|
|||||||
2
.github/workflows/file_health.yaml
vendored
2
.github/workflows/file_health.yaml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
check_file_health:
|
check_file_health:
|
||||||
name: Check file health
|
name: Check file health
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: checkout repository
|
- name: checkout repository
|
||||||
|
|||||||
47
.travis.yml
47
.travis.yml
@@ -4,7 +4,8 @@ os:
|
|||||||
- linux
|
- linux
|
||||||
- osx
|
- osx
|
||||||
|
|
||||||
dist: bionic
|
dist: focal
|
||||||
|
osx_image: xcode12.2
|
||||||
|
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -16,6 +17,11 @@ env:
|
|||||||
- secure: "OI9CUjj4lTb0HwwIZU5PbECU3hLlAL6KC8KsbwohG8/O3j5fLcnmDsK4Ad9us5cC39sS11Jcd1kDP2qRcCuST/glVNhLkcjKkiQerOfd5nQ/qL4JYfz/1mfP5mdpz9jHKzpLUIG+TXkbSTjP6VVmsb5KPT+3pKEdRFZB+Pu9+J8="
|
- secure: "OI9CUjj4lTb0HwwIZU5PbECU3hLlAL6KC8KsbwohG8/O3j5fLcnmDsK4Ad9us5cC39sS11Jcd1kDP2qRcCuST/glVNhLkcjKkiQerOfd5nQ/qL4JYfz/1mfP5mdpz9jHKzpLUIG+TXkbSTjP6VVmsb5KPT+3pKEdRFZB+Pu9+J8="
|
||||||
- coverity_branch: coverity_scan
|
- coverity_branch: coverity_scan
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
include:
|
||||||
|
- env: libt_branch=RC_2_0 gui=true build_system=qmake
|
||||||
|
os: linux
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
on_success: change
|
on_success: change
|
||||||
@@ -39,8 +45,7 @@ addons:
|
|||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
# sources list: https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json
|
# sources list: https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json
|
||||||
- sourceline: 'ppa:qbittorrent-team/qbt-libtorrent-travisci'
|
- sourceline: 'deb https://apt.kitware.com/ubuntu/ focal main'
|
||||||
- sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
|
|
||||||
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
|
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
|
||||||
packages:
|
packages:
|
||||||
# packages list: https://github.com/travis-ci/apt-package-safelist/blob/master/ubuntu-trusty
|
# packages list: https://github.com/travis-ci/apt-package-safelist/blob/master/ubuntu-trusty
|
||||||
@@ -69,6 +74,8 @@ before_install:
|
|||||||
# TravisCI installs its own cmake to another location which ovverides other installations
|
# TravisCI installs its own cmake to another location which ovverides other installations
|
||||||
# if they don't call the new binary directly
|
# if they don't call the new binary directly
|
||||||
alias cmake="/usr/bin/cmake"
|
alias cmake="/usr/bin/cmake"
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
|
||||||
fi
|
fi
|
||||||
- |
|
- |
|
||||||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||||
@@ -114,20 +121,34 @@ install:
|
|||||||
ccache -V && ccache --show-stats && ccache --zero-stats
|
ccache -V && ccache --show-stats && ccache --zero-stats
|
||||||
fi
|
fi
|
||||||
- |
|
- |
|
||||||
if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
if [ "$libt_branch" = "RC_1_2" ]; then
|
||||||
# Will install latest 1.2.x daily build from the PPA
|
|
||||||
sudo apt-get -y install libtorrent-rasterbar-dev
|
|
||||||
fi
|
|
||||||
- |
|
|
||||||
if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
|
||||||
# building libtorrent manually should be faster than using the official bottle
|
|
||||||
# because the bottle will also pull in a lot of updated dependencies and prolong the overall time
|
|
||||||
pushd "$HOME"
|
pushd "$HOME"
|
||||||
git clone --single-branch --branch RC_1_2 https://github.com/arvidn/libtorrent.git
|
git clone --single-branch --branch RC_1_2 https://github.com/arvidn/libtorrent.git
|
||||||
cd libtorrent
|
cd libtorrent
|
||||||
git checkout tags/v1.2.10
|
git checkout tags/v1.2.11
|
||||||
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14 -Ddeprecated-functions=OFF -DOPENSSL_ROOT_DIR="$openssl_root_path" ./
|
cmake \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_CXX_STANDARD=14 \
|
||||||
|
-Ddeprecated-functions=OFF \
|
||||||
|
-DOPENSSL_ROOT_DIR="$openssl_root_path" \
|
||||||
|
./
|
||||||
|
make
|
||||||
|
sudo make install
|
||||||
|
popd
|
||||||
|
elif [ "$libt_branch" = "RC_2_0" ]; then
|
||||||
|
pushd "$HOME"
|
||||||
|
git clone --single-branch --branch RC_2_0 https://github.com/arvidn/libtorrent.git
|
||||||
|
cd libtorrent
|
||||||
|
git checkout tags/v2.0.1
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
cmake \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_CXX_STANDARD=14 \
|
||||||
|
-Ddeprecated-functions=ON \
|
||||||
|
-DOPENSSL_ROOT_DIR="$openssl_root_path" \
|
||||||
|
./
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
popd
|
popd
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR) # Policies <= CMP0097 default t
|
|||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
|
||||||
|
|
||||||
project(qBittorrent
|
project(qBittorrent
|
||||||
VERSION 4.3.1.0
|
VERSION 4.3.2.0
|
||||||
DESCRIPTION "The qBittorrent BitTorrent client"
|
DESCRIPTION "The qBittorrent BitTorrent client"
|
||||||
HOMEPAGE_URL "https://www.qbittorrent.org/"
|
HOMEPAGE_URL "https://www.qbittorrent.org/"
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
@@ -11,14 +11,15 @@ project(qBittorrent
|
|||||||
|
|
||||||
# use CONFIG mode first in find_package
|
# use CONFIG mode first in find_package
|
||||||
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
|
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
|
||||||
# version requirements
|
# version requirements - older vesions may work, but you are on your own
|
||||||
set(requiredBoostVersion 1.40)
|
set(minBoostVersion 1.65)
|
||||||
set(requiredQtVersion 5.9.0)
|
set(minQtVersion 5.9.5)
|
||||||
set(requiredOpenSSLVersion 1.0)
|
set(minOpenSSLVersion 1.1.1)
|
||||||
set(requiredLibtorrentVersion 1.2.0)
|
set(minLibtorrentVersion 1.2.11)
|
||||||
set(requiredZlibVersion 1.2.5.2)
|
set(minZlibVersion 1.2.11)
|
||||||
|
|
||||||
# features (some are platform-specific)
|
# features (some are platform-specific)
|
||||||
|
include(CheckCXXSourceCompiles) # TODO: migrate to CheckSourceCompiles in CMake >= 3.19
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
include(FeatureOptionsSetup)
|
include(FeatureOptionsSetup)
|
||||||
feature_option(STACKTRACE "Enable stacktraces" ON)
|
feature_option(STACKTRACE "Enable stacktraces" ON)
|
||||||
@@ -34,6 +35,18 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
"Install systemd service file to a directory manually overridable with Systemd_SERVICES_INSTALL_DIR"
|
"Install systemd service file to a directory manually overridable with Systemd_SERVICES_INSTALL_DIR"
|
||||||
OFF "NOT GUI" OFF
|
OFF "NOT GUI" OFF
|
||||||
)
|
)
|
||||||
|
if (STACKTRACE)
|
||||||
|
check_cxx_source_compiles(
|
||||||
|
"#include <execinfo.h>
|
||||||
|
int main(){return 0;}"
|
||||||
|
QBITTORRENT_HAS_EXECINFO_H
|
||||||
|
)
|
||||||
|
if (NOT QBITTORRENT_HAS_EXECINFO_H)
|
||||||
|
message(FATAL_ERROR "execinfo.h header file not found.\n"
|
||||||
|
"Please either disable the STACKTRACE feature or use a libc that has this header file, such as glibc (GNU libc)."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
elseif (MSVC)
|
elseif (MSVC)
|
||||||
feature_option(MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" ON)
|
feature_option(MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" ON)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ Example:
|
|||||||
|
|
||||||
## 8. Include guard
|
## 8. Include guard
|
||||||
|
|
||||||
`#pragma once` should be used instead of "include guard" in new code:
|
`#pragma once` must be used instead of a "classic include guard":
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
// examplewidget.h
|
// examplewidget.h
|
||||||
|
|||||||
22
Changelog
22
Changelog
@@ -1,3 +1,25 @@
|
|||||||
|
Sun Dec 27 2020 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.3.2
|
||||||
|
- FEATURE: Allow to add root folder to torrent content (glassez)
|
||||||
|
- FEATURE: "HTTPS tracker validation" option is available on all platforms with latest libtorrent (Chocobo1)
|
||||||
|
- FEATURE: Option for supporting internationalized domain names (IDNs) (Chocobo1)
|
||||||
|
- BUGFIX: Fix broken sorting on some columns (Chocobo1)
|
||||||
|
- BUGFIX: Fix availability per file value (Chocobo1)
|
||||||
|
- BUGFIX: Fix status of torrents without metadata (sledgehammer999)
|
||||||
|
- BUGFIX: Don't try to remove folders for a torrent without metadata (sledgehammer999)
|
||||||
|
- BUGFIX: Lift upper limit of "Max concurrent HTTP announces" option (Chocobo1)
|
||||||
|
- BUGFIX: Add links to libtorrent documentation (Chocobo1)
|
||||||
|
- BUGFIX: Move "embedded tracker" options to qbt section (Chocobo1)
|
||||||
|
- BUGFIX: Properly handle "Append extension" option changing (glassez)
|
||||||
|
- BUGFIX: Correctly save paused torrent state (glassez)
|
||||||
|
- BUGFIX: Fix bug of "move storage job" can be performed multiple times (glassez)
|
||||||
|
- WEBUI: Add ability to use 'shift+delete' to delete torrents (Chocobo1)
|
||||||
|
- WEBUI: Allow to attach tags while adding torrents (Jesse Chan)
|
||||||
|
- WEBUI: Bump version to 2.6.2 (Jesse Chan)
|
||||||
|
- WEBUI: Remove unnecessary restriction on input length (Chocobo1)
|
||||||
|
- WINDOWS: NSIS: Update Russian translation (Andrei Stepanov)
|
||||||
|
- WINDOWS: NSIS: Update Italian translation (Alessandro Simonelli)
|
||||||
|
- OTHER: Drop support for building with libtorrent < 1.2.11 (Vladimir Golovnev)
|
||||||
|
|
||||||
Wed Nov 25 2020 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.3.1
|
Wed Nov 25 2020 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.3.1
|
||||||
- FEATURE: Allow progress bar styling from custom themes (jagannatharjun)
|
- FEATURE: Allow progress bar styling from custom themes (jagannatharjun)
|
||||||
- FEATURE: Allow adding torrents using "Paste" key sequence (Chocobo1)
|
- FEATURE: Allow adding torrents using "Paste" key sequence (Chocobo1)
|
||||||
|
|||||||
16
INSTALL
16
INSTALL
@@ -3,23 +3,27 @@ qBittorrent - A BitTorrent client in C++ / Qt
|
|||||||
|
|
||||||
1) Install these dependencies:
|
1) Install these dependencies:
|
||||||
|
|
||||||
- Boost >= 1.40
|
- Boost >= 1.65
|
||||||
|
|
||||||
- libtorrent-rasterbar >= 1.2 (by Arvid Norberg)
|
- libtorrent-rasterbar >= 1.2.11 (by Arvid Norberg)
|
||||||
* https://www.libtorrent.org/
|
* https://www.libtorrent.org/
|
||||||
* Be careful: another library (the one used by rTorrent) uses a similar name
|
* Be careful: another library (the one used by rTorrent) uses a similar name
|
||||||
|
|
||||||
- OpenSSL >= 1.0
|
- OpenSSL >= 1.1.1
|
||||||
|
|
||||||
- Qt >= 5.9.0
|
- Qt >= 5.9.5
|
||||||
|
|
||||||
- zlib >= 1.2.5.2
|
- zlib >= 1.2.11
|
||||||
|
|
||||||
- pkg-config (compile-time only)
|
- pkg-config (compile-time only on *nix systems)
|
||||||
|
|
||||||
- Python >= 3.5.0 (optional, runtime only)
|
- Python >= 3.5.0 (optional, runtime only)
|
||||||
* Required by the internal search engine
|
* Required by the internal 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.
|
||||||
|
Please ensure you are building with an officially supported configuration when reporting bugs.
|
||||||
|
|
||||||
2a) Compile and install qBittorrent with Qt graphical interface
|
2a) Compile and install qBittorrent with Qt graphical interface
|
||||||
|
|
||||||
$ ./configure
|
$ ./configure
|
||||||
|
|||||||
124
configure
vendored
124
configure
vendored
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.69 for qbittorrent v4.3.1.
|
# Generated by GNU Autoconf 2.69 for qbittorrent v4.3.2.
|
||||||
#
|
#
|
||||||
# Report bugs to <bugs.qbittorrent.org>.
|
# Report bugs to <bugs.qbittorrent.org>.
|
||||||
#
|
#
|
||||||
@@ -580,8 +580,8 @@ MAKEFLAGS=
|
|||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='qbittorrent'
|
PACKAGE_NAME='qbittorrent'
|
||||||
PACKAGE_TARNAME='qbittorrent'
|
PACKAGE_TARNAME='qbittorrent'
|
||||||
PACKAGE_VERSION='v4.3.1'
|
PACKAGE_VERSION='v4.3.2'
|
||||||
PACKAGE_STRING='qbittorrent v4.3.1'
|
PACKAGE_STRING='qbittorrent v4.3.2'
|
||||||
PACKAGE_BUGREPORT='bugs.qbittorrent.org'
|
PACKAGE_BUGREPORT='bugs.qbittorrent.org'
|
||||||
PACKAGE_URL='https://www.qbittorrent.org/'
|
PACKAGE_URL='https://www.qbittorrent.org/'
|
||||||
|
|
||||||
@@ -1302,7 +1302,7 @@ if test "$ac_init_help" = "long"; then
|
|||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures qbittorrent v4.3.1 to adapt to many kinds of systems.
|
\`configure' configures qbittorrent v4.3.2 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
@@ -1373,7 +1373,7 @@ fi
|
|||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of qbittorrent v4.3.1:";;
|
short | recursive ) echo "Configuration of qbittorrent v4.3.2:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
@@ -1427,7 +1427,7 @@ Some influential environment variables:
|
|||||||
directories to add to pkg-config's search path
|
directories to add to pkg-config's search path
|
||||||
PKG_CONFIG_LIBDIR
|
PKG_CONFIG_LIBDIR
|
||||||
path overriding pkg-config's built-in search path
|
path overriding pkg-config's built-in search path
|
||||||
QT_QMAKE value of host_bins for Qt5Core >= 5.9.0, overriding pkg-config
|
QT_QMAKE value of host_bins for Qt5Core >= 5.9.5, overriding pkg-config
|
||||||
Qt5Svg_CFLAGS
|
Qt5Svg_CFLAGS
|
||||||
C compiler flags for Qt5Svg, overriding pkg-config
|
C compiler flags for Qt5Svg, overriding pkg-config
|
||||||
Qt5Svg_LIBS linker flags for Qt5Svg, overriding pkg-config
|
Qt5Svg_LIBS linker flags for Qt5Svg, overriding pkg-config
|
||||||
@@ -1509,7 +1509,7 @@ fi
|
|||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
qbittorrent configure v4.3.1
|
qbittorrent configure v4.3.2
|
||||||
generated by GNU Autoconf 2.69
|
generated by GNU Autoconf 2.69
|
||||||
|
|
||||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||||
@@ -1648,7 +1648,7 @@ cat >config.log <<_ACEOF
|
|||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by qbittorrent $as_me v4.3.1, which was
|
It was created by qbittorrent $as_me v4.3.2, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
@@ -2026,6 +2026,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
: ${CFLAGS=""}
|
||||||
|
: ${CXXFLAGS=""}
|
||||||
ac_ext=c
|
ac_ext=c
|
||||||
ac_cpp='$CPP $CPPFLAGS'
|
ac_cpp='$CPP $CPPFLAGS'
|
||||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||||
@@ -3826,7 +3828,7 @@ fi
|
|||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='qbittorrent'
|
PACKAGE='qbittorrent'
|
||||||
VERSION='v4.3.1'
|
VERSION='v4.3.2'
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
@@ -4485,8 +4487,8 @@ $as_echo "$enable_webui" >&6; }
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if test -n "$PKG_CONFIG" && \
|
if test -n "$PKG_CONFIG" && \
|
||||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.9.0\""; } >&5
|
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.9.5\""; } >&5
|
||||||
($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.9.0") 2>&5
|
($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.9.5") 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||||
test $ac_status = 0; }; then
|
test $ac_status = 0; }; then
|
||||||
@@ -4495,12 +4497,12 @@ if test -n "$QT_QMAKE"; then
|
|||||||
pkg_cv_QT_QMAKE="$QT_QMAKE"
|
pkg_cv_QT_QMAKE="$QT_QMAKE"
|
||||||
elif test -n "$PKG_CONFIG"; then
|
elif test -n "$PKG_CONFIG"; then
|
||||||
if test -n "$PKG_CONFIG" && \
|
if test -n "$PKG_CONFIG" && \
|
||||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.9.0\""; } >&5
|
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.9.5\""; } >&5
|
||||||
($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.9.0") 2>&5
|
($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.9.5") 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||||
test $ac_status = 0; }; then
|
test $ac_status = 0; }; then
|
||||||
pkg_cv_QT_QMAKE=`$PKG_CONFIG --variable="host_bins" "Qt5Core >= 5.9.0" 2>/dev/null`
|
pkg_cv_QT_QMAKE=`$PKG_CONFIG --variable="host_bins" "Qt5Core >= 5.9.5" 2>/dev/null`
|
||||||
test "x$?" != "x0" && pkg_failed=yes
|
test "x$?" != "x0" && pkg_failed=yes
|
||||||
else
|
else
|
||||||
pkg_failed=yes
|
pkg_failed=yes
|
||||||
@@ -4527,8 +4529,8 @@ fi
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt5 qmake >= 5.9.0" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt5 qmake >= 5.9.5" >&5
|
||||||
$as_echo_n "checking for Qt5 qmake >= 5.9.0... " >&6; }
|
$as_echo_n "checking for Qt5 qmake >= 5.9.5... " >&6; }
|
||||||
if test "x$QT_QMAKE" != "x"; then :
|
if test "x$QT_QMAKE" != "x"; then :
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT_QMAKE" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT_QMAKE" >&5
|
||||||
$as_echo "$QT_QMAKE" >&6; }
|
$as_echo "$QT_QMAKE" >&6; }
|
||||||
@@ -4642,11 +4644,11 @@ case "x$enable_qt_dbus" in #(
|
|||||||
"xyes") :
|
"xyes") :
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||||
$as_echo "yes" >&6; }
|
$as_echo "yes" >&6; }
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt5DBus >= 5.9.0" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt5DBus >= 5.9.5" >&5
|
||||||
$as_echo_n "checking for Qt5DBus >= 5.9.0... " >&6; }
|
$as_echo_n "checking for Qt5DBus >= 5.9.5... " >&6; }
|
||||||
if test -n "$PKG_CONFIG" && \
|
if test -n "$PKG_CONFIG" && \
|
||||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5DBus >= 5.9.0\""; } >&5
|
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5DBus >= 5.9.5\""; } >&5
|
||||||
($PKG_CONFIG --exists --print-errors "Qt5DBus >= 5.9.0") 2>&5
|
($PKG_CONFIG --exists --print-errors "Qt5DBus >= 5.9.5") 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||||
test $ac_status = 0; }; then
|
test $ac_status = 0; }; then
|
||||||
@@ -4716,10 +4718,10 @@ BOOST_CPPFLAGS=""
|
|||||||
if test "x$want_boost" = "xyes"; then :
|
if test "x$want_boost" = "xyes"; then :
|
||||||
|
|
||||||
|
|
||||||
if test "x1.40" = "x"; then :
|
if test "x1.65" = "x"; then :
|
||||||
_AX_BOOST_BASE_TONUMERICVERSION_req="1.20.0"
|
_AX_BOOST_BASE_TONUMERICVERSION_req="1.20.0"
|
||||||
else
|
else
|
||||||
_AX_BOOST_BASE_TONUMERICVERSION_req="1.40"
|
_AX_BOOST_BASE_TONUMERICVERSION_req="1.65"
|
||||||
fi
|
fi
|
||||||
_AX_BOOST_BASE_TONUMERICVERSION_req_shorten=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([0-9]*\.[0-9]*\)'`
|
_AX_BOOST_BASE_TONUMERICVERSION_req_shorten=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([0-9]*\.[0-9]*\)'`
|
||||||
_AX_BOOST_BASE_TONUMERICVERSION_req_major=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([0-9]*\)'`
|
_AX_BOOST_BASE_TONUMERICVERSION_req_major=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([0-9]*\)'`
|
||||||
@@ -4763,16 +4765,16 @@ esac
|
|||||||
|
|
||||||
if test "x$_AX_BOOST_BASE_boost_path" != "x"; then :
|
if test "x$_AX_BOOST_BASE_boost_path" != "x"; then :
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.40 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.65 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"" >&5
|
||||||
$as_echo_n "checking for boostlib >= 1.40 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"... " >&6; }
|
$as_echo_n "checking for boostlib >= 1.65 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"... " >&6; }
|
||||||
if test -d "$_AX_BOOST_BASE_boost_path/include" && test -r "$_AX_BOOST_BASE_boost_path/include"; then :
|
if test -d "$_AX_BOOST_BASE_boost_path/include" && test -r "$_AX_BOOST_BASE_boost_path/include"; then :
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||||
$as_echo "yes" >&6; }
|
$as_echo "yes" >&6; }
|
||||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include"
|
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include"
|
||||||
for _AX_BOOST_BASE_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do
|
for _AX_BOOST_BASE_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.40 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.65 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"" >&5
|
||||||
$as_echo_n "checking for boostlib >= 1.40 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"... " >&6; }
|
$as_echo_n "checking for boostlib >= 1.65 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"... " >&6; }
|
||||||
if test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" ; then :
|
if test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" ; then :
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||||
@@ -4815,8 +4817,8 @@ fi
|
|||||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_lib_path"
|
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_lib_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.40 ($WANT_BOOST_VERSION)" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.65 ($WANT_BOOST_VERSION)" >&5
|
||||||
$as_echo_n "checking for boostlib >= 1.40 ($WANT_BOOST_VERSION)... " >&6; }
|
$as_echo_n "checking for boostlib >= 1.65 ($WANT_BOOST_VERSION)... " >&6; }
|
||||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||||
export CPPFLAGS
|
export CPPFLAGS
|
||||||
@@ -4985,8 +4987,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
|||||||
|
|
||||||
if test "x$succeeded" != "xyes" ; then
|
if test "x$succeeded" != "xyes" ; then
|
||||||
if test "x$_version" = "x0" ; then
|
if test "x$_version" = "x0" ; then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: We could not detect the boost libraries (version 1.40 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: We could not detect the boost libraries (version 1.65 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&5
|
||||||
$as_echo "$as_me: We could not detect the boost libraries (version 1.40 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&6;}
|
$as_echo "$as_me: We could not detect the boost libraries (version 1.65 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&6;}
|
||||||
else
|
else
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Your boost libraries seems to old (version $_version)." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Your boost libraries seems to old (version $_version)." >&5
|
||||||
$as_echo "$as_me: Your boost libraries seems to old (version $_version)." >&6;}
|
$as_echo "$as_me: Your boost libraries seems to old (version $_version)." >&6;}
|
||||||
@@ -5292,12 +5294,12 @@ if test -n "$libtorrent_CFLAGS"; then
|
|||||||
pkg_cv_libtorrent_CFLAGS="$libtorrent_CFLAGS"
|
pkg_cv_libtorrent_CFLAGS="$libtorrent_CFLAGS"
|
||||||
elif test -n "$PKG_CONFIG"; then
|
elif test -n "$PKG_CONFIG"; then
|
||||||
if test -n "$PKG_CONFIG" && \
|
if test -n "$PKG_CONFIG" && \
|
||||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar >= 1.2\""; } >&5
|
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar >= 1.2.11\""; } >&5
|
||||||
($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar >= 1.2") 2>&5
|
($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar >= 1.2.11") 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||||
test $ac_status = 0; }; then
|
test $ac_status = 0; }; then
|
||||||
pkg_cv_libtorrent_CFLAGS=`$PKG_CONFIG --cflags "libtorrent-rasterbar >= 1.2" 2>/dev/null`
|
pkg_cv_libtorrent_CFLAGS=`$PKG_CONFIG --cflags "libtorrent-rasterbar >= 1.2.11" 2>/dev/null`
|
||||||
test "x$?" != "x0" && pkg_failed=yes
|
test "x$?" != "x0" && pkg_failed=yes
|
||||||
else
|
else
|
||||||
pkg_failed=yes
|
pkg_failed=yes
|
||||||
@@ -5309,12 +5311,12 @@ if test -n "$libtorrent_LIBS"; then
|
|||||||
pkg_cv_libtorrent_LIBS="$libtorrent_LIBS"
|
pkg_cv_libtorrent_LIBS="$libtorrent_LIBS"
|
||||||
elif test -n "$PKG_CONFIG"; then
|
elif test -n "$PKG_CONFIG"; then
|
||||||
if test -n "$PKG_CONFIG" && \
|
if test -n "$PKG_CONFIG" && \
|
||||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar >= 1.2\""; } >&5
|
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar >= 1.2.11\""; } >&5
|
||||||
($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar >= 1.2") 2>&5
|
($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar >= 1.2.11") 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||||
test $ac_status = 0; }; then
|
test $ac_status = 0; }; then
|
||||||
pkg_cv_libtorrent_LIBS=`$PKG_CONFIG --libs "libtorrent-rasterbar >= 1.2" 2>/dev/null`
|
pkg_cv_libtorrent_LIBS=`$PKG_CONFIG --libs "libtorrent-rasterbar >= 1.2.11" 2>/dev/null`
|
||||||
test "x$?" != "x0" && pkg_failed=yes
|
test "x$?" != "x0" && pkg_failed=yes
|
||||||
else
|
else
|
||||||
pkg_failed=yes
|
pkg_failed=yes
|
||||||
@@ -5335,14 +5337,14 @@ else
|
|||||||
_pkg_short_errors_supported=no
|
_pkg_short_errors_supported=no
|
||||||
fi
|
fi
|
||||||
if test $_pkg_short_errors_supported = yes; then
|
if test $_pkg_short_errors_supported = yes; then
|
||||||
libtorrent_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libtorrent-rasterbar >= 1.2" 2>&1`
|
libtorrent_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libtorrent-rasterbar >= 1.2.11" 2>&1`
|
||||||
else
|
else
|
||||||
libtorrent_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libtorrent-rasterbar >= 1.2" 2>&1`
|
libtorrent_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libtorrent-rasterbar >= 1.2.11" 2>&1`
|
||||||
fi
|
fi
|
||||||
# Put the nasty error message in config.log where it belongs
|
# Put the nasty error message in config.log where it belongs
|
||||||
echo "$libtorrent_PKG_ERRORS" >&5
|
echo "$libtorrent_PKG_ERRORS" >&5
|
||||||
|
|
||||||
as_fn_error $? "Package requirements (libtorrent-rasterbar >= 1.2) were not met:
|
as_fn_error $? "Package requirements (libtorrent-rasterbar >= 1.2.11) were not met:
|
||||||
|
|
||||||
$libtorrent_PKG_ERRORS
|
$libtorrent_PKG_ERRORS
|
||||||
|
|
||||||
@@ -5385,12 +5387,12 @@ if test -n "$openssl_CFLAGS"; then
|
|||||||
pkg_cv_openssl_CFLAGS="$openssl_CFLAGS"
|
pkg_cv_openssl_CFLAGS="$openssl_CFLAGS"
|
||||||
elif test -n "$PKG_CONFIG"; then
|
elif test -n "$PKG_CONFIG"; then
|
||||||
if test -n "$PKG_CONFIG" && \
|
if test -n "$PKG_CONFIG" && \
|
||||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.0\""; } >&5
|
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.1.1\""; } >&5
|
||||||
($PKG_CONFIG --exists --print-errors "openssl >= 1.0") 2>&5
|
($PKG_CONFIG --exists --print-errors "openssl >= 1.1.1") 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||||
test $ac_status = 0; }; then
|
test $ac_status = 0; }; then
|
||||||
pkg_cv_openssl_CFLAGS=`$PKG_CONFIG --cflags "openssl >= 1.0" 2>/dev/null`
|
pkg_cv_openssl_CFLAGS=`$PKG_CONFIG --cflags "openssl >= 1.1.1" 2>/dev/null`
|
||||||
test "x$?" != "x0" && pkg_failed=yes
|
test "x$?" != "x0" && pkg_failed=yes
|
||||||
else
|
else
|
||||||
pkg_failed=yes
|
pkg_failed=yes
|
||||||
@@ -5402,12 +5404,12 @@ if test -n "$openssl_LIBS"; then
|
|||||||
pkg_cv_openssl_LIBS="$openssl_LIBS"
|
pkg_cv_openssl_LIBS="$openssl_LIBS"
|
||||||
elif test -n "$PKG_CONFIG"; then
|
elif test -n "$PKG_CONFIG"; then
|
||||||
if test -n "$PKG_CONFIG" && \
|
if test -n "$PKG_CONFIG" && \
|
||||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.0\""; } >&5
|
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.1.1\""; } >&5
|
||||||
($PKG_CONFIG --exists --print-errors "openssl >= 1.0") 2>&5
|
($PKG_CONFIG --exists --print-errors "openssl >= 1.1.1") 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||||
test $ac_status = 0; }; then
|
test $ac_status = 0; }; then
|
||||||
pkg_cv_openssl_LIBS=`$PKG_CONFIG --libs "openssl >= 1.0" 2>/dev/null`
|
pkg_cv_openssl_LIBS=`$PKG_CONFIG --libs "openssl >= 1.1.1" 2>/dev/null`
|
||||||
test "x$?" != "x0" && pkg_failed=yes
|
test "x$?" != "x0" && pkg_failed=yes
|
||||||
else
|
else
|
||||||
pkg_failed=yes
|
pkg_failed=yes
|
||||||
@@ -5428,14 +5430,14 @@ else
|
|||||||
_pkg_short_errors_supported=no
|
_pkg_short_errors_supported=no
|
||||||
fi
|
fi
|
||||||
if test $_pkg_short_errors_supported = yes; then
|
if test $_pkg_short_errors_supported = yes; then
|
||||||
openssl_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl >= 1.0" 2>&1`
|
openssl_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl >= 1.1.1" 2>&1`
|
||||||
else
|
else
|
||||||
openssl_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl >= 1.0" 2>&1`
|
openssl_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl >= 1.1.1" 2>&1`
|
||||||
fi
|
fi
|
||||||
# Put the nasty error message in config.log where it belongs
|
# Put the nasty error message in config.log where it belongs
|
||||||
echo "$openssl_PKG_ERRORS" >&5
|
echo "$openssl_PKG_ERRORS" >&5
|
||||||
|
|
||||||
as_fn_error $? "Package requirements (openssl >= 1.0) were not met:
|
as_fn_error $? "Package requirements (openssl >= 1.1.1) were not met:
|
||||||
|
|
||||||
$openssl_PKG_ERRORS
|
$openssl_PKG_ERRORS
|
||||||
|
|
||||||
@@ -5478,12 +5480,12 @@ if test -n "$zlib_CFLAGS"; then
|
|||||||
pkg_cv_zlib_CFLAGS="$zlib_CFLAGS"
|
pkg_cv_zlib_CFLAGS="$zlib_CFLAGS"
|
||||||
elif test -n "$PKG_CONFIG"; then
|
elif test -n "$PKG_CONFIG"; then
|
||||||
if test -n "$PKG_CONFIG" && \
|
if test -n "$PKG_CONFIG" && \
|
||||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib >= 1.2.5.2\""; } >&5
|
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib >= 1.2.11\""; } >&5
|
||||||
($PKG_CONFIG --exists --print-errors "zlib >= 1.2.5.2") 2>&5
|
($PKG_CONFIG --exists --print-errors "zlib >= 1.2.11") 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||||
test $ac_status = 0; }; then
|
test $ac_status = 0; }; then
|
||||||
pkg_cv_zlib_CFLAGS=`$PKG_CONFIG --cflags "zlib >= 1.2.5.2" 2>/dev/null`
|
pkg_cv_zlib_CFLAGS=`$PKG_CONFIG --cflags "zlib >= 1.2.11" 2>/dev/null`
|
||||||
test "x$?" != "x0" && pkg_failed=yes
|
test "x$?" != "x0" && pkg_failed=yes
|
||||||
else
|
else
|
||||||
pkg_failed=yes
|
pkg_failed=yes
|
||||||
@@ -5495,12 +5497,12 @@ if test -n "$zlib_LIBS"; then
|
|||||||
pkg_cv_zlib_LIBS="$zlib_LIBS"
|
pkg_cv_zlib_LIBS="$zlib_LIBS"
|
||||||
elif test -n "$PKG_CONFIG"; then
|
elif test -n "$PKG_CONFIG"; then
|
||||||
if test -n "$PKG_CONFIG" && \
|
if test -n "$PKG_CONFIG" && \
|
||||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib >= 1.2.5.2\""; } >&5
|
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib >= 1.2.11\""; } >&5
|
||||||
($PKG_CONFIG --exists --print-errors "zlib >= 1.2.5.2") 2>&5
|
($PKG_CONFIG --exists --print-errors "zlib >= 1.2.11") 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||||
test $ac_status = 0; }; then
|
test $ac_status = 0; }; then
|
||||||
pkg_cv_zlib_LIBS=`$PKG_CONFIG --libs "zlib >= 1.2.5.2" 2>/dev/null`
|
pkg_cv_zlib_LIBS=`$PKG_CONFIG --libs "zlib >= 1.2.11" 2>/dev/null`
|
||||||
test "x$?" != "x0" && pkg_failed=yes
|
test "x$?" != "x0" && pkg_failed=yes
|
||||||
else
|
else
|
||||||
pkg_failed=yes
|
pkg_failed=yes
|
||||||
@@ -5521,14 +5523,14 @@ else
|
|||||||
_pkg_short_errors_supported=no
|
_pkg_short_errors_supported=no
|
||||||
fi
|
fi
|
||||||
if test $_pkg_short_errors_supported = yes; then
|
if test $_pkg_short_errors_supported = yes; then
|
||||||
zlib_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "zlib >= 1.2.5.2" 2>&1`
|
zlib_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "zlib >= 1.2.11" 2>&1`
|
||||||
else
|
else
|
||||||
zlib_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "zlib >= 1.2.5.2" 2>&1`
|
zlib_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "zlib >= 1.2.11" 2>&1`
|
||||||
fi
|
fi
|
||||||
# Put the nasty error message in config.log where it belongs
|
# Put the nasty error message in config.log where it belongs
|
||||||
echo "$zlib_PKG_ERRORS" >&5
|
echo "$zlib_PKG_ERRORS" >&5
|
||||||
|
|
||||||
as_fn_error $? "Package requirements (zlib >= 1.2.5.2) were not met:
|
as_fn_error $? "Package requirements (zlib >= 1.2.11) were not met:
|
||||||
|
|
||||||
$zlib_PKG_ERRORS
|
$zlib_PKG_ERRORS
|
||||||
|
|
||||||
@@ -6343,7 +6345,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by qbittorrent $as_me v4.3.1, which was
|
This file was extended by qbittorrent $as_me v4.3.2, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
@@ -6401,7 +6403,7 @@ _ACEOF
|
|||||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
qbittorrent config.status v4.3.1
|
qbittorrent config.status v4.3.2
|
||||||
configured by $0, generated by GNU Autoconf 2.69,
|
configured by $0, generated by GNU Autoconf 2.69,
|
||||||
with options \\"\$ac_cs_config\\"
|
with options \\"\$ac_cs_config\\"
|
||||||
|
|
||||||
@@ -7659,7 +7661,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by qbittorrent $as_me v4.3.1, which was
|
This file was extended by qbittorrent $as_me v4.3.2, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
@@ -7717,7 +7719,7 @@ _ACEOF
|
|||||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
qbittorrent config.status v4.3.1
|
qbittorrent config.status v4.3.2
|
||||||
configured by $0, generated by GNU Autoconf 2.69,
|
configured by $0, generated by GNU Autoconf 2.69,
|
||||||
with options \\"\$ac_cs_config\\"
|
with options \\"\$ac_cs_config\\"
|
||||||
|
|
||||||
|
|||||||
12
configure.ac
12
configure.ac
@@ -1,6 +1,8 @@
|
|||||||
AC_INIT([qbittorrent], [v4.3.1], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
|
AC_INIT([qbittorrent], [v4.3.2], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
: ${CFLAGS=""}
|
||||||
|
: ${CXXFLAGS=""}
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
AC_PROG_SED
|
AC_PROG_SED
|
||||||
@@ -157,7 +159,7 @@ AS_CASE(["x$enable_qt_dbus"],
|
|||||||
AC_MSG_ERROR([Unknown option "$enable_qt_dbus". Use either "yes" or "no".])])
|
AC_MSG_ERROR([Unknown option "$enable_qt_dbus". Use either "yes" or "no".])])
|
||||||
|
|
||||||
|
|
||||||
AX_BOOST_BASE([1.40],
|
AX_BOOST_BASE([1.65],
|
||||||
[AC_MSG_NOTICE([Boost CXXFLAGS: "$BOOST_CPPFLAGS"])
|
[AC_MSG_NOTICE([Boost CXXFLAGS: "$BOOST_CPPFLAGS"])
|
||||||
AC_MSG_NOTICE([Boost LDFLAGS: "$BOOST_LDFLAGS"])],
|
AC_MSG_NOTICE([Boost LDFLAGS: "$BOOST_LDFLAGS"])],
|
||||||
[AC_MSG_ERROR([Could not find Boost])])
|
[AC_MSG_ERROR([Could not find Boost])])
|
||||||
@@ -178,17 +180,17 @@ AC_MSG_NOTICE([Boost.System LIB: "$BOOST_SYSTEM_LIB"])
|
|||||||
LIBS="$BOOST_SYSTEM_LIB $LIBS"
|
LIBS="$BOOST_SYSTEM_LIB $LIBS"
|
||||||
|
|
||||||
PKG_CHECK_MODULES(libtorrent,
|
PKG_CHECK_MODULES(libtorrent,
|
||||||
[libtorrent-rasterbar >= 1.2],
|
[libtorrent-rasterbar >= 1.2.11],
|
||||||
[CXXFLAGS="$libtorrent_CFLAGS $CXXFLAGS"
|
[CXXFLAGS="$libtorrent_CFLAGS $CXXFLAGS"
|
||||||
LIBS="$libtorrent_LIBS $LIBS"])
|
LIBS="$libtorrent_LIBS $LIBS"])
|
||||||
|
|
||||||
PKG_CHECK_MODULES(openssl,
|
PKG_CHECK_MODULES(openssl,
|
||||||
[openssl >= 1.0],
|
[openssl >= 1.1.1],
|
||||||
[CXXFLAGS="$openssl_CFLAGS $CXXFLAGS"
|
[CXXFLAGS="$openssl_CFLAGS $CXXFLAGS"
|
||||||
LIBS="$openssl_LIBS $LIBS"])
|
LIBS="$openssl_LIBS $LIBS"])
|
||||||
|
|
||||||
PKG_CHECK_MODULES(zlib,
|
PKG_CHECK_MODULES(zlib,
|
||||||
[zlib >= 1.2.5.2],
|
[zlib >= 1.2.11],
|
||||||
[CXXFLAGS="$zlib_CFLAGS $CXXFLAGS"
|
[CXXFLAGS="$zlib_CFLAGS $CXXFLAGS"
|
||||||
LIBS="$zlib_LIBS $LIBS"])
|
LIBS="$zlib_LIBS $LIBS"])
|
||||||
|
|
||||||
|
|||||||
2
dist/mac/Info.plist
vendored
2
dist/mac/Info.plist
vendored
@@ -55,7 +55,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>4.3.0</string>
|
<string>4.3.2</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>@EXECUTABLE@</string>
|
<string>@EXECUTABLE@</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
|
|||||||
@@ -74,6 +74,6 @@
|
|||||||
<url type="translate">https://github.com/qbittorrent/qBittorrent/wiki/How-to-translate-qBittorrent</url>
|
<url type="translate">https://github.com/qbittorrent/qBittorrent/wiki/How-to-translate-qBittorrent</url>
|
||||||
<content_rating type="oars-1.1"/>
|
<content_rating type="oars-1.1"/>
|
||||||
<releases>
|
<releases>
|
||||||
<release version="4.3.1" date="2020-11-25"/>
|
<release version="4.3.2" date="2020-12-27"/>
|
||||||
</releases>
|
</releases>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
17
dist/unix/org.qbittorrent.qBittorrent.desktop
vendored
17
dist/unix/org.qbittorrent.qBittorrent.desktop
vendored
@@ -11,6 +11,8 @@ Type=Application
|
|||||||
StartupNotify=false
|
StartupNotify=false
|
||||||
StartupWMClass=qbittorrent
|
StartupWMClass=qbittorrent
|
||||||
Keywords=bittorrent;torrent;magnet;download;p2p;
|
Keywords=bittorrent;torrent;magnet;download;p2p;
|
||||||
|
|
||||||
|
# Translations
|
||||||
Comment[oc]=Telecargar e partejar de fichièrs amb BitTorrent
|
Comment[oc]=Telecargar e partejar de fichièrs amb BitTorrent
|
||||||
GenericName[oc]=Client BitTorrent
|
GenericName[oc]=Client BitTorrent
|
||||||
Name[oc]=qBittorrent
|
Name[oc]=qBittorrent
|
||||||
@@ -53,6 +55,9 @@ Name[en_GB]=qBittorrent
|
|||||||
Comment[es]=Descargue y comparta archivos por BitTorrent
|
Comment[es]=Descargue y comparta archivos por BitTorrent
|
||||||
GenericName[es]=Cliente BitTorrent
|
GenericName[es]=Cliente BitTorrent
|
||||||
Name[es]=qBittorrent
|
Name[es]=qBittorrent
|
||||||
|
Comment[et]=Lae alla ja jaga faile üle BitTorrenti
|
||||||
|
GenericName[et]=BitTorrent klient
|
||||||
|
Name[et]=qBittorrent
|
||||||
Comment[eu]=Jeitsi eta elkarbanatu agiriak BitTorrent bidez
|
Comment[eu]=Jeitsi eta elkarbanatu agiriak BitTorrent bidez
|
||||||
GenericName[eu]=BitTorrent bezeroa
|
GenericName[eu]=BitTorrent bezeroa
|
||||||
Name[eu]=qBittorrent
|
Name[eu]=qBittorrent
|
||||||
@@ -86,7 +91,7 @@ Name[id]=qBittorrent
|
|||||||
Comment[is]=Sækja og deila skrám yfir BitTorrent
|
Comment[is]=Sækja og deila skrám yfir BitTorrent
|
||||||
GenericName[is]=BitTorrent biðlarar
|
GenericName[is]=BitTorrent biðlarar
|
||||||
Name[is]=qBittorrent
|
Name[is]=qBittorrent
|
||||||
Comment[it]=Client BitTorrent per il download di file via internet
|
Comment[it]=Scarica e condividi file tramite BitTorrent
|
||||||
GenericName[it]=Client BitTorrent
|
GenericName[it]=Client BitTorrent
|
||||||
Name[it]=qBittorrent
|
Name[it]=qBittorrent
|
||||||
Comment[ja]=BitTorrent でファイルをダウンロードおよび共有します
|
Comment[ja]=BitTorrent でファイルをダウンロードおよび共有します
|
||||||
@@ -137,6 +142,7 @@ Name[sk]=qBittorrent
|
|||||||
Comment[sl]=Prenesite in delite datoteke preko BitTorrenta
|
Comment[sl]=Prenesite in delite datoteke preko BitTorrenta
|
||||||
GenericName[sl]=BitTorrent odjemalec
|
GenericName[sl]=BitTorrent odjemalec
|
||||||
Name[sl]=qBittorrent
|
Name[sl]=qBittorrent
|
||||||
|
Comment[sr]=Преузимајте и делите фајлове преко BitTorrent протокола
|
||||||
GenericName[sr]=BitTorrent-клијент
|
GenericName[sr]=BitTorrent-клијент
|
||||||
Comment[sr@latin]=Preuzimanje i deljenje fajlova preko BitTorrent-a
|
Comment[sr@latin]=Preuzimanje i deljenje fajlova preko BitTorrent-a
|
||||||
GenericName[sr@latin]=BitTorrent klijent
|
GenericName[sr@latin]=BitTorrent klijent
|
||||||
@@ -150,8 +156,8 @@ Name[uz@Latn]=qBittorrent
|
|||||||
Comment[ltg]=Atsasyuteit i daleit failus ar BitTorrent
|
Comment[ltg]=Atsasyuteit i daleit failus ar BitTorrent
|
||||||
GenericName[ltg]=BitTorrent klients
|
GenericName[ltg]=BitTorrent klients
|
||||||
Name[ltg]=qBittorrent
|
Name[ltg]=qBittorrent
|
||||||
Comment[hi_IN]= अपनी फाइलें BitTorrent के माध्यम से डाउनलोड आैर साॅझा करें
|
Comment[hi_IN]=BitTorrent द्वारा फाइल डाउनलोड व सहभाजन
|
||||||
GenericName[hi_IN]=BitTorrent उपभोक्ता
|
GenericName[hi_IN]=BitTorrent साधन
|
||||||
Name[hi_IN]=qBittorrent
|
Name[hi_IN]=qBittorrent
|
||||||
Comment[tr]=Dosyaları BitTorrent üzerinden indirin ve paylaşın
|
Comment[tr]=Dosyaları BitTorrent üzerinden indirin ve paylaşın
|
||||||
GenericName[tr]=BitTorrent istemcisi
|
GenericName[tr]=BitTorrent istemcisi
|
||||||
@@ -165,6 +171,9 @@ Name[uk]=qBittorrent
|
|||||||
Comment[vi]=Tải về và chia sẻ các tập tin thông qua BitTorrent
|
Comment[vi]=Tải về và chia sẻ các tập tin thông qua BitTorrent
|
||||||
GenericName[vi]=Máy trạm dạng BitTorrent
|
GenericName[vi]=Máy trạm dạng BitTorrent
|
||||||
Name[vi]=qBittorrent
|
Name[vi]=qBittorrent
|
||||||
|
Comment[az@latin]=Faylları BitTorrent vasitəsilə göndərin və paylaşın
|
||||||
|
GenericName[az@latin]=BitTorrent client
|
||||||
|
Name[az@latin]=qBittorrent
|
||||||
Comment[zh_HK]=經由BitTorrent下載並分享檔案
|
Comment[zh_HK]=經由BitTorrent下載並分享檔案
|
||||||
GenericName[zh_HK]=BitTorrent用戶端
|
GenericName[zh_HK]=BitTorrent用戶端
|
||||||
Name[zh_HK]=qBittorrent
|
Name[zh_HK]=qBittorrent
|
||||||
@@ -195,6 +204,6 @@ Name[te]=క్యు బిట్ టొరెంట్
|
|||||||
Comment[en_AU]=Download and share files over BitTorrent
|
Comment[en_AU]=Download and share files over BitTorrent
|
||||||
GenericName[en_AU]=BitTorrent client
|
GenericName[en_AU]=BitTorrent client
|
||||||
Name[en_AU]=qBittorrent
|
Name[en_AU]=qBittorrent
|
||||||
Comment[th]=ดาว์นโหลดและแชร์ไฟล์ด้วยบิททอเร้น
|
Comment[th]=ดาวน์โหลดและแชร์ไฟล์ด้วยบิททอเร้น
|
||||||
GenericName[th]=โปรแกรมบิททอเร้น
|
GenericName[th]=โปรแกรมบิททอเร้น
|
||||||
Name[th]=qBittorrent
|
Name[th]=qBittorrent
|
||||||
|
|||||||
20
dist/windows/installer-translations/italian.nsi
vendored
20
dist/windows/installer-translations/italian.nsi
vendored
@@ -3,9 +3,9 @@
|
|||||||
;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)"
|
;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)"
|
||||||
LangString inst_qbt_req ${LANG_ITALIAN} "qBittorrent (necessario)"
|
LangString inst_qbt_req ${LANG_ITALIAN} "qBittorrent (necessario)"
|
||||||
;LangString inst_dekstop ${LANG_ENGLISH} "Create Desktop Shortcut"
|
;LangString inst_dekstop ${LANG_ENGLISH} "Create Desktop Shortcut"
|
||||||
LangString inst_dekstop ${LANG_ITALIAN} "Crea icone sul desktop"
|
LangString inst_dekstop ${LANG_ITALIAN} "Crea collegamento sul Desktop"
|
||||||
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
|
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
|
||||||
LangString inst_startmenu ${LANG_ITALIAN} "Crea gruppo programmi"
|
LangString inst_startmenu ${LANG_ITALIAN} "Aggiungi al menu Start"
|
||||||
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
|
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
|
||||||
LangString inst_startup ${LANG_ITALIAN} "Esegui qBittorrent all'avvio di Windows"
|
LangString inst_startup ${LANG_ITALIAN} "Esegui qBittorrent all'avvio di Windows"
|
||||||
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
|
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
|
||||||
@@ -15,19 +15,19 @@ LangString inst_magnet ${LANG_ITALIAN} "Apri collegamenti magnet con qBittorrent
|
|||||||
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
|
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
|
||||||
LangString inst_firewall ${LANG_ITALIAN} "Aggiungi regola al firewall di Windows"
|
LangString inst_firewall ${LANG_ITALIAN} "Aggiungi regola al firewall di 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_ENGLISH} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)"
|
||||||
LangString inst_pathlimit ${LANG_ITALIAN} "Disabilita limite percorso Windows (limite MAX_PATH max 260 caratterin, richiede Windows 10 versione 1607 o successive)"
|
LangString inst_pathlimit ${LANG_ITALIAN} "Disabilita limite lunghezza percorsi Windows (limite MAX_PATH di 260 caratteri, richiede Windows 10 versione 1607 o successive)"
|
||||||
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
|
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
|
||||||
LangString inst_firewallinfo ${LANG_ITALIAN} "Aggiunta regola al firewall di Windows"
|
LangString inst_firewallinfo ${LANG_ITALIAN} "Aggiunta regola al firewall di Windows"
|
||||||
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
|
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
|
||||||
LangString inst_warning ${LANG_ITALIAN} "qBittorrent è in esecuzione.%n%nChiudi l'applicazione qBittorrent prima della nuova installazione."
|
LangString inst_warning ${LANG_ITALIAN} "qBittorrent è in esecuzione. Chiudilo prima di procedere con l'installazione."
|
||||||
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
|
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
|
||||||
LangString inst_uninstall_question ${LANG_ITALIAN} "L'attuale versione di qBittorrent verrà disinstallata.%n%nLe impostazioni utente e i torrent rimanno invariati."
|
LangString inst_uninstall_question ${LANG_ITALIAN} "La versione attuale verrà disinstallata. Le impostazioni utente e i torrent rimarranno invariati."
|
||||||
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
|
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
|
||||||
LangString inst_unist ${LANG_ITALIAN} "Disinstallazione versione precedente di qBittorrent."
|
LangString inst_unist ${LANG_ITALIAN} "Disinstallazione versione precedente."
|
||||||
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
|
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
|
||||||
LangString launch_qbt ${LANG_ITALIAN} "Esegui qBittorrent"
|
LangString launch_qbt ${LANG_ITALIAN} "Esegui qBittorrent."
|
||||||
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
|
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
|
||||||
LangString inst_requires_64bit ${LANG_ITALIAN} "Questo installer di qBittorrent funziona solo con Windows a 64bit."
|
LangString inst_requires_64bit ${LANG_ITALIAN} "Questo installer funziona solo con versioni di Windows a 64bit."
|
||||||
;LangString inst_requires_win7 ${LANG_ENGLISH} "This qBittorrent version requires at least Windows 7."
|
;LangString inst_requires_win7 ${LANG_ENGLISH} "This qBittorrent version requires at least Windows 7."
|
||||||
LangString inst_requires_win7 ${LANG_ITALIAN} "Questa versione di qBittorrent richiede Windows 7 o versioni successive."
|
LangString inst_requires_win7 ${LANG_ITALIAN} "Questa versione di qBittorrent richiede Windows 7 o versioni successive."
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ LangString remove_shortcuts ${LANG_ITALIAN} "Rimuovi collegamenti"
|
|||||||
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
|
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
|
||||||
LangString remove_associations ${LANG_ITALIAN} "Rimuovi associazione file"
|
LangString remove_associations ${LANG_ITALIAN} "Rimuovi associazione file"
|
||||||
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
|
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
|
||||||
LangString remove_registry ${LANG_ITALIAN} "Rimuovi chiavi registro"
|
LangString remove_registry ${LANG_ITALIAN} "Rimuovi chiavi di registro"
|
||||||
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
|
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
|
||||||
LangString remove_conf ${LANG_ITALIAN} "Rimuovi file di configurazione"
|
LangString remove_conf ${LANG_ITALIAN} "Rimuovi file di configurazione"
|
||||||
;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule"
|
;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule"
|
||||||
@@ -52,7 +52,7 @@ LangString remove_firewallinfo ${LANG_ITALIAN} "Rimozione regola dal firewall di
|
|||||||
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
|
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
|
||||||
LangString remove_cache ${LANG_ITALIAN} "Rimuovi torrent e dati nella cache"
|
LangString remove_cache ${LANG_ITALIAN} "Rimuovi torrent e dati nella cache"
|
||||||
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
|
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
|
||||||
LangString uninst_warning ${LANG_ITALIAN} "qBittorrent è in esecuzione.%n%nChiudi qBittorrent prima della disinstallazione."
|
LangString uninst_warning ${LANG_ITALIAN} "qBittorrent è in esecuzione. Chiudilo prima di procedere con la disinstallazione."
|
||||||
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
|
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
|
||||||
LangString uninst_tor_warn ${LANG_ITALIAN} "Associazione file .torrent non rimossa. File associati con:"
|
LangString uninst_tor_warn ${LANG_ITALIAN} "Associazione file .torrent non rimossa. File associati con:"
|
||||||
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
|
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ LangString inst_firewallinfo ${LANG_RUSSIAN} "Добавление в списо
|
|||||||
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
|
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
|
||||||
LangString inst_warning ${LANG_RUSSIAN} "qBittorrent запущен. Пожалуйста, закройте qBittorrent и перезапустите программу установки."
|
LangString inst_warning ${LANG_RUSSIAN} "qBittorrent запущен. Пожалуйста, закройте qBittorrent и перезапустите программу установки."
|
||||||
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
|
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
|
||||||
LangString inst_uninstall_question ${LANG_RUSSIAN} "Обнаружена предыдущая установка. Она будет деинсталлирована без удаления пользовательских настроек."
|
LangString inst_uninstall_question ${LANG_RUSSIAN} "Текущая версия будет деинсталлирована. Пользовательские настройки и торренты останутся нетронутыми."
|
||||||
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
|
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
|
||||||
LangString inst_unist ${LANG_RUSSIAN} "Деинсталлируется старая версия."
|
LangString inst_unist ${LANG_RUSSIAN} "Деинсталлируется старая версия."
|
||||||
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
|
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
|
||||||
|
|||||||
2
dist/windows/options.nsi
vendored
2
dist/windows/options.nsi
vendored
@@ -28,7 +28,7 @@ XPStyle on
|
|||||||
!define CSIDL_LOCALAPPDATA '0x1C' ;Local Application Data path
|
!define CSIDL_LOCALAPPDATA '0x1C' ;Local Application Data path
|
||||||
|
|
||||||
; Program specific
|
; Program specific
|
||||||
!define PROG_VERSION "4.3.1"
|
!define PROG_VERSION "4.3.2"
|
||||||
|
|
||||||
!define MUI_FINISHPAGE_RUN
|
!define MUI_FINISHPAGE_RUN
|
||||||
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun
|
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
# Sets the QT_QMAKE variable to the path of Qt5 qmake if found.
|
# Sets the QT_QMAKE variable to the path of Qt5 qmake if found.
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
AC_DEFUN([FIND_QT5],
|
AC_DEFUN([FIND_QT5],
|
||||||
[PKG_CHECK_EXISTS([Qt5Core >= 5.9.0],
|
[PKG_CHECK_EXISTS([Qt5Core >= 5.9.5],
|
||||||
[PKG_CHECK_VAR(QT_QMAKE,
|
[PKG_CHECK_VAR(QT_QMAKE,
|
||||||
[Qt5Core >= 5.9.0],
|
[Qt5Core >= 5.9.5],
|
||||||
[host_bins])
|
[host_bins])
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ AS_IF([test -f "$QT_QMAKE/qmake"],
|
|||||||
[QT_QMAKE=""])
|
[QT_QMAKE=""])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_MSG_CHECKING([for Qt5 qmake >= 5.9.0])
|
AC_MSG_CHECKING([for Qt5 qmake >= 5.9.5])
|
||||||
AS_IF([test "x$QT_QMAKE" != "x"],
|
AS_IF([test "x$QT_QMAKE" != "x"],
|
||||||
[AC_MSG_RESULT([$QT_QMAKE])],
|
[AC_MSG_RESULT([$QT_QMAKE])],
|
||||||
[AC_MSG_RESULT([not found])]
|
[AC_MSG_RESULT([not found])]
|
||||||
@@ -29,8 +29,8 @@ AS_IF([test "x$QT_QMAKE" != "x"],
|
|||||||
# Sets the HAVE_QTDBUS variable to true or false.
|
# Sets the HAVE_QTDBUS variable to true or false.
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
AC_DEFUN([FIND_QTDBUS],
|
AC_DEFUN([FIND_QTDBUS],
|
||||||
[AC_MSG_CHECKING([for Qt5DBus >= 5.9.0])
|
[AC_MSG_CHECKING([for Qt5DBus >= 5.9.5])
|
||||||
PKG_CHECK_EXISTS([Qt5DBus >= 5.9.0],
|
PKG_CHECK_EXISTS([Qt5DBus >= 5.9.5],
|
||||||
[AC_MSG_RESULT([found])
|
[AC_MSG_RESULT([found])
|
||||||
HAVE_QTDBUS=[true]],
|
HAVE_QTDBUS=[true]],
|
||||||
[AC_MSG_RESULT([not found])
|
[AC_MSG_RESULT([not found])
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
if (UNIX AND (NOT APPLE) AND (NOT CYGWIN))
|
if (UNIX AND (NOT APPLE) AND (NOT CYGWIN))
|
||||||
find_package(LibtorrentRasterbar QUIET ${requiredLibtorrentVersion} COMPONENTS torrent-rasterbar)
|
find_package(LibtorrentRasterbar QUIET ${minLibtorrentVersion} COMPONENTS torrent-rasterbar)
|
||||||
if (NOT LibtorrentRasterbar_FOUND)
|
if (NOT LibtorrentRasterbar_FOUND)
|
||||||
include(FindPkgConfig)
|
include(FindPkgConfig)
|
||||||
pkg_check_modules(LIBTORRENT_RASTERBAR IMPORTED_TARGET GLOBAL "libtorrent-rasterbar>=${requiredLibtorrentVersion}")
|
pkg_check_modules(LIBTORRENT_RASTERBAR IMPORTED_TARGET GLOBAL "libtorrent-rasterbar>=${minLibtorrentVersion}")
|
||||||
if (NOT LIBTORRENT_RASTERBAR_FOUND)
|
if (NOT LIBTORRENT_RASTERBAR_FOUND)
|
||||||
message(
|
message(
|
||||||
FATAL_ERROR
|
FATAL_ERROR
|
||||||
"Package LibtorrentRasterbar >= ${requiredLibtorrentVersion} not found"
|
"Package LibtorrentRasterbar >= ${minLibtorrentVersion} not found"
|
||||||
" with CMake or pkg-config.\n- Set LibtorrentRasterbar_DIR to a directory containing"
|
" with CMake or pkg-config.\n- Set LibtorrentRasterbar_DIR to a directory containing"
|
||||||
" a LibtorrentRasterbarConfig.cmake file or add the installation prefix of LibtorrentRasterbar"
|
" 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"
|
" to CMAKE_PREFIX_PATH.\n- Alternatively, make sure there is a valid libtorrent-rasterbar.pc"
|
||||||
@@ -18,9 +18,9 @@ if (UNIX AND (NOT APPLE) AND (NOT CYGWIN))
|
|||||||
# force a fake package to show up in the feature summary
|
# force a fake package to show up in the feature summary
|
||||||
set_property(GLOBAL APPEND PROPERTY
|
set_property(GLOBAL APPEND PROPERTY
|
||||||
PACKAGES_FOUND
|
PACKAGES_FOUND
|
||||||
"LibtorrentRasterbar via pkg-config (required version >= ${requiredLibtorrentVersion})"
|
"LibtorrentRasterbar via pkg-config (version >= ${minLibtorrentVersion})"
|
||||||
)
|
)
|
||||||
set_package_properties("LibtorrentRasterbar via pkg-config (required version >= ${requiredLibtorrentVersion})"
|
set_package_properties("LibtorrentRasterbar via pkg-config (version >= ${minLibtorrentVersion})"
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
TYPE REQUIRED
|
TYPE REQUIRED
|
||||||
)
|
)
|
||||||
@@ -28,16 +28,16 @@ if (UNIX AND (NOT APPLE) AND (NOT CYGWIN))
|
|||||||
set_package_properties(LibtorrentRasterbar PROPERTIES TYPE REQUIRED)
|
set_package_properties(LibtorrentRasterbar PROPERTIES TYPE REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
find_package(LibtorrentRasterbar ${requiredLibtorrentVersion} REQUIRED COMPONENTS torrent-rasterbar)
|
find_package(LibtorrentRasterbar ${minLibtorrentVersion} REQUIRED COMPONENTS torrent-rasterbar)
|
||||||
endif()
|
endif()
|
||||||
# force variable type so that it always shows up in ccmake/cmake-gui frontends
|
# force variable type so that it always shows up in ccmake/cmake-gui frontends
|
||||||
set_property(CACHE LibtorrentRasterbar_DIR PROPERTY TYPE PATH)
|
set_property(CACHE LibtorrentRasterbar_DIR PROPERTY TYPE PATH)
|
||||||
find_package(Boost ${requiredBoostVersion} REQUIRED)
|
find_package(Boost ${minBoostVersion} REQUIRED)
|
||||||
find_package(OpenSSL ${requiredOpenSSLVersion} REQUIRED)
|
find_package(OpenSSL ${minOpenSSLVersion} REQUIRED)
|
||||||
find_package(ZLIB ${requiredZlibVersion} REQUIRED)
|
find_package(ZLIB ${minZlibVersion} REQUIRED)
|
||||||
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS Core Network Xml LinguistTools)
|
find_package(Qt5 ${minQtVersion} REQUIRED COMPONENTS Core Network Xml LinguistTools)
|
||||||
if (DBUS)
|
if (DBUS)
|
||||||
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS DBus)
|
find_package(Qt5 ${minQtVersion} REQUIRED COMPONENTS DBus)
|
||||||
set_package_properties(Qt5DBus PROPERTIES
|
set_package_properties(Qt5DBus PROPERTIES
|
||||||
DESCRIPTION "Qt5 module for inter-process communication over the D-Bus protocol"
|
DESCRIPTION "Qt5 module for inter-process communication over the D-Bus protocol"
|
||||||
PURPOSE "Required by the DBUS feature"
|
PURPOSE "Required by the DBUS feature"
|
||||||
@@ -60,11 +60,11 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|||||||
add_subdirectory(base)
|
add_subdirectory(base)
|
||||||
|
|
||||||
if (GUI)
|
if (GUI)
|
||||||
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS Widgets Svg)
|
find_package(Qt5 ${minQtVersion} REQUIRED COMPONENTS Widgets Svg)
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS MacExtras)
|
find_package(Qt5 ${minQtVersion} REQUIRED COMPONENTS MacExtras)
|
||||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
find_package(Qt5 ${requiredQtVersion} REQUIRED COMPONENTS WinExtras)
|
find_package(Qt5 ${minQtVersion} REQUIRED COMPONENTS WinExtras)
|
||||||
endif()
|
endif()
|
||||||
add_subdirectory(gui)
|
add_subdirectory(gui)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -28,8 +28,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef APP_OPTIONS_H
|
#pragma once
|
||||||
#define APP_OPTIONS_H
|
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
@@ -81,5 +80,3 @@ private:
|
|||||||
|
|
||||||
QBtCommandLineParameters parseCommandLine(const QStringList &args);
|
QBtCommandLineParameters parseCommandLine(const QStringList &args);
|
||||||
void displayUsage(const QString &prgName);
|
void displayUsage(const QString &prgName);
|
||||||
|
|
||||||
#endif // APP_OPTIONS_H
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
#include "base/global.h"
|
#include "base/global.h"
|
||||||
#include "base/logger.h"
|
#include "base/logger.h"
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FILELOGGER_H
|
#pragma once
|
||||||
#define FILELOGGER_H
|
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@@ -73,5 +72,3 @@ private:
|
|||||||
QFile m_logFile;
|
QFile m_logFile;
|
||||||
QTimer m_flusher;
|
QTimer m_flusher;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FILELOGGER_H
|
|
||||||
|
|||||||
@@ -66,8 +66,7 @@
|
|||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QTLOCALPEER_H
|
#pragma once
|
||||||
#define QTLOCALPEER_H
|
|
||||||
|
|
||||||
#include "qtlockedfile.h"
|
#include "qtlockedfile.h"
|
||||||
|
|
||||||
@@ -99,5 +98,3 @@ protected:
|
|||||||
private:
|
private:
|
||||||
static const char* ack;
|
static const char* ack;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QTLOCALPEER_H
|
|
||||||
|
|||||||
@@ -66,8 +66,7 @@
|
|||||||
****************************************************************************
|
****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QTLOCKEDFILE_H
|
#pragma once
|
||||||
#define QTLOCKEDFILE_H
|
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
@@ -112,5 +111,3 @@ namespace QtLP_Private
|
|||||||
LockMode m_lock_mode;
|
LockMode m_lock_mode;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -18,8 +18,7 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef STACKTRACE_WIN_H
|
#pragma once
|
||||||
#define STACKTRACE_WIN_H
|
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <dbghelp.h>
|
#include <dbghelp.h>
|
||||||
@@ -355,5 +354,3 @@ const QString straceWin::getBacktrace()
|
|||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#pragma optimize("g", on)
|
#pragma optimize("g", on)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // STACKTRACE_WIN_H
|
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STACKTRACEDIALOG_H
|
#pragma once
|
||||||
#define STACKTRACEDIALOG_H
|
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
@@ -51,5 +50,3 @@ public:
|
|||||||
private:
|
private:
|
||||||
Ui::StacktraceDialog *m_ui;
|
Ui::StacktraceDialog *m_ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // STACKTRACEDIALOG_H
|
|
||||||
|
|||||||
@@ -29,11 +29,15 @@
|
|||||||
#include "upgrade.h"
|
#include "upgrade.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QMetaEnum>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
|
#include "base/bittorrent/torrentcontentlayout.h"
|
||||||
#include "base/logger.h"
|
#include "base/logger.h"
|
||||||
#include "base/profile.h"
|
#include "base/profile.h"
|
||||||
#include "base/settingsstorage.h"
|
#include "base/settingsstorage.h"
|
||||||
#include "base/utils/fs.h"
|
#include "base/utils/fs.h"
|
||||||
|
#include "base/utils/string.h"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@@ -78,11 +82,32 @@ namespace
|
|||||||
, QLatin1String("Preferences/WebUI/HTTPS/KeyPath")
|
, QLatin1String("Preferences/WebUI/HTTPS/KeyPath")
|
||||||
, Utils::Fs::toNativePath(configPath + QLatin1String("WebUIPrivateKey.pem")));
|
, Utils::Fs::toNativePath(configPath + QLatin1String("WebUIPrivateKey.pem")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void upgradeTorrentContentLayout()
|
||||||
|
{
|
||||||
|
const QString oldKey {QLatin1String {"BitTorrent/Session/CreateTorrentSubfolder"}};
|
||||||
|
const QString newKey {QLatin1String {"BitTorrent/Session/TorrentContentLayout"}};
|
||||||
|
|
||||||
|
SettingsStorage *settingsStorage {SettingsStorage::instance()};
|
||||||
|
const QVariant oldData {settingsStorage->loadValue(oldKey)};
|
||||||
|
const QString newData {settingsStorage->loadValue(newKey).toString()};
|
||||||
|
|
||||||
|
if (!newData.isEmpty() || !oldData.isValid())
|
||||||
|
return;
|
||||||
|
|
||||||
|
const bool createSubfolder = oldData.toBool();
|
||||||
|
const BitTorrent::TorrentContentLayout torrentContentLayout =
|
||||||
|
(createSubfolder ? BitTorrent::TorrentContentLayout::Original : BitTorrent::TorrentContentLayout::NoSubfolder);
|
||||||
|
|
||||||
|
settingsStorage->storeValue(newKey, Utils::String::fromEnum(torrentContentLayout));
|
||||||
|
settingsStorage->removeValue(oldKey);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool upgrade(const bool /*ask*/)
|
bool upgrade(const bool /*ask*/)
|
||||||
{
|
{
|
||||||
exportWebUIHttpsFiles();
|
exportWebUIHttpsFiles();
|
||||||
|
upgradeTorrentContentLayout();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ add_library(qbt_base STATIC
|
|||||||
bittorrent/common.h
|
bittorrent/common.h
|
||||||
bittorrent/customstorage.h
|
bittorrent/customstorage.h
|
||||||
bittorrent/downloadpriority.h
|
bittorrent/downloadpriority.h
|
||||||
|
bittorrent/filesearcher.h
|
||||||
bittorrent/filterparserthread.h
|
bittorrent/filterparserthread.h
|
||||||
bittorrent/infohash.h
|
bittorrent/infohash.h
|
||||||
bittorrent/ltqhash.h
|
bittorrent/ltqhash.h
|
||||||
@@ -23,6 +24,7 @@ add_library(qbt_base STATIC
|
|||||||
bittorrent/sessionstatus.h
|
bittorrent/sessionstatus.h
|
||||||
bittorrent/speedmonitor.h
|
bittorrent/speedmonitor.h
|
||||||
bittorrent/statistics.h
|
bittorrent/statistics.h
|
||||||
|
bittorrent/torrentcontentlayout.h
|
||||||
bittorrent/torrentcreatorthread.h
|
bittorrent/torrentcreatorthread.h
|
||||||
bittorrent/torrenthandle.h
|
bittorrent/torrenthandle.h
|
||||||
bittorrent/torrenthandleimpl.h
|
bittorrent/torrenthandleimpl.h
|
||||||
@@ -90,6 +92,7 @@ add_library(qbt_base STATIC
|
|||||||
bittorrent/bandwidthscheduler.cpp
|
bittorrent/bandwidthscheduler.cpp
|
||||||
bittorrent/customstorage.cpp
|
bittorrent/customstorage.cpp
|
||||||
bittorrent/downloadpriority.cpp
|
bittorrent/downloadpriority.cpp
|
||||||
|
bittorrent/filesearcher.cpp
|
||||||
bittorrent/filterparserthread.cpp
|
bittorrent/filterparserthread.cpp
|
||||||
bittorrent/infohash.cpp
|
bittorrent/infohash.cpp
|
||||||
bittorrent/magneturi.cpp
|
bittorrent/magneturi.cpp
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ HEADERS += \
|
|||||||
$$PWD/bittorrent/common.h \
|
$$PWD/bittorrent/common.h \
|
||||||
$$PWD/bittorrent/customstorage.h \
|
$$PWD/bittorrent/customstorage.h \
|
||||||
$$PWD/bittorrent/downloadpriority.h \
|
$$PWD/bittorrent/downloadpriority.h \
|
||||||
|
$$PWD/bittorrent/filesearcher.h \
|
||||||
$$PWD/bittorrent/filterparserthread.h \
|
$$PWD/bittorrent/filterparserthread.h \
|
||||||
$$PWD/bittorrent/infohash.h \
|
$$PWD/bittorrent/infohash.h \
|
||||||
$$PWD/bittorrent/ltqhash.h \
|
$$PWD/bittorrent/ltqhash.h \
|
||||||
@@ -22,6 +23,7 @@ HEADERS += \
|
|||||||
$$PWD/bittorrent/sessionstatus.h \
|
$$PWD/bittorrent/sessionstatus.h \
|
||||||
$$PWD/bittorrent/speedmonitor.h \
|
$$PWD/bittorrent/speedmonitor.h \
|
||||||
$$PWD/bittorrent/statistics.h \
|
$$PWD/bittorrent/statistics.h \
|
||||||
|
$$PWD/bittorrent/torrentcontentlayout.h \
|
||||||
$$PWD/bittorrent/torrentcreatorthread.h \
|
$$PWD/bittorrent/torrentcreatorthread.h \
|
||||||
$$PWD/bittorrent/torrenthandle.h \
|
$$PWD/bittorrent/torrenthandle.h \
|
||||||
$$PWD/bittorrent/torrenthandleimpl.h \
|
$$PWD/bittorrent/torrenthandleimpl.h \
|
||||||
@@ -90,6 +92,7 @@ SOURCES += \
|
|||||||
$$PWD/bittorrent/bandwidthscheduler.cpp \
|
$$PWD/bittorrent/bandwidthscheduler.cpp \
|
||||||
$$PWD/bittorrent/customstorage.cpp \
|
$$PWD/bittorrent/customstorage.cpp \
|
||||||
$$PWD/bittorrent/downloadpriority.cpp \
|
$$PWD/bittorrent/downloadpriority.cpp \
|
||||||
|
$$PWD/bittorrent/filesearcher.cpp \
|
||||||
$$PWD/bittorrent/filterparserthread.cpp \
|
$$PWD/bittorrent/filterparserthread.cpp \
|
||||||
$$PWD/bittorrent/infohash.cpp \
|
$$PWD/bittorrent/infohash.cpp \
|
||||||
$$PWD/bittorrent/magneturi.cpp \
|
$$PWD/bittorrent/magneturi.cpp \
|
||||||
|
|||||||
@@ -28,12 +28,15 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
#include "base/tristatebool.h"
|
#include "base/tristatebool.h"
|
||||||
#include "torrenthandle.h"
|
#include "torrenthandle.h"
|
||||||
|
#include "torrentcontentlayout.h"
|
||||||
|
|
||||||
namespace BitTorrent
|
namespace BitTorrent
|
||||||
{
|
{
|
||||||
@@ -52,7 +55,7 @@ namespace BitTorrent
|
|||||||
TriStateBool addPaused;
|
TriStateBool addPaused;
|
||||||
QVector<DownloadPriority> filePriorities; // used if TorrentInfo is set
|
QVector<DownloadPriority> filePriorities; // used if TorrentInfo is set
|
||||||
bool skipChecking = false;
|
bool skipChecking = false;
|
||||||
TriStateBool createSubfolder;
|
boost::optional<BitTorrent::TorrentContentLayout> contentLayout;
|
||||||
TriStateBool useAutoTMM;
|
TriStateBool useAutoTMM;
|
||||||
int uploadLimit = -1;
|
int uploadLimit = -1;
|
||||||
int downloadLimit = -1;
|
int downloadLimit = -1;
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BANDWIDTHSCHEDULER_H
|
#pragma once
|
||||||
#define BANDWIDTHSCHEDULER_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@@ -52,5 +51,3 @@ private:
|
|||||||
QTimer m_timer;
|
QTimer m_timer;
|
||||||
bool m_lastAlternative;
|
bool m_lastAlternative;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BANDWIDTHSCHEDULER_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BITTORRENT_CACHESTATUS_H
|
#pragma once
|
||||||
#define BITTORRENT_CACHESTATUS_H
|
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
@@ -39,8 +38,6 @@ namespace BitTorrent
|
|||||||
quint64 jobQueueLength = 0;
|
quint64 jobQueueLength = 0;
|
||||||
quint64 averageJobTime = 0;
|
quint64 averageJobTime = 0;
|
||||||
quint64 queuedBytes = 0;
|
quint64 queuedBytes = 0;
|
||||||
qreal readRatio = 0.0;
|
qreal readRatio = 0; // TODO: remove when LIBTORRENT_VERSION_NUM >= 20000
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BITTORRENT_CACHESTATUS_H
|
|
||||||
|
|||||||
69
src/base/bittorrent/filesearcher.cpp
Normal file
69
src/base/bittorrent/filesearcher.cpp
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Bittorrent Client using Qt and libtorrent.
|
||||||
|
* Copyright (C) 2020 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "filesearcher.h"
|
||||||
|
|
||||||
|
#include <QDir>
|
||||||
|
|
||||||
|
#include "base/bittorrent/common.h"
|
||||||
|
#include "base/bittorrent/infohash.h"
|
||||||
|
|
||||||
|
void FileSearcher::search(const BitTorrent::InfoHash &id, const QStringList &originalFileNames
|
||||||
|
, const QString &completeSavePath, const QString &incompleteSavePath)
|
||||||
|
{
|
||||||
|
const auto findInDir = [](const QString &dirPath, QStringList &fileNames) -> bool
|
||||||
|
{
|
||||||
|
const QDir dir {dirPath};
|
||||||
|
bool found = false;
|
||||||
|
for (QString &fileName : fileNames)
|
||||||
|
{
|
||||||
|
if (dir.exists(fileName))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
else if (dir.exists(fileName + QB_EXT))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
fileName += QB_EXT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return found;
|
||||||
|
};
|
||||||
|
|
||||||
|
QString savePath = completeSavePath;
|
||||||
|
QStringList adjustedFileNames = originalFileNames;
|
||||||
|
const bool found = findInDir(savePath, adjustedFileNames);
|
||||||
|
if (!found && !incompleteSavePath.isEmpty())
|
||||||
|
{
|
||||||
|
savePath = incompleteSavePath;
|
||||||
|
findInDir(savePath, adjustedFileNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
emit searchFinished(id, savePath, adjustedFileNames);
|
||||||
|
}
|
||||||
52
src/base/bittorrent/filesearcher.h
Normal file
52
src/base/bittorrent/filesearcher.h
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Bittorrent Client using Qt and libtorrent.
|
||||||
|
* Copyright (C) 2020 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 <QObject>
|
||||||
|
|
||||||
|
namespace BitTorrent
|
||||||
|
{
|
||||||
|
class InfoHash;
|
||||||
|
}
|
||||||
|
|
||||||
|
class FileSearcher final : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_DISABLE_COPY(FileSearcher)
|
||||||
|
|
||||||
|
public:
|
||||||
|
FileSearcher() = default;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void search(const BitTorrent::InfoHash &id, const QStringList &originalFileNames
|
||||||
|
, const QString &completeSavePath, const QString &incompleteSavePath);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void searchFinished(const BitTorrent::InfoHash &id, const QString &savePath, const QStringList &fileNames);
|
||||||
|
};
|
||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FILTERPARSERTHREAD_H
|
#pragma once
|
||||||
#define FILTERPARSERTHREAD_H
|
|
||||||
|
|
||||||
#include <libtorrent/ip_filter.hpp>
|
#include <libtorrent/ip_filter.hpp>
|
||||||
|
|
||||||
@@ -64,5 +63,3 @@ private:
|
|||||||
QString m_filePath;
|
QString m_filePath;
|
||||||
lt::ip_filter m_filter;
|
lt::ip_filter m_filter;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BITTORRENT_FILTERPARSERTHREAD_H
|
|
||||||
|
|||||||
@@ -33,10 +33,7 @@
|
|||||||
|
|
||||||
using namespace BitTorrent;
|
using namespace BitTorrent;
|
||||||
|
|
||||||
InfoHash::InfoHash()
|
const int InfoHashTypeId = qRegisterMetaType<InfoHash>();
|
||||||
: m_valid(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
InfoHash::InfoHash(const lt::sha1_hash &nativeHash)
|
InfoHash::InfoHash(const lt::sha1_hash &nativeHash)
|
||||||
: m_valid(true)
|
: m_valid(true)
|
||||||
@@ -87,6 +84,11 @@ bool BitTorrent::operator!=(const InfoHash &left, const InfoHash &right)
|
|||||||
return !(left == right);
|
return !(left == right);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BitTorrent::operator<(const InfoHash &left, const InfoHash &right)
|
||||||
|
{
|
||||||
|
return static_cast<lt::sha1_hash>(left) < static_cast<lt::sha1_hash>(right);
|
||||||
|
}
|
||||||
|
|
||||||
uint BitTorrent::qHash(const InfoHash &key, const uint seed)
|
uint BitTorrent::qHash(const InfoHash &key, const uint seed)
|
||||||
{
|
{
|
||||||
return ::qHash((std::hash<lt::sha1_hash> {})(key), seed);
|
return ::qHash((std::hash<lt::sha1_hash> {})(key), seed);
|
||||||
|
|||||||
@@ -26,11 +26,11 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BITTORRENT_INFOHASH_H
|
#pragma once
|
||||||
#define BITTORRENT_INFOHASH_H
|
|
||||||
|
|
||||||
#include <libtorrent/sha1_hash.hpp>
|
#include <libtorrent/sha1_hash.hpp>
|
||||||
|
|
||||||
|
#include <QMetaType>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
namespace BitTorrent
|
namespace BitTorrent
|
||||||
@@ -38,7 +38,7 @@ namespace BitTorrent
|
|||||||
class InfoHash
|
class InfoHash
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoHash();
|
InfoHash() = default;
|
||||||
InfoHash(const lt::sha1_hash &nativeHash);
|
InfoHash(const lt::sha1_hash &nativeHash);
|
||||||
InfoHash(const QString &hashString);
|
InfoHash(const QString &hashString);
|
||||||
InfoHash(const InfoHash &other) = default;
|
InfoHash(const InfoHash &other) = default;
|
||||||
@@ -54,14 +54,15 @@ namespace BitTorrent
|
|||||||
operator QString() const;
|
operator QString() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_valid;
|
bool m_valid = false;
|
||||||
lt::sha1_hash m_nativeHash;
|
lt::sha1_hash m_nativeHash;
|
||||||
QString m_hashString;
|
QString m_hashString;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator==(const InfoHash &left, const InfoHash &right);
|
bool operator==(const InfoHash &left, const InfoHash &right);
|
||||||
bool operator!=(const InfoHash &left, const InfoHash &right);
|
bool operator!=(const InfoHash &left, const InfoHash &right);
|
||||||
|
bool operator<(const InfoHash &left, const InfoHash &right);
|
||||||
uint qHash(const InfoHash &key, uint seed);
|
uint qHash(const InfoHash &key, uint seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BITTORRENT_INFOHASH_H
|
Q_DECLARE_METATYPE(BitTorrent::InfoHash)
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BITTORRENT_MAGNETURI_H
|
#pragma once
|
||||||
#define BITTORRENT_MAGNETURI_H
|
|
||||||
|
|
||||||
#include <libtorrent/add_torrent_params.hpp>
|
#include <libtorrent/add_torrent_params.hpp>
|
||||||
|
|
||||||
@@ -65,5 +64,3 @@ namespace BitTorrent
|
|||||||
lt::add_torrent_params m_addTorrentParams;
|
lt::add_torrent_params m_addTorrentParams;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BITTORRENT_MAGNETURI_H
|
|
||||||
|
|||||||
@@ -52,3 +52,11 @@ bool NativeTorrentExtension::on_pause()
|
|||||||
// and other extensions to be also invoked.
|
// and other extensions to be also invoked.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NativeTorrentExtension::on_state(const lt::torrent_status::state_t state)
|
||||||
|
{
|
||||||
|
if (m_state == lt::torrent_status::downloading_metadata)
|
||||||
|
m_torrentHandle.set_flags(lt::torrent_flags::stop_when_ready);
|
||||||
|
|
||||||
|
m_state = state;
|
||||||
|
}
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool on_pause() override;
|
bool on_pause() override;
|
||||||
|
void on_state(lt::torrent_status::state_t state) override;
|
||||||
|
|
||||||
lt::torrent_handle m_torrentHandle;
|
lt::torrent_handle m_torrentHandle;
|
||||||
|
lt::torrent_status::state_t m_state = lt::torrent_status::checking_resume_data;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BITTORRENT_PEERINFO_H
|
#pragma once
|
||||||
#define BITTORRENT_PEERINFO_H
|
|
||||||
|
|
||||||
#include <libtorrent/peer_info.hpp>
|
#include <libtorrent/peer_info.hpp>
|
||||||
|
|
||||||
@@ -104,5 +103,3 @@ namespace BitTorrent
|
|||||||
mutable QString m_country;
|
mutable QString m_country;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BITTORRENT_PEERINFO_H
|
|
||||||
|
|||||||
@@ -88,6 +88,7 @@
|
|||||||
#include "bandwidthscheduler.h"
|
#include "bandwidthscheduler.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "customstorage.h"
|
#include "customstorage.h"
|
||||||
|
#include "filesearcher.h"
|
||||||
#include "filterparserthread.h"
|
#include "filterparserthread.h"
|
||||||
#include "ltunderlyingtype.h"
|
#include "ltunderlyingtype.h"
|
||||||
#include "magneturi.h"
|
#include "magneturi.h"
|
||||||
@@ -346,11 +347,7 @@ Session::Session(QObject *parent)
|
|||||||
, m_hashingThreads(BITTORRENT_SESSION_KEY("HashingThreadsCount"), 2)
|
, m_hashingThreads(BITTORRENT_SESSION_KEY("HashingThreadsCount"), 2)
|
||||||
, m_filePoolSize(BITTORRENT_SESSION_KEY("FilePoolSize"), 40)
|
, m_filePoolSize(BITTORRENT_SESSION_KEY("FilePoolSize"), 40)
|
||||||
, m_checkingMemUsage(BITTORRENT_SESSION_KEY("CheckingMemUsageSize"), 32)
|
, m_checkingMemUsage(BITTORRENT_SESSION_KEY("CheckingMemUsageSize"), 32)
|
||||||
#if (LIBTORRENT_VERSION_NUM >= 10206)
|
|
||||||
, m_diskCacheSize(BITTORRENT_SESSION_KEY("DiskCacheSize"), -1)
|
, m_diskCacheSize(BITTORRENT_SESSION_KEY("DiskCacheSize"), -1)
|
||||||
#else
|
|
||||||
, m_diskCacheSize(BITTORRENT_SESSION_KEY("DiskCacheSize"), 64)
|
|
||||||
#endif
|
|
||||||
, m_diskCacheTTL(BITTORRENT_SESSION_KEY("DiskCacheTTL"), 60)
|
, m_diskCacheTTL(BITTORRENT_SESSION_KEY("DiskCacheTTL"), 60)
|
||||||
, m_useOSCache(BITTORRENT_SESSION_KEY("UseOSCache"), true)
|
, m_useOSCache(BITTORRENT_SESSION_KEY("UseOSCache"), true)
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
@@ -380,11 +377,7 @@ Session::Session(QObject *parent)
|
|||||||
, m_includeOverheadInLimits(BITTORRENT_SESSION_KEY("IncludeOverheadInLimits"), false)
|
, m_includeOverheadInLimits(BITTORRENT_SESSION_KEY("IncludeOverheadInLimits"), false)
|
||||||
, m_announceIP(BITTORRENT_SESSION_KEY("AnnounceIP"))
|
, m_announceIP(BITTORRENT_SESSION_KEY("AnnounceIP"))
|
||||||
, m_maxConcurrentHTTPAnnounces(BITTORRENT_SESSION_KEY("MaxConcurrentHTTPAnnounces"), 50)
|
, m_maxConcurrentHTTPAnnounces(BITTORRENT_SESSION_KEY("MaxConcurrentHTTPAnnounces"), 50)
|
||||||
#if (LIBTORRENT_VERSION_NUM >= 10206)
|
|
||||||
, m_stopTrackerTimeout(BITTORRENT_SESSION_KEY("StopTrackerTimeout"), 5)
|
, m_stopTrackerTimeout(BITTORRENT_SESSION_KEY("StopTrackerTimeout"), 5)
|
||||||
#else
|
|
||||||
, m_stopTrackerTimeout(BITTORRENT_SESSION_KEY("StopTrackerTimeout"), 1)
|
|
||||||
#endif
|
|
||||||
, m_maxConnections(BITTORRENT_SESSION_KEY("MaxConnections"), 500, lowerLimited(0, -1))
|
, m_maxConnections(BITTORRENT_SESSION_KEY("MaxConnections"), 500, lowerLimited(0, -1))
|
||||||
, m_maxUploads(BITTORRENT_SESSION_KEY("MaxUploads"), 20, lowerLimited(0, -1))
|
, m_maxUploads(BITTORRENT_SESSION_KEY("MaxUploads"), 20, lowerLimited(0, -1))
|
||||||
, m_maxConnectionsPerTorrent(BITTORRENT_SESSION_KEY("MaxConnectionsPerTorrent"), 100, lowerLimited(0, -1))
|
, m_maxConnectionsPerTorrent(BITTORRENT_SESSION_KEY("MaxConnectionsPerTorrent"), 100, lowerLimited(0, -1))
|
||||||
@@ -394,6 +387,7 @@ Session::Session(QObject *parent)
|
|||||||
, m_isUTPRateLimited(BITTORRENT_SESSION_KEY("uTPRateLimited"), true)
|
, m_isUTPRateLimited(BITTORRENT_SESSION_KEY("uTPRateLimited"), true)
|
||||||
, m_utpMixedMode(BITTORRENT_SESSION_KEY("uTPMixedMode"), MixedModeAlgorithm::TCP
|
, m_utpMixedMode(BITTORRENT_SESSION_KEY("uTPMixedMode"), MixedModeAlgorithm::TCP
|
||||||
, clampValue(MixedModeAlgorithm::TCP, MixedModeAlgorithm::Proportional))
|
, clampValue(MixedModeAlgorithm::TCP, MixedModeAlgorithm::Proportional))
|
||||||
|
, m_IDNSupportEnabled(BITTORRENT_SESSION_KEY("IDNSupportEnabled"), false)
|
||||||
, m_multiConnectionsPerIpEnabled(BITTORRENT_SESSION_KEY("MultiConnectionsPerIp"), false)
|
, m_multiConnectionsPerIpEnabled(BITTORRENT_SESSION_KEY("MultiConnectionsPerIp"), false)
|
||||||
, m_validateHTTPSTrackerCertificate(BITTORRENT_SESSION_KEY("ValidateHTTPSTrackerCertificate"), false)
|
, m_validateHTTPSTrackerCertificate(BITTORRENT_SESSION_KEY("ValidateHTTPSTrackerCertificate"), false)
|
||||||
, m_blockPeersOnPrivilegedPorts(BITTORRENT_SESSION_KEY("BlockPeersOnPrivilegedPorts"), false)
|
, m_blockPeersOnPrivilegedPorts(BITTORRENT_SESSION_KEY("BlockPeersOnPrivilegedPorts"), false)
|
||||||
@@ -402,7 +396,7 @@ Session::Session(QObject *parent)
|
|||||||
, m_globalMaxRatio(BITTORRENT_SESSION_KEY("GlobalMaxRatio"), -1, [](qreal r) { return r < 0 ? -1. : r;})
|
, m_globalMaxRatio(BITTORRENT_SESSION_KEY("GlobalMaxRatio"), -1, [](qreal r) { return r < 0 ? -1. : r;})
|
||||||
, m_globalMaxSeedingMinutes(BITTORRENT_SESSION_KEY("GlobalMaxSeedingMinutes"), -1, lowerLimited(-1))
|
, m_globalMaxSeedingMinutes(BITTORRENT_SESSION_KEY("GlobalMaxSeedingMinutes"), -1, lowerLimited(-1))
|
||||||
, m_isAddTorrentPaused(BITTORRENT_SESSION_KEY("AddTorrentPaused"), false)
|
, m_isAddTorrentPaused(BITTORRENT_SESSION_KEY("AddTorrentPaused"), false)
|
||||||
, m_isKeepTorrentTopLevelFolder(BITTORRENT_SESSION_KEY("CreateTorrentSubfolder"), true)
|
, m_torrentContentLayout(BITTORRENT_SESSION_KEY("TorrentContentLayout"), TorrentContentLayout::Original)
|
||||||
, m_isAppendExtensionEnabled(BITTORRENT_SESSION_KEY("AddExtensionToIncompleteFiles"), false)
|
, m_isAppendExtensionEnabled(BITTORRENT_SESSION_KEY("AddExtensionToIncompleteFiles"), false)
|
||||||
, m_refreshInterval(BITTORRENT_SESSION_KEY("RefreshInterval"), 1500)
|
, m_refreshInterval(BITTORRENT_SESSION_KEY("RefreshInterval"), 1500)
|
||||||
, m_isPreallocationEnabled(BITTORRENT_SESSION_KEY("Preallocation"), false)
|
, m_isPreallocationEnabled(BITTORRENT_SESSION_KEY("Preallocation"), false)
|
||||||
@@ -509,6 +503,12 @@ Session::Session(QObject *parent)
|
|||||||
m_resumeDataSavingManager = new ResumeDataSavingManager {m_resumeFolderPath};
|
m_resumeDataSavingManager = new ResumeDataSavingManager {m_resumeFolderPath};
|
||||||
m_resumeDataSavingManager->moveToThread(m_ioThread);
|
m_resumeDataSavingManager->moveToThread(m_ioThread);
|
||||||
connect(m_ioThread, &QThread::finished, m_resumeDataSavingManager, &QObject::deleteLater);
|
connect(m_ioThread, &QThread::finished, m_resumeDataSavingManager, &QObject::deleteLater);
|
||||||
|
|
||||||
|
m_fileSearcher = new FileSearcher;
|
||||||
|
m_fileSearcher->moveToThread(m_ioThread);
|
||||||
|
connect(m_ioThread, &QThread::finished, m_fileSearcher, &QObject::deleteLater);
|
||||||
|
connect(m_fileSearcher, &FileSearcher::searchFinished, this, &Session::fileSearchFinished);
|
||||||
|
|
||||||
m_ioThread->start();
|
m_ioThread->start();
|
||||||
|
|
||||||
// Regular saving of fastresume data
|
// Regular saving of fastresume data
|
||||||
@@ -593,11 +593,11 @@ void Session::setAppendExtensionEnabled(const bool enabled)
|
|||||||
{
|
{
|
||||||
if (isAppendExtensionEnabled() != enabled)
|
if (isAppendExtensionEnabled() != enabled)
|
||||||
{
|
{
|
||||||
|
m_isAppendExtensionEnabled = enabled;
|
||||||
|
|
||||||
// append or remove .!qB extension for incomplete files
|
// append or remove .!qB extension for incomplete files
|
||||||
for (TorrentHandleImpl *const torrent : asConst(m_torrents))
|
for (TorrentHandleImpl *const torrent : asConst(m_torrents))
|
||||||
torrent->handleAppendExtensionToggled();
|
torrent->handleAppendExtensionToggled();
|
||||||
|
|
||||||
m_isAppendExtensionEnabled = enabled;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -661,9 +661,7 @@ QString Session::tempPath() const
|
|||||||
QString Session::torrentTempPath(const TorrentInfo &torrentInfo) const
|
QString Session::torrentTempPath(const TorrentInfo &torrentInfo) const
|
||||||
{
|
{
|
||||||
if ((torrentInfo.filesCount() > 1) && !torrentInfo.hasRootFolder())
|
if ((torrentInfo.filesCount() > 1) && !torrentInfo.hasRootFolder())
|
||||||
return tempPath()
|
return tempPath() + torrentInfo.name() + '/';
|
||||||
+ QString::fromStdString(torrentInfo.nativeInfo()->orig_files().name())
|
|
||||||
+ '/';
|
|
||||||
|
|
||||||
return tempPath();
|
return tempPath();
|
||||||
}
|
}
|
||||||
@@ -1089,9 +1087,6 @@ void Session::initializeNativeSession()
|
|||||||
// turn them off before `lt::session` ctor to avoid split second effects
|
// turn them off before `lt::session` ctor to avoid split second effects
|
||||||
pack.set_bool(lt::settings_pack::enable_upnp, false);
|
pack.set_bool(lt::settings_pack::enable_upnp, false);
|
||||||
pack.set_bool(lt::settings_pack::enable_natpmp, false);
|
pack.set_bool(lt::settings_pack::enable_natpmp, false);
|
||||||
#if (LIBTORRENT_VERSION_NUM < 10204)
|
|
||||||
pack.set_bool(lt::settings_pack::upnp_ignore_nonrouters, true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (LIBTORRENT_VERSION_NUM > 20000)
|
#if (LIBTORRENT_VERSION_NUM > 20000)
|
||||||
// preserve the same behavior as in earlier libtorrent versions
|
// preserve the same behavior as in earlier libtorrent versions
|
||||||
@@ -1166,80 +1161,44 @@ void Session::applyBandwidthLimits(lt::settings_pack &settingsPack) const
|
|||||||
|
|
||||||
void Session::initMetrics()
|
void Session::initMetrics()
|
||||||
{
|
{
|
||||||
m_metricIndices.net.hasIncomingConnections = lt::find_metric_idx("net.has_incoming_connections");
|
const auto findMetricIndex = [](const char *name) -> int
|
||||||
Q_ASSERT(m_metricIndices.net.hasIncomingConnections >= 0);
|
{
|
||||||
|
const int index = lt::find_metric_idx(name);
|
||||||
|
Q_ASSERT(index >= 0);
|
||||||
|
return index;
|
||||||
|
};
|
||||||
|
|
||||||
m_metricIndices.net.sentPayloadBytes = lt::find_metric_idx("net.sent_payload_bytes");
|
// TODO: switch to "designated initializers" in C++20
|
||||||
Q_ASSERT(m_metricIndices.net.sentPayloadBytes >= 0);
|
m_metricIndices.net.hasIncomingConnections = findMetricIndex("net.has_incoming_connections");
|
||||||
|
m_metricIndices.net.sentPayloadBytes = findMetricIndex("net.sent_payload_bytes");
|
||||||
|
m_metricIndices.net.recvPayloadBytes = findMetricIndex("net.recv_payload_bytes");
|
||||||
|
m_metricIndices.net.sentBytes = findMetricIndex("net.sent_bytes");
|
||||||
|
m_metricIndices.net.recvBytes = findMetricIndex("net.recv_bytes");
|
||||||
|
m_metricIndices.net.sentIPOverheadBytes = findMetricIndex("net.sent_ip_overhead_bytes");
|
||||||
|
m_metricIndices.net.recvIPOverheadBytes = findMetricIndex("net.recv_ip_overhead_bytes");
|
||||||
|
m_metricIndices.net.sentTrackerBytes = findMetricIndex("net.sent_tracker_bytes");
|
||||||
|
m_metricIndices.net.recvTrackerBytes = findMetricIndex("net.recv_tracker_bytes");
|
||||||
|
m_metricIndices.net.recvRedundantBytes = findMetricIndex("net.recv_redundant_bytes");
|
||||||
|
m_metricIndices.net.recvFailedBytes = findMetricIndex("net.recv_failed_bytes");
|
||||||
|
|
||||||
m_metricIndices.net.recvPayloadBytes = lt::find_metric_idx("net.recv_payload_bytes");
|
m_metricIndices.peer.numPeersConnected = findMetricIndex("peer.num_peers_connected");
|
||||||
Q_ASSERT(m_metricIndices.net.recvPayloadBytes >= 0);
|
m_metricIndices.peer.numPeersDownDisk = findMetricIndex("peer.num_peers_down_disk");
|
||||||
|
m_metricIndices.peer.numPeersUpDisk = findMetricIndex("peer.num_peers_up_disk");
|
||||||
|
|
||||||
m_metricIndices.net.sentBytes = lt::find_metric_idx("net.sent_bytes");
|
m_metricIndices.dht.dhtBytesIn = findMetricIndex("dht.dht_bytes_in");
|
||||||
Q_ASSERT(m_metricIndices.net.sentBytes >= 0);
|
m_metricIndices.dht.dhtBytesOut = findMetricIndex("dht.dht_bytes_out");
|
||||||
|
m_metricIndices.dht.dhtNodes = findMetricIndex("dht.dht_nodes");
|
||||||
|
|
||||||
m_metricIndices.net.recvBytes = lt::find_metric_idx("net.recv_bytes");
|
m_metricIndices.disk.diskBlocksInUse = findMetricIndex("disk.disk_blocks_in_use");
|
||||||
Q_ASSERT(m_metricIndices.net.recvBytes >= 0);
|
m_metricIndices.disk.numBlocksRead = findMetricIndex("disk.num_blocks_read");
|
||||||
|
#if (LIBTORRENT_VERSION_NUM < 20000)
|
||||||
m_metricIndices.net.sentIPOverheadBytes = lt::find_metric_idx("net.sent_ip_overhead_bytes");
|
m_metricIndices.disk.numBlocksCacheHits = findMetricIndex("disk.num_blocks_cache_hits");
|
||||||
Q_ASSERT(m_metricIndices.net.sentIPOverheadBytes >= 0);
|
#endif
|
||||||
|
m_metricIndices.disk.writeJobs = findMetricIndex("disk.num_write_ops");
|
||||||
m_metricIndices.net.recvIPOverheadBytes = lt::find_metric_idx("net.recv_ip_overhead_bytes");
|
m_metricIndices.disk.readJobs = findMetricIndex("disk.num_read_ops");
|
||||||
Q_ASSERT(m_metricIndices.net.recvIPOverheadBytes >= 0);
|
m_metricIndices.disk.hashJobs = findMetricIndex("disk.num_blocks_hashed");
|
||||||
|
m_metricIndices.disk.queuedDiskJobs = findMetricIndex("disk.queued_disk_jobs");
|
||||||
m_metricIndices.net.sentTrackerBytes = lt::find_metric_idx("net.sent_tracker_bytes");
|
m_metricIndices.disk.diskJobTime = findMetricIndex("disk.disk_job_time");
|
||||||
Q_ASSERT(m_metricIndices.net.sentTrackerBytes >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.net.recvTrackerBytes = lt::find_metric_idx("net.recv_tracker_bytes");
|
|
||||||
Q_ASSERT(m_metricIndices.net.recvTrackerBytes >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.net.recvRedundantBytes = lt::find_metric_idx("net.recv_redundant_bytes");
|
|
||||||
Q_ASSERT(m_metricIndices.net.recvRedundantBytes >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.net.recvFailedBytes = lt::find_metric_idx("net.recv_failed_bytes");
|
|
||||||
Q_ASSERT(m_metricIndices.net.recvFailedBytes >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.peer.numPeersConnected = lt::find_metric_idx("peer.num_peers_connected");
|
|
||||||
Q_ASSERT(m_metricIndices.peer.numPeersConnected >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.peer.numPeersDownDisk = lt::find_metric_idx("peer.num_peers_down_disk");
|
|
||||||
Q_ASSERT(m_metricIndices.peer.numPeersDownDisk >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.peer.numPeersUpDisk = lt::find_metric_idx("peer.num_peers_up_disk");
|
|
||||||
Q_ASSERT(m_metricIndices.peer.numPeersUpDisk >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.dht.dhtBytesIn = lt::find_metric_idx("dht.dht_bytes_in");
|
|
||||||
Q_ASSERT(m_metricIndices.dht.dhtBytesIn >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.dht.dhtBytesOut = lt::find_metric_idx("dht.dht_bytes_out");
|
|
||||||
Q_ASSERT(m_metricIndices.dht.dhtBytesOut >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.dht.dhtNodes = lt::find_metric_idx("dht.dht_nodes");
|
|
||||||
Q_ASSERT(m_metricIndices.dht.dhtNodes >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.disk.diskBlocksInUse = lt::find_metric_idx("disk.disk_blocks_in_use");
|
|
||||||
Q_ASSERT(m_metricIndices.disk.diskBlocksInUse >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.disk.numBlocksRead = lt::find_metric_idx("disk.num_blocks_read");
|
|
||||||
Q_ASSERT(m_metricIndices.disk.numBlocksRead >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.disk.numBlocksCacheHits = lt::find_metric_idx("disk.num_blocks_cache_hits");
|
|
||||||
Q_ASSERT(m_metricIndices.disk.numBlocksCacheHits >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.disk.writeJobs = lt::find_metric_idx("disk.num_write_ops");
|
|
||||||
Q_ASSERT(m_metricIndices.disk.writeJobs >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.disk.readJobs = lt::find_metric_idx("disk.num_read_ops");
|
|
||||||
Q_ASSERT(m_metricIndices.disk.readJobs >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.disk.hashJobs = lt::find_metric_idx("disk.num_blocks_hashed");
|
|
||||||
Q_ASSERT(m_metricIndices.disk.hashJobs >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.disk.queuedDiskJobs = lt::find_metric_idx("disk.queued_disk_jobs");
|
|
||||||
Q_ASSERT(m_metricIndices.disk.queuedDiskJobs >= 0);
|
|
||||||
|
|
||||||
m_metricIndices.disk.diskJobTime = lt::find_metric_idx("disk.disk_job_time");
|
|
||||||
Q_ASSERT(m_metricIndices.disk.diskJobTime >= 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
||||||
@@ -1341,9 +1300,7 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
|||||||
settingsPack.set_bool(lt::settings_pack::coalesce_writes, isCoalesceReadWriteEnabled());
|
settingsPack.set_bool(lt::settings_pack::coalesce_writes, isCoalesceReadWriteEnabled());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (LIBTORRENT_VERSION_NUM >= 10202)
|
|
||||||
settingsPack.set_bool(lt::settings_pack::piece_extent_affinity, usePieceExtentAffinity());
|
settingsPack.set_bool(lt::settings_pack::piece_extent_affinity, usePieceExtentAffinity());
|
||||||
#endif
|
|
||||||
|
|
||||||
settingsPack.set_int(lt::settings_pack::suggest_mode, isSuggestModeEnabled()
|
settingsPack.set_int(lt::settings_pack::suggest_mode, isSuggestModeEnabled()
|
||||||
? lt::settings_pack::suggest_read_cache : lt::settings_pack::no_piece_suggestions);
|
? lt::settings_pack::suggest_read_cache : lt::settings_pack::no_piece_suggestions);
|
||||||
@@ -1380,18 +1337,14 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
|||||||
settingsPack.set_int(lt::settings_pack::outgoing_port, outgoingPortsMin());
|
settingsPack.set_int(lt::settings_pack::outgoing_port, outgoingPortsMin());
|
||||||
settingsPack.set_int(lt::settings_pack::num_outgoing_ports, outgoingPortsMax() - outgoingPortsMin() + 1);
|
settingsPack.set_int(lt::settings_pack::num_outgoing_ports, outgoingPortsMax() - outgoingPortsMin() + 1);
|
||||||
|
|
||||||
#if (LIBTORRENT_VERSION_NUM >= 10206)
|
|
||||||
settingsPack.set_int(lt::settings_pack::upnp_lease_duration, UPnPLeaseDuration());
|
settingsPack.set_int(lt::settings_pack::upnp_lease_duration, UPnPLeaseDuration());
|
||||||
#endif
|
|
||||||
|
|
||||||
// Include overhead in transfer limits
|
// Include overhead in transfer limits
|
||||||
settingsPack.set_bool(lt::settings_pack::rate_limit_ip_overhead, includeOverheadInLimits());
|
settingsPack.set_bool(lt::settings_pack::rate_limit_ip_overhead, includeOverheadInLimits());
|
||||||
// IP address to announce to trackers
|
// IP address to announce to trackers
|
||||||
settingsPack.set_str(lt::settings_pack::announce_ip, announceIP().toStdString());
|
settingsPack.set_str(lt::settings_pack::announce_ip, announceIP().toStdString());
|
||||||
#if (LIBTORRENT_VERSION_NUM >= 10207)
|
|
||||||
// Max concurrent HTTP announces
|
// Max concurrent HTTP announces
|
||||||
settingsPack.set_int(lt::settings_pack::max_concurrent_http_announces, maxConcurrentHTTPAnnounces());
|
settingsPack.set_int(lt::settings_pack::max_concurrent_http_announces, maxConcurrentHTTPAnnounces());
|
||||||
#endif
|
|
||||||
// Stop tracker timeout
|
// Stop tracker timeout
|
||||||
settingsPack.set_int(lt::settings_pack::stop_tracker_timeout, stopTrackerTimeout());
|
settingsPack.set_int(lt::settings_pack::stop_tracker_timeout, stopTrackerTimeout());
|
||||||
// * Max connections limit
|
// * Max connections limit
|
||||||
@@ -1435,6 +1388,10 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAS_IDN_SUPPORT
|
||||||
|
settingsPack.set_bool(lt::settings_pack::allow_idna, isIDNSupportEnabled());
|
||||||
|
#endif
|
||||||
|
|
||||||
settingsPack.set_bool(lt::settings_pack::allow_multiple_connections_per_ip, multiConnectionsPerIpEnabled());
|
settingsPack.set_bool(lt::settings_pack::allow_multiple_connections_per_ip, multiConnectionsPerIpEnabled());
|
||||||
|
|
||||||
#ifdef HAS_HTTPS_TRACKER_VALIDATION
|
#ifdef HAS_HTTPS_TRACKER_VALIDATION
|
||||||
@@ -1765,6 +1722,31 @@ void Session::handleDownloadFinished(const Net::DownloadResult &result)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Session::fileSearchFinished(const InfoHash &id, const QString &savePath, const QStringList &fileNames)
|
||||||
|
{
|
||||||
|
TorrentHandleImpl *torrent = m_torrents.value(id);
|
||||||
|
if (torrent)
|
||||||
|
{
|
||||||
|
torrent->fileSearchFinished(savePath, fileNames);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto loadingTorrentsIter = m_loadingTorrents.find(id);
|
||||||
|
if (loadingTorrentsIter != m_loadingTorrents.end())
|
||||||
|
{
|
||||||
|
LoadTorrentParams params = loadingTorrentsIter.value();
|
||||||
|
m_loadingTorrents.erase(loadingTorrentsIter);
|
||||||
|
|
||||||
|
lt::add_torrent_params &p = params.ltAddTorrentParams;
|
||||||
|
|
||||||
|
p.save_path = Utils::Fs::toNativePath(savePath).toStdString();
|
||||||
|
for (int i = 0; i < fileNames.size(); ++i)
|
||||||
|
p.renamed_files[lt::file_index_t {i}] = fileNames[i].toStdString();
|
||||||
|
|
||||||
|
loadTorrent(params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Return the torrent handle, given its hash
|
// Return the torrent handle, given its hash
|
||||||
TorrentHandle *Session::findTorrent(const InfoHash &hash) const
|
TorrentHandle *Session::findTorrent(const InfoHash &hash) const
|
||||||
{
|
{
|
||||||
@@ -1892,12 +1874,12 @@ bool Session::deleteTorrent(const InfoHash &hash, const DeleteOption deleteOptio
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Session::cancelLoadMetadata(const InfoHash &hash)
|
bool Session::cancelDownloadMetadata(const InfoHash &hash)
|
||||||
{
|
{
|
||||||
const auto loadedMetadataIter = m_loadedMetadata.find(hash);
|
const auto downloadedMetadataIter = m_downloadedMetadata.find(hash);
|
||||||
if (loadedMetadataIter == m_loadedMetadata.end()) return false;
|
if (downloadedMetadataIter == m_downloadedMetadata.end()) return false;
|
||||||
|
|
||||||
m_loadedMetadata.erase(loadedMetadataIter);
|
m_downloadedMetadata.erase(downloadedMetadataIter);
|
||||||
--m_extraLimit;
|
--m_extraLimit;
|
||||||
adjustLimits();
|
adjustLimits();
|
||||||
m_nativeSession->remove_torrent(m_nativeSession->find_torrent(hash), lt::session::delete_files);
|
m_nativeSession->remove_torrent(m_nativeSession->find_torrent(hash), lt::session::delete_files);
|
||||||
@@ -1951,7 +1933,7 @@ void Session::decreaseTorrentsQueuePos(const QVector<InfoHash> &hashes)
|
|||||||
torrentQueue.pop();
|
torrentQueue.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto i = m_loadedMetadata.cbegin(); i != m_loadedMetadata.cend(); ++i)
|
for (auto i = m_downloadedMetadata.cbegin(); i != m_downloadedMetadata.cend(); ++i)
|
||||||
torrentQueuePositionBottom(m_nativeSession->find_torrent(*i));
|
torrentQueuePositionBottom(m_nativeSession->find_torrent(*i));
|
||||||
|
|
||||||
saveTorrentsQueue();
|
saveTorrentsQueue();
|
||||||
@@ -2004,7 +1986,7 @@ void Session::bottomTorrentsQueuePos(const QVector<InfoHash> &hashes)
|
|||||||
torrentQueue.pop();
|
torrentQueue.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto i = m_loadedMetadata.cbegin(); i != m_loadedMetadata.cend(); ++i)
|
for (auto i = m_downloadedMetadata.cbegin(); i != m_downloadedMetadata.cend(); ++i)
|
||||||
torrentQueuePositionBottom(m_nativeSession->find_torrent(*i));
|
torrentQueuePositionBottom(m_nativeSession->find_torrent(*i));
|
||||||
|
|
||||||
saveTorrentsQueue();
|
saveTorrentsQueue();
|
||||||
@@ -2058,21 +2040,6 @@ bool Session::addTorrent(const MagnetUri &magnetUri, const AddTorrentParams &par
|
|||||||
{
|
{
|
||||||
if (!magnetUri.isValid()) return false;
|
if (!magnetUri.isValid()) return false;
|
||||||
|
|
||||||
const InfoHash hash = magnetUri.hash();
|
|
||||||
|
|
||||||
const auto it = m_loadedMetadata.constFind(hash);
|
|
||||||
if (it != m_loadedMetadata.constEnd())
|
|
||||||
{
|
|
||||||
// It looks illogical that we don't just use an existing handle,
|
|
||||||
// but as previous experience has shown, it actually creates unnecessary
|
|
||||||
// problems and unwanted behavior due to the fact that it was originally
|
|
||||||
// added with parameters other than those provided by the user.
|
|
||||||
m_loadedMetadata.erase(it);
|
|
||||||
--m_extraLimit;
|
|
||||||
adjustLimits();
|
|
||||||
m_nativeSession->remove_torrent(m_nativeSession->find_torrent(hash), lt::session::delete_files);
|
|
||||||
}
|
|
||||||
|
|
||||||
return addTorrent_impl(params, magnetUri);
|
return addTorrent_impl(params, magnetUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2091,9 +2058,9 @@ LoadTorrentParams Session::initLoadTorrentParams(const AddTorrentParams &addTorr
|
|||||||
loadTorrentParams.tags = addTorrentParams.tags;
|
loadTorrentParams.tags = addTorrentParams.tags;
|
||||||
loadTorrentParams.firstLastPiecePriority = addTorrentParams.firstLastPiecePriority;
|
loadTorrentParams.firstLastPiecePriority = addTorrentParams.firstLastPiecePriority;
|
||||||
loadTorrentParams.hasSeedStatus = addTorrentParams.skipChecking; // do not react on 'torrent_finished_alert' when skipping
|
loadTorrentParams.hasSeedStatus = addTorrentParams.skipChecking; // do not react on 'torrent_finished_alert' when skipping
|
||||||
loadTorrentParams.hasRootFolder = ((addTorrentParams.createSubfolder == TriStateBool::Undefined)
|
loadTorrentParams.contentLayout = (addTorrentParams.contentLayout
|
||||||
? isKeepTorrentTopLevelFolder()
|
? *addTorrentParams.contentLayout
|
||||||
: (addTorrentParams.createSubfolder == TriStateBool::True));
|
: torrentContentLayout());
|
||||||
loadTorrentParams.forced = (addTorrentParams.addForced == TriStateBool::True);
|
loadTorrentParams.forced = (addTorrentParams.addForced == TriStateBool::True);
|
||||||
loadTorrentParams.paused = ((addTorrentParams.addPaused == TriStateBool::Undefined)
|
loadTorrentParams.paused = ((addTorrentParams.addPaused == TriStateBool::Undefined)
|
||||||
? isAddTorrentPaused()
|
? isAddTorrentPaused()
|
||||||
@@ -2113,7 +2080,7 @@ LoadTorrentParams Session::initLoadTorrentParams(const AddTorrentParams &addTorr
|
|||||||
|
|
||||||
const QString category = addTorrentParams.category;
|
const QString category = addTorrentParams.category;
|
||||||
if (!category.isEmpty() && !m_categories.contains(category) && !addCategory(category))
|
if (!category.isEmpty() && !m_categories.contains(category) && !addCategory(category))
|
||||||
loadTorrentParams.category = "";
|
loadTorrentParams.category = "";
|
||||||
else
|
else
|
||||||
loadTorrentParams.category = addTorrentParams.category;
|
loadTorrentParams.category = addTorrentParams.category;
|
||||||
|
|
||||||
@@ -2126,9 +2093,15 @@ bool Session::addTorrent_impl(const AddTorrentParams &addTorrentParams, const Ma
|
|||||||
const bool hasMetadata = metadata.isValid();
|
const bool hasMetadata = metadata.isValid();
|
||||||
const InfoHash hash = (hasMetadata ? metadata.hash() : magnetUri.hash());
|
const InfoHash hash = (hasMetadata ? metadata.hash() : magnetUri.hash());
|
||||||
|
|
||||||
|
// It looks illogical that we don't just use an existing handle,
|
||||||
|
// but as previous experience has shown, it actually creates unnecessary
|
||||||
|
// problems and unwanted behavior due to the fact that it was originally
|
||||||
|
// added with parameters other than those provided by the user.
|
||||||
|
cancelDownloadMetadata(hash);
|
||||||
|
|
||||||
// We should not add the torrent if it is already
|
// We should not add the torrent if it is already
|
||||||
// processed or is pending to add to session
|
// processed or is pending to add to session
|
||||||
if (m_loadingTorrents.contains(hash) || m_loadedMetadata.contains(hash))
|
if (m_loadingTorrents.contains(hash))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TorrentHandleImpl *const torrent = m_torrents.value(hash);
|
TorrentHandleImpl *const torrent = m_torrents.value(hash);
|
||||||
@@ -2146,15 +2119,19 @@ bool Session::addTorrent_impl(const AddTorrentParams &addTorrentParams, const Ma
|
|||||||
LoadTorrentParams loadTorrentParams = initLoadTorrentParams(addTorrentParams);
|
LoadTorrentParams loadTorrentParams = initLoadTorrentParams(addTorrentParams);
|
||||||
lt::add_torrent_params &p = loadTorrentParams.ltAddTorrentParams;
|
lt::add_torrent_params &p = loadTorrentParams.ltAddTorrentParams;
|
||||||
|
|
||||||
|
bool isFindingIncompleteFiles = false;
|
||||||
|
|
||||||
// If empty then Automatic mode, otherwise Manual mode
|
// If empty then Automatic mode, otherwise Manual mode
|
||||||
QString actualSavePath = loadTorrentParams.savePath.isEmpty() ? categorySavePath(loadTorrentParams.category) : loadTorrentParams.savePath;
|
const QString actualSavePath = loadTorrentParams.savePath.isEmpty() ? categorySavePath(loadTorrentParams.category) : loadTorrentParams.savePath;
|
||||||
if (hasMetadata)
|
if (hasMetadata)
|
||||||
{
|
{
|
||||||
if (!loadTorrentParams.hasRootFolder)
|
metadata.setContentLayout(loadTorrentParams.contentLayout);
|
||||||
metadata.stripRootFolder();
|
|
||||||
|
|
||||||
if (!loadTorrentParams.hasSeedStatus)
|
if (!loadTorrentParams.hasSeedStatus)
|
||||||
findIncompleteFiles(metadata, actualSavePath); // if needed points savePath to incomplete folder too
|
{
|
||||||
|
findIncompleteFiles(metadata, actualSavePath);
|
||||||
|
isFindingIncompleteFiles = true;
|
||||||
|
}
|
||||||
|
|
||||||
// if torrent name wasn't explicitly set we handle the case of
|
// if torrent name wasn't explicitly set we handle the case of
|
||||||
// initial renaming of torrent content and rename torrent accordingly
|
// initial renaming of torrent content and rename torrent accordingly
|
||||||
@@ -2184,9 +2161,6 @@ bool Session::addTorrent_impl(const AddTorrentParams &addTorrentParams, const Ma
|
|||||||
|
|
||||||
if (loadTorrentParams.name.isEmpty() && !p.name.empty())
|
if (loadTorrentParams.name.isEmpty() && !p.name.empty())
|
||||||
loadTorrentParams.name = QString::fromStdString(p.name);
|
loadTorrentParams.name = QString::fromStdString(p.name);
|
||||||
|
|
||||||
if (isTempPathEnabled())
|
|
||||||
actualSavePath = tempPath();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p.save_path = Utils::Fs::toNativePath(actualSavePath).toStdString();
|
p.save_path = Utils::Fs::toNativePath(actualSavePath).toStdString();
|
||||||
@@ -2218,7 +2192,11 @@ bool Session::addTorrent_impl(const AddTorrentParams &addTorrentParams, const Ma
|
|||||||
else
|
else
|
||||||
p.flags |= lt::torrent_flags::auto_managed;
|
p.flags |= lt::torrent_flags::auto_managed;
|
||||||
|
|
||||||
return loadTorrent(loadTorrentParams);
|
if (!isFindingIncompleteFiles)
|
||||||
|
return loadTorrent(loadTorrentParams);
|
||||||
|
|
||||||
|
m_loadingTorrents.insert(hash, loadTorrentParams);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a torrent to the BitTorrent session
|
// Add a torrent to the BitTorrent session
|
||||||
@@ -2243,42 +2221,27 @@ bool Session::loadTorrent(LoadTorrentParams params)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Session::findIncompleteFiles(TorrentInfo &torrentInfo, QString &savePath) const
|
void Session::findIncompleteFiles(const TorrentInfo &torrentInfo, const QString &savePath) const
|
||||||
{
|
{
|
||||||
auto findInDir = [](const QString &dirPath, TorrentInfo &torrentInfo) -> bool
|
const InfoHash searchId = torrentInfo.hash();
|
||||||
|
const QStringList originalFileNames = torrentInfo.filePaths();
|
||||||
|
const QString completeSavePath = savePath;
|
||||||
|
const QString incompleteSavePath = (isTempPathEnabled() ? torrentTempPath(torrentInfo) : QString {});
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||||
|
QMetaObject::invokeMethod(m_fileSearcher, [=]()
|
||||||
{
|
{
|
||||||
const QDir dir(dirPath);
|
m_fileSearcher->search(searchId, originalFileNames, completeSavePath, incompleteSavePath);
|
||||||
bool found = false;
|
});
|
||||||
for (int i = 0; i < torrentInfo.filesCount(); ++i)
|
#else
|
||||||
{
|
QMetaObject::invokeMethod(m_fileSearcher, "search"
|
||||||
const QString filePath = torrentInfo.filePath(i);
|
, Q_ARG(BitTorrent::InfoHash, searchId), Q_ARG(QStringList, originalFileNames)
|
||||||
if (dir.exists(filePath))
|
, Q_ARG(QString, completeSavePath), Q_ARG(QString, incompleteSavePath));
|
||||||
{
|
#endif
|
||||||
found = true;
|
|
||||||
}
|
|
||||||
else if (dir.exists(filePath + QB_EXT))
|
|
||||||
{
|
|
||||||
found = true;
|
|
||||||
torrentInfo.renameFile(i, filePath + QB_EXT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return found;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool found = findInDir(savePath, torrentInfo);
|
|
||||||
if (!found && isTempPathEnabled())
|
|
||||||
{
|
|
||||||
savePath = torrentTempPath(torrentInfo);
|
|
||||||
found = findInDir(savePath, torrentInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
return found;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a torrent to the BitTorrent session in hidden mode
|
// Add a torrent to libtorrent session in hidden mode
|
||||||
// and force it to load its metadata
|
// and force it to download its metadata
|
||||||
bool Session::loadMetadata(const MagnetUri &magnetUri)
|
bool Session::downloadMetadata(const MagnetUri &magnetUri)
|
||||||
{
|
{
|
||||||
if (!magnetUri.isValid()) return false;
|
if (!magnetUri.isValid()) return false;
|
||||||
|
|
||||||
@@ -2289,7 +2252,7 @@ bool Session::loadMetadata(const MagnetUri &magnetUri)
|
|||||||
// processed or adding to session
|
// processed or adding to session
|
||||||
if (m_torrents.contains(hash)) return false;
|
if (m_torrents.contains(hash)) return false;
|
||||||
if (m_loadingTorrents.contains(hash)) return false;
|
if (m_loadingTorrents.contains(hash)) return false;
|
||||||
if (m_loadedMetadata.contains(hash)) return false;
|
if (m_downloadedMetadata.contains(hash)) return false;
|
||||||
|
|
||||||
qDebug("Adding torrent to preload metadata...");
|
qDebug("Adding torrent to preload metadata...");
|
||||||
qDebug(" -> Hash: %s", qUtf8Printable(hash));
|
qDebug(" -> Hash: %s", qUtf8Printable(hash));
|
||||||
@@ -2322,13 +2285,13 @@ bool Session::loadMetadata(const MagnetUri &magnetUri)
|
|||||||
p.storage = customStorageConstructor;
|
p.storage = customStorageConstructor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Adding torrent to BitTorrent session
|
// Adding torrent to libtorrent session
|
||||||
lt::error_code ec;
|
lt::error_code ec;
|
||||||
lt::torrent_handle h = m_nativeSession->add_torrent(p, ec);
|
lt::torrent_handle h = m_nativeSession->add_torrent(p, ec);
|
||||||
if (ec) return false;
|
if (ec) return false;
|
||||||
|
|
||||||
// waiting for metadata...
|
// waiting for metadata...
|
||||||
m_loadedMetadata.insert(h.info_hash());
|
m_downloadedMetadata.insert(h.info_hash());
|
||||||
++m_extraLimit;
|
++m_extraLimit;
|
||||||
adjustLimits();
|
adjustLimits();
|
||||||
|
|
||||||
@@ -3701,6 +3664,19 @@ void Session::setUtpMixedMode(const MixedModeAlgorithm mode)
|
|||||||
configureDeferred();
|
configureDeferred();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Session::isIDNSupportEnabled() const
|
||||||
|
{
|
||||||
|
return m_IDNSupportEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Session::setIDNSupportEnabled(const bool enabled)
|
||||||
|
{
|
||||||
|
if (enabled == m_IDNSupportEnabled) return;
|
||||||
|
|
||||||
|
m_IDNSupportEnabled = enabled;
|
||||||
|
configureDeferred();
|
||||||
|
}
|
||||||
|
|
||||||
bool Session::multiConnectionsPerIpEnabled() const
|
bool Session::multiConnectionsPerIpEnabled() const
|
||||||
{
|
{
|
||||||
return m_multiConnectionsPerIpEnabled;
|
return m_multiConnectionsPerIpEnabled;
|
||||||
@@ -3775,7 +3751,7 @@ bool Session::isKnownTorrent(const InfoHash &hash) const
|
|||||||
{
|
{
|
||||||
return (m_torrents.contains(hash)
|
return (m_torrents.contains(hash)
|
||||||
|| m_loadingTorrents.contains(hash)
|
|| m_loadingTorrents.contains(hash)
|
||||||
|| m_loadedMetadata.contains(hash));
|
|| m_downloadedMetadata.contains(hash));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::updateSeedingLimitTimer()
|
void Session::updateSeedingLimitTimer()
|
||||||
@@ -3879,8 +3855,6 @@ void Session::handleTorrentUrlSeedsRemoved(TorrentHandleImpl *const torrent, con
|
|||||||
|
|
||||||
void Session::handleTorrentMetadataReceived(TorrentHandleImpl *const torrent)
|
void Session::handleTorrentMetadataReceived(TorrentHandleImpl *const torrent)
|
||||||
{
|
{
|
||||||
torrent->saveResumeData();
|
|
||||||
|
|
||||||
// Save metadata
|
// Save metadata
|
||||||
const QDir resumeDataDir {m_resumeFolderPath};
|
const QDir resumeDataDir {m_resumeFolderPath};
|
||||||
const QString torrentFileName {QString {"%1.torrent"}.arg(torrent->hash())};
|
const QString torrentFileName {QString {"%1.torrent"}.arg(torrent->hash())};
|
||||||
@@ -3897,7 +3871,7 @@ void Session::handleTorrentMetadataReceived(TorrentHandleImpl *const torrent)
|
|||||||
.arg(torrentFileName, err.message()), Log::CRITICAL);
|
.arg(torrentFileName, err.message()), Log::CRITICAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit torrentMetadataLoaded(torrent);
|
emit torrentMetadataReceived(torrent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::handleTorrentPaused(TorrentHandleImpl *const torrent)
|
void Session::handleTorrentPaused(TorrentHandleImpl *const torrent)
|
||||||
@@ -4052,6 +4026,8 @@ void Session::moveTorrentStorage(const MoveStorageJob &job) const
|
|||||||
void Session::handleMoveTorrentStorageJobFinished()
|
void Session::handleMoveTorrentStorageJobFinished()
|
||||||
{
|
{
|
||||||
const MoveStorageJob finishedJob = m_moveStorageQueue.takeFirst();
|
const MoveStorageJob finishedJob = m_moveStorageQueue.takeFirst();
|
||||||
|
if (!m_moveStorageQueue.isEmpty())
|
||||||
|
moveTorrentStorage(m_moveStorageQueue.first());
|
||||||
|
|
||||||
const auto iter = std::find_if(m_moveStorageQueue.cbegin(), m_moveStorageQueue.cend()
|
const auto iter = std::find_if(m_moveStorageQueue.cbegin(), m_moveStorageQueue.cend()
|
||||||
, [&finishedJob](const MoveStorageJob &job)
|
, [&finishedJob](const MoveStorageJob &job)
|
||||||
@@ -4063,22 +4039,17 @@ void Session::handleMoveTorrentStorageJobFinished()
|
|||||||
|
|
||||||
TorrentHandleImpl *torrent = m_torrents.value(finishedJob.torrentHandle.info_hash());
|
TorrentHandleImpl *torrent = m_torrents.value(finishedJob.torrentHandle.info_hash());
|
||||||
if (torrent)
|
if (torrent)
|
||||||
torrent->handleMoveStorageJobFinished(torrentHasOutstandingJob);
|
|
||||||
|
|
||||||
if (!torrentHasOutstandingJob)
|
|
||||||
{
|
{
|
||||||
if (!torrent)
|
torrent->handleMoveStorageJobFinished(torrentHasOutstandingJob);
|
||||||
{
|
}
|
||||||
// Last job is completed for torrent that being removing, so actually remove it
|
else if (!torrentHasOutstandingJob)
|
||||||
const lt::torrent_handle nativeHandle {finishedJob.torrentHandle};
|
{
|
||||||
const RemovingTorrentData &removingTorrentData = m_removingTorrents[nativeHandle.info_hash()];
|
// Last job is completed for torrent that being removing, so actually remove it
|
||||||
if (removingTorrentData.deleteOption == Torrent)
|
const lt::torrent_handle nativeHandle {finishedJob.torrentHandle};
|
||||||
m_nativeSession->remove_torrent(nativeHandle, lt::session::delete_partfile);
|
const RemovingTorrentData &removingTorrentData = m_removingTorrents[nativeHandle.info_hash()];
|
||||||
}
|
if (removingTorrentData.deleteOption == Torrent)
|
||||||
|
m_nativeSession->remove_torrent(nativeHandle, lt::session::delete_partfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_moveStorageQueue.isEmpty())
|
|
||||||
moveTorrentStorage(m_moveStorageQueue.first());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::handleTorrentTrackerWarning(TorrentHandleImpl *const torrent, const QString &trackerUrl)
|
void Session::handleTorrentTrackerWarning(TorrentHandleImpl *const torrent, const QString &trackerUrl)
|
||||||
@@ -4223,9 +4194,27 @@ bool Session::loadTorrentResumeData(const QByteArray &data, const TorrentInfo &m
|
|||||||
Utils::Fs::toUniformPath(fromLTString(root.dict_find_string_value("qBt-savePath"))));
|
Utils::Fs::toUniformPath(fromLTString(root.dict_find_string_value("qBt-savePath"))));
|
||||||
torrentParams.hasSeedStatus = root.dict_find_int_value("qBt-seedStatus");
|
torrentParams.hasSeedStatus = root.dict_find_int_value("qBt-seedStatus");
|
||||||
torrentParams.firstLastPiecePriority = root.dict_find_int_value("qBt-firstLastPiecePriority");
|
torrentParams.firstLastPiecePriority = root.dict_find_int_value("qBt-firstLastPiecePriority");
|
||||||
torrentParams.hasRootFolder = root.dict_find_int_value("qBt-hasRootFolder");
|
|
||||||
torrentParams.seedingTimeLimit = root.dict_find_int_value("qBt-seedingTimeLimit", TorrentHandle::USE_GLOBAL_SEEDING_TIME);
|
torrentParams.seedingTimeLimit = root.dict_find_int_value("qBt-seedingTimeLimit", TorrentHandle::USE_GLOBAL_SEEDING_TIME);
|
||||||
|
|
||||||
|
// TODO: The following code is deprecated. Replace with the commented one after several releases in 4.4.x.
|
||||||
|
// === BEGIN DEPRECATED CODE === //
|
||||||
|
const lt::bdecode_node contentLayoutNode = root.dict_find("qBt-contentLayout");
|
||||||
|
if (contentLayoutNode.type() == lt::bdecode_node::string_t)
|
||||||
|
{
|
||||||
|
const QString contentLayoutStr = fromLTString(contentLayoutNode.string_value());
|
||||||
|
torrentParams.contentLayout = Utils::String::toEnum(contentLayoutStr, TorrentContentLayout::Original);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const bool hasRootFolder = root.dict_find_int_value("qBt-hasRootFolder");
|
||||||
|
torrentParams.contentLayout = (hasRootFolder ? TorrentContentLayout::Original : TorrentContentLayout::NoSubfolder);
|
||||||
|
}
|
||||||
|
// === END DEPRECATED CODE === //
|
||||||
|
// === BEGIN REPLACEMENT CODE === //
|
||||||
|
// torrentParams.contentLayout = Utils::String::parse(
|
||||||
|
// fromLTString(root.dict_find_string_value("qBt-contentLayout")), TorrentContentLayout::Default);
|
||||||
|
// === END REPLACEMENT CODE === //
|
||||||
|
|
||||||
const lt::string_view ratioLimitString = root.dict_find_string_value("qBt-ratioLimit");
|
const lt::string_view ratioLimitString = root.dict_find_string_value("qBt-ratioLimit");
|
||||||
if (ratioLimitString.empty())
|
if (ratioLimitString.empty())
|
||||||
torrentParams.ratioLimit = root.dict_find_int_value("qBt-ratioLimit", TorrentHandle::USE_GLOBAL_RATIO * 1000) / 1000.0;
|
torrentParams.ratioLimit = root.dict_find_int_value("qBt-ratioLimit", TorrentHandle::USE_GLOBAL_RATIO * 1000) / 1000.0;
|
||||||
@@ -4258,21 +4247,21 @@ bool Session::loadTorrentResumeData(const QByteArray &data, const TorrentInfo &m
|
|||||||
if (metadata.isValid())
|
if (metadata.isValid())
|
||||||
p.ti = metadata.nativeInfo();
|
p.ti = metadata.nativeInfo();
|
||||||
|
|
||||||
torrentParams.paused = (p.flags & lt::torrent_flags::paused) && !(p.flags & lt::torrent_flags::auto_managed);
|
if (p.flags & lt::torrent_flags::stop_when_ready)
|
||||||
if (!torrentParams.paused)
|
|
||||||
{
|
{
|
||||||
// If torrent has "stop_when_ready" flag set then it is actually "stopped"
|
// If torrent has "stop_when_ready" flag set then it is actually "stopped"
|
||||||
// but temporarily "resumed" to perform some service jobs (e.g. checking)
|
torrentParams.paused = true;
|
||||||
torrentParams.paused = !!(p.flags & lt::torrent_flags::stop_when_ready);
|
torrentParams.forced = false;
|
||||||
|
// ...but temporarily "resumed" to perform some service jobs (e.g. checking)
|
||||||
|
p.flags &= ~lt::torrent_flags::paused;
|
||||||
|
p.flags |= lt::torrent_flags::auto_managed;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Fix inconsistent state when "paused" torrent has "stop_when_ready" flag set
|
torrentParams.paused = (p.flags & lt::torrent_flags::paused) && !(p.flags & lt::torrent_flags::auto_managed);
|
||||||
p.flags &= ~lt::torrent_flags::stop_when_ready;
|
torrentParams.forced = !(p.flags & lt::torrent_flags::paused) && !(p.flags & lt::torrent_flags::auto_managed);
|
||||||
}
|
}
|
||||||
|
|
||||||
torrentParams.forced = !(p.flags & lt::torrent_flags::paused) && !(p.flags & lt::torrent_flags::auto_managed);
|
|
||||||
|
|
||||||
const bool hasMetadata = (p.ti && p.ti->is_valid());
|
const bool hasMetadata = (p.ti && p.ti->is_valid());
|
||||||
if (!hasMetadata && !root.dict_find("info-hash"))
|
if (!hasMetadata && !root.dict_find("info-hash"))
|
||||||
{
|
{
|
||||||
@@ -4456,14 +4445,14 @@ std::vector<lt::alert *> Session::getPendingAlerts(const lt::time_duration time)
|
|||||||
return alerts;
|
return alerts;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Session::isKeepTorrentTopLevelFolder() const
|
TorrentContentLayout Session::torrentContentLayout() const
|
||||||
{
|
{
|
||||||
return m_isKeepTorrentTopLevelFolder;
|
return m_torrentContentLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::setKeepTorrentTopLevelFolder(const bool value)
|
void Session::setTorrentContentLayout(const TorrentContentLayout value)
|
||||||
{
|
{
|
||||||
m_isKeepTorrentTopLevelFolder = value;
|
m_torrentContentLayout = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read alerts sent by the BitTorrent session
|
// Read alerts sent by the BitTorrent session
|
||||||
@@ -4504,11 +4493,6 @@ void Session::handleAlert(const lt::alert *a)
|
|||||||
case lt::file_error_alert::alert_type:
|
case lt::file_error_alert::alert_type:
|
||||||
handleFileErrorAlert(static_cast<const lt::file_error_alert*>(a));
|
handleFileErrorAlert(static_cast<const lt::file_error_alert*>(a));
|
||||||
break;
|
break;
|
||||||
#if (LIBTORRENT_VERSION_NUM < 10208)
|
|
||||||
case lt::read_piece_alert::alert_type:
|
|
||||||
handleReadPieceAlert(static_cast<const lt::read_piece_alert*>(a));
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case lt::add_torrent_alert::alert_type:
|
case lt::add_torrent_alert::alert_type:
|
||||||
handleAddTorrentAlert(static_cast<const lt::add_torrent_alert*>(a));
|
handleAddTorrentAlert(static_cast<const lt::add_torrent_alert*>(a));
|
||||||
break;
|
break;
|
||||||
@@ -4554,11 +4538,9 @@ void Session::handleAlert(const lt::alert *a)
|
|||||||
case lt::storage_moved_failed_alert::alert_type:
|
case lt::storage_moved_failed_alert::alert_type:
|
||||||
handleStorageMovedFailedAlert(static_cast<const lt::storage_moved_failed_alert*>(a));
|
handleStorageMovedFailedAlert(static_cast<const lt::storage_moved_failed_alert*>(a));
|
||||||
break;
|
break;
|
||||||
#if (LIBTORRENT_VERSION_NUM >= 10204)
|
|
||||||
case lt::socks5_alert::alert_type:
|
case lt::socks5_alert::alert_type:
|
||||||
handleSocks5Alert(static_cast<const lt::socks5_alert *>(a));
|
handleSocks5Alert(static_cast<const lt::socks5_alert *>(a));
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const std::exception &exc)
|
catch (const std::exception &exc)
|
||||||
@@ -4590,7 +4572,7 @@ void Session::createTorrentHandle(const lt::torrent_handle &nativeHandle)
|
|||||||
|
|
||||||
const LoadTorrentParams params = m_loadingTorrents.take(nativeHandle.info_hash());
|
const LoadTorrentParams params = m_loadingTorrents.take(nativeHandle.info_hash());
|
||||||
|
|
||||||
auto *const torrent = new TorrentHandleImpl {this, nativeHandle, params};
|
auto *const torrent = new TorrentHandleImpl {this, m_nativeSession, nativeHandle, params};
|
||||||
m_torrents.insert(torrent->hash(), torrent);
|
m_torrents.insert(torrent->hash(), torrent);
|
||||||
|
|
||||||
const bool hasMetadata = torrent->hasMetadata();
|
const bool hasMetadata = torrent->hasMetadata();
|
||||||
@@ -4645,12 +4627,6 @@ void Session::createTorrentHandle(const lt::torrent_handle &nativeHandle)
|
|||||||
// Torrent could have error just after adding to libtorrent
|
// Torrent could have error just after adding to libtorrent
|
||||||
if (torrent->hasError())
|
if (torrent->hasError())
|
||||||
LogMsg(tr("Torrent errored. Torrent: \"%1\". Error: %2.").arg(torrent->name(), torrent->error()), Log::WARNING);
|
LogMsg(tr("Torrent errored. Torrent: \"%1\". Error: %2.").arg(torrent->name(), torrent->error()), Log::WARNING);
|
||||||
|
|
||||||
#if (LIBTORRENT_VERSION_NUM < 10208)
|
|
||||||
// Check if file(s) exist when using skip hash check
|
|
||||||
if (nativeHandle.flags() & lt::torrent_flags::seed_mode)
|
|
||||||
nativeHandle.read_piece(lt::piece_index_t {0});
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::handleAddTorrentAlert(const lt::add_torrent_alert *p)
|
void Session::handleAddTorrentAlert(const lt::add_torrent_alert *p)
|
||||||
@@ -4704,17 +4680,17 @@ void Session::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed_ale
|
|||||||
if (removingTorrentDataIter == m_removingTorrents.end())
|
if (removingTorrentDataIter == m_removingTorrents.end())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// libtorrent won't delete the directory if it contains files not listed in the torrent,
|
|
||||||
// so we remove the directory ourselves
|
|
||||||
Utils::Fs::smartRemoveEmptyFolderTree(removingTorrentDataIter->pathToRemove);
|
|
||||||
|
|
||||||
if (p->error)
|
if (p->error)
|
||||||
{
|
{
|
||||||
|
// libtorrent won't delete the directory if it contains files not listed in the torrent,
|
||||||
|
// so we remove the directory ourselves
|
||||||
|
Utils::Fs::smartRemoveEmptyFolderTree(removingTorrentDataIter->pathToRemove);
|
||||||
|
|
||||||
LogMsg(tr("'%1' was removed from the transfer list but the files couldn't be deleted. Error: %2", "'xxx.avi' was removed...")
|
LogMsg(tr("'%1' was removed from the transfer list but the files couldn't be deleted. Error: %2", "'xxx.avi' was removed...")
|
||||||
.arg(removingTorrentDataIter->name, QString::fromLocal8Bit(p->error.message().c_str()))
|
.arg(removingTorrentDataIter->name, QString::fromLocal8Bit(p->error.message().c_str()))
|
||||||
, Log::WARNING);
|
, Log::WARNING);
|
||||||
}
|
}
|
||||||
else
|
else // torrent without metadata, hence no files on disk
|
||||||
{
|
{
|
||||||
LogMsg(tr("'%1' was removed from the transfer list.", "'xxx.avi' was removed...").arg(removingTorrentDataIter->name));
|
LogMsg(tr("'%1' was removed from the transfer list.", "'xxx.avi' was removed...").arg(removingTorrentDataIter->name));
|
||||||
}
|
}
|
||||||
@@ -4724,18 +4700,18 @@ void Session::handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed_ale
|
|||||||
void Session::handleMetadataReceivedAlert(const lt::metadata_received_alert *p)
|
void Session::handleMetadataReceivedAlert(const lt::metadata_received_alert *p)
|
||||||
{
|
{
|
||||||
const InfoHash hash {p->handle.info_hash()};
|
const InfoHash hash {p->handle.info_hash()};
|
||||||
const auto loadedMetadataIter = m_loadedMetadata.find(hash);
|
const auto downloadedMetadataIter = m_downloadedMetadata.find(hash);
|
||||||
|
|
||||||
if (loadedMetadataIter != m_loadedMetadata.end())
|
if (downloadedMetadataIter != m_downloadedMetadata.end())
|
||||||
{
|
{
|
||||||
TorrentInfo metadata {p->handle.torrent_file()};
|
TorrentInfo metadata {p->handle.torrent_file()};
|
||||||
|
|
||||||
m_loadedMetadata.erase(loadedMetadataIter);
|
m_downloadedMetadata.erase(downloadedMetadataIter);
|
||||||
--m_extraLimit;
|
--m_extraLimit;
|
||||||
adjustLimits();
|
adjustLimits();
|
||||||
m_nativeSession->remove_torrent(p->handle, lt::session::delete_files);
|
m_nativeSession->remove_torrent(p->handle, lt::session::delete_files);
|
||||||
|
|
||||||
emit metadataLoaded(metadata);
|
emit metadataDownloaded(metadata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4761,17 +4737,6 @@ void Session::handleFileErrorAlert(const lt::file_error_alert *p)
|
|||||||
m_recentErroredTorrentsTimer->start();
|
m_recentErroredTorrentsTimer->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (LIBTORRENT_VERSION_NUM < 10208)
|
|
||||||
void Session::handleReadPieceAlert(const lt::read_piece_alert *p) const
|
|
||||||
{
|
|
||||||
if (p->error)
|
|
||||||
{
|
|
||||||
p->handle.unset_flags(lt::torrent_flags::auto_managed);
|
|
||||||
p->handle.force_recheck();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void Session::handlePortmapWarningAlert(const lt::portmap_error_alert *p)
|
void Session::handlePortmapWarningAlert(const lt::portmap_error_alert *p)
|
||||||
{
|
{
|
||||||
LogMsg(tr("UPnP/NAT-PMP: Port mapping failure, message: %1").arg(QString::fromStdString(p->message())), Log::CRITICAL);
|
LogMsg(tr("UPnP/NAT-PMP: Port mapping failure, message: %1").arg(QString::fromStdString(p->message())), Log::CRITICAL);
|
||||||
@@ -4922,11 +4887,14 @@ void Session::handleSessionStatsAlert(const lt::session_stats_alert *p)
|
|||||||
m_status.peersCount = stats[m_metricIndices.peer.numPeersConnected];
|
m_status.peersCount = stats[m_metricIndices.peer.numPeersConnected];
|
||||||
|
|
||||||
const int64_t numBlocksRead = stats[m_metricIndices.disk.numBlocksRead];
|
const int64_t numBlocksRead = stats[m_metricIndices.disk.numBlocksRead];
|
||||||
const int64_t numBlocksCacheHits = stats[m_metricIndices.disk.numBlocksCacheHits];
|
|
||||||
m_cacheStatus.totalUsedBuffers = stats[m_metricIndices.disk.diskBlocksInUse];
|
m_cacheStatus.totalUsedBuffers = stats[m_metricIndices.disk.diskBlocksInUse];
|
||||||
m_cacheStatus.readRatio = static_cast<qreal>(numBlocksCacheHits) / std::max<int64_t>(numBlocksCacheHits + numBlocksRead, 1);
|
|
||||||
m_cacheStatus.jobQueueLength = stats[m_metricIndices.disk.queuedDiskJobs];
|
m_cacheStatus.jobQueueLength = stats[m_metricIndices.disk.queuedDiskJobs];
|
||||||
|
|
||||||
|
#if (LIBTORRENT_VERSION_NUM < 20000)
|
||||||
|
const int64_t numBlocksCacheHits = stats[m_metricIndices.disk.numBlocksCacheHits];
|
||||||
|
m_cacheStatus.readRatio = static_cast<qreal>(numBlocksCacheHits) / std::max<int64_t>((numBlocksCacheHits + numBlocksRead), 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
const int64_t totalJobs = stats[m_metricIndices.disk.writeJobs] + stats[m_metricIndices.disk.readJobs]
|
const int64_t totalJobs = stats[m_metricIndices.disk.writeJobs] + stats[m_metricIndices.disk.readJobs]
|
||||||
+ stats[m_metricIndices.disk.hashJobs];
|
+ stats[m_metricIndices.disk.hashJobs];
|
||||||
m_cacheStatus.averageJobTime = (totalJobs > 0)
|
m_cacheStatus.averageJobTime = (totalJobs > 0)
|
||||||
@@ -5013,7 +4981,6 @@ void Session::handleStateUpdateAlert(const lt::state_update_alert *p)
|
|||||||
enqueueRefresh();
|
enqueueRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (LIBTORRENT_VERSION_NUM >= 10204)
|
|
||||||
void Session::handleSocks5Alert(const lt::socks5_alert *p) const
|
void Session::handleSocks5Alert(const lt::socks5_alert *p) const
|
||||||
{
|
{
|
||||||
if (p->error)
|
if (p->error)
|
||||||
@@ -5022,4 +4989,3 @@ void Session::handleSocks5Alert(const lt::socks5_alert *p) const
|
|||||||
, Log::WARNING);
|
, Log::WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BITTORRENT_SESSION_H
|
#pragma once
|
||||||
#define BITTORRENT_SESSION_H
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -41,6 +40,7 @@
|
|||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
|
#include <QtContainerFwd>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
#include "base/settingvalue.h"
|
#include "base/settingvalue.h"
|
||||||
@@ -50,20 +50,24 @@
|
|||||||
#include "sessionstatus.h"
|
#include "sessionstatus.h"
|
||||||
#include "torrentinfo.h"
|
#include "torrentinfo.h"
|
||||||
|
|
||||||
#if ((LIBTORRENT_VERSION_NUM >= 10206) && !defined(Q_OS_WIN))
|
#if !defined(Q_OS_WIN) || (LIBTORRENT_VERSION_NUM >= 10212)
|
||||||
#define HAS_HTTPS_TRACKER_VALIDATION
|
#define HAS_HTTPS_TRACKER_VALIDATION
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ((LIBTORRENT_VERSION_NUM >= 10212) && (LIBTORRENT_VERSION_NUM < 20000)) || (LIBTORRENT_VERSION_NUM >= 20002)
|
||||||
|
#define HAS_IDN_SUPPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
class QFile;
|
class QFile;
|
||||||
class QNetworkConfiguration;
|
class QNetworkConfiguration;
|
||||||
class QNetworkConfigurationManager;
|
class QNetworkConfigurationManager;
|
||||||
class QString;
|
class QString;
|
||||||
class QStringList;
|
|
||||||
class QThread;
|
class QThread;
|
||||||
class QTimer;
|
class QTimer;
|
||||||
class QUrl;
|
class QUrl;
|
||||||
|
|
||||||
class BandwidthScheduler;
|
class BandwidthScheduler;
|
||||||
|
class FileSearcher;
|
||||||
class FilterParserThread;
|
class FilterParserThread;
|
||||||
class ResumeDataSavingManager;
|
class ResumeDataSavingManager;
|
||||||
class Statistics;
|
class Statistics;
|
||||||
@@ -110,7 +114,7 @@ namespace BitTorrent
|
|||||||
// Using `Q_ENUM_NS()` without a wrapper namespace in our case is not advised
|
// Using `Q_ENUM_NS()` without a wrapper namespace in our case is not advised
|
||||||
// since `Q_NAMESPACE` cannot be used when the same namespace resides at different files.
|
// since `Q_NAMESPACE` cannot be used when the same namespace resides at different files.
|
||||||
// https://www.kdab.com/new-qt-5-8-meta-object-support-namespaces/#comment-143779
|
// https://www.kdab.com/new-qt-5-8-meta-object-support-namespaces/#comment-143779
|
||||||
namespace SessionSettingsEnums
|
inline namespace SessionSettingsEnums
|
||||||
{
|
{
|
||||||
Q_NAMESPACE
|
Q_NAMESPACE
|
||||||
|
|
||||||
@@ -156,49 +160,50 @@ namespace BitTorrent
|
|||||||
Q_ENUM_NS(OSMemoryPriority)
|
Q_ENUM_NS(OSMemoryPriority)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
using namespace SessionSettingsEnums;
|
|
||||||
|
|
||||||
struct SessionMetricIndices
|
struct SessionMetricIndices
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int hasIncomingConnections = 0;
|
int hasIncomingConnections = -1;
|
||||||
int sentPayloadBytes = 0;
|
int sentPayloadBytes = -1;
|
||||||
int recvPayloadBytes = 0;
|
int recvPayloadBytes = -1;
|
||||||
int sentBytes = 0;
|
int sentBytes = -1;
|
||||||
int recvBytes = 0;
|
int recvBytes = -1;
|
||||||
int sentIPOverheadBytes = 0;
|
int sentIPOverheadBytes = -1;
|
||||||
int recvIPOverheadBytes = 0;
|
int recvIPOverheadBytes = -1;
|
||||||
int sentTrackerBytes = 0;
|
int sentTrackerBytes = -1;
|
||||||
int recvTrackerBytes = 0;
|
int recvTrackerBytes = -1;
|
||||||
int recvRedundantBytes = 0;
|
int recvRedundantBytes = -1;
|
||||||
int recvFailedBytes = 0;
|
int recvFailedBytes = -1;
|
||||||
} net;
|
} net;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int numPeersConnected = 0;
|
int numPeersConnected = -1;
|
||||||
int numPeersUpDisk = 0;
|
int numPeersUpDisk = -1;
|
||||||
int numPeersDownDisk = 0;
|
int numPeersDownDisk = -1;
|
||||||
} peer;
|
} peer;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int dhtBytesIn = 0;
|
int dhtBytesIn = -1;
|
||||||
int dhtBytesOut = 0;
|
int dhtBytesOut = -1;
|
||||||
int dhtNodes = 0;
|
int dhtNodes = -1;
|
||||||
} dht;
|
} dht;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int diskBlocksInUse = 0;
|
int diskBlocksInUse = -1;
|
||||||
int numBlocksRead = 0;
|
int numBlocksRead = -1;
|
||||||
int numBlocksCacheHits = 0;
|
#if (LIBTORRENT_VERSION_NUM < 20000)
|
||||||
int writeJobs = 0;
|
int numBlocksCacheHits = -1;
|
||||||
int readJobs = 0;
|
#endif
|
||||||
int hashJobs = 0;
|
int writeJobs = -1;
|
||||||
int queuedDiskJobs = 0;
|
int readJobs = -1;
|
||||||
int diskJobTime = 0;
|
int hashJobs = -1;
|
||||||
|
int queuedDiskJobs = -1;
|
||||||
|
int diskJobTime = -1;
|
||||||
} disk;
|
} disk;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -270,8 +275,8 @@ namespace BitTorrent
|
|||||||
void setPeXEnabled(bool enabled);
|
void setPeXEnabled(bool enabled);
|
||||||
bool isAddTorrentPaused() const;
|
bool isAddTorrentPaused() const;
|
||||||
void setAddTorrentPaused(bool value);
|
void setAddTorrentPaused(bool value);
|
||||||
bool isKeepTorrentTopLevelFolder() const;
|
TorrentContentLayout torrentContentLayout() const;
|
||||||
void setKeepTorrentTopLevelFolder(bool value);
|
void setTorrentContentLayout(TorrentContentLayout value);
|
||||||
bool isTrackerEnabled() const;
|
bool isTrackerEnabled() const;
|
||||||
void setTrackerEnabled(bool enabled);
|
void setTrackerEnabled(bool enabled);
|
||||||
bool isAppendExtensionEnabled() const;
|
bool isAppendExtensionEnabled() const;
|
||||||
@@ -416,6 +421,8 @@ namespace BitTorrent
|
|||||||
void setUTPRateLimited(bool limited);
|
void setUTPRateLimited(bool limited);
|
||||||
MixedModeAlgorithm utpMixedMode() const;
|
MixedModeAlgorithm utpMixedMode() const;
|
||||||
void setUtpMixedMode(MixedModeAlgorithm mode);
|
void setUtpMixedMode(MixedModeAlgorithm mode);
|
||||||
|
bool isIDNSupportEnabled() const;
|
||||||
|
void setIDNSupportEnabled(bool enabled);
|
||||||
bool multiConnectionsPerIpEnabled() const;
|
bool multiConnectionsPerIpEnabled() const;
|
||||||
void setMultiConnectionsPerIpEnabled(bool enabled);
|
void setMultiConnectionsPerIpEnabled(bool enabled);
|
||||||
bool validateHTTPSTrackerCertificate() const;
|
bool validateHTTPSTrackerCertificate() const;
|
||||||
@@ -453,8 +460,8 @@ namespace BitTorrent
|
|||||||
bool addTorrent(const MagnetUri &magnetUri, const AddTorrentParams ¶ms = AddTorrentParams());
|
bool addTorrent(const MagnetUri &magnetUri, const AddTorrentParams ¶ms = AddTorrentParams());
|
||||||
bool addTorrent(const TorrentInfo &torrentInfo, const AddTorrentParams ¶ms = AddTorrentParams());
|
bool addTorrent(const TorrentInfo &torrentInfo, const AddTorrentParams ¶ms = AddTorrentParams());
|
||||||
bool deleteTorrent(const InfoHash &hash, DeleteOption deleteOption = Torrent);
|
bool deleteTorrent(const InfoHash &hash, DeleteOption deleteOption = Torrent);
|
||||||
bool loadMetadata(const MagnetUri &magnetUri);
|
bool downloadMetadata(const MagnetUri &magnetUri);
|
||||||
bool cancelLoadMetadata(const InfoHash &hash);
|
bool cancelDownloadMetadata(const InfoHash &hash);
|
||||||
|
|
||||||
void recursiveTorrentDownload(const InfoHash &hash);
|
void recursiveTorrentDownload(const InfoHash &hash);
|
||||||
void increaseTorrentsQueuePos(const QVector<InfoHash> &hashes);
|
void increaseTorrentsQueuePos(const QVector<InfoHash> &hashes);
|
||||||
@@ -488,6 +495,8 @@ namespace BitTorrent
|
|||||||
|
|
||||||
bool addMoveTorrentStorageJob(TorrentHandleImpl *torrent, const QString &newPath, MoveStorageMode mode);
|
bool addMoveTorrentStorageJob(TorrentHandleImpl *torrent, const QString &newPath, MoveStorageMode mode);
|
||||||
|
|
||||||
|
void findIncompleteFiles(const TorrentInfo &torrentInfo, const QString &savePath) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void allTorrentsFinished();
|
void allTorrentsFinished();
|
||||||
void categoryAdded(const QString &categoryName);
|
void categoryAdded(const QString &categoryName);
|
||||||
@@ -497,7 +506,7 @@ namespace BitTorrent
|
|||||||
void fullDiskError(TorrentHandle *torrent, const QString &msg);
|
void fullDiskError(TorrentHandle *torrent, const QString &msg);
|
||||||
void IPFilterParsed(bool error, int ruleCount);
|
void IPFilterParsed(bool error, int ruleCount);
|
||||||
void loadTorrentFailed(const QString &error);
|
void loadTorrentFailed(const QString &error);
|
||||||
void metadataLoaded(const TorrentInfo &info);
|
void metadataDownloaded(const TorrentInfo &info);
|
||||||
void recursiveTorrentDownloadPossible(TorrentHandle *torrent);
|
void recursiveTorrentDownloadPossible(TorrentHandle *torrent);
|
||||||
void speedLimitModeChanged(bool alternative);
|
void speedLimitModeChanged(bool alternative);
|
||||||
void statsUpdated();
|
void statsUpdated();
|
||||||
@@ -510,7 +519,7 @@ namespace BitTorrent
|
|||||||
void torrentFinished(TorrentHandle *torrent);
|
void torrentFinished(TorrentHandle *torrent);
|
||||||
void torrentFinishedChecking(TorrentHandle *torrent);
|
void torrentFinishedChecking(TorrentHandle *torrent);
|
||||||
void torrentLoaded(TorrentHandle *torrent);
|
void torrentLoaded(TorrentHandle *torrent);
|
||||||
void torrentMetadataLoaded(TorrentHandle *torrent);
|
void torrentMetadataReceived(TorrentHandle *torrent);
|
||||||
void torrentPaused(TorrentHandle *torrent);
|
void torrentPaused(TorrentHandle *torrent);
|
||||||
void torrentResumed(TorrentHandle *torrent);
|
void torrentResumed(TorrentHandle *torrent);
|
||||||
void torrentSavePathChanged(TorrentHandle *torrent);
|
void torrentSavePathChanged(TorrentHandle *torrent);
|
||||||
@@ -537,6 +546,7 @@ namespace BitTorrent
|
|||||||
void handleIPFilterParsed(int ruleCount);
|
void handleIPFilterParsed(int ruleCount);
|
||||||
void handleIPFilterError();
|
void handleIPFilterError();
|
||||||
void handleDownloadFinished(const Net::DownloadResult &result);
|
void handleDownloadFinished(const Net::DownloadResult &result);
|
||||||
|
void fileSearchFinished(const InfoHash &id, const QString &savePath, const QStringList &fileNames);
|
||||||
|
|
||||||
// Session reconfiguration triggers
|
// Session reconfiguration triggers
|
||||||
void networkOnlineStateChanged(bool online);
|
void networkOnlineStateChanged(bool online);
|
||||||
@@ -593,7 +603,6 @@ namespace BitTorrent
|
|||||||
bool loadTorrent(LoadTorrentParams params);
|
bool loadTorrent(LoadTorrentParams params);
|
||||||
LoadTorrentParams initLoadTorrentParams(const AddTorrentParams &addTorrentParams);
|
LoadTorrentParams initLoadTorrentParams(const AddTorrentParams &addTorrentParams);
|
||||||
bool addTorrent_impl(const AddTorrentParams &addTorrentParams, const MagnetUri &magnetUri, TorrentInfo torrentInfo = TorrentInfo());
|
bool addTorrent_impl(const AddTorrentParams &addTorrentParams, const MagnetUri &magnetUri, TorrentInfo torrentInfo = TorrentInfo());
|
||||||
bool findIncompleteFiles(TorrentInfo &torrentInfo, QString &savePath) const;
|
|
||||||
|
|
||||||
void updateSeedingLimitTimer();
|
void updateSeedingLimitTimer();
|
||||||
void exportTorrentFile(const TorrentHandle *torrent, TorrentExportFolder folder = TorrentExportFolder::Regular);
|
void exportTorrentFile(const TorrentHandle *torrent, TorrentExportFolder folder = TorrentExportFolder::Regular);
|
||||||
@@ -604,9 +613,6 @@ namespace BitTorrent
|
|||||||
void handleStateUpdateAlert(const lt::state_update_alert *p);
|
void handleStateUpdateAlert(const lt::state_update_alert *p);
|
||||||
void handleMetadataReceivedAlert(const lt::metadata_received_alert *p);
|
void handleMetadataReceivedAlert(const lt::metadata_received_alert *p);
|
||||||
void handleFileErrorAlert(const lt::file_error_alert *p);
|
void handleFileErrorAlert(const lt::file_error_alert *p);
|
||||||
#if (LIBTORRENT_VERSION_NUM < 10208)
|
|
||||||
void handleReadPieceAlert(const lt::read_piece_alert *p) const;
|
|
||||||
#endif
|
|
||||||
void handleTorrentRemovedAlert(const lt::torrent_removed_alert *p);
|
void handleTorrentRemovedAlert(const lt::torrent_removed_alert *p);
|
||||||
void handleTorrentDeletedAlert(const lt::torrent_deleted_alert *p);
|
void handleTorrentDeletedAlert(const lt::torrent_deleted_alert *p);
|
||||||
void handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed_alert *p);
|
void handleTorrentDeleteFailedAlert(const lt::torrent_delete_failed_alert *p);
|
||||||
@@ -622,9 +628,7 @@ namespace BitTorrent
|
|||||||
void handleAlertsDroppedAlert(const lt::alerts_dropped_alert *p) const;
|
void handleAlertsDroppedAlert(const lt::alerts_dropped_alert *p) const;
|
||||||
void handleStorageMovedAlert(const lt::storage_moved_alert *p);
|
void handleStorageMovedAlert(const lt::storage_moved_alert *p);
|
||||||
void handleStorageMovedFailedAlert(const lt::storage_moved_failed_alert *p);
|
void handleStorageMovedFailedAlert(const lt::storage_moved_failed_alert *p);
|
||||||
#if (LIBTORRENT_VERSION_NUM >= 10204)
|
|
||||||
void handleSocks5Alert(const lt::socks5_alert *p) const;
|
void handleSocks5Alert(const lt::socks5_alert *p) const;
|
||||||
#endif
|
|
||||||
|
|
||||||
void createTorrentHandle(const lt::torrent_handle &nativeHandle);
|
void createTorrentHandle(const lt::torrent_handle &nativeHandle);
|
||||||
|
|
||||||
@@ -690,6 +694,7 @@ namespace BitTorrent
|
|||||||
CachedSettingValue<BTProtocol> m_btProtocol;
|
CachedSettingValue<BTProtocol> m_btProtocol;
|
||||||
CachedSettingValue<bool> m_isUTPRateLimited;
|
CachedSettingValue<bool> m_isUTPRateLimited;
|
||||||
CachedSettingValue<MixedModeAlgorithm> m_utpMixedMode;
|
CachedSettingValue<MixedModeAlgorithm> m_utpMixedMode;
|
||||||
|
CachedSettingValue<bool> m_IDNSupportEnabled;
|
||||||
CachedSettingValue<bool> m_multiConnectionsPerIpEnabled;
|
CachedSettingValue<bool> m_multiConnectionsPerIpEnabled;
|
||||||
CachedSettingValue<bool> m_validateHTTPSTrackerCertificate;
|
CachedSettingValue<bool> m_validateHTTPSTrackerCertificate;
|
||||||
CachedSettingValue<bool> m_blockPeersOnPrivilegedPorts;
|
CachedSettingValue<bool> m_blockPeersOnPrivilegedPorts;
|
||||||
@@ -698,7 +703,7 @@ namespace BitTorrent
|
|||||||
CachedSettingValue<qreal> m_globalMaxRatio;
|
CachedSettingValue<qreal> m_globalMaxRatio;
|
||||||
CachedSettingValue<int> m_globalMaxSeedingMinutes;
|
CachedSettingValue<int> m_globalMaxSeedingMinutes;
|
||||||
CachedSettingValue<bool> m_isAddTorrentPaused;
|
CachedSettingValue<bool> m_isAddTorrentPaused;
|
||||||
CachedSettingValue<bool> m_isKeepTorrentTopLevelFolder;
|
CachedSettingValue<TorrentContentLayout> m_torrentContentLayout;
|
||||||
CachedSettingValue<bool> m_isAppendExtensionEnabled;
|
CachedSettingValue<bool> m_isAppendExtensionEnabled;
|
||||||
CachedSettingValue<int> m_refreshInterval;
|
CachedSettingValue<int> m_refreshInterval;
|
||||||
CachedSettingValue<bool> m_isPreallocationEnabled;
|
CachedSettingValue<bool> m_isPreallocationEnabled;
|
||||||
@@ -763,8 +768,9 @@ namespace BitTorrent
|
|||||||
// fastresume data writing thread
|
// fastresume data writing thread
|
||||||
QThread *m_ioThread = nullptr;
|
QThread *m_ioThread = nullptr;
|
||||||
ResumeDataSavingManager *m_resumeDataSavingManager = nullptr;
|
ResumeDataSavingManager *m_resumeDataSavingManager = nullptr;
|
||||||
|
FileSearcher *m_fileSearcher = nullptr;
|
||||||
|
|
||||||
QSet<InfoHash> m_loadedMetadata;
|
QSet<InfoHash> m_downloadedMetadata;
|
||||||
|
|
||||||
QHash<InfoHash, TorrentHandleImpl *> m_torrents;
|
QHash<InfoHash, TorrentHandleImpl *> m_torrents;
|
||||||
QHash<InfoHash, LoadTorrentParams> m_loadingTorrents;
|
QHash<InfoHash, LoadTorrentParams> m_loadingTorrents;
|
||||||
@@ -795,5 +801,3 @@ namespace BitTorrent
|
|||||||
Q_DECLARE_METATYPE(std::shared_ptr<lt::entry>)
|
Q_DECLARE_METATYPE(std::shared_ptr<lt::entry>)
|
||||||
const int sharedPtrLtEntryTypeID = qRegisterMetaType<std::shared_ptr<lt::entry>>();
|
const int sharedPtrLtEntryTypeID = qRegisterMetaType<std::shared_ptr<lt::entry>>();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // BITTORRENT_SESSION_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BITTORRENT_SESSIONSTATUS_H
|
#pragma once
|
||||||
#define BITTORRENT_SESSIONSTATUS_H
|
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
@@ -74,5 +73,3 @@ namespace BitTorrent
|
|||||||
quint64 peersCount = 0;
|
quint64 peersCount = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BITTORRENT_SESSIONSTATUS_H
|
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SPEEDMONITOR_H
|
#pragma once
|
||||||
#define SPEEDMONITOR_H
|
|
||||||
|
|
||||||
#ifndef Q_MOC_RUN
|
#ifndef Q_MOC_RUN
|
||||||
#include <boost/circular_buffer.hpp>
|
#include <boost/circular_buffer.hpp>
|
||||||
@@ -86,5 +85,3 @@ private:
|
|||||||
boost::circular_buffer<SpeedSample> m_speedSamples;
|
boost::circular_buffer<SpeedSample> m_speedSamples;
|
||||||
SpeedSample m_sum;
|
SpeedSample m_sum;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SPEEDMONITOR_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STATISTICS_H
|
#pragma once
|
||||||
#define STATISTICS_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@@ -67,5 +66,3 @@ private:
|
|||||||
|
|
||||||
QTimer m_timer;
|
QTimer m_timer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // STATISTICS_H
|
|
||||||
|
|||||||
51
src/base/bittorrent/torrentcontentlayout.h
Normal file
51
src/base/bittorrent/torrentcontentlayout.h
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* Bittorrent Client using Qt and libtorrent.
|
||||||
|
* Copyright (C) 2020 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 <QMetaEnum>
|
||||||
|
|
||||||
|
namespace BitTorrent
|
||||||
|
{
|
||||||
|
// Using `Q_ENUM_NS()` without a wrapper namespace in our case is not advised
|
||||||
|
// since `Q_NAMESPACE` cannot be used when the same namespace resides at different files.
|
||||||
|
// https://www.kdab.com/new-qt-5-8-meta-object-support-namespaces/#comment-143779
|
||||||
|
inline namespace TorrentContentLayoutNS
|
||||||
|
{
|
||||||
|
Q_NAMESPACE
|
||||||
|
|
||||||
|
enum class TorrentContentLayout
|
||||||
|
{
|
||||||
|
Original,
|
||||||
|
Subfolder,
|
||||||
|
NoSubfolder
|
||||||
|
};
|
||||||
|
|
||||||
|
Q_ENUM_NS(TorrentContentLayout)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BITTORRENT_TORRENTCREATORTHREAD_H
|
#pragma once
|
||||||
#define BITTORRENT_TORRENTCREATORTHREAD_H
|
|
||||||
|
|
||||||
#include <libtorrent/version.hpp>
|
#include <libtorrent/version.hpp>
|
||||||
|
|
||||||
@@ -94,5 +93,3 @@ namespace BitTorrent
|
|||||||
TorrentCreatorParams m_params;
|
TorrentCreatorParams m_params;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BITTORRENT_TORRENTCREATORTHREAD_H
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
#include <QHash>
|
||||||
|
|
||||||
namespace BitTorrent
|
namespace BitTorrent
|
||||||
{
|
{
|
||||||
uint qHash(const TorrentState key, const uint seed)
|
uint qHash(const TorrentState key, const uint seed)
|
||||||
|
|||||||
@@ -29,15 +29,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QHash>
|
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QSet>
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVector>
|
#include <QtContainerFwd>
|
||||||
|
|
||||||
class QBitArray;
|
class QBitArray;
|
||||||
class QDateTime;
|
class QDateTime;
|
||||||
class QStringList;
|
|
||||||
class QUrl;
|
class QUrl;
|
||||||
|
|
||||||
namespace BitTorrent
|
namespace BitTorrent
|
||||||
@@ -180,8 +177,6 @@ namespace BitTorrent
|
|||||||
virtual bool removeTag(const QString &tag) = 0;
|
virtual bool removeTag(const QString &tag) = 0;
|
||||||
virtual void removeAllTags() = 0;
|
virtual void removeAllTags() = 0;
|
||||||
|
|
||||||
virtual bool hasRootFolder() const = 0;
|
|
||||||
|
|
||||||
virtual int filesCount() const = 0;
|
virtual int filesCount() const = 0;
|
||||||
virtual int piecesCount() const = 0;
|
virtual int piecesCount() const = 0;
|
||||||
virtual int piecesHave() const = 0;
|
virtual int piecesHave() const = 0;
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
#include <libtorrent/alert_types.hpp>
|
#include <libtorrent/alert_types.hpp>
|
||||||
#include <libtorrent/entry.hpp>
|
#include <libtorrent/entry.hpp>
|
||||||
#include <libtorrent/magnet_uri.hpp>
|
#include <libtorrent/magnet_uri.hpp>
|
||||||
|
#include <libtorrent/session.hpp>
|
||||||
#include <libtorrent/storage_defs.hpp>
|
#include <libtorrent/storage_defs.hpp>
|
||||||
#include <libtorrent/time.hpp>
|
#include <libtorrent/time.hpp>
|
||||||
#include <libtorrent/version.hpp>
|
#include <libtorrent/version.hpp>
|
||||||
@@ -101,10 +102,11 @@ namespace
|
|||||||
|
|
||||||
// TorrentHandleImpl
|
// TorrentHandleImpl
|
||||||
|
|
||||||
TorrentHandleImpl::TorrentHandleImpl(Session *session, const lt::torrent_handle &nativeHandle,
|
TorrentHandleImpl::TorrentHandleImpl(Session *session, lt::session *nativeSession
|
||||||
const LoadTorrentParams ¶ms)
|
, const lt::torrent_handle &nativeHandle, const LoadTorrentParams ¶ms)
|
||||||
: QObject(session)
|
: QObject(session)
|
||||||
, m_session(session)
|
, m_session(session)
|
||||||
|
, m_nativeSession(nativeSession)
|
||||||
, m_nativeHandle(nativeHandle)
|
, m_nativeHandle(nativeHandle)
|
||||||
, m_name(params.name)
|
, m_name(params.name)
|
||||||
, m_savePath(Utils::Fs::toNativePath(params.savePath))
|
, m_savePath(Utils::Fs::toNativePath(params.savePath))
|
||||||
@@ -113,8 +115,8 @@ TorrentHandleImpl::TorrentHandleImpl(Session *session, const lt::torrent_handle
|
|||||||
, m_ratioLimit(params.ratioLimit)
|
, m_ratioLimit(params.ratioLimit)
|
||||||
, m_seedingTimeLimit(params.seedingTimeLimit)
|
, m_seedingTimeLimit(params.seedingTimeLimit)
|
||||||
, m_operatingMode(params.forced ? TorrentOperatingMode::Forced : TorrentOperatingMode::AutoManaged)
|
, m_operatingMode(params.forced ? TorrentOperatingMode::Forced : TorrentOperatingMode::AutoManaged)
|
||||||
|
, m_contentLayout(params.contentLayout)
|
||||||
, m_hasSeedStatus(params.hasSeedStatus)
|
, m_hasSeedStatus(params.hasSeedStatus)
|
||||||
, m_hasRootFolder(params.hasRootFolder)
|
|
||||||
, m_hasFirstLastPiecePriority(params.firstLastPiecePriority)
|
, m_hasFirstLastPiecePriority(params.firstLastPiecePriority)
|
||||||
, m_useAutoTMM(params.savePath.isEmpty())
|
, m_useAutoTMM(params.savePath.isEmpty())
|
||||||
, m_isStopped(params.paused)
|
, m_isStopped(params.paused)
|
||||||
@@ -123,20 +125,19 @@ TorrentHandleImpl::TorrentHandleImpl(Session *session, const lt::torrent_handle
|
|||||||
if (m_useAutoTMM)
|
if (m_useAutoTMM)
|
||||||
m_savePath = Utils::Fs::toNativePath(m_session->categorySavePath(m_category));
|
m_savePath = Utils::Fs::toNativePath(m_session->categorySavePath(m_category));
|
||||||
|
|
||||||
|
m_hash = InfoHash {m_nativeHandle.info_hash()};
|
||||||
|
if (m_ltAddTorrentParams.ti)
|
||||||
|
{
|
||||||
|
// Initialize it only if torrent is added with metadata.
|
||||||
|
// Otherwise it should be initialized in "Metadata received" handler.
|
||||||
|
m_torrentInfo = TorrentInfo {m_nativeHandle.torrent_file()};
|
||||||
|
}
|
||||||
|
|
||||||
updateStatus();
|
updateStatus();
|
||||||
m_hash = InfoHash(m_nativeStatus.info_hash);
|
|
||||||
|
|
||||||
if (hasMetadata())
|
if (hasMetadata())
|
||||||
{
|
|
||||||
applyFirstLastPiecePriority(m_hasFirstLastPiecePriority);
|
applyFirstLastPiecePriority(m_hasFirstLastPiecePriority);
|
||||||
|
|
||||||
if (!params.restored)
|
|
||||||
{
|
|
||||||
if (filesCount() == 1)
|
|
||||||
m_hasRootFolder = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Remove the following upgrade code in v.4.4
|
// TODO: Remove the following upgrade code in v.4.4
|
||||||
// == BEGIN UPGRADE CODE ==
|
// == BEGIN UPGRADE CODE ==
|
||||||
const QString spath = actualStorageLocation();
|
const QString spath = actualStorageLocation();
|
||||||
@@ -176,17 +177,15 @@ InfoHash TorrentHandleImpl::hash() const
|
|||||||
|
|
||||||
QString TorrentHandleImpl::name() const
|
QString TorrentHandleImpl::name() const
|
||||||
{
|
{
|
||||||
QString name = m_name;
|
if (!m_name.isEmpty())
|
||||||
if (!name.isEmpty()) return name;
|
return m_name;
|
||||||
|
|
||||||
name = QString::fromStdString(m_nativeStatus.name);
|
|
||||||
if (!name.isEmpty()) return name;
|
|
||||||
|
|
||||||
if (hasMetadata())
|
if (hasMetadata())
|
||||||
{
|
return m_torrentInfo.name();
|
||||||
name = QString::fromStdString(m_torrentInfo.nativeInfo()->orig_files().name());
|
|
||||||
if (!name.isEmpty()) return name;
|
const QString name = QString::fromStdString(m_nativeStatus.name);
|
||||||
}
|
if (!name.isEmpty())
|
||||||
|
return name;
|
||||||
|
|
||||||
return m_hash;
|
return m_hash;
|
||||||
}
|
}
|
||||||
@@ -252,7 +251,7 @@ QString TorrentHandleImpl::savePath(bool actual) const
|
|||||||
|
|
||||||
QString TorrentHandleImpl::rootPath(bool actual) const
|
QString TorrentHandleImpl::rootPath(bool actual) const
|
||||||
{
|
{
|
||||||
if ((filesCount() > 1) && !hasRootFolder())
|
if (!hasMetadata())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
const QString firstFilePath = filePath(0);
|
const QString firstFilePath = filePath(0);
|
||||||
@@ -265,10 +264,13 @@ QString TorrentHandleImpl::rootPath(bool actual) const
|
|||||||
|
|
||||||
QString TorrentHandleImpl::contentPath(const bool actual) const
|
QString TorrentHandleImpl::contentPath(const bool actual) const
|
||||||
{
|
{
|
||||||
|
if (!hasMetadata())
|
||||||
|
return {};
|
||||||
|
|
||||||
if (filesCount() == 1)
|
if (filesCount() == 1)
|
||||||
return QDir(savePath(actual)).absoluteFilePath(filePath(0));
|
return QDir(savePath(actual)).absoluteFilePath(filePath(0));
|
||||||
|
|
||||||
if (hasRootFolder())
|
if (m_torrentInfo.hasRootFolder())
|
||||||
return rootPath(actual);
|
return rootPath(actual);
|
||||||
|
|
||||||
return savePath(actual);
|
return savePath(actual);
|
||||||
@@ -290,11 +292,6 @@ void TorrentHandleImpl::setAutoTMMEnabled(bool enabled)
|
|||||||
move_impl(m_session->categorySavePath(m_category), MoveStorageMode::Overwrite);
|
move_impl(m_session->categorySavePath(m_category), MoveStorageMode::Overwrite);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TorrentHandleImpl::hasRootFolder() const
|
|
||||||
{
|
|
||||||
return m_hasRootFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString TorrentHandleImpl::actualStorageLocation() const
|
QString TorrentHandleImpl::actualStorageLocation() const
|
||||||
{
|
{
|
||||||
return QString::fromStdString(m_nativeStatus.save_path);
|
return QString::fromStdString(m_nativeStatus.save_path);
|
||||||
@@ -445,9 +442,7 @@ void TorrentHandleImpl::removeUrlSeeds(const QVector<QUrl> &urlSeeds)
|
|||||||
|
|
||||||
void TorrentHandleImpl::clearPeers()
|
void TorrentHandleImpl::clearPeers()
|
||||||
{
|
{
|
||||||
#if (LIBTORRENT_VERSION_NUM >= 10207)
|
|
||||||
m_nativeHandle.clear_peers();
|
m_nativeHandle.clear_peers();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TorrentHandleImpl::connectPeer(const PeerAddress &peerAddress)
|
bool TorrentHandleImpl::connectPeer(const PeerAddress &peerAddress)
|
||||||
@@ -646,7 +641,9 @@ bool TorrentHandleImpl::isPaused() const
|
|||||||
bool TorrentHandleImpl::isQueued() const
|
bool TorrentHandleImpl::isQueued() const
|
||||||
{
|
{
|
||||||
// Torrent is Queued if it isn't in Paused state but paused internally
|
// Torrent is Queued if it isn't in Paused state but paused internally
|
||||||
return ((m_nativeStatus.flags & lt::torrent_flags::paused) && !isPaused());
|
return (!isPaused()
|
||||||
|
&& (m_nativeStatus.flags & lt::torrent_flags::auto_managed)
|
||||||
|
&& (m_nativeStatus.flags & lt::torrent_flags::paused));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TorrentHandleImpl::isChecking() const
|
bool TorrentHandleImpl::isChecking() const
|
||||||
@@ -753,10 +750,19 @@ void TorrentHandleImpl::updateState()
|
|||||||
{
|
{
|
||||||
m_state = TorrentState::Error;
|
m_state = TorrentState::Error;
|
||||||
}
|
}
|
||||||
|
else if (!hasMetadata())
|
||||||
|
{
|
||||||
|
if (isPaused())
|
||||||
|
m_state = TorrentState::PausedDownloading;
|
||||||
|
else if (m_session->isQueueingSystemEnabled() && isQueued())
|
||||||
|
m_state = TorrentState::QueuedDownloading;
|
||||||
|
else
|
||||||
|
m_state = TorrentState::DownloadingMetadata;
|
||||||
|
}
|
||||||
else if ((m_nativeStatus.state == lt::torrent_status::checking_files)
|
else if ((m_nativeStatus.state == lt::torrent_status::checking_files)
|
||||||
&& (!isPaused() || (m_nativeStatus.flags & lt::torrent_flags::auto_managed)
|
&& (!isPaused() || (m_nativeStatus.flags & lt::torrent_flags::auto_managed)
|
||||||
|| !(m_nativeStatus.flags & lt::torrent_flags::paused)))
|
|| !(m_nativeStatus.flags & lt::torrent_flags::paused)))
|
||||||
{
|
{
|
||||||
// If the torrent is not just in the "checking" state, but is being actually checked
|
// If the torrent is not just in the "checking" state, but is being actually checked
|
||||||
m_state = m_hasSeedStatus ? TorrentState::CheckingUploading : TorrentState::CheckingDownloading;
|
m_state = m_hasSeedStatus ? TorrentState::CheckingUploading : TorrentState::CheckingDownloading;
|
||||||
}
|
}
|
||||||
@@ -777,8 +783,6 @@ void TorrentHandleImpl::updateState()
|
|||||||
{
|
{
|
||||||
if (isPaused())
|
if (isPaused())
|
||||||
m_state = TorrentState::PausedDownloading;
|
m_state = TorrentState::PausedDownloading;
|
||||||
else if (m_nativeStatus.state == lt::torrent_status::downloading_metadata)
|
|
||||||
m_state = TorrentState::DownloadingMetadata;
|
|
||||||
else if (m_session->isQueueingSystemEnabled() && isQueued())
|
else if (m_session->isQueueingSystemEnabled() && isQueued())
|
||||||
m_state = TorrentState::QueuedDownloading;
|
m_state = TorrentState::QueuedDownloading;
|
||||||
else if (isForced())
|
else if (isForced())
|
||||||
@@ -792,7 +796,7 @@ void TorrentHandleImpl::updateState()
|
|||||||
|
|
||||||
bool TorrentHandleImpl::hasMetadata() const
|
bool TorrentHandleImpl::hasMetadata() const
|
||||||
{
|
{
|
||||||
return m_nativeStatus.has_metadata;
|
return m_torrentInfo.isValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TorrentHandleImpl::hasMissingFiles() const
|
bool TorrentHandleImpl::hasMissingFiles() const
|
||||||
@@ -894,6 +898,9 @@ qlonglong TorrentHandleImpl::eta() const
|
|||||||
|
|
||||||
QVector<qreal> TorrentHandleImpl::filesProgress() const
|
QVector<qreal> TorrentHandleImpl::filesProgress() const
|
||||||
{
|
{
|
||||||
|
if (!hasMetadata())
|
||||||
|
return {};
|
||||||
|
|
||||||
std::vector<int64_t> fp;
|
std::vector<int64_t> fp;
|
||||||
m_nativeHandle.file_progress(fp, lt::torrent_handle::piece_granularity);
|
m_nativeHandle.file_progress(fp, lt::torrent_handle::piece_granularity);
|
||||||
|
|
||||||
@@ -1281,18 +1288,66 @@ void TorrentHandleImpl::applyFirstLastPiecePriority(const bool enabled, const QV
|
|||||||
m_nativeHandle.prioritize_pieces(piecePriorities);
|
m_nativeHandle.prioritize_pieces(piecePriorities);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TorrentHandleImpl::fileSearchFinished(const QString &savePath, const QStringList &fileNames)
|
||||||
|
{
|
||||||
|
endReceivedMetadataHandling(savePath, fileNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TorrentHandleImpl::endReceivedMetadataHandling(const QString &savePath, const QStringList &fileNames)
|
||||||
|
{
|
||||||
|
const auto queuePos = m_nativeHandle.queue_position();
|
||||||
|
|
||||||
|
lt::add_torrent_params p = m_ltAddTorrentParams;
|
||||||
|
p.ti = std::const_pointer_cast<lt::torrent_info>(m_nativeHandle.torrent_file());
|
||||||
|
|
||||||
|
m_nativeSession->remove_torrent(m_nativeHandle, lt::session::delete_partfile);
|
||||||
|
|
||||||
|
for (int i = 0; i < fileNames.size(); ++i)
|
||||||
|
p.renamed_files[lt::file_index_t {i}] = fileNames[i].toStdString();
|
||||||
|
|
||||||
|
p.save_path = Utils::Fs::toNativePath(savePath).toStdString();
|
||||||
|
p.flags |= lt::torrent_flags::update_subscribe
|
||||||
|
| lt::torrent_flags::override_trackers
|
||||||
|
| lt::torrent_flags::override_web_seeds;
|
||||||
|
|
||||||
|
m_nativeHandle = m_nativeSession->add_torrent(p);
|
||||||
|
m_nativeHandle.queue_position_set(queuePos);
|
||||||
|
|
||||||
|
m_torrentInfo = TorrentInfo {m_nativeHandle.torrent_file()};
|
||||||
|
// If first/last piece priority was specified when adding this torrent,
|
||||||
|
// we should apply it now that we have metadata:
|
||||||
|
if (m_hasFirstLastPiecePriority)
|
||||||
|
applyFirstLastPiecePriority(true);
|
||||||
|
|
||||||
|
if (!m_isStopped)
|
||||||
|
{
|
||||||
|
setAutoManaged(m_operatingMode == TorrentOperatingMode::AutoManaged);
|
||||||
|
if (m_operatingMode == TorrentOperatingMode::Forced)
|
||||||
|
m_nativeHandle.resume();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_maintenanceJob = MaintenanceJob::None;
|
||||||
|
|
||||||
|
updateStatus();
|
||||||
|
|
||||||
|
m_session->handleTorrentMetadataReceived(this);
|
||||||
|
}
|
||||||
|
|
||||||
void TorrentHandleImpl::pause()
|
void TorrentHandleImpl::pause()
|
||||||
{
|
{
|
||||||
setAutoManaged(false);
|
|
||||||
m_nativeHandle.pause();
|
|
||||||
|
|
||||||
m_speedMonitor.reset();
|
|
||||||
|
|
||||||
if (!m_isStopped)
|
if (!m_isStopped)
|
||||||
{
|
{
|
||||||
m_isStopped = true;
|
m_isStopped = true;
|
||||||
m_session->handleTorrentPaused(this);
|
m_session->handleTorrentPaused(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_maintenanceJob == MaintenanceJob::None)
|
||||||
|
{
|
||||||
|
setAutoManaged(false);
|
||||||
|
m_nativeHandle.pause();
|
||||||
|
|
||||||
|
m_speedMonitor.reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentHandleImpl::resume(const TorrentOperatingMode mode)
|
void TorrentHandleImpl::resume(const TorrentOperatingMode mode)
|
||||||
@@ -1306,24 +1361,24 @@ void TorrentHandleImpl::resume(const TorrentOperatingMode mode)
|
|||||||
m_nativeHandle.force_recheck();
|
m_nativeHandle.force_recheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_operatingMode = mode;
|
||||||
|
|
||||||
if (m_isStopped)
|
if (m_isStopped)
|
||||||
{
|
{
|
||||||
// Torrent may have been temporarily resumed to perform checking files
|
// Torrent may have been temporarily resumed to perform checking files
|
||||||
// so we have to ensure it will not pause after checking is done.
|
// so we have to ensure it will not pause after checking is done.
|
||||||
m_nativeHandle.unset_flags(lt::torrent_flags::stop_when_ready);
|
m_nativeHandle.unset_flags(lt::torrent_flags::stop_when_ready);
|
||||||
}
|
|
||||||
|
|
||||||
setAutoManaged(mode == TorrentOperatingMode::AutoManaged);
|
|
||||||
if (mode == TorrentOperatingMode::Forced)
|
|
||||||
m_nativeHandle.resume();
|
|
||||||
|
|
||||||
m_operatingMode = mode;
|
|
||||||
|
|
||||||
if (m_isStopped)
|
|
||||||
{
|
|
||||||
m_isStopped = false;
|
m_isStopped = false;
|
||||||
m_session->handleTorrentResumed(this);
|
m_session->handleTorrentResumed(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_maintenanceJob == MaintenanceJob::None)
|
||||||
|
{
|
||||||
|
setAutoManaged(m_operatingMode == TorrentOperatingMode::AutoManaged);
|
||||||
|
if (m_operatingMode == TorrentOperatingMode::Forced)
|
||||||
|
m_nativeHandle.resume();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentHandleImpl::moveStorage(const QString &newPath, const MoveStorageMode mode)
|
void TorrentHandleImpl::moveStorage(const QString &newPath, const MoveStorageMode mode)
|
||||||
@@ -1408,13 +1463,20 @@ void TorrentHandleImpl::handleTrackerErrorAlert(const lt::tracker_error_alert *p
|
|||||||
void TorrentHandleImpl::handleTorrentCheckedAlert(const lt::torrent_checked_alert *p)
|
void TorrentHandleImpl::handleTorrentCheckedAlert(const lt::torrent_checked_alert *p)
|
||||||
{
|
{
|
||||||
Q_UNUSED(p);
|
Q_UNUSED(p);
|
||||||
qDebug("\"%s\" have just finished checking", qUtf8Printable(name()));
|
qDebug("\"%s\" have just finished checking.", qUtf8Printable(name()));
|
||||||
|
|
||||||
|
|
||||||
|
if (!hasMetadata())
|
||||||
|
{
|
||||||
|
// The torrent is checked due to metadata received, but we should not process
|
||||||
|
// this event until the torrent is reloaded using the received metadata.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
saveResumeData();
|
||||||
|
|
||||||
if (m_fastresumeDataRejected && !m_hasMissingFiles)
|
if (m_fastresumeDataRejected && !m_hasMissingFiles)
|
||||||
{
|
|
||||||
saveResumeData();
|
|
||||||
m_fastresumeDataRejected = false;
|
m_fastresumeDataRejected = false;
|
||||||
}
|
|
||||||
|
|
||||||
updateStatus();
|
updateStatus();
|
||||||
|
|
||||||
@@ -1473,13 +1535,18 @@ void TorrentHandleImpl::handleTorrentResumedAlert(const lt::torrent_resumed_aler
|
|||||||
|
|
||||||
void TorrentHandleImpl::handleSaveResumeDataAlert(const lt::save_resume_data_alert *p)
|
void TorrentHandleImpl::handleSaveResumeDataAlert(const lt::save_resume_data_alert *p)
|
||||||
{
|
{
|
||||||
if (p && !m_hasMissingFiles)
|
if (!m_hasMissingFiles)
|
||||||
{
|
{
|
||||||
// Update recent resume data
|
// Update recent resume data
|
||||||
m_ltAddTorrentParams = p->params;
|
m_ltAddTorrentParams = p->params;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_isStopped)
|
if (m_isStopped)
|
||||||
|
{
|
||||||
|
m_ltAddTorrentParams.flags |= lt::torrent_flags::paused;
|
||||||
|
m_ltAddTorrentParams.flags &= ~lt::torrent_flags::auto_managed;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Torrent can be actually "running" but temporarily "paused" to perform some
|
// Torrent can be actually "running" but temporarily "paused" to perform some
|
||||||
// service jobs behind the scenes so we need to restore it as "running"
|
// service jobs behind the scenes so we need to restore it as "running"
|
||||||
@@ -1498,12 +1565,23 @@ void TorrentHandleImpl::handleSaveResumeDataAlert(const lt::save_resume_data_ale
|
|||||||
m_ltAddTorrentParams.save_path = Profile::instance()->toPortablePath(
|
m_ltAddTorrentParams.save_path = Profile::instance()->toPortablePath(
|
||||||
QString::fromStdString(m_ltAddTorrentParams.save_path)).toStdString();
|
QString::fromStdString(m_ltAddTorrentParams.save_path)).toStdString();
|
||||||
|
|
||||||
|
if (m_maintenanceJob == MaintenanceJob::HandleMetadata)
|
||||||
|
{
|
||||||
|
m_ltAddTorrentParams.have_pieces.clear();
|
||||||
|
m_ltAddTorrentParams.verified_pieces.clear();
|
||||||
|
|
||||||
|
TorrentInfo metadata = TorrentInfo {m_nativeHandle.torrent_file()};
|
||||||
|
metadata.setContentLayout(m_contentLayout);
|
||||||
|
|
||||||
|
m_session->findIncompleteFiles(metadata, m_savePath);
|
||||||
|
}
|
||||||
|
|
||||||
auto resumeDataPtr = std::make_shared<lt::entry>(lt::write_resume_data(m_ltAddTorrentParams));
|
auto resumeDataPtr = std::make_shared<lt::entry>(lt::write_resume_data(m_ltAddTorrentParams));
|
||||||
lt::entry &resumeData = *resumeDataPtr;
|
lt::entry &resumeData = *resumeDataPtr;
|
||||||
|
|
||||||
// TODO: The following code is deprecated. Remove after several releases in 4.3.x.
|
// TODO: The following code is deprecated. Remove after several releases in 4.3.x.
|
||||||
// === BEGIN DEPRECATED CODE === //
|
// === BEGIN DEPRECATED CODE === //
|
||||||
const bool useDummyResumeData = !p;
|
const bool useDummyResumeData = !hasMetadata();
|
||||||
if (useDummyResumeData)
|
if (useDummyResumeData)
|
||||||
{
|
{
|
||||||
updateStatus();
|
updateStatus();
|
||||||
@@ -1525,7 +1603,7 @@ void TorrentHandleImpl::handleSaveResumeDataAlert(const lt::save_resume_data_ale
|
|||||||
resumeData["qBt-tags"] = setToEntryList(m_tags);
|
resumeData["qBt-tags"] = setToEntryList(m_tags);
|
||||||
resumeData["qBt-name"] = m_name.toStdString();
|
resumeData["qBt-name"] = m_name.toStdString();
|
||||||
resumeData["qBt-seedStatus"] = m_hasSeedStatus;
|
resumeData["qBt-seedStatus"] = m_hasSeedStatus;
|
||||||
resumeData["qBt-hasRootFolder"] = m_hasRootFolder;
|
resumeData["qBt-contentLayout"] = Utils::String::fromEnum(m_contentLayout).toStdString();
|
||||||
resumeData["qBt-firstLastPiecePriority"] = m_hasFirstLastPiecePriority;
|
resumeData["qBt-firstLastPiecePriority"] = m_hasFirstLastPiecePriority;
|
||||||
|
|
||||||
m_session->handleTorrentResumeDataReady(this, resumeDataPtr);
|
m_session->handleTorrentResumeDataReady(this, resumeDataPtr);
|
||||||
@@ -1534,11 +1612,7 @@ void TorrentHandleImpl::handleSaveResumeDataAlert(const lt::save_resume_data_ale
|
|||||||
void TorrentHandleImpl::handleSaveResumeDataFailedAlert(const lt::save_resume_data_failed_alert *p)
|
void TorrentHandleImpl::handleSaveResumeDataFailedAlert(const lt::save_resume_data_failed_alert *p)
|
||||||
{
|
{
|
||||||
Q_UNUSED(p);
|
Q_UNUSED(p);
|
||||||
|
Q_ASSERT_X(false, Q_FUNC_INFO, "This point should be unreachable since libtorrent 1.2.11");
|
||||||
// if torrent has no metadata libtorrent doesn't generate "fastresume" data
|
|
||||||
// so we should save dummy "fastresume" data containing the values used to
|
|
||||||
// load torrent and qBittorrent own resume data
|
|
||||||
handleSaveResumeDataAlert(nullptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentHandleImpl::handleFastResumeRejectedAlert(const lt::fastresume_rejected_alert *p)
|
void TorrentHandleImpl::handleFastResumeRejectedAlert(const lt::fastresume_rejected_alert *p)
|
||||||
@@ -1560,12 +1634,8 @@ void TorrentHandleImpl::handleFastResumeRejectedAlert(const lt::fastresume_rejec
|
|||||||
|
|
||||||
void TorrentHandleImpl::handleFileRenamedAlert(const lt::file_renamed_alert *p)
|
void TorrentHandleImpl::handleFileRenamedAlert(const lt::file_renamed_alert *p)
|
||||||
{
|
{
|
||||||
// We don't really need to call updateStatus() in this place.
|
// Remove empty leftover folders
|
||||||
// All we need to do is make sure we have a valid instance of the TorrentInfo object.
|
// For example renaming "a/b/c" to "d/b/c", then folders "a/b" and "a" will
|
||||||
m_torrentInfo = TorrentInfo {m_nativeHandle.torrent_file()};
|
|
||||||
|
|
||||||
// remove empty leftover folders
|
|
||||||
// for example renaming "a/b/c" to "d/b/c", then folders "a/b" and "a" will
|
|
||||||
// be removed if they are empty
|
// be removed if they are empty
|
||||||
const QString oldFilePath = m_oldPath[p->index].takeFirst();
|
const QString oldFilePath = m_oldPath[p->index].takeFirst();
|
||||||
const QString newFilePath = Utils::Fs::toUniformPath(p->new_name());
|
const QString newFilePath = Utils::Fs::toUniformPath(p->new_name());
|
||||||
@@ -1626,10 +1696,6 @@ void TorrentHandleImpl::handleFileRenameFailedAlert(const lt::file_rename_failed
|
|||||||
|
|
||||||
void TorrentHandleImpl::handleFileCompletedAlert(const lt::file_completed_alert *p)
|
void TorrentHandleImpl::handleFileCompletedAlert(const lt::file_completed_alert *p)
|
||||||
{
|
{
|
||||||
// We don't really need to call updateStatus() in this place.
|
|
||||||
// All we need to do is make sure we have a valid instance of the TorrentInfo object.
|
|
||||||
m_torrentInfo = TorrentInfo {m_nativeHandle.torrent_file()};
|
|
||||||
|
|
||||||
qDebug("A file completed download in torrent \"%s\"", qUtf8Printable(name()));
|
qDebug("A file completed download in torrent \"%s\"", qUtf8Printable(name()));
|
||||||
if (m_session->isAppendExtensionEnabled())
|
if (m_session->isAppendExtensionEnabled())
|
||||||
{
|
{
|
||||||
@@ -1647,20 +1713,11 @@ void TorrentHandleImpl::handleFileCompletedAlert(const lt::file_completed_alert
|
|||||||
void TorrentHandleImpl::handleMetadataReceivedAlert(const lt::metadata_received_alert *p)
|
void TorrentHandleImpl::handleMetadataReceivedAlert(const lt::metadata_received_alert *p)
|
||||||
{
|
{
|
||||||
Q_UNUSED(p);
|
Q_UNUSED(p);
|
||||||
qDebug("Metadata received for torrent %s.", qUtf8Printable(name()));
|
|
||||||
updateStatus();
|
|
||||||
if (m_session->isAppendExtensionEnabled())
|
|
||||||
manageIncompleteFiles();
|
|
||||||
if (!m_hasRootFolder)
|
|
||||||
m_torrentInfo.stripRootFolder();
|
|
||||||
if (filesCount() == 1)
|
|
||||||
m_hasRootFolder = false;
|
|
||||||
m_session->handleTorrentMetadataReceived(this);
|
|
||||||
|
|
||||||
// If first/last piece priority was specified when adding this torrent,
|
qDebug("Metadata received for torrent %s.", qUtf8Printable(name()));
|
||||||
// we should apply it now that we have metadata:
|
|
||||||
if (m_hasFirstLastPiecePriority)
|
m_maintenanceJob = MaintenanceJob::HandleMetadata;
|
||||||
applyFirstLastPiecePriority(true);
|
saveResumeData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentHandleImpl::handlePerformanceAlert(const lt::performance_alert *p) const
|
void TorrentHandleImpl::handlePerformanceAlert(const lt::performance_alert *p) const
|
||||||
@@ -1814,13 +1871,6 @@ lt::torrent_handle TorrentHandleImpl::nativeHandle() const
|
|||||||
return m_nativeHandle;
|
return m_nativeHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentHandleImpl::updateTorrentInfo()
|
|
||||||
{
|
|
||||||
if (!hasMetadata()) return;
|
|
||||||
|
|
||||||
m_torrentInfo = TorrentInfo(m_nativeStatus.torrent_file.lock());
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TorrentHandleImpl::isMoveInProgress() const
|
bool TorrentHandleImpl::isMoveInProgress() const
|
||||||
{
|
{
|
||||||
return m_storageIsMoving;
|
return m_storageIsMoving;
|
||||||
@@ -1839,19 +1889,20 @@ void TorrentHandleImpl::updateStatus()
|
|||||||
void TorrentHandleImpl::updateStatus(const lt::torrent_status &nativeStatus)
|
void TorrentHandleImpl::updateStatus(const lt::torrent_status &nativeStatus)
|
||||||
{
|
{
|
||||||
m_nativeStatus = nativeStatus;
|
m_nativeStatus = nativeStatus;
|
||||||
|
|
||||||
updateState();
|
updateState();
|
||||||
updateTorrentInfo();
|
|
||||||
|
|
||||||
// NOTE: Don't change the order of these conditionals!
|
|
||||||
// Otherwise it will not work properly since torrent can be CheckingDownloading.
|
|
||||||
if (isChecking())
|
|
||||||
m_unchecked = false;
|
|
||||||
else if (isDownloading())
|
|
||||||
m_unchecked = true;
|
|
||||||
|
|
||||||
m_speedMonitor.addSample({nativeStatus.download_payload_rate
|
m_speedMonitor.addSample({nativeStatus.download_payload_rate
|
||||||
, nativeStatus.upload_payload_rate});
|
, nativeStatus.upload_payload_rate});
|
||||||
|
|
||||||
|
if (hasMetadata())
|
||||||
|
{
|
||||||
|
// NOTE: Don't change the order of these conditionals!
|
||||||
|
// Otherwise it will not work properly since torrent can be CheckingDownloading.
|
||||||
|
if (isChecking())
|
||||||
|
m_unchecked = false;
|
||||||
|
else if (isDownloading())
|
||||||
|
m_unchecked = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentHandleImpl::setRatioLimit(qreal limit)
|
void TorrentHandleImpl::setRatioLimit(qreal limit)
|
||||||
@@ -1924,7 +1975,7 @@ void TorrentHandleImpl::prioritizeFiles(const QVector<DownloadPriority> &priorit
|
|||||||
if ((oldPriorities[i] == DownloadPriority::Ignored)
|
if ((oldPriorities[i] == DownloadPriority::Ignored)
|
||||||
&& (priorities[i] > DownloadPriority::Ignored)
|
&& (priorities[i] > DownloadPriority::Ignored)
|
||||||
&& (progress[i] < 1.0))
|
&& (progress[i] < 1.0))
|
||||||
{
|
{
|
||||||
m_hasSeedStatus = false;
|
m_hasSeedStatus = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,12 +62,13 @@ namespace BitTorrent
|
|||||||
QString category;
|
QString category;
|
||||||
QSet<QString> tags;
|
QSet<QString> tags;
|
||||||
QString savePath;
|
QString savePath;
|
||||||
|
TorrentContentLayout contentLayout = TorrentContentLayout::Original;
|
||||||
bool firstLastPiecePriority = false;
|
bool firstLastPiecePriority = false;
|
||||||
bool hasSeedStatus = false;
|
bool hasSeedStatus = false;
|
||||||
bool hasRootFolder = true;
|
|
||||||
bool forced = false;
|
bool forced = false;
|
||||||
bool paused = false;
|
bool paused = false;
|
||||||
|
|
||||||
|
|
||||||
qreal ratioLimit = TorrentHandle::USE_GLOBAL_RATIO;
|
qreal ratioLimit = TorrentHandle::USE_GLOBAL_RATIO;
|
||||||
int seedingTimeLimit = TorrentHandle::USE_GLOBAL_SEEDING_TIME;
|
int seedingTimeLimit = TorrentHandle::USE_GLOBAL_SEEDING_TIME;
|
||||||
|
|
||||||
@@ -80,14 +81,20 @@ namespace BitTorrent
|
|||||||
Overwrite
|
Overwrite
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class MaintenanceJob
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
HandleMetadata
|
||||||
|
};
|
||||||
|
|
||||||
class TorrentHandleImpl final : public QObject, public TorrentHandle
|
class TorrentHandleImpl final : public QObject, public TorrentHandle
|
||||||
{
|
{
|
||||||
Q_DISABLE_COPY(TorrentHandleImpl)
|
Q_DISABLE_COPY(TorrentHandleImpl)
|
||||||
Q_DECLARE_TR_FUNCTIONS(BitTorrent::TorrentHandleImpl)
|
Q_DECLARE_TR_FUNCTIONS(BitTorrent::TorrentHandleImpl)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TorrentHandleImpl(Session *session, const lt::torrent_handle &nativeHandle,
|
TorrentHandleImpl(Session *session, lt::session *nativeSession
|
||||||
const LoadTorrentParams ¶ms);
|
, const lt::torrent_handle &nativeHandle, const LoadTorrentParams ¶ms);
|
||||||
~TorrentHandleImpl() override;
|
~TorrentHandleImpl() override;
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
@@ -123,8 +130,6 @@ namespace BitTorrent
|
|||||||
bool removeTag(const QString &tag) override;
|
bool removeTag(const QString &tag) override;
|
||||||
void removeAllTags() override;
|
void removeAllTags() override;
|
||||||
|
|
||||||
bool hasRootFolder() const override;
|
|
||||||
|
|
||||||
int filesCount() const override;
|
int filesCount() const override;
|
||||||
int piecesCount() const override;
|
int piecesCount() const override;
|
||||||
int piecesHave() const override;
|
int piecesHave() const override;
|
||||||
@@ -241,6 +246,7 @@ namespace BitTorrent
|
|||||||
void handleAppendExtensionToggled();
|
void handleAppendExtensionToggled();
|
||||||
void saveResumeData();
|
void saveResumeData();
|
||||||
void handleMoveStorageJobFinished(bool hasOutstandingJob);
|
void handleMoveStorageJobFinished(bool hasOutstandingJob);
|
||||||
|
void fileSearchFinished(const QString &savePath, const QStringList &fileNames);
|
||||||
|
|
||||||
QString actualStorageLocation() const;
|
QString actualStorageLocation() const;
|
||||||
|
|
||||||
@@ -250,7 +256,6 @@ namespace BitTorrent
|
|||||||
void updateStatus();
|
void updateStatus();
|
||||||
void updateStatus(const lt::torrent_status &nativeStatus);
|
void updateStatus(const lt::torrent_status &nativeStatus);
|
||||||
void updateState();
|
void updateState();
|
||||||
void updateTorrentInfo();
|
|
||||||
|
|
||||||
void handleFastResumeRejectedAlert(const lt::fastresume_rejected_alert *p);
|
void handleFastResumeRejectedAlert(const lt::fastresume_rejected_alert *p);
|
||||||
void handleFileCompletedAlert(const lt::file_completed_alert *p);
|
void handleFileCompletedAlert(const lt::file_completed_alert *p);
|
||||||
@@ -279,7 +284,10 @@ namespace BitTorrent
|
|||||||
void manageIncompleteFiles();
|
void manageIncompleteFiles();
|
||||||
void applyFirstLastPiecePriority(bool enabled, const QVector<DownloadPriority> &updatedFilePrio = {});
|
void applyFirstLastPiecePriority(bool enabled, const QVector<DownloadPriority> &updatedFilePrio = {});
|
||||||
|
|
||||||
|
void endReceivedMetadataHandling(const QString &savePath, const QStringList &fileNames);
|
||||||
|
|
||||||
Session *const m_session;
|
Session *const m_session;
|
||||||
|
lt::session *m_nativeSession;
|
||||||
lt::torrent_handle m_nativeHandle;
|
lt::torrent_handle m_nativeHandle;
|
||||||
lt::torrent_status m_nativeStatus;
|
lt::torrent_status m_nativeStatus;
|
||||||
TorrentState m_state = TorrentState::Unknown;
|
TorrentState m_state = TorrentState::Unknown;
|
||||||
@@ -294,6 +302,8 @@ namespace BitTorrent
|
|||||||
int m_renameCount = 0;
|
int m_renameCount = 0;
|
||||||
bool m_storageIsMoving = false;
|
bool m_storageIsMoving = false;
|
||||||
|
|
||||||
|
MaintenanceJob m_maintenanceJob = MaintenanceJob::None;
|
||||||
|
|
||||||
// Until libtorrent provide an "old_name" field in `file_renamed_alert`
|
// Until libtorrent provide an "old_name" field in `file_renamed_alert`
|
||||||
// we will rely on this workaround to remove empty leftover folders
|
// we will rely on this workaround to remove empty leftover folders
|
||||||
QHash<lt::file_index_t, QVector<QString>> m_oldPath;
|
QHash<lt::file_index_t, QVector<QString>> m_oldPath;
|
||||||
@@ -308,10 +318,10 @@ namespace BitTorrent
|
|||||||
qreal m_ratioLimit;
|
qreal m_ratioLimit;
|
||||||
int m_seedingTimeLimit;
|
int m_seedingTimeLimit;
|
||||||
TorrentOperatingMode m_operatingMode;
|
TorrentOperatingMode m_operatingMode;
|
||||||
|
TorrentContentLayout m_contentLayout;
|
||||||
bool m_hasSeedStatus;
|
bool m_hasSeedStatus;
|
||||||
bool m_fastresumeDataRejected = false;
|
bool m_fastresumeDataRejected = false;
|
||||||
bool m_hasMissingFiles = false;
|
bool m_hasMissingFiles = false;
|
||||||
bool m_hasRootFolder;
|
|
||||||
bool m_hasFirstLastPiecePriority = false;
|
bool m_hasFirstLastPiecePriority = false;
|
||||||
bool m_useAutoTMM;
|
bool m_useAutoTMM;
|
||||||
bool m_isStopped;
|
bool m_isStopped;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
#include "base/exceptions.h"
|
#include "base/exceptions.h"
|
||||||
#include "base/global.h"
|
#include "base/global.h"
|
||||||
@@ -51,6 +52,29 @@
|
|||||||
|
|
||||||
using namespace BitTorrent;
|
using namespace BitTorrent;
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
QString getRootFolder(const QStringList &filePaths)
|
||||||
|
{
|
||||||
|
QString rootFolder;
|
||||||
|
for (const QString &filePath : filePaths)
|
||||||
|
{
|
||||||
|
if (QDir::isAbsolutePath(filePath)) continue;
|
||||||
|
|
||||||
|
const auto filePathElements = filePath.splitRef('/');
|
||||||
|
// if at least one file has no root folder, no common root folder exists
|
||||||
|
if (filePathElements.count() <= 1) return {};
|
||||||
|
|
||||||
|
if (rootFolder.isEmpty())
|
||||||
|
rootFolder = filePathElements.at(0).toString();
|
||||||
|
else if (rootFolder != filePathElements.at(0))
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
return rootFolder;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TorrentInfo::TorrentInfo(std::shared_ptr<const lt::torrent_info> nativeInfo)
|
TorrentInfo::TorrentInfo(std::shared_ptr<const lt::torrent_info> nativeInfo)
|
||||||
{
|
{
|
||||||
m_nativeInfo = std::const_pointer_cast<lt::torrent_info>(nativeInfo);
|
m_nativeInfo = std::const_pointer_cast<lt::torrent_info>(nativeInfo);
|
||||||
@@ -169,7 +193,7 @@ InfoHash TorrentInfo::hash() const
|
|||||||
QString TorrentInfo::name() const
|
QString TorrentInfo::name() const
|
||||||
{
|
{
|
||||||
if (!isValid()) return {};
|
if (!isValid()) return {};
|
||||||
return QString::fromStdString(m_nativeInfo->name());
|
return QString::fromStdString(m_nativeInfo->orig_files().name());
|
||||||
}
|
}
|
||||||
|
|
||||||
QDateTime TorrentInfo::creationDate() const
|
QDateTime TorrentInfo::creationDate() const
|
||||||
@@ -411,23 +435,7 @@ int TorrentInfo::fileIndex(const QString &fileName) const
|
|||||||
|
|
||||||
QString TorrentInfo::rootFolder() const
|
QString TorrentInfo::rootFolder() const
|
||||||
{
|
{
|
||||||
QString rootFolder;
|
return getRootFolder(filePaths());
|
||||||
for (int i = 0; i < filesCount(); ++i)
|
|
||||||
{
|
|
||||||
const QString filePath = this->filePath(i);
|
|
||||||
if (QDir::isAbsolutePath(filePath)) continue;
|
|
||||||
|
|
||||||
const auto filePathElements = filePath.splitRef('/');
|
|
||||||
// if at least one file has no root folder, no common root folder exists
|
|
||||||
if (filePathElements.count() <= 1) return "";
|
|
||||||
|
|
||||||
if (rootFolder.isEmpty())
|
|
||||||
rootFolder = filePathElements.at(0).toString();
|
|
||||||
else if (rootFolder != filePathElements.at(0))
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
return rootFolder;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TorrentInfo::hasRootFolder() const
|
bool TorrentInfo::hasRootFolder() const
|
||||||
@@ -435,10 +443,26 @@ bool TorrentInfo::hasRootFolder() const
|
|||||||
return !rootFolder().isEmpty();
|
return !rootFolder().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TorrentInfo::setContentLayout(const TorrentContentLayout layout)
|
||||||
|
{
|
||||||
|
switch (layout)
|
||||||
|
{
|
||||||
|
case TorrentContentLayout::Original:
|
||||||
|
setContentLayout(defaultContentLayout());
|
||||||
|
break;
|
||||||
|
case TorrentContentLayout::Subfolder:
|
||||||
|
if (rootFolder().isEmpty())
|
||||||
|
addRootFolder();
|
||||||
|
break;
|
||||||
|
case TorrentContentLayout::NoSubfolder:
|
||||||
|
if (!rootFolder().isEmpty())
|
||||||
|
stripRootFolder();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TorrentInfo::stripRootFolder()
|
void TorrentInfo::stripRootFolder()
|
||||||
{
|
{
|
||||||
if (!hasRootFolder()) return;
|
|
||||||
|
|
||||||
lt::file_storage files = m_nativeInfo->files();
|
lt::file_storage files = m_nativeInfo->files();
|
||||||
|
|
||||||
// Solution for case of renamed root folder
|
// Solution for case of renamed root folder
|
||||||
@@ -455,6 +479,32 @@ void TorrentInfo::stripRootFolder()
|
|||||||
m_nativeInfo->remap_files(files);
|
m_nativeInfo->remap_files(files);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TorrentInfo::addRootFolder()
|
||||||
|
{
|
||||||
|
const QString rootFolder = name();
|
||||||
|
Q_ASSERT(!rootFolder.isEmpty());
|
||||||
|
|
||||||
|
const std::string rootPrefix = Utils::Fs::toNativePath(rootFolder + QLatin1Char {'/'}).toStdString();
|
||||||
|
lt::file_storage files = m_nativeInfo->files();
|
||||||
|
files.set_name(rootFolder.toStdString());
|
||||||
|
for (int i = 0; i < files.num_files(); ++i)
|
||||||
|
files.rename_file(lt::file_index_t {i}, rootPrefix + files.file_path(lt::file_index_t {i}));
|
||||||
|
m_nativeInfo->remap_files(files);
|
||||||
|
}
|
||||||
|
|
||||||
|
TorrentContentLayout TorrentInfo::defaultContentLayout() const
|
||||||
|
{
|
||||||
|
QStringList origFilePaths;
|
||||||
|
origFilePaths.reserve(filesCount());
|
||||||
|
for (int i = 0; i < filesCount(); ++i)
|
||||||
|
origFilePaths << origFilePath(i);
|
||||||
|
|
||||||
|
const QString origRootFolder = getRootFolder(origFilePaths);
|
||||||
|
return (origRootFolder.isEmpty()
|
||||||
|
? TorrentContentLayout::NoSubfolder
|
||||||
|
: TorrentContentLayout::Subfolder);
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<lt::torrent_info> TorrentInfo::nativeInfo() const
|
std::shared_ptr<lt::torrent_info> TorrentInfo::nativeInfo() const
|
||||||
{
|
{
|
||||||
return m_nativeInfo;
|
return m_nativeInfo;
|
||||||
|
|||||||
@@ -26,20 +26,19 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BITTORRENT_TORRENTINFO_H
|
#pragma once
|
||||||
#define BITTORRENT_TORRENTINFO_H
|
|
||||||
|
|
||||||
#include <libtorrent/torrent_info.hpp>
|
#include <libtorrent/torrent_info.hpp>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QVector>
|
#include <QtContainerFwd>
|
||||||
|
|
||||||
#include "base/indexrange.h"
|
#include "base/indexrange.h"
|
||||||
|
#include "torrentcontentlayout.h"
|
||||||
|
|
||||||
class QByteArray;
|
class QByteArray;
|
||||||
class QDateTime;
|
class QDateTime;
|
||||||
class QString;
|
class QString;
|
||||||
class QStringList;
|
|
||||||
class QUrl;
|
class QUrl;
|
||||||
|
|
||||||
namespace BitTorrent
|
namespace BitTorrent
|
||||||
@@ -96,15 +95,17 @@ namespace BitTorrent
|
|||||||
|
|
||||||
QString rootFolder() const;
|
QString rootFolder() const;
|
||||||
bool hasRootFolder() const;
|
bool hasRootFolder() const;
|
||||||
void stripRootFolder();
|
void setContentLayout(TorrentContentLayout layout);
|
||||||
|
|
||||||
std::shared_ptr<lt::torrent_info> nativeInfo() const;
|
std::shared_ptr<lt::torrent_info> nativeInfo() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// returns file index or -1 if fileName is not found
|
// returns file index or -1 if fileName is not found
|
||||||
int fileIndex(const QString &fileName) const;
|
int fileIndex(const QString &fileName) const;
|
||||||
|
void stripRootFolder();
|
||||||
|
void addRootFolder();
|
||||||
|
TorrentContentLayout defaultContentLayout() const;
|
||||||
|
|
||||||
std::shared_ptr<lt::torrent_info> m_nativeInfo;
|
std::shared_ptr<lt::torrent_info> m_nativeInfo;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BITTORRENT_TORRENTINFO_H
|
|
||||||
|
|||||||
@@ -28,8 +28,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BITTORRENT_TRACKER_H
|
#pragma once
|
||||||
#define BITTORRENT_TRACKER_H
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -106,5 +105,3 @@ namespace BitTorrent
|
|||||||
QHash<InfoHash, TorrentStats> m_torrents;
|
QHash<InfoHash, TorrentStats> m_torrents;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BITTORRENT_TRACKER_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BITTORRENT_TRACKERENTRY_H
|
#pragma once
|
||||||
#define BITTORRENT_TRACKERENTRY_H
|
|
||||||
|
|
||||||
#include <libtorrent/announce_entry.hpp>
|
#include <libtorrent/announce_entry.hpp>
|
||||||
|
|
||||||
@@ -73,5 +72,3 @@ namespace BitTorrent
|
|||||||
bool operator==(const TrackerEntry &left, const TrackerEntry &right);
|
bool operator==(const TrackerEntry &left, const TrackerEntry &right);
|
||||||
uint qHash(const TrackerEntry &key, uint seed);
|
uint qHash(const TrackerEntry &key, uint seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BITTORRENT_TRACKERENTRY_H
|
|
||||||
|
|||||||
@@ -26,17 +26,15 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FILESYSTEMWATCHER_H
|
#pragma once
|
||||||
#define FILESYSTEMWATCHER_H
|
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileSystemWatcher>
|
#include <QFileSystemWatcher>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
#include <QtContainerFwd>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
class QStringList;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Subclassing QFileSystemWatcher in order to support Network File
|
* Subclassing QFileSystemWatcher in order to support Network File
|
||||||
* System watching (NFS, CIFS) on Linux and Mac OS.
|
* System watching (NFS, CIFS) on Linux and Mac OS.
|
||||||
@@ -70,5 +68,3 @@ private:
|
|||||||
QVector<QDir> m_watchedFolders;
|
QVector<QDir> m_watchedFolders;
|
||||||
QTimer m_watchTimer;
|
QTimer m_watchTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FILESYSTEMWATCHER_H
|
|
||||||
|
|||||||
@@ -28,8 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef HTTP_CONNECTION_H
|
#pragma once
|
||||||
#define HTTP_CONNECTION_H
|
|
||||||
|
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@@ -66,5 +65,3 @@ namespace Http
|
|||||||
QElapsedTimer m_idleTimer;
|
QElapsedTimer m_idleTimer;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HTTP_CONNECTION_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef HTTP_IREQUESTHANDLER_H
|
#pragma once
|
||||||
#define HTTP_IREQUESTHANDLER_H
|
|
||||||
|
|
||||||
namespace Http
|
namespace Http
|
||||||
{
|
{
|
||||||
@@ -42,5 +41,3 @@ namespace Http
|
|||||||
virtual Response processRequest(const Request &request, const Environment &env) = 0;
|
virtual Response processRequest(const Request &request, const Environment &env) = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HTTP_IREQUESTHANDLER_H
|
|
||||||
|
|||||||
@@ -28,8 +28,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef HTTP_REQUESTPARSER_H
|
#pragma once
|
||||||
#define HTTP_REQUESTPARSER_H
|
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
@@ -70,5 +69,3 @@ namespace Http
|
|||||||
Request m_request;
|
Request m_request;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HTTP_REQUESTPARSER_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef HTTP_RESPONSEBUILDER_H
|
#pragma once
|
||||||
#define HTTP_RESPONSEBUILDER_H
|
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
@@ -50,5 +49,3 @@ namespace Http
|
|||||||
Response m_response;
|
Response m_response;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HTTP_RESPONSEBUILDER_H
|
|
||||||
|
|||||||
@@ -28,8 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef HTTP_RESPONSEGENERATOR_H
|
#pragma once
|
||||||
#define HTTP_RESPONSEGENERATOR_H
|
|
||||||
|
|
||||||
class QByteArray;
|
class QByteArray;
|
||||||
class QString;
|
class QString;
|
||||||
@@ -42,5 +41,3 @@ namespace Http
|
|||||||
QString httpDate();
|
QString httpDate();
|
||||||
void compressContent(Response &response);
|
void compressContent(Response &response);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HTTP_RESPONSEGENERATOR_H
|
|
||||||
|
|||||||
@@ -28,8 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef HTTP_SERVER_H
|
#pragma once
|
||||||
#define HTTP_SERVER_H
|
|
||||||
|
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QSslCertificate>
|
#include <QSslCertificate>
|
||||||
@@ -67,5 +66,3 @@ namespace Http
|
|||||||
QSslKey m_key;
|
QSslKey m_key;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HTTP_SERVER_H
|
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef HTTP_TYPES_H
|
#pragma once
|
||||||
#define HTTP_TYPES_H
|
|
||||||
|
|
||||||
#include <QHostAddress>
|
#include <QHostAddress>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
@@ -127,5 +126,3 @@ namespace Http
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HTTP_TYPES_H
|
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef ICONPROVIDER_H
|
#pragma once
|
||||||
#define ICONPROVIDER_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
@@ -51,5 +50,3 @@ protected:
|
|||||||
|
|
||||||
static IconProvider *m_instance;
|
static IconProvider *m_instance;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ICONPROVIDER_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QBT_INDEXRANGE_H
|
#pragma once
|
||||||
#define QBT_INDEXRANGE_H
|
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
@@ -169,5 +168,3 @@ private:
|
|||||||
IndexType m_first;
|
IndexType m_first;
|
||||||
IndexDiffType m_size;
|
IndexDiffType m_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QBT_INDEXRANGE_H
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,15 +26,14 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LOGGER_H
|
#pragma once
|
||||||
#define LOGGER_H
|
|
||||||
|
|
||||||
#include <boost/circular_buffer.hpp>
|
#include <boost/circular_buffer.hpp>
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QReadWriteLock>
|
#include <QReadWriteLock>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVector>
|
#include <QtContainerFwd>
|
||||||
|
|
||||||
const int MAX_LOG_MESSAGES = 20000;
|
const int MAX_LOG_MESSAGES = 20000;
|
||||||
|
|
||||||
@@ -103,5 +102,3 @@ private:
|
|||||||
|
|
||||||
// Helper function
|
// Helper function
|
||||||
void LogMsg(const QString &message, const Log::MsgType &type = Log::NORMAL);
|
void LogMsg(const QString &message, const Log::MsgType &type = Log::NORMAL);
|
||||||
|
|
||||||
#endif // LOGGER_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef DNSUPDATER_H
|
#pragma once
|
||||||
#define DNSUPDATER_H
|
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QHostAddress>
|
#include <QHostAddress>
|
||||||
@@ -84,5 +83,3 @@ namespace Net
|
|||||||
QString m_password;
|
QString m_password;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // DNSUPDATER_H
|
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NET_DOWNLOADMANAGER_H
|
#pragma once
|
||||||
#define NET_DOWNLOADMANAGER_H
|
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
@@ -159,5 +158,3 @@ namespace Net
|
|||||||
connect(handler, &DownloadHandler::finished, context, slot);
|
connect(handler, &DownloadHandler::finished, context, slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // NET_DOWNLOADMANAGER_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef GEOIPDATABASE_H
|
#pragma once
|
||||||
#define GEOIPDATABASE_H
|
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
@@ -100,5 +99,3 @@ private:
|
|||||||
quint32 m_size;
|
quint32 m_size;
|
||||||
uchar *m_data;
|
uchar *m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GEOIPDATABASE_H
|
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NET_GEOIPMANAGER_H
|
#pragma once
|
||||||
#define NET_GEOIPMANAGER_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
@@ -73,5 +72,3 @@ namespace Net
|
|||||||
static GeoIPManager *m_instance;
|
static GeoIPManager *m_instance;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // NET_GEOIPMANAGER_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NET_PORTFORWARDER_H
|
#pragma once
|
||||||
#define NET_PORTFORWARDER_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
@@ -53,5 +52,3 @@ namespace Net
|
|||||||
static PortForwarder *m_instance;
|
static PortForwarder *m_instance;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // NET_PORTFORWARDER_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NET_PROXYCONFIGURATIONMANAGER_H
|
#pragma once
|
||||||
#define NET_PROXYCONFIGURATIONMANAGER_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
@@ -85,5 +84,3 @@ namespace Net
|
|||||||
bool m_isProxyOnlyForTorrents;
|
bool m_isProxyOnlyForTorrents;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // NET_PROXYCONFIGURATIONMANAGER_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NET_REVERSERESOLUTION_H
|
#pragma once
|
||||||
#define NET_REVERSERESOLUTION_H
|
|
||||||
|
|
||||||
#include <QCache>
|
#include <QCache>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@@ -60,5 +59,3 @@ namespace Net
|
|||||||
QCache<QHostAddress, QString> m_cache; // <IP, HostName>
|
QCache<QHostAddress, QString> m_cache; // <IP, HostName>
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // NET_REVERSERESOLUTION_H
|
|
||||||
|
|||||||
@@ -30,8 +30,7 @@
|
|||||||
* This code is based on QxtSmtp from libqxt (http://libqxt.org)
|
* This code is based on QxtSmtp from libqxt (http://libqxt.org)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SMTP_H
|
#pragma once
|
||||||
#define SMTP_H
|
|
||||||
|
|
||||||
#include <QAbstractSocket>
|
#include <QAbstractSocket>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
@@ -119,5 +118,3 @@ namespace Net
|
|||||||
QString m_password;
|
QString m_password;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // SMTP_H
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QList>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QNetworkCookie>
|
#include <QNetworkCookie>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|||||||
@@ -27,19 +27,17 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PREFERENCES_H
|
#pragma once
|
||||||
#define PREFERENCES_H
|
|
||||||
|
|
||||||
#include <QList>
|
#include <QtContainerFwd>
|
||||||
|
#include <QVariant>
|
||||||
|
|
||||||
#include "base/utils/net.h"
|
#include "base/utils/net.h"
|
||||||
|
|
||||||
class QDateTime;
|
class QDateTime;
|
||||||
class QNetworkCookie;
|
class QNetworkCookie;
|
||||||
class QSize;
|
class QSize;
|
||||||
class QStringList;
|
|
||||||
class QTime;
|
class QTime;
|
||||||
class QVariant;
|
|
||||||
|
|
||||||
enum SchedulerDays
|
enum SchedulerDays
|
||||||
{
|
{
|
||||||
@@ -404,5 +402,3 @@ public slots:
|
|||||||
|
|
||||||
void apply();
|
void apply();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PREFERENCES_H
|
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QBT_PROFILE_H
|
#pragma once
|
||||||
#define QBT_PROFILE_H
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@@ -82,5 +81,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
QString specialFolderLocation(SpecialFolder folder);
|
QString specialFolderLocation(SpecialFolder folder);
|
||||||
|
|
||||||
#endif // QBT_PROFILE_H
|
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef QBT_PROFILE_P_H
|
#pragma once
|
||||||
#define QBT_PROFILE_P_H
|
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
@@ -132,5 +131,3 @@ namespace Private
|
|||||||
QDir m_baseDir;
|
QDir m_baseDir;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QBT_PROFILE_P_H
|
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ void AutoDownloader::processJob(const QSharedPointer<ProcessingJob> &job)
|
|||||||
params.savePath = rule.savePath();
|
params.savePath = rule.savePath();
|
||||||
params.category = rule.assignedCategory();
|
params.category = rule.assignedCategory();
|
||||||
params.addPaused = rule.addPaused();
|
params.addPaused = rule.addPaused();
|
||||||
params.createSubfolder = rule.createSubfolder();
|
params.contentLayout = rule.torrentContentLayout();
|
||||||
if (!rule.savePath().isEmpty())
|
if (!rule.savePath().isEmpty())
|
||||||
params.useAutoTMM = TriStateBool::False;
|
params.useAutoTMM = TriStateBool::False;
|
||||||
const auto torrentURL = job->articleData.value(Article::KeyTorrentURL).toString();
|
const auto torrentURL = job->articleData.value(Article::KeyTorrentURL).toString();
|
||||||
|
|||||||
@@ -40,11 +40,11 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
#include "../global.h"
|
#include "base/global.h"
|
||||||
#include "../preferences.h"
|
#include "base/preferences.h"
|
||||||
#include "../tristatebool.h"
|
#include "base/tristatebool.h"
|
||||||
#include "../utils/fs.h"
|
#include "base/utils/fs.h"
|
||||||
#include "../utils/string.h"
|
#include "base/utils/string.h"
|
||||||
#include "rss_article.h"
|
#include "rss_article.h"
|
||||||
#include "rss_autodownloader.h"
|
#include "rss_autodownloader.h"
|
||||||
#include "rss_feed.h"
|
#include "rss_feed.h"
|
||||||
@@ -91,6 +91,21 @@ namespace
|
|||||||
default: return 0; // default
|
default: return 0; // default
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boost::optional<BitTorrent::TorrentContentLayout> jsonValueToContentLayout(const QJsonValue &jsonVal)
|
||||||
|
{
|
||||||
|
const QString str = jsonVal.toString();
|
||||||
|
if (str.isEmpty())
|
||||||
|
return {};
|
||||||
|
return Utils::String::toEnum(str, BitTorrent::TorrentContentLayout::Original);
|
||||||
|
}
|
||||||
|
|
||||||
|
QJsonValue contentLayoutToJsonValue(const boost::optional<BitTorrent::TorrentContentLayout> contentLayout)
|
||||||
|
{
|
||||||
|
if (!contentLayout)
|
||||||
|
return {};
|
||||||
|
return Utils::String::fromEnum(*contentLayout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString Str_Name(QStringLiteral("name"));
|
const QString Str_Name(QStringLiteral("name"));
|
||||||
@@ -106,6 +121,7 @@ const QString Str_LastMatch(QStringLiteral("lastMatch"));
|
|||||||
const QString Str_IgnoreDays(QStringLiteral("ignoreDays"));
|
const QString Str_IgnoreDays(QStringLiteral("ignoreDays"));
|
||||||
const QString Str_AddPaused(QStringLiteral("addPaused"));
|
const QString Str_AddPaused(QStringLiteral("addPaused"));
|
||||||
const QString Str_CreateSubfolder(QStringLiteral("createSubfolder"));
|
const QString Str_CreateSubfolder(QStringLiteral("createSubfolder"));
|
||||||
|
const QString Str_ContentLayout(QStringLiteral("torrentContentLayout"));
|
||||||
const QString Str_SmartFilter(QStringLiteral("smartFilter"));
|
const QString Str_SmartFilter(QStringLiteral("smartFilter"));
|
||||||
const QString Str_PreviouslyMatched(QStringLiteral("previouslyMatchedEpisodes"));
|
const QString Str_PreviouslyMatched(QStringLiteral("previouslyMatchedEpisodes"));
|
||||||
|
|
||||||
@@ -127,7 +143,7 @@ namespace RSS
|
|||||||
QString savePath;
|
QString savePath;
|
||||||
QString category;
|
QString category;
|
||||||
TriStateBool addPaused = TriStateBool::Undefined;
|
TriStateBool addPaused = TriStateBool::Undefined;
|
||||||
TriStateBool createSubfolder = TriStateBool::Undefined;
|
boost::optional<BitTorrent::TorrentContentLayout> contentLayout;
|
||||||
|
|
||||||
bool smartFilter = false;
|
bool smartFilter = false;
|
||||||
QStringList previouslyMatchedEpisodes;
|
QStringList previouslyMatchedEpisodes;
|
||||||
@@ -149,7 +165,7 @@ namespace RSS
|
|||||||
&& (savePath == other.savePath)
|
&& (savePath == other.savePath)
|
||||||
&& (category == other.category)
|
&& (category == other.category)
|
||||||
&& (addPaused == other.addPaused)
|
&& (addPaused == other.addPaused)
|
||||||
&& (createSubfolder == other.createSubfolder)
|
&& (contentLayout == other.contentLayout)
|
||||||
&& (smartFilter == other.smartFilter);
|
&& (smartFilter == other.smartFilter);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -462,7 +478,7 @@ QJsonObject AutoDownloadRule::toJsonObject() const
|
|||||||
, {Str_LastMatch, lastMatch().toString(Qt::RFC2822Date)}
|
, {Str_LastMatch, lastMatch().toString(Qt::RFC2822Date)}
|
||||||
, {Str_IgnoreDays, ignoreDays()}
|
, {Str_IgnoreDays, ignoreDays()}
|
||||||
, {Str_AddPaused, triStateBoolToJsonValue(addPaused())}
|
, {Str_AddPaused, triStateBoolToJsonValue(addPaused())}
|
||||||
, {Str_CreateSubfolder, triStateBoolToJsonValue(createSubfolder())}
|
, {Str_ContentLayout, contentLayoutToJsonValue(torrentContentLayout())}
|
||||||
, {Str_SmartFilter, useSmartFilter()}
|
, {Str_SmartFilter, useSmartFilter()}
|
||||||
, {Str_PreviouslyMatched, QJsonArray::fromStringList(previouslyMatchedEpisodes())}};
|
, {Str_PreviouslyMatched, QJsonArray::fromStringList(previouslyMatchedEpisodes())}};
|
||||||
}
|
}
|
||||||
@@ -479,7 +495,29 @@ AutoDownloadRule AutoDownloadRule::fromJsonObject(const QJsonObject &jsonObj, co
|
|||||||
rule.setSavePath(jsonObj.value(Str_SavePath).toString());
|
rule.setSavePath(jsonObj.value(Str_SavePath).toString());
|
||||||
rule.setCategory(jsonObj.value(Str_AssignedCategory).toString());
|
rule.setCategory(jsonObj.value(Str_AssignedCategory).toString());
|
||||||
rule.setAddPaused(jsonValueToTriStateBool(jsonObj.value(Str_AddPaused)));
|
rule.setAddPaused(jsonValueToTriStateBool(jsonObj.value(Str_AddPaused)));
|
||||||
rule.setCreateSubfolder(jsonValueToTriStateBool(jsonObj.value(Str_CreateSubfolder)));
|
|
||||||
|
// TODO: The following code is deprecated. Replace with the commented one after several releases in 4.4.x.
|
||||||
|
// === BEGIN DEPRECATED CODE === //
|
||||||
|
if (jsonObj.contains(Str_ContentLayout))
|
||||||
|
{
|
||||||
|
rule.setTorrentContentLayout(jsonValueToContentLayout(jsonObj.value(Str_ContentLayout)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const TriStateBool createSubfolder = jsonValueToTriStateBool(jsonObj.value(Str_CreateSubfolder));
|
||||||
|
boost::optional<BitTorrent::TorrentContentLayout> contentLayout;
|
||||||
|
if (createSubfolder == TriStateBool::True)
|
||||||
|
contentLayout = BitTorrent::TorrentContentLayout::Original;
|
||||||
|
else if (createSubfolder == TriStateBool::False)
|
||||||
|
contentLayout = BitTorrent::TorrentContentLayout::NoSubfolder;
|
||||||
|
|
||||||
|
rule.setTorrentContentLayout(contentLayout);
|
||||||
|
}
|
||||||
|
// === END DEPRECATED CODE === //
|
||||||
|
// === BEGIN REPLACEMENT CODE === //
|
||||||
|
// rule.setTorrentContentLayout(jsonValueToContentLayout(jsonObj.value(Str_ContentLayout)));
|
||||||
|
// === END REPLACEMENT CODE === //
|
||||||
|
|
||||||
rule.setLastMatch(QDateTime::fromString(jsonObj.value(Str_LastMatch).toString(), Qt::RFC2822Date));
|
rule.setLastMatch(QDateTime::fromString(jsonObj.value(Str_LastMatch).toString(), Qt::RFC2822Date));
|
||||||
rule.setIgnoreDays(jsonObj.value(Str_IgnoreDays).toInt());
|
rule.setIgnoreDays(jsonObj.value(Str_IgnoreDays).toInt());
|
||||||
rule.setUseSmartFilter(jsonObj.value(Str_SmartFilter).toBool(false));
|
rule.setUseSmartFilter(jsonObj.value(Str_SmartFilter).toBool(false));
|
||||||
@@ -611,14 +649,14 @@ void AutoDownloadRule::setAddPaused(const TriStateBool addPaused)
|
|||||||
m_dataPtr->addPaused = addPaused;
|
m_dataPtr->addPaused = addPaused;
|
||||||
}
|
}
|
||||||
|
|
||||||
TriStateBool AutoDownloadRule::createSubfolder() const
|
boost::optional<BitTorrent::TorrentContentLayout> AutoDownloadRule::torrentContentLayout() const
|
||||||
{
|
{
|
||||||
return m_dataPtr->createSubfolder;
|
return m_dataPtr->contentLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoDownloadRule::setCreateSubfolder(const TriStateBool createSubfolder)
|
void AutoDownloadRule::setTorrentContentLayout(const boost::optional<BitTorrent::TorrentContentLayout> contentLayout)
|
||||||
{
|
{
|
||||||
m_dataPtr->createSubfolder = createSubfolder;
|
m_dataPtr->contentLayout = contentLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AutoDownloadRule::assignedCategory() const
|
QString AutoDownloadRule::assignedCategory() const
|
||||||
|
|||||||
@@ -29,9 +29,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
#include <QSharedDataPointer>
|
#include <QSharedDataPointer>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
|
#include "base/bittorrent/torrentcontentlayout.h"
|
||||||
|
|
||||||
class QDateTime;
|
class QDateTime;
|
||||||
class QJsonObject;
|
class QJsonObject;
|
||||||
class QRegularExpression;
|
class QRegularExpression;
|
||||||
@@ -79,8 +83,8 @@ namespace RSS
|
|||||||
void setSavePath(const QString &savePath);
|
void setSavePath(const QString &savePath);
|
||||||
TriStateBool addPaused() const;
|
TriStateBool addPaused() const;
|
||||||
void setAddPaused(TriStateBool addPaused);
|
void setAddPaused(TriStateBool addPaused);
|
||||||
TriStateBool createSubfolder() const;
|
boost::optional<BitTorrent::TorrentContentLayout> torrentContentLayout() const;
|
||||||
void setCreateSubfolder(TriStateBool createSubfolder);
|
void setTorrentContentLayout(boost::optional<BitTorrent::TorrentContentLayout> contentLayout);
|
||||||
QString assignedCategory() const;
|
QString assignedCategory() const;
|
||||||
void setCategory(const QString &category);
|
void setCategory(const QString &category);
|
||||||
|
|
||||||
|
|||||||
@@ -26,13 +26,11 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SCANFOLDERSMODEL_H
|
#pragma once
|
||||||
#define SCANFOLDERSMODEL_H
|
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QtContainerFwd>
|
||||||
class QStringList;
|
|
||||||
|
|
||||||
class FileSystemWatcher;
|
class FileSystemWatcher;
|
||||||
|
|
||||||
@@ -111,5 +109,3 @@ private:
|
|||||||
QList<PathData*> m_pathList;
|
QList<PathData*> m_pathList;
|
||||||
FileSystemWatcher *m_fsWatcher;
|
FileSystemWatcher *m_fsWatcher;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SCANFOLDERSMODEL_H
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
#include "base/global.h"
|
#include "base/global.h"
|
||||||
#include "base/utils/foreignapps.h"
|
#include "base/utils/foreignapps.h"
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVector>
|
#include <QtContainerFwd>
|
||||||
|
|
||||||
class QProcess;
|
class QProcess;
|
||||||
class QTimer;
|
class QTimer;
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SETTINGSSTORAGE_H
|
#pragma once
|
||||||
#define SETTINGSSTORAGE_H
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QReadWriteLock>
|
#include <QReadWriteLock>
|
||||||
@@ -61,5 +60,3 @@ private:
|
|||||||
QTimer m_timer;
|
QTimer m_timer;
|
||||||
mutable QReadWriteLock m_lock;
|
mutable QReadWriteLock m_lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SETTINGSSTORAGE_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SETTINGVALUE_H
|
#pragma once
|
||||||
#define SETTINGVALUE_H
|
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
@@ -35,6 +34,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
#include "settingsstorage.h"
|
#include "settingsstorage.h"
|
||||||
|
#include "utils/string.h"
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class CachedSettingValue
|
class CachedSettingValue
|
||||||
@@ -78,13 +78,13 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// regular load/save pair
|
// regular load/save pair
|
||||||
template <typename U, typename std::enable_if<!std::is_enum<U>::value, int>::type = 0>
|
template <typename U, typename std::enable_if_t<!std::is_enum<U>::value, int> = 0>
|
||||||
U loadValue(const U &defaultValue)
|
U loadValue(const U &defaultValue)
|
||||||
{
|
{
|
||||||
return SettingsStorage::instance()->loadValue(m_keyName, defaultValue).template value<T>();
|
return SettingsStorage::instance()->loadValue(m_keyName, defaultValue).template value<T>();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename U, typename std::enable_if<!std::is_enum<U>::value, int>::type = 0>
|
template <typename U, typename std::enable_if_t<!std::is_enum<U>::value, int> = 0>
|
||||||
void storeValue(const U &value)
|
void storeValue(const U &value)
|
||||||
{
|
{
|
||||||
SettingsStorage::instance()->storeValue(m_keyName, value);
|
SettingsStorage::instance()->storeValue(m_keyName, value);
|
||||||
@@ -92,27 +92,18 @@ private:
|
|||||||
|
|
||||||
// load/save pair for an enum
|
// load/save pair for an enum
|
||||||
// saves literal value of the enum constant, obtained from QMetaEnum
|
// saves literal value of the enum constant, obtained from QMetaEnum
|
||||||
template <typename U, typename std::enable_if<std::is_enum<U>::value, int>::type = 0>
|
template <typename U, typename std::enable_if_t<std::is_enum<U>::value, int> = 0>
|
||||||
U loadValue(const U &defaultValue)
|
U loadValue(const U &defaultValue)
|
||||||
{
|
{
|
||||||
static_assert(std::is_same<int, typename std::underlying_type<U>::type>::value,
|
return Utils::String::toEnum(SettingsStorage::instance()->loadValue(m_keyName).toString(), defaultValue);
|
||||||
"Enumeration underlying type has to be int");
|
|
||||||
|
|
||||||
bool ok = false;
|
|
||||||
const U res = static_cast<U>(QMetaEnum::fromType<U>().keyToValue(
|
|
||||||
SettingsStorage::instance()->loadValue(m_keyName).toString().toLatin1().constData(), &ok));
|
|
||||||
return ok ? res : defaultValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename U, typename std::enable_if<std::is_enum<U>::value, int>::type = 0>
|
template <typename U, typename std::enable_if_t<std::is_enum<U>::value, int> = 0>
|
||||||
void storeValue(const U &value)
|
void storeValue(const U &value)
|
||||||
{
|
{
|
||||||
SettingsStorage::instance()->storeValue(m_keyName,
|
SettingsStorage::instance()->storeValue(m_keyName, Utils::String::fromEnum(value));
|
||||||
QString::fromLatin1(QMetaEnum::fromType<U>().valueToKey(static_cast<int>(value))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString m_keyName;
|
const QString m_keyName;
|
||||||
T m_value;
|
T m_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SETTINGVALUE_H
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include "bittorrent/torrenthandle.h"
|
#include "bittorrent/torrenthandle.h"
|
||||||
|
|
||||||
const QString TorrentFilter::AnyCategory;
|
const QString TorrentFilter::AnyCategory;
|
||||||
const QStringSet TorrentFilter::AnyHash = (QStringSet() << QString());
|
const InfoHashSet TorrentFilter::AnyHash {{}};
|
||||||
const QString TorrentFilter::AnyTag;
|
const QString TorrentFilter::AnyTag;
|
||||||
|
|
||||||
const TorrentFilter TorrentFilter::DownloadingTorrent(TorrentFilter::Downloading);
|
const TorrentFilter TorrentFilter::DownloadingTorrent(TorrentFilter::Downloading);
|
||||||
@@ -49,12 +49,7 @@ const TorrentFilter TorrentFilter::ErroredTorrent(TorrentFilter::Errored);
|
|||||||
|
|
||||||
using BitTorrent::TorrentHandle;
|
using BitTorrent::TorrentHandle;
|
||||||
|
|
||||||
TorrentFilter::TorrentFilter()
|
TorrentFilter::TorrentFilter(const Type type, const InfoHashSet &hashSet, const QString &category, const QString &tag)
|
||||||
: m_type(All)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
TorrentFilter::TorrentFilter(const Type type, const QStringSet &hashSet, const QString &category, const QString &tag)
|
|
||||||
: m_type(type)
|
: m_type(type)
|
||||||
, m_category(category)
|
, m_category(category)
|
||||||
, m_tag(tag)
|
, m_tag(tag)
|
||||||
@@ -62,7 +57,7 @@ TorrentFilter::TorrentFilter(const Type type, const QStringSet &hashSet, const Q
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
TorrentFilter::TorrentFilter(const QString &filter, const QStringSet &hashSet, const QString &category, const QString &tag)
|
TorrentFilter::TorrentFilter(const QString &filter, const InfoHashSet &hashSet, const QString &category, const QString &tag)
|
||||||
: m_type(All)
|
: m_type(All)
|
||||||
, m_category(category)
|
, m_category(category)
|
||||||
, m_tag(tag)
|
, m_tag(tag)
|
||||||
@@ -112,7 +107,7 @@ bool TorrentFilter::setTypeByName(const QString &filter)
|
|||||||
return setType(type);
|
return setType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TorrentFilter::setHashSet(const QStringSet &hashSet)
|
bool TorrentFilter::setHashSet(const InfoHashSet &hashSet)
|
||||||
{
|
{
|
||||||
if (m_hashSet != hashSet)
|
if (m_hashSet != hashSet)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,19 +26,20 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TORRENTFILTER_H
|
#pragma once
|
||||||
#define TORRENTFILTER_H
|
|
||||||
|
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
typedef QSet<QString> QStringSet;
|
#include "base/bittorrent/infohash.h"
|
||||||
|
|
||||||
namespace BitTorrent
|
namespace BitTorrent
|
||||||
{
|
{
|
||||||
class TorrentHandle;
|
class TorrentHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using InfoHashSet = QSet<BitTorrent::InfoHash>;
|
||||||
|
|
||||||
class TorrentFilter
|
class TorrentFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -60,7 +61,7 @@ public:
|
|||||||
|
|
||||||
// These mean any permutation, including no category / tag.
|
// These mean any permutation, including no category / tag.
|
||||||
static const QString AnyCategory;
|
static const QString AnyCategory;
|
||||||
static const QStringSet AnyHash;
|
static const InfoHashSet AnyHash;
|
||||||
static const QString AnyTag;
|
static const QString AnyTag;
|
||||||
|
|
||||||
static const TorrentFilter DownloadingTorrent;
|
static const TorrentFilter DownloadingTorrent;
|
||||||
@@ -75,15 +76,15 @@ public:
|
|||||||
static const TorrentFilter StalledDownloadingTorrent;
|
static const TorrentFilter StalledDownloadingTorrent;
|
||||||
static const TorrentFilter ErroredTorrent;
|
static const TorrentFilter ErroredTorrent;
|
||||||
|
|
||||||
TorrentFilter();
|
TorrentFilter() = default;
|
||||||
// category & tags: pass empty string for uncategorized / untagged torrents.
|
// category & tags: pass empty string for uncategorized / untagged torrents.
|
||||||
// Pass null string (QString()) to disable filtering (i.e. all torrents).
|
// Pass null string (QString()) to disable filtering (i.e. all torrents).
|
||||||
TorrentFilter(Type type, const QStringSet &hashSet = AnyHash, const QString &category = AnyCategory, const QString &tag = AnyTag);
|
TorrentFilter(Type type, const InfoHashSet &hashSet = AnyHash, const QString &category = AnyCategory, const QString &tag = AnyTag);
|
||||||
TorrentFilter(const QString &filter, const QStringSet &hashSet = AnyHash, const QString &category = AnyCategory, const QString &tags = AnyTag);
|
TorrentFilter(const QString &filter, const InfoHashSet &hashSet = AnyHash, const QString &category = AnyCategory, const QString &tags = AnyTag);
|
||||||
|
|
||||||
bool setType(Type type);
|
bool setType(Type type);
|
||||||
bool setTypeByName(const QString &filter);
|
bool setTypeByName(const QString &filter);
|
||||||
bool setHashSet(const QStringSet &hashSet);
|
bool setHashSet(const InfoHashSet &hashSet);
|
||||||
bool setCategory(const QString &category);
|
bool setCategory(const QString &category);
|
||||||
bool setTag(const QString &tag);
|
bool setTag(const QString &tag);
|
||||||
|
|
||||||
@@ -95,10 +96,8 @@ private:
|
|||||||
bool matchCategory(const BitTorrent::TorrentHandle *torrent) const;
|
bool matchCategory(const BitTorrent::TorrentHandle *torrent) const;
|
||||||
bool matchTag(const BitTorrent::TorrentHandle *torrent) const;
|
bool matchTag(const BitTorrent::TorrentHandle *torrent) const;
|
||||||
|
|
||||||
Type m_type;
|
Type m_type {All};
|
||||||
QString m_category;
|
QString m_category;
|
||||||
QString m_tag;
|
QString m_tag;
|
||||||
QStringSet m_hashSet;
|
InfoHashSet m_hashSet;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TORRENTFILTER_H
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRISTATEBOOL_H
|
#pragma once
|
||||||
#define TRISTATEBOOL_H
|
|
||||||
|
|
||||||
class TriStateBool
|
class TriStateBool
|
||||||
{
|
{
|
||||||
@@ -68,5 +67,3 @@ constexpr bool operator!=(const TriStateBool &left, const TriStateBool &right)
|
|||||||
{
|
{
|
||||||
return !(left == right);
|
return !(left == right);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TRISTATEBOOL_H
|
|
||||||
|
|||||||
@@ -26,10 +26,9 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TYPES_H
|
#pragma once
|
||||||
#define TYPES_H
|
|
||||||
|
|
||||||
#include <QMap>
|
#include <QtContainerFwd>
|
||||||
|
|
||||||
const qlonglong MAX_ETA = 8640000;
|
const qlonglong MAX_ETA = 8640000;
|
||||||
|
|
||||||
@@ -42,5 +41,3 @@ enum class ShutdownDialogAction
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef QMap<QString, QString> QStringMap;
|
typedef QMap<QString, QString> QStringMap;
|
||||||
|
|
||||||
#endif // TYPES_H
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include "bytearray.h"
|
#include "bytearray.h"
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
QVector<QByteArray> Utils::ByteArray::splitToViews(const QByteArray &in, const QByteArray &sep, const QString::SplitBehavior behavior)
|
QVector<QByteArray> Utils::ByteArray::splitToViews(const QByteArray &in, const QByteArray &sep, const QString::SplitBehavior behavior)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVector>
|
#include <QtContainerFwd>
|
||||||
|
|
||||||
class QByteArray;
|
class QByteArray;
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTILS_FS_H
|
#pragma once
|
||||||
#define UTILS_FS_H
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility functions related to file system.
|
* Utility functions related to file system.
|
||||||
@@ -79,5 +78,3 @@ namespace Utils
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // UTILS_FS_H
|
|
||||||
|
|||||||
@@ -27,8 +27,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTILS_GZIP_H
|
#pragma once
|
||||||
#define UTILS_GZIP_H
|
|
||||||
|
|
||||||
class QByteArray;
|
class QByteArray;
|
||||||
|
|
||||||
@@ -40,5 +39,3 @@ namespace Utils
|
|||||||
QByteArray decompress(const QByteArray &data, bool *ok = nullptr);
|
QByteArray decompress(const QByteArray &data, bool *ok = nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // UTILS_GZIP_H
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) && defined(QT_DBUS_LIB)
|
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) && defined(QT_DBUS_LIB)
|
||||||
#include <QDBusInterface>
|
#include <QDBusInterface>
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTILS_MISC_H
|
#pragma once
|
||||||
#define UTILS_MISC_H
|
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
@@ -108,5 +107,3 @@ namespace Utils
|
|||||||
#endif // Q_OS_WIN
|
#endif // Q_OS_WIN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // UTILS_MISC_H
|
|
||||||
|
|||||||
@@ -28,10 +28,13 @@
|
|||||||
|
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
|
||||||
|
#include <QList>
|
||||||
#include <QNetworkInterface>
|
#include <QNetworkInterface>
|
||||||
|
#include <QPair>
|
||||||
#include <QSslCertificate>
|
#include <QSslCertificate>
|
||||||
#include <QSslKey>
|
#include <QSslKey>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
namespace Utils
|
namespace Utils
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,13 +26,10 @@
|
|||||||
* exception statement from your version.
|
* exception statement from your version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BASE_UTILS_NET_H
|
#pragma once
|
||||||
#define BASE_UTILS_NET_H
|
|
||||||
|
|
||||||
#include <QHostAddress>
|
#include <QHostAddress>
|
||||||
#include <QList>
|
#include <QtContainerFwd>
|
||||||
#include <QPair>
|
|
||||||
#include <QVector>
|
|
||||||
|
|
||||||
class QSslCertificate;
|
class QSslCertificate;
|
||||||
class QSslKey;
|
class QSslKey;
|
||||||
@@ -59,5 +56,3 @@ namespace Utils
|
|||||||
bool isSSLKeyValid(const QByteArray &data);
|
bool isSSLKeyValid(const QByteArray &data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BASE_UTILS_NET_H
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
#include "bytearray.h"
|
#include "bytearray.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user