diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index c77cc888e2d0..1302695fbcc4 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -7,19 +7,17 @@ body:
#### ADVISORY
"We do not support any versions older than the current release series"
- "We do not support any 3rd party/forked versions e.g. `portableapps`/`Enhanced Edition`etc."
+ "We do not support any 3rd party/forked versions e.g. `portableapps`/`Enhanced Edition` etc."
"Please post all details in **English**."
#### Prerequisites before submitting an issue!
- Read the issue reporting section in the **[contributing guidelines](https://github.com/qbittorrent/qBittorrent/blob/master/CONTRIBUTING.md)**, to know how to submit a good bug report with the required information.
- Verify that the issue is not fixed and is reproducible in the **[latest official qBittorrent version](https://www.qbittorrent.org/download.php).**
- - (Optional, but recommended) Verify that the issue is not fixed and is reproducible in the latest CI (currently only on **[Windows](https://github.com/qbittorrent/qBittorrent/actions/workflows/ci_windows.yaml?query=branch%3Amaster+event%3Apush)**) builds.
- - Check the **[frequent/common issues list](https://github.com/qbittorrent/qBittorrent/projects/2)** and perform a **[search of the issue tracker (including closed ones)](https://github.com/qbittorrent/qBittorrent/issues)** to avoid posting a duplicate.
+ - (Optional, but recommended) Verify that the issue is not fixed and is reproducible in the latest CI (**[macOS](https://github.com/qbittorrent/qBittorrent/actions/workflows/ci_macos.yaml?query=branch%3Amaster+event%3Apush)** / **[Ubuntu](https://github.com/qbittorrent/qBittorrent/actions/workflows/ci_ubuntu.yaml?query=branch%3Amaster+event%3Apush)** / **[Windows](https://github.com/qbittorrent/qBittorrent/actions/workflows/ci_windows.yaml?query=branch%3Amaster+event%3Apush)**) builds.
+ - Perform a **[search of the issue tracker (including closed ones)](https://github.com/qbittorrent/qBittorrent/issues?q=is%3Aissue+is%3Aopen+-label%3A%22Feature+request%22)** to avoid posting a duplicate.
- Make sure this is not a support request or question, both of which are better suited for either the **[discussions section](https://github.com/qbittorrent/qBittorrent/discussions)**, **[forum](https://qbforums.shiki.hu/)**, or **[subreddit](https://www.reddit.com/r/qBittorrent/)**.
- Verify that the **[wiki](https://github.com/qbittorrent/qBittorrent/wiki)** did not contain a suitable solution either.
- - If relevant to issue/when asked, the qBittorrent preferences file, qBittorrent.log & watched_folders.json (if using "Watched Folders" feature) must be provided.
- See **[Where does qBittorrent save its settings?](https://github.com/qbittorrent/qBittorrent/wiki/Frequently-Asked-Questions#Where_does_qBittorrent_save_its_settings)**
- type: textarea
attributes:
@@ -28,10 +26,10 @@ body:
Qt and libtorrent-rasterbar versions are required when: 1. You are using linux. 2. You are not using an official build downloaded from our website.
Example of preferred formatting:
- qBittorrent: 4.3.7 x64
- Operating system: Windows 10 Pro 21H1/2009 x64
- Qt: 5.15.2
- libtorrent-rasterbar: 1.2.14
+ qBittorrent: 4.6.6 x64
+ Operating system: Windows 10 Pro x64 (22H2) 10.0.19045
+ Qt: 6.4.3
+ libtorrent-rasterbar: 1.2.19
placeholder: |
qBittorrent:
Operating system:
@@ -73,4 +71,4 @@ body:
See **[Where does qBittorrent save its settings?](https://github.com/qbittorrent/qBittorrent/wiki/Frequently-Asked-Questions#Where_does_qBittorrent_save_its_settings)**
#### Note: It's the user's responsibility to redact any sensitive information
validations:
- required: false
+ required: true
diff --git a/.github/workflows/ci_file_health.yaml b/.github/workflows/ci_file_health.yaml
index f613f48b05f2..48bc52f595a6 100644
--- a/.github/workflows/ci_file_health.yaml
+++ b/.github/workflows/ci_file_health.yaml
@@ -12,17 +12,21 @@ jobs:
ci:
name: Check
runs-on: ubuntu-latest
+ permissions:
+ security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- - name: Install tools
- uses: actions/setup-python@v4
+ - name: Setup python
+ uses: actions/setup-python@v5
with:
python-version: "*"
- name: Check files
- uses: pre-commit/action@v3.0.0
+ uses: pre-commit/action@v3.0.1
- name: Check doc
env:
@@ -32,7 +36,7 @@ jobs:
curl \
-L \
-o "${{ runner.temp }}/pandoc.tar.gz" \
- "https://github.com/jgm/pandoc/releases/download/3.1.7/pandoc-3.1.7-linux-amd64.tar.gz"
+ "https://github.com/jgm/pandoc/releases/download/3.6/pandoc-3.6-linux-amd64.tar.gz"
tar -xf "${{ runner.temp }}/pandoc.tar.gz" -C "${{ github.workspace }}/.."
mv "${{ github.workspace }}/.."/pandoc-* "${{ env.pandoc_path }}"
# run pandoc
@@ -42,3 +46,26 @@ jobs:
done
# check diff, ignore "Automatically generated by ..." part
git diff -I '\.\\".*' --exit-code
+
+ - name: Check GitHub Actions workflow
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ pip install zizmor
+ IGNORE_RULEID='(.ruleId != "template-injection")
+ and (.ruleId != "unpinned-uses")'
+ IGNORE_ID='(.id != "template-injection")
+ and (.id != "unpinned-uses")'
+ zizmor \
+ --format sarif \
+ --pedantic \
+ ./ \
+ | jq "(.runs[].results |= map(select($IGNORE_RULEID)))
+ | (.runs[].tool.driver.rules |= map(select($IGNORE_ID)))" \
+ > "${{ runner.temp }}/zizmor_results.sarif"
+
+ - name: Upload zizmor results
+ uses: github/codeql-action/upload-sarif@v3
+ with:
+ category: zizmor
+ sarif_file: "${{ runner.temp }}/zizmor_results.sarif"
diff --git a/.github/workflows/ci_macos.yaml b/.github/workflows/ci_macos.yaml
index 92de8782799d..3927ee6947ae 100644
--- a/.github/workflows/ci_macos.yaml
+++ b/.github/workflows/ci_macos.yaml
@@ -2,8 +2,7 @@ name: CI - macOS
on: [pull_request, push]
-permissions:
- actions: write
+permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -13,24 +12,28 @@ jobs:
ci:
name: Build
runs-on: macos-latest
+ permissions:
+ actions: write
strategy:
fail-fast: false
matrix:
- libt_version: ["2.0.9", "1.2.19"]
+ libt_version: ["2.0.11", "1.2.20"]
qbt_gui: ["GUI=ON", "GUI=OFF"]
- qt_version: ["6.5.2"]
+ qt_version: ["6.7.0"]
env:
boost_path: "${{ github.workspace }}/../boost"
- openssl_root: /usr/local/opt/openssl@3
+ libtorrent_path: "${{ github.workspace }}/../libtorrent"
steps:
- name: Checkout repository
uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- name: Install dependencies
- uses: Wandalen/wretry.action@v1
+ uses: Wandalen/wretry.action@v3
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
@@ -46,23 +49,35 @@ jobs:
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
+ store_cache: ${{ github.ref == 'refs/heads/master' }}
update_packager_index: false
+ ccache_options: |
+ max_size=2G
- name: Install boost
+ env:
+ BOOST_MAJOR_VERSION: "1"
+ BOOST_MINOR_VERSION: "86"
+ BOOST_PATCH_VERSION: "0"
run: |
- curl \
- -L \
- -o "${{ runner.temp }}/boost.tar.gz" \
- "https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz"
- tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."
+ boost_url="https://archives.boost.io/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
+ boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
+ set +e
+ curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
+ tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
+ if [ "$_exitCode" -ne "0" ]; then
+ curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
+ tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
+ fi
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
- name: Install Qt
- uses: jurplel/install-qt-action@v3
+ uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt_version }}
archives: qtbase qtdeclarative qtsvg qttools
# Not sure why Qt made a hard dependency on qtdeclarative, try removing it when Qt > 6.4.0
+ cache: true
- name: Install libtorrent
run: |
@@ -70,24 +85,24 @@ jobs:
--branch v${{ matrix.libt_version }} \
--depth 1 \
--recurse-submodules \
- https://github.com/arvidn/libtorrent.git
- cd libtorrent
+ https://github.com/arvidn/libtorrent.git \
+ ${{ env.libtorrent_path }}
+ cd ${{ env.libtorrent_path }}
cmake \
-B build \
-G "Ninja" \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
- -DCMAKE_CXX_STANDARD=17 \
+ -DCMAKE_CXX_STANDARD=20 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBOOST_ROOT="${{ env.boost_path }}" \
- -Ddeprecated-functions=OFF \
- -DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
+ -Ddeprecated-functions=OFF
cmake --build build
sudo cmake --install build
- name: Build qBittorrent
run: |
- CXXFLAGS="$CXXFLAGS -Werror -Wno-error=deprecated-declarations" \
+ CXXFLAGS="$CXXFLAGS -DQT_FORCE_ASSERTS -Werror -Wno-error=deprecated-declarations" \
LDFLAGS="$LDFLAGS -gz" \
cmake \
-B build \
@@ -95,7 +110,6 @@ jobs:
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBOOST_ROOT="${{ env.boost_path }}" \
- -DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
-DTESTING=ON \
-DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }}
@@ -110,8 +124,18 @@ jobs:
if [ "${{ matrix.qbt_gui }}" = "GUI=OFF" ]; then
appName="qbittorrent-nox"
fi
+ # package
pushd build
- macdeployqt "$appName.app" -dmg -no-strip
+ PACKAGE_RETRY=0
+ while [ "$PACKAGE_RETRY" -lt "3" ]; do
+ macdeployqt "$appName.app" -dmg -no-strip
+ if [ -f "$appName.dmg" ]; then
+ break
+ fi
+ sleep 5
+ PACKAGE_RETRY=$((PACKAGE_RETRY + 1))
+ echo "Retry $PACKAGE_RETRY..."
+ done
popd
# prepare upload folder
mkdir upload
@@ -119,10 +143,10 @@ jobs:
mkdir upload/cmake
cp build/compile_commands.json upload/cmake
mkdir upload/cmake/libtorrent
- cp libtorrent/build/compile_commands.json upload/cmake/libtorrent
+ cp ${{ env.libtorrent_path }}/build/compile_commands.json upload/cmake/libtorrent
- name: Upload build artifacts
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
path: upload
diff --git a/.github/workflows/ci_python.yaml b/.github/workflows/ci_python.yaml
new file mode 100644
index 000000000000..871614dad51f
--- /dev/null
+++ b/.github/workflows/ci_python.yaml
@@ -0,0 +1,91 @@
+name: CI - Python
+
+on: [pull_request, push]
+
+permissions: {}
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: ${{ github.head_ref != '' }}
+
+jobs:
+ ci:
+ name: Check
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+
+ - name: Setup python (auxiliary scripts)
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3' # use default version
+
+ - name: Install tools (auxiliary scripts)
+ run: pip install bandit pycodestyle pyflakes
+
+ - name: Gather files (auxiliary scripts)
+ run: |
+ export "PY_FILES=$(find . -type f -name '*.py' ! -path '*searchengine*' -printf '%p ')"
+ echo $PY_FILES
+ echo "PY_FILES=$PY_FILES" >> "$GITHUB_ENV"
+
+ - name: Lint code (auxiliary scripts)
+ run: |
+ pyflakes $PY_FILES
+ bandit --skip B101,B314,B405 $PY_FILES
+
+ - name: Format code (auxiliary scripts)
+ run: |
+ pycodestyle \
+ --max-line-length=1000 \
+ --statistics \
+ $PY_FILES
+
+ - name: Build code (auxiliary scripts)
+ run: |
+ python -m compileall $PY_FILES
+
+ - name: Setup python (search engine)
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.9'
+
+ - name: Install tools (search engine)
+ run: pip install bandit mypy pycodestyle pyflakes pyright
+
+ - name: Gather files (search engine)
+ run: |
+ export "PY_FILES=$(find . -type f -name '*.py' -path '*searchengine*' ! -name 'socks.py' -printf '%p ')"
+ echo $PY_FILES
+ echo "PY_FILES=$PY_FILES" >> "$GITHUB_ENV"
+
+ - name: Check typings (search engine)
+ run: |
+ MYPYPATH="src/searchengine/nova3" \
+ mypy \
+ --follow-imports skip \
+ --strict \
+ $PY_FILES
+ pyright \
+ $PY_FILES
+
+ - name: Lint code (search engine)
+ run: |
+ pyflakes $PY_FILES
+ bandit --skip B110,B310,B314,B405 $PY_FILES
+
+ - name: Format code (search engine)
+ run: |
+ pycodestyle \
+ --ignore=E265,E402 \
+ --max-line-length=1000 \
+ --statistics \
+ $PY_FILES
+
+ - name: Build code (search engine)
+ run: |
+ python -m compileall $PY_FILES
diff --git a/.github/workflows/ci_ubuntu.yaml b/.github/workflows/ci_ubuntu.yaml
index 64f9bac58bd5..5643d7cce79e 100644
--- a/.github/workflows/ci_ubuntu.yaml
+++ b/.github/workflows/ci_ubuntu.yaml
@@ -2,9 +2,7 @@ name: CI - Ubuntu
on: [pull_request, push]
-permissions:
- actions: write
- security-events: write
+permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -14,21 +12,27 @@ jobs:
ci:
name: Build
runs-on: ubuntu-latest
+ permissions:
+ actions: write
+ security-events: write
strategy:
fail-fast: false
matrix:
- libt_version: ["2.0.9", "1.2.19"]
+ libt_version: ["2.0.11", "1.2.20"]
qbt_gui: ["GUI=ON", "GUI=OFF"]
qt_version: ["6.5.2"]
env:
boost_path: "${{ github.workspace }}/../boost"
- harden_flags: "-D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS"
+ harden_flags: "-D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS"
+ libtorrent_path: "${{ github.workspace }}/../libtorrent"
steps:
- name: Checkout repository
uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- name: Install dependencies
run: |
@@ -40,24 +44,34 @@ jobs:
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
+ store_cache: ${{ github.ref == 'refs/heads/master' }}
update_packager_index: false
ccache_options: |
max_size=2G
- name: Install boost
+ env:
+ BOOST_MAJOR_VERSION: "1"
+ BOOST_MINOR_VERSION: "77"
+ BOOST_PATCH_VERSION: "0"
run: |
- curl \
- -L \
- -o "${{ runner.temp }}/boost.tar.gz" \
- "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz"
- tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."
+ boost_url="https://archives.boost.io/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
+ boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
+ set +e
+ curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
+ tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
+ if [ "$_exitCode" -ne "0" ]; then
+ curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
+ tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
+ fi
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
- name: Install Qt
- uses: jurplel/install-qt-action@v3
+ uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt_version }}
archives: icu qtbase qtdeclarative qtsvg qttools
+ cache: true
- name: Install libtorrent
run: |
@@ -65,14 +79,16 @@ jobs:
--branch v${{ matrix.libt_version }} \
--depth 1 \
--recurse-submodules \
- https://github.com/arvidn/libtorrent.git
- cd libtorrent
+ https://github.com/arvidn/libtorrent.git \
+ ${{ env.libtorrent_path }}
+ cd ${{ env.libtorrent_path }}
CXXFLAGS="$CXXFLAGS ${{ env.harden_flags }}" \
cmake \
-B build \
-G "Ninja" \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_CXX_STANDARD=20 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBOOST_ROOT="${{ env.boost_path }}" \
-Ddeprecated-functions=OFF
@@ -81,7 +97,7 @@ jobs:
# to avoid scanning 3rdparty codebases, initialize it just before building qbt
- name: Initialize CodeQL
- uses: github/codeql-action/init@v2
+ uses: github/codeql-action/init@v3
if: startsWith(matrix.libt_version, 2) && (matrix.qbt_gui == 'GUI=ON')
with:
config-file: ./.github/workflows/helper/codeql/cpp.yaml
@@ -89,7 +105,7 @@ jobs:
- name: Build qBittorrent
run: |
- CXXFLAGS="$CXXFLAGS ${{ env.harden_flags }} -Werror" \
+ CXXFLAGS="$CXXFLAGS ${{ env.harden_flags }} -DQT_FORCE_ASSERTS -Werror" \
LDFLAGS="$LDFLAGS -gz" \
cmake \
-B build \
@@ -107,7 +123,7 @@ jobs:
DESTDIR="qbittorrent" cmake --install build
- name: Run CodeQL analysis
- uses: github/codeql-action/analyze@v2
+ uses: github/codeql-action/analyze@v3
if: startsWith(matrix.libt_version, 2) && (matrix.qbt_gui == 'GUI=ON')
with:
category: ${{ github.base_ref || github.ref_name }}
@@ -118,37 +134,40 @@ jobs:
mkdir upload/cmake
cp build/compile_commands.json upload/cmake
mkdir upload/cmake/libtorrent
- cp libtorrent/build/compile_commands.json upload/cmake/libtorrent
+ cp ${{ env.libtorrent_path }}/build/compile_commands.json upload/cmake/libtorrent
- - name: 'AppImage: Prepare env'
+ - name: Install AppImage
run: |
- sudo apt install libfuse2
- wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
- wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
- wget https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage
- chmod +x linuxdeploy-x86_64.AppImage
- chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
- chmod +x linuxdeploy-plugin-appimage-x86_64.AppImage
-
- - name: 'AppImage: Prepare nox'
+ curl \
+ -L \
+ -Z \
+ -O https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage \
+ -O https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage \
+ -O https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage
+ chmod +x \
+ linuxdeploy-x86_64.AppImage \
+ linuxdeploy-plugin-qt-x86_64.AppImage \
+ linuxdeploy-plugin-appimage-x86_64.AppImage
+
+ - name: Prepare files for AppImage
if: matrix.qbt_gui == 'GUI=OFF'
run: |
- mkdir -p qbittorrent/usr/share/icons/hicolor/scalable/apps/
- mkdir -p qbittorrent/usr/share/applications/
- cp dist/unix/menuicons/scalable/apps/qbittorrent.svg qbittorrent/usr/share/icons/hicolor/scalable/apps/qbittorrent.svg
+ mkdir -p qbittorrent/usr/share/applications
cp .github/workflows/helper/appimage/org.qbittorrent.qBittorrent.desktop qbittorrent/usr/share/applications/org.qbittorrent.qBittorrent.desktop
+ mkdir -p qbittorrent/usr/share/icons/hicolor/scalable/apps
+ cp dist/unix/menuicons/scalable/apps/qbittorrent.svg qbittorrent/usr/share/icons/hicolor/scalable/apps/qbittorrent.svg
- - name: 'AppImage: Package'
+ - name: Package AppImage
run: |
- ./linuxdeploy-x86_64.AppImage --appdir=qbittorrent --plugin qt
+ ./linuxdeploy-x86_64.AppImage --appdir qbittorrent --plugin qt
rm qbittorrent/apprun-hooks/*
cp .github/workflows/helper/appimage/export_vars.sh qbittorrent/apprun-hooks/export_vars.sh
NO_APPSTREAM=1 \
- OUTPUT=upload/qbittorrent-CI_Ubuntu_x86_64.AppImage \
- ./linuxdeploy-x86_64.AppImage --appdir=qbittorrent --output appimage
+ OUTPUT=upload/qbittorrent-CI_Ubuntu_x86_64.AppImage \
+ ./linuxdeploy-x86_64.AppImage --appdir qbittorrent --output appimage
- name: Upload build artifacts
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: qBittorrent-CI_Ubuntu-x64_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
path: upload
diff --git a/.github/workflows/ci_webui.yaml b/.github/workflows/ci_webui.yaml
index e7bd0478f270..a46e003ca94d 100644
--- a/.github/workflows/ci_webui.yaml
+++ b/.github/workflows/ci_webui.yaml
@@ -2,8 +2,7 @@ name: CI - WebUI
on: [pull_request, push]
-permissions:
- security-events: write
+permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -13,6 +12,8 @@ jobs:
ci:
name: Check
runs-on: ubuntu-latest
+ permissions:
+ security-events: write
defaults:
run:
@@ -21,6 +22,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- name: Setup nodejs
uses: actions/setup-node@v4
@@ -28,7 +31,15 @@ jobs:
node-version: 'lts/*'
- name: Install tools
- run: npm install
+ run: |
+ npm install
+ npm ls
+ echo "::group::npm ls --all"
+ npm ls --all
+ echo "::endgroup::"
+
+ - name: Run tests
+ run: npm test
- name: Lint code
run: npm run lint
@@ -39,10 +50,10 @@ jobs:
git diff --exit-code
- name: Initialize CodeQL
- uses: github/codeql-action/init@v2
+ uses: github/codeql-action/init@v3
with:
- config-file: ./.github/workflows/helper/codeql/js.yaml
+ config-file: .github/workflows/helper/codeql/js.yaml
languages: javascript
- name: Run CodeQL analysis
- uses: github/codeql-action/analyze@v2
+ uses: github/codeql-action/analyze@v3
diff --git a/.github/workflows/ci_windows.yaml b/.github/workflows/ci_windows.yaml
index 0f61d2715baa..95118d51c2c8 100644
--- a/.github/workflows/ci_windows.yaml
+++ b/.github/workflows/ci_windows.yaml
@@ -2,8 +2,7 @@ name: CI - Windows
on: [pull_request, push]
-permissions:
- actions: write
+permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -13,61 +12,96 @@ jobs:
ci:
name: Build
runs-on: windows-latest
+ permissions:
+ actions: write
strategy:
fail-fast: false
matrix:
- libt_version: ["2.0.9", "1.2.19"]
+ libt_version: ["2.0.11", "1.2.20"]
env:
boost_path: "${{ github.workspace }}/../boost"
- libtorrent_path: "${{ github.workspace }}/libtorrent"
+ libtorrent_path: "${{ github.workspace }}/../libtorrent"
+ vcpkg_path: "c:/vcpkg"
steps:
- name: Checkout repository
uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- name: Setup devcmd
uses: ilammy/msvc-dev-cmd@v1
- name: Install build tools
run: |
- choco install ninja
-
- # use the preinstalled vcpkg from image
- # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#package-management
- - name: Setup vcpkg
- uses: lukka/run-vcpkg@v11
+ if ((Get-Command "ninja.exe" -ErrorAction SilentlyContinue) -eq $null)
+ {
+ choco install ninja
+ }
+ where.exe ninja
+ ninja --version
+
+ # https://learn.microsoft.com/en-us/vcpkg/users/binarycaching#gha
+ - name: Set variables for vcpkg
+ uses: actions/github-script@v7
with:
- vcpkgDirectory: C:/vcpkg
- doNotUpdateVcpkg: true # the preinstalled vcpkg is updated regularly
+ script: |
+ core.exportVariable('ACTIONS_CACHE_URL', (process.env.ACTIONS_CACHE_URL || ''));
+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', (process.env.ACTIONS_RUNTIME_TOKEN || ''));
- - name: Install dependencies from vcpkg
+ - name: Install dependencies with vcpkg
run: |
+ # create our own triplet
+ New-Item `
+ -Force `
+ -ItemType File `
+ -Path "${{ env.vcpkg_path }}/triplets_overlay/x64-windows-static-md-release.cmake"
+ # OpenSSL isn't compatible with `/guard:cf` flag so we omit it for now, see: https://github.com/openssl/openssl/issues/22554
+ Add-Content `
+ -Path "${{ env.vcpkg_path }}/triplets_overlay/x64-windows-static-md-release.cmake" `
+ -Value @("set(VCPKG_TARGET_ARCHITECTURE x64)",
+ "set(VCPKG_LIBRARY_LINKAGE static)",
+ "set(VCPKG_CRT_LINKAGE dynamic)",
+ "set(VCPKG_BUILD_TYPE release)")
# clear buildtrees after each package installation to reduce disk space requirements
$packages = `
- "openssl:x64-windows-static-release",
- "zlib:x64-windows-static-release"
- ${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe upgrade `
- --no-dry-run
- ${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe install `
+ "openssl:x64-windows-static-md-release",
+ "zlib:x64-windows-static-md-release"
+ ${{ env.vcpkg_path }}/vcpkg.exe upgrade `
+ --no-dry-run `
+ --overlay-triplets="${{ env.vcpkg_path }}/triplets_overlay"
+ ${{ env.vcpkg_path }}/vcpkg.exe install `
+ --binarysource="clear;x-gha,readwrite" `
--clean-after-build `
+ --overlay-triplets="${{ env.vcpkg_path }}/triplets_overlay" `
$packages
- name: Install boost
+ env:
+ BOOST_MAJOR_VERSION: "1"
+ BOOST_MINOR_VERSION: "86"
+ BOOST_PATCH_VERSION: "0"
run: |
- curl `
- -L `
- -o "${{ runner.temp }}/boost.tar.gz" `
- "https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz"
+ $boost_url="https://archives.boost.io/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
+ $boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
+ curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."
+ if ($LastExitCode -ne 0)
+ {
+ curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
+ tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."
+ }
move "${{ github.workspace }}/../boost_*" "${{ env.boost_path }}"
- name: Install Qt
- uses: jurplel/install-qt-action@v3
+ uses: jurplel/install-qt-action@v4
with:
- version: "6.5.2"
+ version: "6.8.0"
+ arch: win64_msvc2022_64
archives: qtbase qtsvg qttools
+ cache: true
- name: Install libtorrent
run: |
@@ -75,39 +109,41 @@ jobs:
--branch v${{ matrix.libt_version }} `
--depth 1 `
--recurse-submodules `
- https://github.com/arvidn/libtorrent.git
- cd libtorrent
+ https://github.com/arvidn/libtorrent.git `
+ ${{ env.libtorrent_path }}
+ cd ${{ env.libtorrent_path }}
$env:CXXFLAGS+=" /guard:cf"
$env:LDFLAGS+=" /guard:cf"
cmake `
-B build `
-G "Ninja" `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
+ -DCMAKE_CXX_STANDARD=20 `
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
- -DCMAKE_INSTALL_PREFIX="${{ env.libtorrent_path }}" `
- -DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
+ -DCMAKE_INSTALL_PREFIX="${{ env.libtorrent_path }}/install" `
+ -DCMAKE_TOOLCHAIN_FILE="${{ env.vcpkg_path }}/scripts/buildsystems/vcpkg.cmake" `
-DBOOST_ROOT="${{ env.boost_path }}" `
-DBUILD_SHARED_LIBS=OFF `
-Ddeprecated-functions=OFF `
-Dstatic_runtime=OFF `
- -DVCPKG_TARGET_TRIPLET=x64-windows-static-release
+ -DVCPKG_TARGET_TRIPLET=x64-windows-static-md-release
cmake --build build
cmake --install build
- name: Build qBittorrent
run: |
- $env:CXXFLAGS+=" /WX"
+ $env:CXXFLAGS+="/DQT_FORCE_ASSERTS /WX"
cmake `
-B build `
-G "Ninja" `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
- -DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
+ -DCMAKE_TOOLCHAIN_FILE="${{ env.vcpkg_path }}/scripts/buildsystems/vcpkg.cmake" `
-DBOOST_ROOT="${{ env.boost_path }}" `
- -DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/lib/cmake/LibtorrentRasterbar" `
+ -DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/install/lib/cmake/LibtorrentRasterbar" `
-DMSVC_RUNTIME_DYNAMIC=ON `
-DTESTING=ON `
- -DVCPKG_TARGET_TRIPLET=x64-windows-static-release `
+ -DVCPKG_TARGET_TRIPLET=x64-windows-static-md-release `
-DVERBOSE_CONFIGURE=ON `
--graphviz=build/target_graph.dot
cmake --build build --target qbt_update_translations
@@ -122,35 +158,35 @@ jobs:
copy build/qbittorrent.pdb upload/qBittorrent
copy dist/windows/qt.conf upload/qBittorrent
# runtimes
- copy "${{ env.Qt6_DIR }}/bin/Qt6Core.dll" upload/qBittorrent
- copy "${{ env.Qt6_DIR }}/bin/Qt6Gui.dll" upload/qBittorrent
- copy "${{ env.Qt6_DIR }}/bin/Qt6Network.dll" upload/qBittorrent
- copy "${{ env.Qt6_DIR }}/bin/Qt6Sql.dll" upload/qBittorrent
- copy "${{ env.Qt6_DIR }}/bin/Qt6Svg.dll" upload/qBittorrent
- copy "${{ env.Qt6_DIR }}/bin/Qt6Widgets.dll" upload/qBittorrent
- copy "${{ env.Qt6_DIR }}/bin/Qt6Xml.dll" upload/qBittorrent
+ copy "${{ env.Qt_ROOT_DIR }}/bin/Qt6Core.dll" upload/qBittorrent
+ copy "${{ env.Qt_ROOT_DIR }}/bin/Qt6Gui.dll" upload/qBittorrent
+ copy "${{ env.Qt_ROOT_DIR }}/bin/Qt6Network.dll" upload/qBittorrent
+ copy "${{ env.Qt_ROOT_DIR }}/bin/Qt6Sql.dll" upload/qBittorrent
+ copy "${{ env.Qt_ROOT_DIR }}/bin/Qt6Svg.dll" upload/qBittorrent
+ copy "${{ env.Qt_ROOT_DIR }}/bin/Qt6Widgets.dll" upload/qBittorrent
+ copy "${{ env.Qt_ROOT_DIR }}/bin/Qt6Xml.dll" upload/qBittorrent
mkdir upload/qBittorrent/plugins/iconengines
- copy "${{ env.Qt6_DIR }}/plugins/iconengines/qsvgicon.dll" upload/qBittorrent/plugins/iconengines
+ copy "${{ env.Qt_ROOT_DIR }}/plugins/iconengines/qsvgicon.dll" upload/qBittorrent/plugins/iconengines
mkdir upload/qBittorrent/plugins/imageformats
- copy "${{ env.Qt6_DIR }}/plugins/imageformats/qico.dll" upload/qBittorrent/plugins/imageformats
- copy "${{ env.Qt6_DIR }}/plugins/imageformats/qsvg.dll" upload/qBittorrent/plugins/imageformats
+ copy "${{ env.Qt_ROOT_DIR }}/plugins/imageformats/qico.dll" upload/qBittorrent/plugins/imageformats
+ copy "${{ env.Qt_ROOT_DIR }}/plugins/imageformats/qsvg.dll" upload/qBittorrent/plugins/imageformats
mkdir upload/qBittorrent/plugins/platforms
- copy "${{ env.Qt6_DIR }}/plugins/platforms/qwindows.dll" upload/qBittorrent/plugins/platforms
+ copy "${{ env.Qt_ROOT_DIR }}/plugins/platforms/qwindows.dll" upload/qBittorrent/plugins/platforms
mkdir upload/qBittorrent/plugins/sqldrivers
- copy "${{ env.Qt6_DIR }}/plugins/sqldrivers/qsqlite.dll" upload/qBittorrent/plugins/sqldrivers
+ copy "${{ env.Qt_ROOT_DIR }}/plugins/sqldrivers/qsqlite.dll" upload/qBittorrent/plugins/sqldrivers
mkdir upload/qBittorrent/plugins/styles
- copy "${{ env.Qt6_DIR }}/plugins/styles/qwindowsvistastyle.dll" upload/qBittorrent/plugins/styles
+ copy "${{ env.Qt_ROOT_DIR }}/plugins/styles/qmodernwindowsstyle.dll" upload/qBittorrent/plugins/styles
mkdir upload/qBittorrent/plugins/tls
- copy "${{ env.Qt6_DIR }}/plugins/tls/qschannelbackend.dll" upload/qBittorrent/plugins/tls
+ copy "${{ env.Qt_ROOT_DIR }}/plugins/tls/qschannelbackend.dll" upload/qBittorrent/plugins/tls
# cmake additionals
mkdir upload/cmake
copy build/compile_commands.json upload/cmake
copy build/target_graph.dot upload/cmake
mkdir upload/cmake/libtorrent
- copy libtorrent/build/compile_commands.json upload/cmake/libtorrent
+ copy ${{ env.libtorrent_path }}/build/compile_commands.json upload/cmake/libtorrent
- name: Upload build artifacts
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: qBittorrent-CI_Windows-x64_libtorrent-${{ matrix.libt_version }}
path: upload
@@ -158,10 +194,10 @@ jobs:
- name: Create installer
run: |
7z x -o"dist/windows/" "dist/windows/NSISPlugins.zip"
- makensis /DQBT_DIST_DIR="../../upload/qBittorrent" dist/windows/qbittorrent.nsi
+ makensis /DQBT_DIST_DIR="../../upload/qBittorrent" /WX dist/windows/qbittorrent.nsi
- name: Upload installer
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: qBittorrent-CI_Windows-x64_libtorrent-${{ matrix.libt_version }}-setup
path: dist/windows/qbittorrent_*_setup.exe
diff --git a/.github/workflows/coverity-scan.yaml b/.github/workflows/coverity-scan.yaml
index 860ec0b66863..c843ce7ee003 100644
--- a/.github/workflows/coverity-scan.yaml
+++ b/.github/workflows/coverity-scan.yaml
@@ -12,48 +12,85 @@ jobs:
name: Scan
runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ libt_version: ["2.0.11"]
+ qbt_gui: ["GUI=ON"]
+ qt_version: ["6.5.2"]
+
+ env:
+ boost_path: "${{ github.workspace }}/../boost"
+ coverity_path: "${{ github.workspace }}/../coverity"
+ libtorrent_path: "${{ github.workspace }}/../libtorrent"
+
steps:
- name: Checkout repository
uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- name: Install dependencies
run: |
sudo apt update
sudo apt install \
- build-essential cmake ninja-build pkg-config \
- libboost-dev libssl-dev zlib1g-dev
+ build-essential cmake ninja-build \
+ libssl-dev libxkbcommon-x11-dev libxcb-cursor-dev zlib1g-dev
+
+ - name: Install boost
+ env:
+ BOOST_MAJOR_VERSION: "1"
+ BOOST_MINOR_VERSION: "86"
+ BOOST_PATCH_VERSION: "0"
+ run: |
+ boost_url="https://archives.boost.io/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
+ boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
+ set +e
+ curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
+ tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
+ if [ "$_exitCode" -ne "0" ]; then
+ curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
+ tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
+ fi
+ mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
- name: Install Qt
- uses: jurplel/install-qt-action@v3
+ uses: jurplel/install-qt-action@v4
with:
- version: "6.5.2"
- archives: icu qtbase qtsvg qttools
+ version: ${{ matrix.qt_version }}
+ archives: icu qtbase qtdeclarative qtsvg qttools
+ cache: true
- name: Install libtorrent
run: |
git clone \
- --branch "v2.0.9" \
+ --branch v${{ matrix.libt_version }} \
--depth 1 \
--recurse-submodules \
- https://github.com/arvidn/libtorrent.git
- cd libtorrent
+ https://github.com/arvidn/libtorrent.git \
+ ${{ env.libtorrent_path }}
+ cd ${{ env.libtorrent_path }}
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_CXX_STANDARD=20 \
+ -DBOOST_ROOT="${{ env.boost_path }}" \
-Ddeprecated-functions=OFF
cmake --build build
sudo cmake --install build
- name: Download Coverity Build Tool
run: |
- wget \
- -q \
- https://scan.coverity.com/download/linux64 \
- --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=qbittorrent%2FqBittorrent" \
- -O coverity_tool.tgz
- mkdir coverity_tool
- tar xzf coverity_tool.tgz --strip 1 -C coverity_tool
+ curl \
+ -L \
+ -d "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=qbittorrent%2FqBittorrent" \
+ -o "${{ runner.temp }}/coverity_tool.tgz" \
+ "https://scan.coverity.com/download/linux64"
+ mkdir -p ${{ env.coverity_path }}
+ tar \
+ -xf "${{ runner.temp }}/coverity_tool.tgz" \
+ -C "${{ env.coverity_path }}" \
+ --strip-components 1
- name: Build qBittorrent
run: |
@@ -61,10 +98,13 @@ jobs:
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
- -DGUI=ON \
- -DVERBOSE_CONFIGURE=ON
- export PATH="$(pwd)/coverity_tool/bin:$PATH"
- cov-build --dir cov-int cmake --build build
+ -DBOOST_ROOT="${{ env.boost_path }}" \
+ -DVERBOSE_CONFIGURE=ON \
+ -D${{ matrix.qbt_gui }}
+ PATH="${{ env.coverity_path }}/bin:$PATH" \
+ cov-build \
+ --dir cov-int \
+ cmake --build build
- name: Submit the result to Coverity Scan
run: |
diff --git a/.github/workflows/helper/pre-commit/.typos.toml b/.github/workflows/helper/pre-commit/.typos.toml
index 0f33373ade21..90d6e1746af7 100644
--- a/.github/workflows/helper/pre-commit/.typos.toml
+++ b/.github/workflows/helper/pre-commit/.typos.toml
@@ -16,3 +16,5 @@ ths = "ths"
[default.extend-words]
BA = "BA"
helo = "helo"
+Pn = "Pn"
+UIU = "UIU"
diff --git a/.github/workflows/helper/pre-commit/check_grid_items_order.py b/.github/workflows/helper/pre-commit/check_grid_items_order.py
new file mode 100755
index 000000000000..0ab3d6715d30
--- /dev/null
+++ b/.github/workflows/helper/pre-commit/check_grid_items_order.py
@@ -0,0 +1,95 @@
+#!/usr/bin/env python3
+
+# A pre-commit hook for checking items order in grid layouts
+# Copyright (C) 2024 Mike Tzou (Chocobo1)
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# In addition, as a special exception, the copyright holders give permission to
+# link this program with the OpenSSL project's "OpenSSL" library (or with
+# modified versions of it that use the same license as the "OpenSSL" library),
+# and distribute the linked executables. You must obey the GNU General Public
+# License in all respects for all of the code used other than "OpenSSL". If you
+# modify file(s), you may extend this exception to your version of the file(s),
+# but you are not obligated to do so. If you do not wish to do so, delete this
+# exception statement from your version.
+
+from collections.abc import Callable, Sequence
+from typing import Optional
+import argparse
+import re
+import xml.etree.ElementTree as ElementTree
+import sys
+
+
+def traversePostOrder(root: ElementTree.Element, visitFunc: Callable[[ElementTree.Element], None]) -> None:
+ stack = [(root, False)]
+
+ while len(stack) > 0:
+ (element, visit) = stack.pop()
+ if visit:
+ visitFunc(element)
+ else:
+ stack.append((element, True))
+ stack.extend((child, False) for child in reversed(element))
+
+
+def modifyElement(element: ElementTree.Element) -> None:
+ def getSortKey(e: ElementTree.Element) -> tuple[int, int]:
+ if e.tag == 'item':
+ return (int(e.attrib['row']), int(e.attrib['column']))
+ return (-1, -1) # don't care
+
+ if element.tag == 'layout' and element.attrib['class'] == 'QGridLayout' and len(element) > 0:
+ element[:] = sorted(element, key=getSortKey)
+
+ # workaround_2a: ElementTree will unescape `"` and we need to escape it back
+ if element.tag == 'string' and element.text is not None:
+ element.text = element.text.replace('"', '"')
+
+
+def main(argv: Optional[Sequence[str]] = None) -> int:
+ parser = argparse.ArgumentParser()
+ parser.add_argument('filenames', nargs='*', help='Filenames to check')
+ args = parser.parse_args(argv)
+
+ for filename in args.filenames:
+ with open(filename, 'r+') as f:
+ orig = f.read()
+ root = ElementTree.fromstring(orig)
+ traversePostOrder(root, modifyElement)
+ ElementTree.indent(root, ' ')
+
+ # workaround_1: cannot use `xml_declaration=True` since it uses single quotes instead of Qt preferred double quotes
+ ret = f'\n{ElementTree.tostring(root, 'unicode')}\n'
+
+ # workaround_2b: ElementTree will turn `"` into `"`, so revert it back
+ ret = ret.replace('"', '"')
+
+ # workaround_3: Qt prefers no whitespaces in self-closing tags
+ ret = re.sub('<(.+) +/>', r'<\1/>', ret)
+
+ if ret != orig:
+ print(f'Tip: run this script to apply the fix: `python {__file__} {filename}`', file=sys.stderr)
+
+ f.seek(0)
+ f.write(ret)
+ f.truncate()
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/.github/workflows/helper/pre-commit/check_translation_tag.py b/.github/workflows/helper/pre-commit/check_translation_tag.py
index 34705f74dfc9..4be80df492dd 100755
--- a/.github/workflows/helper/pre-commit/check_translation_tag.py
+++ b/.github/workflows/helper/pre-commit/check_translation_tag.py
@@ -26,9 +26,12 @@
# but you are not obligated to do so. If you do not wish to do so, delete this
# exception statement from your version.
-from typing import Optional, Sequence
+from collections.abc import Sequence
+from typing import Optional
import argparse
import re
+import sys
+
def main(argv: Optional[Sequence[str]] = None) -> int:
parser = argparse.ArgumentParser()
@@ -47,12 +50,12 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
for line in file:
if (match := regex.match(line)) is not None:
error_buffer += str(f"Defect file: \"{filename}\"\n"
- f"Line: {line_counter}\n"
- f"Column span: {match.span()}\n"
- f"Part: \"{match.group()}\"\n\n")
+ f"Line: {line_counter}\n"
+ f"Column span: {match.span()}\n"
+ f"Part: \"{match.group()}\"\n\n")
line_counter += 1
- except UnicodeDecodeError as error:
+ except UnicodeDecodeError:
# not a text file, skip
continue
@@ -64,5 +67,6 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
return 0
+
if __name__ == '__main__':
- exit(main())
+ sys.exit(main())
diff --git a/.github/workflows/stale_bot.yaml b/.github/workflows/stale_bot.yaml
index d5b23095f4d2..705f6a5c9fe7 100644
--- a/.github/workflows/stale_bot.yaml
+++ b/.github/workflows/stale_bot.yaml
@@ -4,15 +4,16 @@ on:
schedule:
- cron: '0 0 * * *'
-permissions:
- pull-requests: write
+permissions: {}
jobs:
stale:
runs-on: ubuntu-latest
+ permissions:
+ pull-requests: write
steps:
- name: Mark and close stale PRs
- uses: actions/stale@v8
+ uses: actions/stale@v9
with:
stale-pr-message: "This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity."
close-pr-message: "This PR was closed because it has been stalled for some time with no activity."
diff --git a/.gitignore b/.gitignore
index debe5480afb0..17b9258429f9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.vscode/
src/gui/geoip/GeoIP.dat
src/gui/geoip/GeoIP.dat.gz
src/qbittorrent
@@ -40,7 +41,3 @@ src/icons/skin/build-icons/icons/*.png
# CMake build directory
build/
-
-# Web UI tools
-node_modules
-package-lock.json
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index e10d3e94c6c0..fbf101d28eb2 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,12 @@
repos:
- repo: local
hooks:
+ - id: check-grid-order
+ name: Check items order in grid layouts
+ entry: .github/workflows/helper/pre-commit/check_grid_items_order.py
+ language: script
+ files: \.ui$
+
- id: check-translation-tag
name: Check newline characters in tag
entry: .github/workflows/helper/pre-commit/check_translation_tag.py
@@ -13,7 +19,7 @@ repos:
- ts
- repo: https://github.com/pre-commit/pre-commit-hooks.git
- rev: v4.5.0
+ rev: v5.0.0
hooks:
- id: check-json
name: Check JSON files
@@ -63,19 +69,17 @@ repos:
- ts
- repo: https://github.com/codespell-project/codespell.git
- rev: v2.2.6
+ rev: v2.4.0
hooks:
- id: codespell
name: Check spelling (codespell)
- args: ["--ignore-words-list", "additionals,curren,fo,ket,superseeding,te,ths"]
+ args: ["--ignore-words-list", "additionals,categor,curren,fo,ist,ket,notin,searchin,sectionin,superseeding,te,ths"]
exclude: |
(?x)^(
.*\.desktop |
.*\.qrc |
- build-aux/.* |
Changelog |
dist/windows/installer-translations/.* |
- m4/.* |
src/base/3rdparty/.* |
src/searchengine/nova3/socks.py |
src/webui/www/private/scripts/lib/.*
@@ -84,7 +88,7 @@ repos:
- ts
- repo: https://github.com/crate-ci/typos.git
- rev: v1.16.18
+ rev: v1.29.4
hooks:
- id: typos
name: Check spelling (typos)
@@ -95,11 +99,8 @@ repos:
.*\.desktop |
.*\.qrc |
\.pre-commit-config\.yaml |
- build-aux/.* |
Changelog |
- configure.* |
dist/windows/installer-translations/.* |
- m4/.* |
src/base/3rdparty/.* |
src/searchengine/nova3/socks.py |
src/webui/www/private/scripts/lib/.*
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06032cba58cc..86ede6b3cff8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ set(minBoostVersion 1.76)
set(minQt6Version 6.5.0)
set(minOpenSSLVersion 3.0.2)
set(minLibtorrent1Version 1.2.19)
-set(minLibtorrentVersion 2.0.9)
+set(minLibtorrentVersion 2.0.10)
set(minZlibVersion 1.2.11)
include(GNUInstallDirs)
diff --git a/COPYING.GPLv2 b/COPYING.GPLv2
index d159169d1050..9efa6fbc9628 100644
--- a/COPYING.GPLv2
+++ b/COPYING.GPLv2
@@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -304,8 +304,7 @@ the "copyright" line and a pointer to where the full notice is found.
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.
+ with this program; if not, see .
Also add information on how to contact you by electronic and paper mail.
@@ -329,8 +328,8 @@ necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
- , 1 April 1989
- Ty Coon, President of Vice
+ , 1 April 1989
+ Moe Ghoul, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
diff --git a/Changelog b/Changelog
index 5163569ef5f2..453c4bcdc872 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,320 @@
-Unreleased - sledgehammer999 - v4.5.0
+Unreleased - sledgehammer999 - v5.1.0
+
+Mon Oct 28th 2024 - sledgehammer999 - v5.0.1
+ - FEATURE: Add "Simple pread/pwrite" disk IO type (Hanabishi)
+ - BUGFIX: Don't ignore SSL errors (sledgehammer999)
+ - BUGFIX: Don't try to apply Mark-of-the-Web to nonexistent files (glassez)
+ - BUGFIX: Disable "Move to trash" option by default (glassez)
+ - BUGFIX: Disable the ability to create torrents with a piece size of 256MiB (stalkerok)
+ - BUGFIX: Allow to choose Qt style (glassez)
+ - BUGFIX: Always notify user about duplicate torrent (glassez)
+ - BUGFIX: Correctly handle "torrent finished after move" event (glassez)
+ - BUGFIX: Correctly apply filename filter when `!qB` extension is enabled (glassez)
+ - BUGFIX: Improve color scheme change detection (glassez)
+ - BUGFIX: Fix button state for SSL certificate check (Chocobo1)
+ - WEBUI: Fix CSS that results in hidden torrent list in some browsers (skomerko)
+ - WEBUI: Use proper text color to highlight items in all filter lists (skomerko)
+ - WEBUI: Fix 'rename files' dialog cannot be opened more than once (Chocobo1)
+ - WEBUI: Fix UI of Advanced Settings to show all settings (glassez)
+ - WEBUI: Free resources allocated by web session once it is destructed (dyseg)
+ - SEARCH: Import correct libraries (Chocobo1)
+ - OTHER: Sync flag icons with upstream (xavier2k6)
+
+Sun Sep 29th 2024 - sledgehammer999 - v5.0.0
+ - FEATURE: Support creating .torrent with larger piece size (Chocobo1)
+ - FEATURE: Improve tracker entries handling (glassez)
+ - FEATURE: Add separate filter item for tracker errors (glassez)
+ - FEATURE: Allow to remove tracker from tracker filter widget menu (glassez)
+ - FEATURE: Implement `Reannounce In` column (Hanabishi)
+ - FEATURE: Expose `DHT bootstrap nodes` setting (Chocobo1)
+ - FEATURE: Add support for [Mark-of-the-Web](https://redcanary.com/threat-detection-report/techniques/mark-of-the-web-bypass/) (Chocobo1)
+ - FEATURE: Allow to keep unwanted files in separate folder (glassez)
+ - FEATURE: Add `Copy Comment` to the torrent list's context menu (thalieht)
+ - FEATURE: Allow relative profile paths (Victor Chernyakin)
+ - FEATURE: Enable Ctrl+F hotkey for more inputs (thalieht)
+ - FEATURE: Add seeding limits to RSS and Watched folders options UI (glassez)
+ - FEATURE: Subcategories implicitly follow the parent category options (glassez)
+ - FEATURE: Add option to name each qbittorrent instance (Chocobo1)
+ - FEATURE: Add button for sending test email (Thomas Piccirello)
+ - FEATURE: Allow torrents to override default share limit action (glassez)
+ - FEATURE: Use Start/Stop instead of Resume/Pause (thalieht)
+ - FEATURE: Add the Popularity metric (Aliaksei Urbanski)
+ - FEATURE: Focus on Download button if torrent link retrieved from the clipboard (glassez)
+ - FEATURE: Add ability to pause/resume entire BitTorrent session (glassez)
+ - FEATURE: Add an option to set BitTorrent session shutdown timeout (glassez)
+ - FEATURE: Apply "Excluded file names" to folder names as well (glassez)
+ - FEATURE: Allow to use regular expression to filter torrent content (glassez)
+ - FEATURE: Allow to move content files to Trash instead of deleting them (glassez)
+ - FEATURE: Add ability to display torrent "privateness" in UI (ManiMatter)
+ - FEATURE: Add a flag in `Peers` tab denoting a connection using NAT hole punching (stalkerok)
+ - BUGFIX: Display error message when unrecoverable error occurred (glassez)
+ - BUGFIX: Update size of selected files when selection is changed (glassez)
+ - BUGFIX: Normalize tags by trimming leading/trailing whitespace (glassez)
+ - BUGFIX: Correctly handle share limits in torrent options dialog (glassez)
+ - BUGFIX: Adjust tracker tier when adding additional trackers (Chocobo1)
+ - BUGFIX: Fix inconsistent naming between `Done/Progress` column (luzpaz)
+ - BUGFIX: Sanitize peer client names (Hanabishi)
+ - BUGFIX: Apply share limits immediately when torrent downloading is finished (glassez)
+ - BUGFIX: Show download progress for folders with zero byte size as 100 instead of 0 (vikas_c)
+ - BUGFIX: Fix highlighted piece color (Prince Gupta)
+ - BUGFIX: Apply "merge trackers" logic regardless of way the torrent is added (glassez)
+ - WEBUI: Improve WebUI responsiveness (Chocobo1)
+ - WEBUI: Do not exit the app when WebUI has failed to start (Hanabishi)
+ - WEBUI: Add `Moving` filter to side panel (xavier2k6)
+ - WEBUI: Add dark theme (d47081)
+ - WEBUI: Allow to remember torrent content files deletion (David)
+ - WEBUI: Leave the fields empty when value is invalid (Chocobo1)
+ - WEBUI: Use natural sorting (Chocobo1)
+ - WEBUI: Improve WebUI login behavior (JayRet)
+ - WEBUI: Conditionally show filters sidebar (Thomas Piccirello)
+ - WEBUI: Add support for running concurrent searches (Thomas Piccirello)
+ - WEBUI: Improve accuracy of trackers list (Thomas Piccirello)
+ - WEBUI: Fix error when category doesn't exist (Thomas Piccirello)
+ - WEBUI: Improve table scrolling and selection on mobile (Thomas Piccirello)
+ - WEBUI: Restore search tabs on load (Thomas Piccirello)
+ - WEBUI: Restore previously used tab on load (Thomas Piccirello)
+ - WEBUI: Increase default height of `Share ratio limit` dialog (thalieht)
+ - WEBUI: Use enabled search plugins by default (Thomas Piccirello)
+ - WEBUI: Add columns `Incomplete Save Path`, `Info Hash v1`, `Info Hash v2` (thalieht)
+ - WEBUI: Always create generic filter items (skomerko)
+ - WEBUI: Provide `Use Category paths in Manual Mode` option (skomerko)
+ - WEBUI: Provide `Merge trackers to existing torrent` option (skomerko)
+ - WEBAPI: Fix wrong timestamp values (Chocobo1)
+ - WEBAPI: Send binary data with filename and mime type specified (glassez)
+ - WEBAPI: Expose API for the torrent creator (glassez, Radu Carpa)
+ - WEBAPI: Add support for SSL torrents (Chocobo1, Radu Carpa)
+ - WEBAPI: Provide endpoint for listing directory content (Paweł Kotiuk)
+ - WEBAPI: Provide "private" flag via "torrents/info" endpoint (ManiMatter)
+ - WEBAPI: Add a way to download .torrent file using search plugin (glassez)
+ - WEBAPI: Add "private" filter for "torrents/info" endpoint (ManiMatter)
+ - WEBAPI: Add root_path to "torrents/info" result (David Newhall)
+ - RSS: Show RSS feed title in HTML browser (Jay)
+ - RSS: Allow to set delay between requests to the same host (jNullj)
+ - SEARCH: Allow users to specify Python executable path (Chocobo1)
+ - SEARCH: Lazy load search plugins (milahu)
+ - SEARCH: Add date column to the built-in search engine (ducalex)
+ - SEARCH: Allow to rearrange search tabs (glassez)
+ - WINDOWS: Use Fusion style on Windows 10+. It has better compatibility with dark mode (glassez)
+ - WINDOWS: Allow to set qBittorrent as default program (glassez)
+ - WINDOWS: Don't access "Favorites" folder unexpectedly (glassez)
+ - LINUX: Add support for systemd power management (Chocobo1)
+ - LINUX: Add support for localized man pages (Victor Chernyakin)
+ - LINUX: Specify a locale if none is set (Chocobo1)
+ - MACOS: Display download/upload speed in dock icon (Nick Korotysh)
+ - MACOS: Add support for quarantine on macOS (Chocobo1)
+ - OTHER: Drop support for Qt5, qmake, autotools, Windows < 10, Windows 32-bit
+ - OTHER: Minimum supported versions: Qt: 6.5, Boost: 1.76, OpenSSL: 3.0.2
+ - OTHER: Switch to C++20
+
+Mon Sep 16th 2024 - sledgehammer999 - v4.6.7
+ - BUGFIX: The updater will launch the link to the build variant you're currently using (sledgehammer999)
+ - BUGFIX: Focus on Download button if torrent link retrieved from the clipboard (glassez)
+ - WEBUI: RSS: The list of feeds wouldn't load for Apply Rule (glassez)
+
+Sun Aug 18th 2024 - sledgehammer999 - v4.6.6
+ - BUGFIX: Fix handling of tags containing '&' character (glassez)
+ - BUGFIX: Show scroll bar in Torrent Tags dialog (glassez)
+ - BUGFIX: Apply bulk changes to correct content widget items (glassez)
+ - BUGFIX: Hide zero status filters when torrents are removed (glassez)
+ - BUGFIX: Fix `Incomplete Save Path` cannot be changed for torrents without metadata (glassez)
+ - WEBUI: Correctly apply changed "save path" of RSS rules (glassez)
+ - WEBUI: Clear tracker list on full update (skomerko)
+ - OTHER: Update User-Agent string for internal downloader and search engines (cayenne17)
+
+Sun May 26th 2024 - sledgehammer999 - v4.6.5
+ - BUGFIX: Prevent app from being closed when disabling system tray icon (glassez)
+ - BUGFIX: Fix Enter key behavior in Add new torrent dialog (glassez)
+ - BUGFIX: Prevent invalid status filter index from being used (glassez)
+ - BUGFIX: Add extra offset for dialog frame (glassez)
+ - BUGFIX: Don't overwrite stored layout of main window with incorrect one (glassez)
+ - BUGFIX: Don't forget to resume "missing files" torrent when rechecking (glassez)
+ - WEBUI: Restore ability to use server-side translation by custom WebUI (glassez)
+ - WEBUI: Fix wrong peer number (Chocobo1)
+ - LINUX: Improve AppStream metadata (Chocobo1)
+
+Sun Mar 24th 2024 - sledgehammer999 - v4.6.4
+ - BUGFIX: Correctly adjust "Add New torrent" dialog position in all the cases (glassez)
+ - BUGFIX: Change "metadata received" stop condition behavior (glassez)
+ - BUGFIX: Add a small delay before processing the key input of search boxes (Chocobo1)
+ - BUGFIX: Ensure the profile path is pointing to a directory (Chocobo1)
+ - RSS: Use better icons for RSS articles (glassez)
+ - WINDOWS: NSIS: Update French, Hungarian translations (MarcDrieu, foxi69)
+ - LINUX: Fix sorting when ICU isn't used (Chocobo1)
+ - LINUX: Fix invisible tray icon on Plasma 6 (tehcneko)
+
+Mon Jan 15th 2024 - sledgehammer999 - v4.6.3
+ - BUGFIX: Correctly update number of filtered items (glassez)
+ - BUGFIX: Don't forget to store Stop condition value (glassez)
+ - BUGFIX: Show correctly decoded filename in log (glassez)
+ - BUGFIX: Specify a locale if none is set (Chocobo1)
+ - BUGFIX: Apply inactive seeding time limit set on new torrents (glassez)
+ - BUGFIX: Show URL seeds for torrents that have no metadata (glassez)
+ - BUGFIX: Don't get stuck loading on mismatched info-hashes in resume data (glassez)
+
+Mon Nov 27th 2023 - sledgehammer999 - v4.6.2
+ - BUGFIX: Do not apply share limit if the previous one was applied (glassez)
+ - BUGFIX: Show Add new torrent dialog on main window screen (glassez)
+ - WEBUI: Fix JS memory leak (brvphoenix)
+ - WEBUI: Disable stdout buffering for qbt-nox (Chocobo1)
+ - WINDOWS: NSIS: Display correct Minimum Windows OS requirement (xavier2k6)
+ - WINDOWS: NSIS: Add Hebrew translation (avivmu)
+ - LINUX: WAYLAND: Fix parent widget of "Lock qBittorrent" submenu (Vlad Zahorodnii)
+
+Mon Nov 20th 2023 - sledgehammer999 - v4.6.1
+ - FEATURE: Add option to enable previous Add new torrent dialog behavior (glassez)
+ - BUGFIX: Prevent crash due to race condition when adding magnet link (glassez)
+ - BUGFIX: Fix Enter key behavior when add new torrent (glassez)
+ - BUGFIX: Add missing main window icon (iomezk)
+ - BUGFIX: Update size of selected files when selection is changed (glassez)
+ - BUGFIX: Correctly handle changing save path of torrent w/o metadata (glassez)
+ - BUGFIX: Use appropriate icon for "moving" torrents in transfer list (xavier2k6)
+ - WEBUI: Drop WebUI default credentials (glassez)
+ - WEBUI: Add I2P settings to WebUI (thalieht)
+ - WEBUI: Fix duplicate scrollbar on Transfer List (AgentConDier)
+ - WEBUI: Fix .torrent file upload on iPadOS (Vitaly Cheptsov)
+ - WEBUI: Fix incorrect subcategory sorting (Bartu Özen)
+ - WEBUI: Correctly set save path in RSS rules (glassez)
+ - WEBUI: Allow to request torrents count via WebAPI (glassez)
+ - WEBUI: Improve performance of getting torrent numbers via WebAPI (Chocobo1)
+ - WEBUI: Improve free disk space checking for WebAPI (glassez)
+ - WINDOWS: NSIS: Fixed typo in the installer's hungarian translation (MartinKing01)
+ - LINUX: Fix invisible tray icon with Qt5 in Linux (thalieht)
+ - MACOS: Remove "Physical memory (RAM) usage limit" option (Chocobo1)
+
+Sun Oct 22nd 2023 - sledgehammer999 - v4.6.0
+ - FEATURE: Add (experimental) I2P support (glassez)
+ - FEATURE: Provide UI editor for the default theme (glassez)
+ - FEATURE: Various UI theming improvements (glassez)
+ - FEATURE: Implement torrent tags editing dialog (glassez)
+ - FEATURE: Revamp "Watched folder options" and "Automated RSS downloader" dialog (glassez)
+ - FEATURE: Allow to use another icons in dark mode (glassez)
+ - FEATURE: Allow to add new torrents to queue top (glassez)
+ - FEATURE: Allow to filter torrent list by save path (Tom)
+ - FEATURE: Expose 'socket send/receive buffer size' options (Chocobo1)
+ - FEATURE: Expose 'max torrent file size' setting (Chocobo1)
+ - FEATURE: Expose 'bdecode limits' settings (Chocobo1)
+ - FEATURE: Add options to adjust behavior of merging trackers to existing torrent (glassez)
+ - FEATURE: Add option to stop seeding when torrent has been inactive (Christopher)
+ - FEATURE: Allow to use proxy per subsystem (glassez)
+ - FEATURE: Expand the scope of "Proxy hostname lookup" option (glassez)
+ - FEATURE: Add shortcut for "Ban peer permanently" function (Luka Čelebić)
+ - FEATURE: Add option to auto hide zero status filters (glassez)
+ - FEATURE: Allow to disable confirmation of Pause/Resume All (glassez)
+ - FEATURE: Add alternative shortcut CTRL+E for CTRL+F (Luka Čelebić)
+ - FEATURE: Show filtered port numbers in logs (Hanabishi)
+ - FEATURE: Add button to copy library versions to clipboard (Chocobo1)
+ - BUGFIX: Ensure ongoing storage moving job will be completed when shutting down (Chocobo1)
+ - BUGFIX: Refactored many areas to call non UI blocking code (glassez)
+ - BUGFIX: Various improvements to the SQLite backend (glassez)
+ - BUGFIX: Improve startup window state handling (glassez)
+ - BUGFIX: Use tray icon from system theme only if option is set (glassez)
+ - BUGFIX: Inhibit system sleep while torrents are moving (Sentox6)
+ - BUGFIX: Use hostname instead of domain name in tracker filter list (tearfur)
+ - BUGFIX: Visually validate input path in torrent creator dialog (Chocobo1)
+ - BUGFIX: Disable symlink resolving in Torrent creator (Ignat Loskutov)
+ - BUGFIX: Change default value for `file pool size` and `stop tracker timeout` settings (stalkerok)
+ - BUGFIX: Log when duplicate torrents are being added (glassez)
+ - BUGFIX: Inhibit suspend instead of screen idle (axet)
+ - BUGFIX: Ensure file name is valid when exporting torrents (glassez)
+ - BUGFIX: Open "Save path" if torrent has no metadata (Xu Chao)
+ - BUGFIX: Prevent torrent starting unexpectedly edge case with magnet (Xu Chao)
+ - BUGFIX: Better ergonomics of the "Add new torrent" dialog (Xu Chao, glassez)
+ - WEBUI: Add log viewer (brvphoenix)
+ - WEBUI: WebAPI: Allow to specify session cookie name (glassez)
+ - WEBUI: Improve sync API performance (glassez)
+ - WEBUI: Add filelog settings (brvphoenix)
+ - WEBUI: Add multi-file renaming (loligans)
+ - WEBUI: Add "Add to top of queue" option (thalieht)
+ - WEBUI: Implement subcategories (Bartu Özen)
+ - WEBUI: Set "SameSite=None" if CSRF Protection is disabled (七海千秋)
+ - WEBUI: Show only hosts in tracker filter list (ttys3)
+ - WEBUI: Set Connection status and Speed limits tooltips (Raymond Ha)
+ - WEBUI: set Cross Origin Opener Policy to `same-origin` (Chocobo1)
+ - WEBUI: Fix response for HTTP HEAD method (Chocobo1)
+ - WEBUI: Preserve the network interfaces when connection is down (Fabricio Silva)
+ - WEBUI: Add "Add Tags" field for RSS rules (Matic Babnik)
+ - WEBUI: Fix missing error icon (Trim21)
+ - RSS: Add "Rename rule" button to RSS Downloader (BallsOfSpaghetti)
+ - RSS: Allow to edit RSS feed URL (glassez)
+ - RSS: Allow to assign priority to RSS download rule (glassez)
+ - SEARCH: Use python isolate mode (Chocobo1)
+ - SEARCH: Bump python version minimum requirement to 3.7.0 (Chocobo1)
+ - OTHER: Enable DBUS cmake option on FreeBSD (yuri@FreeBSD)
+ - OTHER: Numerous code improvements and refactorings (glassez, Chocobo1)
+
+Tue Aug 29 2023 - sledgehammer999 - v4.5.5
+ - BUGFIX: Fix transfer list tab hotkey (thalieht)
+ - BUGFIX: Don't forget to enable the Apply button in the Options dialog (glassez)
+ - BUGFIX: Immediately update torrent status on moving files (glassez)
+ - BUGFIX: Improve performance when scrolling the file list of large torrents (gdim47)
+ - BUGFIX: Don't operate on random torrents when multiple are selected and a sort/filter is applied (glassez)
+ - RSS: Fix overwriting feeds.json with an incomplete load of it (Omar Abdul Azeez)
+ - WINDOWS: Software update check logic is disabled for < Win10 (sledgehammer999)
+ - WINDOWS: NSIS: Update Turkish and French translations (Burak Yavuz, MarcDrieu)
+ - WINDOWS: NSIS: Add Romanian translation (rusu-afanasie)
+
+Sun Jun 18 2023 - sledgehammer999 - v4.5.4
+ - BUGFIX: Allow to disable confirmation of Pause/Resume All (glassez)
+ - BUGFIX: Sync flag icons with upstream (Priit Uring)
+ - WEBUI: Fix category save path (Raymond Ha)
+
+Sun May 28 2023 - sledgehammer999 - v4.5.3
+ - BUGFIX: Correctly check if database needs to be updated (glassez)
+ - BUGFIX: Prevent incorrect log message about torrent content deletion (glassez)
+ - BUGFIX: Improve finished torrent handling (glassez)
+ - BUGFIX: Correctly initialize group box children as disabled in Preferences (thalieht)
+ - BUGFIX: Don't miss saving "download path" in SQLite storage (glassez)
+ - BUGFIX: Improve logging of running external program (glassez)
+ - WEBUI: Disable UPnP for web UI by default (glassez)
+ - WEBUI: Use workaround for IOS file picker (DivineHawk)
+ - WEBUI: Work around Chrome download limit (Chocobo1)
+ - WEBUI: Improve 'exporting torrent' behavior (Chocobo1)
+ - WINDOWS: NSIS: Add Slovak translation (Christian Danížek)
+
+Tue Feb 28 2023 - sledgehammer999 - v4.5.2
+ - BUGFIX: Don't unexpectedly activate queued torrents when prefetching metadata for added magnets (glassez)
+ - BUGFIX: Update the cached torrent state once recheck is started (glassez)
+ - BUGFIX: Be more likely to allow the system to use power saving modes (glassez)
+ - WEBUI: Migrate away from unsafe function (Chocobo1)
+ - WEBUI: Blacklist bad ciphers for TLS in the server (sledgehammer999)
+ - WEBUI: Allow only TLS 1.2+ in the server (sledgehammer999)
+ - WEBUI: Allow to set read-only directory as torrent location (glassez)
+ - WEBUI: Reject requests that contain backslash in path (glassez)
+ - RSS: Prevent RSS folder from being moved into itself (glassez)
+ - WINDOWS: NSIS: Update Turkish, Uzbek translation (Burak Yavuz, shitcod3r)
+
+Sun Feb 12 2023 - sledgehammer999 - v4.5.1
+ - FEATURE: Re-allow to use icons from system theme (glassez)
+ - BUGFIX: Fix Speed limit icon size (Nowshed H. Imran)
+ - BUGFIX: Revise and fix some text colors (Chocobo1, Nowshed H. Imran)
+ - BUGFIX: Correctly load folder based UI theme (glassez)
+ - BUGFIX: Fix crash due to invalid encoding of tracker URLs (glassez)
+ - BUGFIX: Don't drop !qB extension when renaming incomplete file (glassez)
+ - BUGFIX: Correctly count the number of torrents in subcategories (glassez)
+ - BUGFIX: Use "additional trackers" when metadata retrieving (glassez)
+ - BUGFIX: Apply correct tab order to Category options dialog (glassez)
+ - BUGFIX: Add all torrents passed via the command line (glassez)
+ - BUGFIX: Fix startup performance on Qt5 (glassez)
+ - BUGFIX: Automatic move will now overwrite existing files (aka previous behavior) (glassez)
+ - BUGFIX: Some fixes for loading Chinese locales (sledgehammer999)
+ - BUGFIX: New Pause icon color for toolbar/menu (Nowshed H. Imran, sledgehammer999)
+ - BUGFIX: Adjust env variable for PDB discovery (sledgehammer999)
+ - WEBUI: Fix missing "queued" icon (thalieht)
+ - WEBUI: Return paths using platform-independent separator format (glassez)
+ - WEBUI: Change order of accepted types of file input (Jason Carr)
+ - WEBUI: Add missing icons (brvphoenix)
+ - WEBUI: Add "Resume data storage type" option (thalieht)
+ - WEBUI: Make rename file dialog resizable (Torsten Schwarz)
+ - WEBUI: Prevent incorrect line breaking (David Xuang)
+ - WEBUI: Improve hotkeys (Fidel Selva)
+ - WEBUI: Remove suggestions while searching for torrents (Midhun V Nadh)
+ - WEBUI: Expose "IS PRIVATE" flag (sotiris-bos)
+ - WEBUI: Return name/hash/infohash_v1/infohash_v2 torrent properties (qbittorrentfan)
+ - WINDOWS: Correctly detect drive letter in path (glassez)
+ - WINDOWS: NSIS: Update Swedish, Lithuanian translations (Jonatan, Deividas)
+ - LINUX: Fix tray icon issues (glassez)
+
+Sat Nov 26 2022 - sledgehammer999 - v4.5.0
- FEATURE: Add `Auto resize columns` functionality (Chocobo1)
- FEATURE: Allow to use Category paths in `Manual` mode (glassez)
- FEATURE: Allow to disable Automatic mode when default "temp" path changed (glassez)
@@ -80,6 +396,70 @@ Unreleased - sledgehammer999 - v4.5.0
- MACOS: Fix wrong background color in properties widget (NotTsunami)
- OTHER: Binary distributions of qbittorrent are GPLv3+ licensed (sledgehammer999)
+Tue Aug 30 2022 - sledgehammer999 - v4.4.5
+ - BUGFIX: Fix missing trackers when adding magnet link. Affects libtorrent 2.0.x builds. (glassez)
+
+Mon Aug 22 2022 - sledgehammer999 - v4.4.4
+ - BUGFIX: Correctly handle data decompression with Qt 6.3 (brvphoenix)
+ - BUGFIX: Fix wrong file names displayed in tooltip (Chocobo1)
+ - BUGFIX: Fix incorrect "max outgoing port" setting (glassez)
+ - BUGFIX: Make working set limit available only on libtorrent 2.0.x builds (summer)
+ - BUGFIX: Try to recover missing tags (summer)
+ - RSS: Clear RSS parsing error after use (glassez)
+ - WEBAPI: Set HTTP method restriction on WebAPI actions (Chocobo1)
+ - WINDOWS: Work around application stuttering on Windows (Chocobo1)
+ - WINDOWS: NSIS: Update Portuguese, Italian, Korean, Latvian translations(Blackspirits, bovirus, Minseo Lee, Coool)
+ - LINUX: Improve D-Bus notifications handling (glassez)
+ - MACOS: Open destination folders on macOS in separate thread (Nick Korotysh)
+
+Tue May 24 2022 - sledgehammer999 - v4.4.3.1
+ - BUGFIX: Fix broken translations (sledgehammer999)
+
+Sun May 22 2022 - sledgehammer999 - v4.4.3
+ - BUGFIX: Correctly handle changing of temp save path (glassez)
+ - BUGFIX: Fix storage in SQLite (glassez)
+ - BUGFIX: Correctly apply content layout when "Skip hash check" is enabled (glassez)
+ - BUGFIX: Don't corrupt IDs of v2 torrents (glassez)
+ - BUGFIX: Reduce the number of hashing threads by default (improves hashing speed on HDDs) (summer)
+ - BUGFIX: Prevent the "update dialog" from blocking input on other windows (summer)
+ - BUGFIX: Add trackers in exported .torrent files (glassez)
+ - BUGFIX: Fix wrong GUI behavior in "Optional IP address to bind to" setting (Chocobo1)
+ - WEBUI: Fix WebUI crash due to missing tags from config (An0n)
+ - WEBUI: Show correct location path (Chocobo1)
+ - MACOS: Fix main window freezing after opening a files dialog (glassez)
+
+Tue Mar 22 2022 - sledgehammer999 - v4.4.2
+ - FEATURE: Allow to limit max memory working set size (glassez)
+ - BUGFIX: Fix UI crash when torrent is in a non-existent category (Kevin Cox)
+ - BUGFIX: Correctly handle changing of global save paths (glassez)
+ - BUGFIX: Disable performance alert (Chocobo1)
+ - BUGFIX: Prevent loading resume data with inconsistent ID (glassez)
+ - BUGFIX: Properly handle metadata download for an existing torrent (glassez)
+ - BUGFIX: Prevent crash when open torrent destination folder (glassez)
+ - WINDOWS: NSIS: Update Spanish, Spanish International and French translations(Juanjo Jiménez, RqndomHax)
+
+Tue Feb 15 2022 - sledgehammer999 - v4.4.1
+ - FEATURE: Restore all torrent settings to the torrent's main context menu (thalieht)
+ - FEATURE: Add confirmation for enabling Auto TMM from context menu (thalieht)
+ - FEATURE: Add tooltip to Automatic Torrent Management context menu action (thalieht)
+ - FEATURE: Add Select All/None buttons in new torrent dialog (thalieht)
+ - BUGFIX: Keep "torrent info" alive while generate .torrent file (glassez)
+ - BUGFIX: Correctly handle Auto TMM in Torrent Files Watcher (glassez)
+ - BUGFIX: Correctly track the root folder name change (glassez)
+ - BUGFIX: Various fixes to the moving torrent code (glassez)
+ - BUGFIX: Update the torrent's download path field when changing category (thalieht)
+ - BUGFIX: Correctly handle received metadata (glassez)
+ - BUGFIX: Store hybrid torrents using legacy filenames (glassez)
+ - BUGFIX: Open correct directory when clicked on Browse button (glassez)
+ - BUGFIX: Fix crash when shutting down and clicing on system tray icon (Chocobo1)
+ - BUGFIX: Fix "Free space on disk" in new torrent dialog (thalieht)
+ - BUGFIX: Optimize completed files handling (Prince Gupta)
+ - BUGFIX: Migrate proxy settings (sledgehammer999)
+ - BUGFIX: Try to recover missing categories (glassez)
+ - WEBUI: WebAPI: fix wrong key used for categories (Chocobo1)
+ - WEBUI: Remove hack for outdated IE 6 browser (Chocobo1)
+ - RSS: Correctly handle XML parsing errors (glassez)
+
Thu Jan 06 2022 - sledgehammer999 - v4.4.0
- FEATURE: Support for v2 torrents along with libtorrent 2.0.x support (glassez, Chocobo1)
- FEATURE: Support for Qt6 (glassez)
diff --git a/INSTALL b/INSTALL
index 8d43301edfad..ec3ff78ea6eb 100644
--- a/INSTALL
+++ b/INSTALL
@@ -5,7 +5,7 @@ qBittorrent - A BitTorrent client in C++ / Qt
- Boost >= 1.76
- - libtorrent-rasterbar 1.2.19 - 1.2.x || 2.0.9 - 2.0.x
+ - libtorrent-rasterbar 1.2.19 - 1.2.x || 2.0.10 - 2.0.x
* By Arvid Norberg, https://www.libtorrent.org/
* Be careful: another library (the one used by rTorrent) uses a similar name
@@ -18,7 +18,7 @@ qBittorrent - A BitTorrent client in C++ / Qt
- CMake >= 3.16
* Compile-time only
- - Python >= 3.7.0
+ - Python >= 3.9.0
* Optional, run-time only
* Used by the bundled search engine
diff --git a/README.md b/README.md
index 45c57956ff2f..d3054bbf279c 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,7 @@
qBittorrent - A BitTorrent client in Qt
------------------------------------------
-[](https://ci.appveyor.com/project/qbittorrent/qBittorrent)
-[](https://github.com/qbittorrent/qBittorrent/actions)
+[](https://github.com/qbittorrent/qBittorrent/actions)
[](https://scan.coverity.com/projects/5494)
********************************
### Description:
@@ -16,15 +15,8 @@ support as well as many features.
The free [IP to Country Lite database](https://db-ip.com/db/download/ip-to-country-lite) by [DB-IP](https://db-ip.com/) is used for resolving the countries of peers. The database is licensed under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).
### Installation:
-For installation, follow the instructions from INSTALL file, but simple:
-```
-./configure
-make && make install
-qbittorrent
-```
-
-will install and execute qBittorrent hopefully without any problem.
+Refer to the [INSTALL](INSTALL) file.
### Public key:
Starting from v3.3.4 all source tarballs and binaries are signed.
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 000000000000..6c931a30c6a1
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,18 @@
+# Security Policy
+
+qBittorrent takes the security of our software seriously, including all source code repositories managed through our GitHub organisation.
+If you believe you have found a security vulnerability in qBittorrent, please report it to us as described below.
+
+## Reporting Security Issues
+
+Please do not report security vulnerabilities through public GitHub issues. Instead, please use GitHubs private vulnerability reporting functionality associated to this repository. Additionally, you may email us with all security-related inquiries and notifications at `security@qbittorrent.org`.
+
+Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
+1. Type of issue
+2. Step-by-step instructions to reproduce the issue
+3. Proof-of-concept or exploit code (if possible)
+4. Potential impact of the issue, including how an attacker might exploit the issue
+
+This information will help us triage your report more quickly. Any and all CVEs will be requested and issued through GitHubs private vulnerability reporting functionality, which will be published alongside the disclosure.
+
+This security policy only applies to the most recent stable branch of qBittorrent. Flaws in old versions that are not present in the current stable branch will not be fixed.
diff --git a/cmake/Modules/CommonConfig.cmake b/cmake/Modules/CommonConfig.cmake
index 1e3a1d006f24..b57dc4bcf914 100644
--- a/cmake/Modules/CommonConfig.cmake
+++ b/cmake/Modules/CommonConfig.cmake
@@ -83,6 +83,7 @@ endif()
if (MSVC)
target_compile_options(qbt_common_cfg INTERFACE
/guard:cf
+ /permissive-
/utf-8
# https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
/Zc:__cplusplus
diff --git a/dist/mac/Info.plist b/dist/mac/Info.plist
index 462356de8755..0b85335fbea5 100644
--- a/dist/mac/Info.plist
+++ b/dist/mac/Info.plist
@@ -55,7 +55,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 4.5.0
+ 5.2.0
CFBundleExecutable
${EXECUTABLE_NAME}
CFBundleIdentifier
@@ -67,7 +67,7 @@
NSAppleScriptEnabled
YES
NSHumanReadableCopyright
- Copyright © 2006-2023 The qBittorrent project
+ Copyright © 2006-2024 The qBittorrent project
UTExportedTypeDeclarations
diff --git a/dist/unix/CMakeLists.txt b/dist/unix/CMakeLists.txt
index 19fb16fbb4df..7072da5eafa9 100644
--- a/dist/unix/CMakeLists.txt
+++ b/dist/unix/CMakeLists.txt
@@ -38,7 +38,7 @@ if (GUI)
COMPONENT data
)
- install(FILES org.qbittorrent.qBittorrent.appdata.xml
+ install(FILES org.qbittorrent.qBittorrent.metainfo.xml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo/
COMPONENT data
)
diff --git a/dist/unix/org.qbittorrent.qBittorrent.desktop b/dist/unix/org.qbittorrent.qBittorrent.desktop
index cb9e814cb4ac..2cd055a1aa65 100644
--- a/dist/unix/org.qbittorrent.qBittorrent.desktop
+++ b/dist/unix/org.qbittorrent.qBittorrent.desktop
@@ -14,216 +14,220 @@ Keywords=bittorrent;torrent;magnet;download;p2p;
SingleMainWindow=true
# Translations
-Comment[af]=Aflaai en deel lêers oor BitTorrent
GenericName[af]=BitTorrent kliënt
+Comment[af]=Aflaai en deel lêers oor BitTorrent
Name[af]=qBittorrent
-Comment[ar]=نزّل وشارك الملفات عبر كيوبتتورنت
GenericName[ar]=عميل بتتورنت
+Comment[ar]=نزّل وشارك الملفات عبر كيوبتتورنت
Name[ar]=qBittorrent
-Comment[be]=Спампоўванне і раздача файлаў праз пратакол BitTorrent
GenericName[be]=Кліент BitTorrent
+Comment[be]=Спампоўванне і раздача файлаў праз пратакол BitTorrent
Name[be]=qBittorrent
-Comment[bg]=Сваляне и споделяне на файлове чрез BitTorrent
GenericName[bg]=BitTorrent клиент
+Comment[bg]=Сваляне и споделяне на файлове чрез BitTorrent
Name[bg]=qBittorrent
-Comment[bn]=বিটটরেন্টে ফাইল ডাউনলোড এবং শেয়ার করুন
GenericName[bn]=বিটটরেন্ট ক্লায়েন্ট
+Comment[bn]=বিটটরেন্টে ফাইল ডাউনলোড এবং শেয়ার করুন
Name[bn]=qBittorrent
-Comment[zh]=通过 BitTorrent 下载和分享文件
GenericName[zh]=BitTorrent 客户端
+Comment[zh]=通过 BitTorrent 下载和分享文件
Name[zh]=qBittorrent
-Comment[bs]=Preuzmi i dijeli datoteke preko BitTorrent-a
GenericName[bs]=BitTorrent klijent
+Comment[bs]=Preuzmi i dijeli datoteke preko BitTorrent-a
Name[bs]=qBittorrent
-Comment[ca]=Baixeu i compartiu fitxers amb el BitTorrent
GenericName[ca]=Client de BitTorrent
+Comment[ca]=Baixeu i compartiu fitxers amb el BitTorrent
Name[ca]=qBittorrent
-Comment[cs]=Stahování a sdílení souborů přes síť BitTorrent
GenericName[cs]=BitTorrent klient
+Comment[cs]=Stahování a sdílení souborů přes síť BitTorrent
Name[cs]=qBittorrent
-Comment[da]=Download og del filer over BitTorrent
GenericName[da]=BitTorrent-klient
+Comment[da]=Download og del filer over BitTorrent
Name[da]=qBittorrent
-Comment[de]=Über BitTorrent Dateien herunterladen und teilen
GenericName[de]=BitTorrent Client
+Comment[de]=Über BitTorrent Dateien herunterladen und teilen
Name[de]=qBittorrent
-Comment[el]=Κάντε λήψη και μοιραστείτε αρχεία μέσω BitTorrent
GenericName[el]=BitTorrent client
+Comment[el]=Κάντε λήψη και μοιραστείτε αρχεία μέσω BitTorrent
Name[el]=qBittorrent
-Comment[en_GB]=Download and share files over BitTorrent
GenericName[en_GB]=BitTorrent client
+Comment[en_GB]=Download and share files over BitTorrent
Name[en_GB]=qBittorrent
-Comment[es]=Descargue y comparta archivos por BitTorrent
GenericName[es]=Cliente BitTorrent
+Comment[es]=Descargue y comparta archivos por BitTorrent
Name[es]=qBittorrent
-Comment[et]=Lae alla ja jaga faile üle BitTorrenti
GenericName[et]=BitTorrent klient
+Comment[et]=Lae alla ja jaga faile üle BitTorrenti
Name[et]=qBittorrent
-Comment[eu]=Jeitsi eta elkarbanatu agiriak BitTorrent bidez
GenericName[eu]=BitTorrent bezeroa
+Comment[eu]=Jeitsi eta elkarbanatu agiriak BitTorrent bidez
Name[eu]=qBittorrent
-Comment[fa]=دانلود و به اشتراک گذاری فایل های بوسیله بیت تورنت
GenericName[fa]=بیت تورنت نسخه کلاینت
+Comment[fa]=دانلود و به اشتراک گذاری فایل های بوسیله بیت تورنت
Name[fa]=qBittorrent
-Comment[fi]=Lataa ja jaa tiedostoja BitTorrentia käyttäen
GenericName[fi]=BitTorrent-asiakasohjelma
+Comment[fi]=Lataa ja jaa tiedostoja BitTorrentia käyttäen
Name[fi]=qBittorrent
-Comment[fr]=Télécharger et partager des fichiers sur BitTorrent
GenericName[fr]=Client BitTorrent
+Comment[fr]=Télécharger et partager des fichiers sur BitTorrent
Name[fr]=qBittorrent
-Comment[gl]=Descargar e compartir ficheiros co protocolo BitTorrent
GenericName[gl]=Cliente BitTorrent
+Comment[gl]=Descargar e compartir ficheiros co protocolo BitTorrent
Name[gl]=qBittorrent
-Comment[gu]=બિટ્ટોરેંટ પર ફાઈલો ડાઉનલોડ અને શેર કરો
GenericName[gu]=બિટ્ટોરેંટ ક્લાયન્ટ
+Comment[gu]=બિટ્ટોરેંટ પર ફાઈલો ડાઉનલોડ અને શેર કરો
Name[gu]=qBittorrent
-Comment[he]=הורד ושתף קבצים על גבי ביטורנט
GenericName[he]=לקוח ביטורנט
+Comment[he]=הורד ושתף קבצים על גבי ביטורנט
Name[he]=qBittorrent
-Comment[hr]=Preuzmite i dijelite datoteke putem BitTorrenta
GenericName[hr]=BitTorrent klijent
+Comment[hr]=Preuzmite i dijelite datoteke putem BitTorrenta
Name[hr]=qBittorrent
-Comment[hu]=Fájlok letöltése és megosztása a BitTorrent hálózaton keresztül
GenericName[hu]=BitTorrent kliens
+Comment[hu]=Fájlok letöltése és megosztása a BitTorrent hálózaton keresztül
Name[hu]=qBittorrent
-Comment[hy]=Նիշքերի փոխանցում BitTorrent-ի միջոցով
GenericName[hy]=BitTorrent սպասառու
+Comment[hy]=Նիշքերի փոխանցում BitTorrent-ի միջոցով
Name[hy]=qBittorrent
-Comment[id]=Unduh dan berbagi berkas melalui BitTorrent
GenericName[id]=Klien BitTorrent
+Comment[id]=Unduh dan berbagi berkas melalui BitTorrent
Name[id]=qBittorrent
-Comment[is]=Sækja og deila skrám yfir BitTorrent
GenericName[is]=BitTorrent biðlarar
+Comment[is]=Sækja og deila skrám yfir BitTorrent
Name[is]=qBittorrent
-Comment[it]=Scarica e condividi file tramite BitTorrent
GenericName[it]=Client BitTorrent
+Comment[it]=Scarica e condividi file tramite BitTorrent
Name[it]=qBittorrent
-Comment[ja]=BitTorrentでファイルのダウンロードと共有
GenericName[ja]=BitTorrentクライアント
+Comment[ja]=BitTorrentでファイルのダウンロードと共有
Name[ja]=qBittorrent
-Comment[ka]=გადმოტვირთეთ და გააზიარეთ ფაილები BitTorrent-ის საშუალებით
GenericName[ka]=BitTorrent კლიენტი
+Comment[ka]=გადმოტვირთეთ და გააზიარეთ ფაილები BitTorrent-ის საშუალებით
Name[ka]=qBittorrent
-Comment[ko]=BitTorrent를 통한 파일 내려받기 및 공유
GenericName[ko]=BitTorrent 클라이언트
+Comment[ko]=BitTorrent를 통한 파일 다운로드 및 공유
Name[ko]=qBittorrent
-Comment[lt]=Atsisiųskite bei dalinkitės failais BitTorrent tinkle
GenericName[lt]=BitTorrent klientas
+Comment[lt]=Atsisiųskite bei dalinkitės failais BitTorrent tinkle
Name[lt]=qBittorrent
-Comment[mk]=Превземајте и споделувајте фајлови преку BitTorrent
GenericName[mk]=BitTorrent клиент
+Comment[mk]=Превземајте и споделувајте фајлови преку BitTorrent
Name[mk]=qBittorrent
-Comment[my]=တောရန့်ဖြင့်ဖိုင်များဒေါင်းလုဒ်ဆွဲရန်နှင့်မျှဝေရန်
GenericName[my]=တောရန့်စီမံခန့်ခွဲသည့်အရာ
+Comment[my]=တောရန့်ဖြင့်ဖိုင်များဒေါင်းလုဒ်ဆွဲရန်နှင့်မျှဝေရန်
Name[my]=qBittorrent
-Comment[nb]=Last ned og del filer over BitTorrent
GenericName[nb]=BitTorrent-klient
+Comment[nb]=Last ned og del filer over BitTorrent
Name[nb]=qBittorrent
-Comment[nl]=Bestanden downloaden en delen via BitTorrent
GenericName[nl]=BitTorrent-client
+Comment[nl]=Bestanden downloaden en delen via BitTorrent
Name[nl]=qBittorrent
-Comment[pl]=Pobieraj i dziel się plikami przez BitTorrent
GenericName[pl]=Klient BitTorrent
+Comment[pl]=Pobieraj i dziel się plikami przez BitTorrent
Name[pl]=qBittorrent
-Comment[pt]=Transferir e partilhar ficheiros por BitTorrent
GenericName[pt]=Cliente BitTorrent
+Comment[pt]=Transferir e partilhar ficheiros por BitTorrent
Name[pt]=qBittorrent
-Comment[pt_BR]=Baixe e compartilhe arquivos pelo BitTorrent
GenericName[pt_BR]=Cliente BitTorrent
+Comment[pt_BR]=Baixe e compartilhe arquivos pelo BitTorrent
Name[pt_BR]=qBittorrent
-Comment[ro]=Descărcați și partajați fișiere prin BitTorrent
GenericName[ro]=Client BitTorrent
+Comment[ro]=Descărcați și partajați fișiere prin BitTorrent
Name[ro]=qBittorrent
-Comment[ru]=Обмен файлами по сети БитТоррент
GenericName[ru]=Клиент сети БитТоррент
+Comment[ru]=Обмен файлами по сети БитТоррент
Name[ru]=qBittorrent
-Comment[sk]=Sťahovanie a zdieľanie súborov prostredníctvom siete BitTorrent
GenericName[sk]=Klient siete BitTorrent
+Comment[sk]=Sťahovanie a zdieľanie súborov prostredníctvom siete BitTorrent
Name[sk]=qBittorrent
-Comment[sl]=Prenesite in delite datoteke preko BitTorrenta
GenericName[sl]=BitTorrent odjemalec
+Comment[sl]=Prenesite in delite datoteke preko BitTorrenta
Name[sl]=qBittorrent
+GenericName[sq]=Klienti BitTorrent
+Comment[sq]=Shkarko dhe shpërndaj skedarë në BitTorrent
Name[sq]=qBittorrent
-Comment[sr]=Преузимајте и делите фајлове преко BitTorrent протокола
-GenericName[sr]=BitTorrent-клијент
+GenericName[sr]=BitTorrent клијент
+Comment[sr]=Преузимајте и делите фајлове преко BitTorrent-а
Name[sr]=qBittorrent
-Comment[sr@latin]=Preuzimanje i deljenje fajlova preko BitTorrent-a
GenericName[sr@latin]=BitTorrent klijent
+Comment[sr@latin]=Preuzimanje i deljenje fajlova preko BitTorrent-a
Name[sr@latin]=qBittorrent
-Comment[sv]=Hämta och dela filer över BitTorrent
GenericName[sv]=BitTorrent-klient
+Comment[sv]=Hämta och dela filer över BitTorrent
Name[sv]=qBittorrent
-Comment[ta]=BitTorrent வழியாக கோப்புகளை பதிவிறக்க மற்றும் பகிர
GenericName[ta]=BitTorrent வாடிக்கையாளர்
+Comment[ta]=BitTorrent வழியாக கோப்புகளை பதிவிறக்க மற்றும் பகிர
Name[ta]=qBittorrent
-Comment[te]=క్యు బిట్ టొరెంట్ తో ఫైల్స్ దిగుమతి చేసుకోండి , పంచుకోండి
GenericName[te]=క్యు బిట్ టొరెంట్ క్లయింట్
+Comment[te]=క్యు బిట్ టొరెంట్ తో ఫైల్స్ దిగుమతి చేసుకోండి , పంచుకోండి
Name[te]=qBittorrent
-Comment[th]=ดาวน์โหลดและแชร์ไฟล์ผ่าน BitTorrent
-GenericName[th]=โปรแกรมบิททอเร้นท์
+GenericName[th]=ไคลเอนต์บิททอร์เรนต์
+Comment[th]=ดาวน์โหลดและแชร์ไฟล์ผ่านบิตทอร์เรนต์
Name[th]=qBittorrent
-Comment[tr]=Dosyaları BitTorrent üzerinden indirin ve paylaşın
GenericName[tr]=BitTorrent istemcisi
+Comment[tr]=Dosyaları BitTorrent üzerinden indirin ve paylaşın
Name[tr]=qBittorrent
-Comment[ur]=BitTorrent پر فائلوں کو ڈاؤن لوڈ کریں اور اشتراک کریں
GenericName[ur]=قیو بٹ ٹورنٹ کلائنٹ
+Comment[ur]=BitTorrent پر فائلوں کو ڈاؤن لوڈ کریں اور اشتراک کریں
Name[ur]=qBittorrent
-Comment[uk]=Завантажуйте та поширюйте файли через BitTorrent
GenericName[uk]=BitTorrent-клієнт
+Comment[uk]=Завантажуйте та поширюйте файли через BitTorrent
Name[uk]=qBittorrent
-Comment[vi]=Tải xuống và chia sẻ tệp qua BitTorrent
GenericName[vi]=Máy khách BitTorrent
+Comment[vi]=Tải xuống và chia sẻ tệp qua BitTorrent
Name[vi]=qBittorrent
-Comment[zh_HK]=經由BitTorrent下載並分享檔案
GenericName[zh_HK]=BitTorrent用戶端
+Comment[zh_HK]=經由BitTorrent下載並分享檔案
Name[zh_HK]=qBittorrent
-Comment[zh_TW]=經由 BitTorrent 下載並分享檔案
GenericName[zh_TW]=BitTorrent 用戶端
+Comment[zh_TW]=使用 BitTorrent 下載並分享檔案
Name[zh_TW]=qBittorrent
-Comment[eo]=Elŝutu kaj kunhavigu dosierojn per BitTorrent
GenericName[eo]=BitTorrent-kliento
+Comment[eo]=Elŝutu kaj kunhavigu dosierojn per BitTorrent
Name[eo]=qBittorrent
-Comment[kk]=BitTorrent арқылы файл жүктеу және бөлісу
GenericName[kk]=BitTorrent клиенті
+Comment[kk]=BitTorrent арқылы файл жүктеу және бөлісу
Name[kk]=qBittorrent
-Comment[en_AU]=Download and share files over BitTorrent
GenericName[en_AU]=BitTorrent client
+Comment[en_AU]=Download and share files over BitTorrent
Name[en_AU]=qBittorrent
Name[rm]=qBittorrent
Name[jv]=qBittorrent
-Comment[oc]=Telecargar e partejar de fichièrs amb BitTorrent
GenericName[oc]=Client BitTorrent
+Comment[oc]=Telecargar e partejar de fichièrs amb BitTorrent
Name[oc]=qBittorrent
Name[ug]=qBittorrent
Name[yi]=qBittorrent
-Comment[nqo]=ߞߐߕߐ߯ߘߐ ߟߎ߬ ߟߊߖߌ߰ ߞߊ߬ ߓߊ߲߫ ߞߵߊ߬ߟߎ߬ ߘߐߕߟߊ߫ ߓߌߙߏߙߍ߲ߕ ߞߊ߲߬
GenericName[nqo]=ߓߌߙߏߙߍ߲ߕ ߕߣߐ߬ߓߐ߬ߟߊ
+Comment[nqo]=ߞߐߕߐ߯ߘߐ ߟߎ߬ ߟߊߖߌ߰ ߞߊ߬ ߓߊ߲߫ ߞߵߊ߬ߟߎ߬ ߘߐߕߟߊ߫ ߓߌߙߏߙߍ߲ߕ ߞߊ߲߬
Name[nqo]=qBittorrent
-Comment[uz@Latn]=BitTorrent orqali fayllarni yuklab olish va baham ko‘rish
GenericName[uz@Latn]=BitTorrent mijozi
+Comment[uz@Latn]=BitTorrent orqali fayllarni yuklab olish va baham ko‘rish
Name[uz@Latn]=qBittorrent
-Comment[ltg]=Atsasyuteit i daleit failus ar BitTorrent
GenericName[ltg]=BitTorrent klients
+Comment[ltg]=Atsasyuteit i daleit failus ar BitTorrent
Name[ltg]=qBittorrent
-Comment[hi_IN]=BitTorrent द्वारा फाइल डाउनलोड व सहभाजन
GenericName[hi_IN]=Bittorrent साधन
+Comment[hi_IN]=BitTorrent द्वारा फाइल डाउनलोड व सहभाजन
Name[hi_IN]=qBittorrent
-Comment[az@latin]=Faylları BitTorrent vasitəsilə endirin və paylaşın
GenericName[az@latin]=BitTorrent client
+Comment[az@latin]=Faylları BitTorrent vasitəsilə endirin və paylaşın
Name[az@latin]=qBittorrent
-Comment[lv_LV]=Lejupielādēt un koplietot failus ar BitTorrent
GenericName[lv_LV]=BitTorrent klients
+Comment[lv_LV]=Lejupielādēt un koplietot failus ar BitTorrent
Name[lv_LV]=qBittorrent
-Comment[ms_MY]=Muat turun dan kongsi fail melalui BitTorrent
GenericName[ms_MY]=Klien BitTorrent
+Comment[ms_MY]=Muat turun dan kongsi fail melalui BitTorrent
Name[ms_MY]=qBittorrent
-Comment[mn_MN]=BitTorrent-оор файлуудаа тат, түгээ
GenericName[mn_MN]=BitTorrent татагч
+Comment[mn_MN]=BitTorrent-оор файлуудаа тат, түгээ
Name[mn_MN]=qBittorrent
-Comment[ne_NP]=फाइलहरू डाउनलोड गर्नुहोस् र BitTorrent मा साझा गर्नुहोस्
GenericName[ne_NP]=BitTorrent क्लाइन्ट
+Comment[ne_NP]=फाइलहरू डाउनलोड गर्नुहोस् र BitTorrent मा साझा गर्नुहोस्
Name[ne_NP]=qBittorrent
-Comment[pt_PT]=Transferir e partilhar ficheiros por BitTorrent
GenericName[pt_PT]=Cliente BitTorrent
+Comment[pt_PT]=Transferir e partilhar ficheiros por BitTorrent
Name[pt_PT]=qBittorrent
+GenericName[si_LK]=BitTorrent සේවාදායකයා
+Comment[si_LK]=BitTorrent හරහා ගොනු බාගත කර බෙදාගන්න.
Name[si_LK]=qBittorrent
diff --git a/dist/unix/org.qbittorrent.qBittorrent.appdata.xml b/dist/unix/org.qbittorrent.qBittorrent.metainfo.xml
similarity index 55%
rename from dist/unix/org.qbittorrent.qBittorrent.appdata.xml
rename to dist/unix/org.qbittorrent.qBittorrent.metainfo.xml
index e56ffc716b6a..4aacf15ce59c 100644
--- a/dist/unix/org.qbittorrent.qBittorrent.appdata.xml
+++ b/dist/unix/org.qbittorrent.qBittorrent.metainfo.xml
@@ -1,6 +1,6 @@
-
+
org.qbittorrent.qBittorrent
CC0-1.0
GPL-3.0-or-later and OpenSSL
@@ -14,33 +14,12 @@
- Polished µTorrent-like User Interface
- -
- Well-integrated and extensible Search Engine
-
- - Simultaneous search in many Torrent search sites
- - Category-specific search requests (e.g. Books, Music, Software)
-
-
+ - Well-integrated and extensible Search Engine
- RSS feed support with advanced download filters (incl. regex)
- -
- Many Bittorrent extensions supported:
-
- - Magnet links
- - Distributed hash table (DHT), peer exchange protocol (PEX), local peer discovery (LSD)
- - Private torrents
- - Encrypted connections
- - and many more...
-
-
+ - Many Bittorrent extensions supported
- Remote control through Web user interface, written with AJAX
- Sequential downloading (Download in order)
- -
- Advanced control over torrents, trackers and peers
-
- - Torrents queueing and prioritizing
- - Torrent content selection and prioritizing
-
-
+ - Advanced control over torrents, trackers and peers
- Bandwidth scheduler
- Torrent creation tool
- IP Filtering (eMule & PeerGuardian format compatible)
@@ -53,27 +32,36 @@
org.qbittorrent.qBittorrent.desktop
- https://alexpl.fedorapeople.org/AppData/qbittorrent/screens/qbittorrent_01.png
+ Main window (General tab collapsed)
+ https://raw.githubusercontent.com/qbittorrent/qBittorrent-website/2741f2a90854604e268c6bba9e6859aad0103583/src/img/screenshots/linux/1.webp
- https://alexpl.fedorapeople.org/AppData/qbittorrent/screens/qbittorrent_02.png
+ Main window (General tab expanded)
+ https://raw.githubusercontent.com/qbittorrent/qBittorrent-website/2741f2a90854604e268c6bba9e6859aad0103583/src/img/screenshots/linux/2.webp
- https://alexpl.fedorapeople.org/AppData/qbittorrent/screens/qbittorrent_03.png
+ Options dialog
+ https://raw.githubusercontent.com/qbittorrent/qBittorrent-website/2741f2a90854604e268c6bba9e6859aad0103583/src/img/screenshots/linux/3.webp
- https://alexpl.fedorapeople.org/AppData/qbittorrent/screens/qbittorrent_04.png
+ Search engine
+ https://raw.githubusercontent.com/qbittorrent/qBittorrent-website/2741f2a90854604e268c6bba9e6859aad0103583/src/img/screenshots/linux/4.webp
sledgehammer999@qbittorrent.org
- The qBittorrent Project
+
+ The qBittorrent Project
+
https://www.qbittorrent.org/
https://bugs.qbittorrent.org/
- https://www.qbittorrent.org/donate
+ https://wiki.qbittorrent.org/Frequently-Asked-Questions
https://forum.qbittorrent.org/
- https://github.com/qbittorrent/qBittorrent/wiki/How-to-translate-qBittorrent
+ https://www.qbittorrent.org/donate
+ https://wiki.qbittorrent.org/How-to-translate-qBittorrent
+ https://github.com/qbittorrent/qBittorrent
+ https://github.com/qbittorrent/qBittorrent/blob/master/CONTRIBUTING.md
-
+
diff --git a/dist/windows/config.nsh b/dist/windows/config.nsh
index fcfe5f5862c9..c01aabe493ac 100644
--- a/dist/windows/config.nsh
+++ b/dist/windows/config.nsh
@@ -14,7 +14,7 @@
; 4.5.1.3 -> good
; 4.5.1.3.2 -> bad
; 4.5.0beta -> bad
-!define /ifndef QBT_VERSION "5.0.0"
+!define /ifndef QBT_VERSION "5.2.0"
; Option that controls the installer's window name
; If set, its value will be used like this:
@@ -86,7 +86,7 @@ OutFile "qbittorrent_${QBT_INSTALLER_FILENAME}_setup.exe"
;Installer Version Information
VIAddVersionKey "ProductName" "qBittorrent"
VIAddVersionKey "CompanyName" "The qBittorrent project"
-VIAddVersionKey "LegalCopyright" "Copyright ©2006-2023 The qBittorrent project"
+VIAddVersionKey "LegalCopyright" "Copyright ©2006-2024 The qBittorrent project"
VIAddVersionKey "FileDescription" "qBittorrent - A Bittorrent Client"
VIAddVersionKey "FileVersion" "${QBT_VERSION}"
diff --git a/dist/windows/gather_qt_translations.py b/dist/windows/gather_qt_translations.py
index d1ff4449986f..cfa212c8cea0 100644
--- a/dist/windows/gather_qt_translations.py
+++ b/dist/windows/gather_qt_translations.py
@@ -7,9 +7,11 @@
import sys
from typing import List
+
def isNotStub(path: str) -> bool:
return (os.path.getsize(path) >= (10 * 1024))
+
def main() -> int:
parser = argparse.ArgumentParser(description='Gather valid Qt translations for NSIS packaging.')
parser.add_argument("qt_translations_folder", help="Qt's translations folder")
@@ -27,5 +29,6 @@ def main() -> int:
return 0
+
if __name__ == '__main__':
sys.exit(main())
diff --git a/dist/windows/installer-translations/afrikaans.nsh b/dist/windows/installer-translations/afrikaans.nsh
index 1a93eb24b7e4..511e306e189b 100644
--- a/dist/windows/installer-translations/afrikaans.nsh
+++ b/dist/windows/installer-translations/afrikaans.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_AFRIKAANS} "Uninstalling previous version."
LangString launch_qbt ${LANG_AFRIKAANS} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_AFRIKAANS} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_AFRIKAANS} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_AFRIKAANS} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_AFRIKAANS} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/albanian.nsh b/dist/windows/installer-translations/albanian.nsh
index 649734e657dc..535e48be3cc3 100644
--- a/dist/windows/installer-translations/albanian.nsh
+++ b/dist/windows/installer-translations/albanian.nsh
@@ -30,8 +30,8 @@ LangString launch_qbt ${LANG_ALBANIAN} "Launch qBittorrent."
LangString inst_requires_64bit ${LANG_ALBANIAN} "This installer works only in 64-bit Windows versions."
;LangString inst_requires_win7 ${LANG_ENGLISH} "This qBittorrent version requires at least Windows 7."
LangString inst_requires_win7 ${LANG_ALBANIAN} "This qBittorrent version requires at least Windows 7."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_ALBANIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_ALBANIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_ALBANIAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/arabic.nsh b/dist/windows/installer-translations/arabic.nsh
index 051e36ab2cb0..7b795295792e 100644
--- a/dist/windows/installer-translations/arabic.nsh
+++ b/dist/windows/installer-translations/arabic.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_ARABIC} "جاري ازالة النسخة السا
LangString launch_qbt ${LANG_ARABIC} "تشغيل البرنامج"
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_ARABIC} "هذا المثبت يعمل فقط في نسخ ويندوز 64 بت"
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_ARABIC} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_ARABIC} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_ARABIC} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/basque.nsh b/dist/windows/installer-translations/basque.nsh
index 34d898edb4a5..d3e78748df0a 100644
--- a/dist/windows/installer-translations/basque.nsh
+++ b/dist/windows/installer-translations/basque.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_BASQUE} "Aurreko bertsioa kentzen."
LangString launch_qbt ${LANG_BASQUE} "Abiarazi qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_BASQUE} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_BASQUE} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_BASQUE} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_BASQUE} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/belarusian.nsh b/dist/windows/installer-translations/belarusian.nsh
index d352b58ceecc..8c712f57390f 100644
--- a/dist/windows/installer-translations/belarusian.nsh
+++ b/dist/windows/installer-translations/belarusian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_BELARUSIAN} "Uninstalling previous version."
LangString launch_qbt ${LANG_BELARUSIAN} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_BELARUSIAN} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_BELARUSIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_BELARUSIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_BELARUSIAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/bosnian.nsh b/dist/windows/installer-translations/bosnian.nsh
index 4e80205c99a1..418603e3e158 100644
--- a/dist/windows/installer-translations/bosnian.nsh
+++ b/dist/windows/installer-translations/bosnian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_BOSNIAN} "Uninstalling previous version."
LangString launch_qbt ${LANG_BOSNIAN} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_BOSNIAN} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_BOSNIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_BOSNIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_BOSNIAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/breton.nsh b/dist/windows/installer-translations/breton.nsh
index 433a1db1e161..a60a21918e9d 100644
--- a/dist/windows/installer-translations/breton.nsh
+++ b/dist/windows/installer-translations/breton.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_BRETON} "Uninstalling previous version."
LangString launch_qbt ${LANG_BRETON} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_BRETON} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_BRETON} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_BRETON} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_BRETON} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/bulgarian.nsh b/dist/windows/installer-translations/bulgarian.nsh
index 0ebcc0f052d1..d3e9eb7e3e13 100644
--- a/dist/windows/installer-translations/bulgarian.nsh
+++ b/dist/windows/installer-translations/bulgarian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_BULGARIAN} "Uninstalling previous version."
LangString launch_qbt ${LANG_BULGARIAN} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_BULGARIAN} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_BULGARIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_BULGARIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_BULGARIAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/catalan.nsh b/dist/windows/installer-translations/catalan.nsh
index 25ca1ad88949..f061c7eec487 100644
--- a/dist/windows/installer-translations/catalan.nsh
+++ b/dist/windows/installer-translations/catalan.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_CATALAN} "Uninstalling previous version."
LangString launch_qbt ${LANG_CATALAN} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_CATALAN} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_CATALAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_CATALAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_CATALAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/croatian.nsh b/dist/windows/installer-translations/croatian.nsh
index 4ac6be009073..b7e435891bd7 100644
--- a/dist/windows/installer-translations/croatian.nsh
+++ b/dist/windows/installer-translations/croatian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_CROATIAN} "Deinstaliraj prethodnu verziju."
LangString launch_qbt ${LANG_CROATIAN} "Pokreni qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_CROATIAN} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_CROATIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_CROATIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_CROATIAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/czech.nsh b/dist/windows/installer-translations/czech.nsh
index f5856ea55726..686b996c4863 100644
--- a/dist/windows/installer-translations/czech.nsh
+++ b/dist/windows/installer-translations/czech.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_CZECH} "Odinstalace předchozí verze."
LangString launch_qbt ${LANG_CZECH} "Spustit qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_CZECH} "Tento instalátor funguje pouze v 64-bit Windows."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_CZECH} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_CZECH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_CZECH} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/danish.nsh b/dist/windows/installer-translations/danish.nsh
index e4b95faa718a..b97d59511ed6 100644
--- a/dist/windows/installer-translations/danish.nsh
+++ b/dist/windows/installer-translations/danish.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_DANISH} "Afinstallerer tidligere version."
LangString launch_qbt ${LANG_DANISH} "Start qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_DANISH} "Installationsprogrammet virker kun i Windows-versioner som er 64-bit."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_DANISH} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_DANISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_DANISH} "Afinstaller qBittorrent"
diff --git a/dist/windows/installer-translations/dutch.nsh b/dist/windows/installer-translations/dutch.nsh
index 373572653e79..9406e53a2f92 100644
--- a/dist/windows/installer-translations/dutch.nsh
+++ b/dist/windows/installer-translations/dutch.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_DUTCH} "Vorige versie verwijderen."
LangString launch_qbt ${LANG_DUTCH} "qBittorrent starten."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_DUTCH} "Dit installatieprogramma werkt alleen in 64-bit Windows-versies."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_DUTCH} "Dit installatieprogramma vereist ten minste Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_DUTCH} "Dit installatieprogramma vereist ten minste Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_DUTCH} "qBittorrent verwijderen"
diff --git a/dist/windows/installer-translations/english.nsh b/dist/windows/installer-translations/english.nsh
index 7de5a35d3cec..b359f048617d 100644
--- a/dist/windows/installer-translations/english.nsh
+++ b/dist/windows/installer-translations/english.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString launch_qbt ${LANG_ENGLISH} "Launch 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_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/esperanto.nsh b/dist/windows/installer-translations/esperanto.nsh
index 549b88856026..cff4aa0357c4 100644
--- a/dist/windows/installer-translations/esperanto.nsh
+++ b/dist/windows/installer-translations/esperanto.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_ESPERANTO} "Uninstalling previous version."
LangString launch_qbt ${LANG_ESPERANTO} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_ESPERANTO} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_ESPERANTO} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_ESPERANTO} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_ESPERANTO} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/estonian.nsh b/dist/windows/installer-translations/estonian.nsh
index 4aaa469335a2..4ca234707eb3 100644
--- a/dist/windows/installer-translations/estonian.nsh
+++ b/dist/windows/installer-translations/estonian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_ESTONIAN} "Desinstallitakse eelmist versiooni."
LangString launch_qbt ${LANG_ESTONIAN} "Käivita qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_ESTONIAN} "See installer töötab ainult 64-bit Windowsi versioonides."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_ESTONIAN} "Selle installeri jaoks on vajalik vähemalt Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_ESTONIAN} "Selle installeri jaoks on vajalik vähemalt Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_ESTONIAN} "Desinstalli qBittorrent"
diff --git a/dist/windows/installer-translations/farsi.nsh b/dist/windows/installer-translations/farsi.nsh
index d89dde80dab8..8851a833e343 100644
--- a/dist/windows/installer-translations/farsi.nsh
+++ b/dist/windows/installer-translations/farsi.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_FARSI} "Uninstalling previous version."
LangString launch_qbt ${LANG_FARSI} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_FARSI} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_FARSI} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_FARSI} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_FARSI} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/finnish.nsh b/dist/windows/installer-translations/finnish.nsh
index b80d0b7f96a4..1645d754868f 100644
--- a/dist/windows/installer-translations/finnish.nsh
+++ b/dist/windows/installer-translations/finnish.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_FINNISH} "Poistetaan aiempi asennus."
LangString launch_qbt ${LANG_FINNISH} "Käynnistä qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_FINNISH} "Tämä asennusohjelma toimii vain 64-bittisellä Windowsin versiolla."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_FINNISH} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_FINNISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_FINNISH} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/french.nsh b/dist/windows/installer-translations/french.nsh
index 985acb3d5a36..fc7c4efe763b 100644
--- a/dist/windows/installer-translations/french.nsh
+++ b/dist/windows/installer-translations/french.nsh
@@ -3,9 +3,9 @@
;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)"
LangString inst_qbt_req ${LANG_FRENCH} "qBittorrent (requis)"
;LangString inst_desktop ${LANG_ENGLISH} "Create Desktop Shortcut"
-LangString inst_desktop ${LANG_FRENCH} "Créer un Raccourci sur le Bureau"
+LangString inst_desktop ${LANG_FRENCH} "Créer un raccourci sur le Bureau"
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
-LangString inst_startmenu ${LANG_FRENCH} "Créer un Raccourci dans le Menu Démarrer"
+LangString inst_startmenu ${LANG_FRENCH} "Créer un raccourci dans le Menu Démarrer"
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
LangString inst_startup ${LANG_FRENCH} "Démarrer qBittorrent au démarrage de Windows"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_FRENCH} "Désinstallation de la version antérieure
LangString launch_qbt ${LANG_FRENCH} "Lancer qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_FRENCH} "Cet installateur ne fonctionne que dans les versions 64 bits de Windows."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_FRENCH} "Cet installateur nécessite au moins Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_FRENCH} "Cet installateur nécessite au moins Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_FRENCH} "Désinstaller qBittorrent"
@@ -55,6 +55,6 @@ LangString remove_cache ${LANG_FRENCH} "Supprimer les torrents et données en ca
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_FRENCH} "qBittorrent est en cours d'exécution. Fermez l'application avant de la désinstaller."
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
-LangString uninst_tor_warn ${LANG_FRENCH} "Ne peut pas supprimer l'association du .torrent. Elle est associée avec :"
+LangString uninst_tor_warn ${LANG_FRENCH} "Impossible de supprimer l'association .torrent. Elle est associée avec :"
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
-LangString uninst_mag_warn ${LANG_FRENCH} "Ne peut pas supprimer l'association du magnet. Elle est associée avec :"
+LangString uninst_mag_warn ${LANG_FRENCH} "Impossible de supprimer l'association magnet. Elle est associée avec :"
diff --git a/dist/windows/installer-translations/galician.nsh b/dist/windows/installer-translations/galician.nsh
index 174083fe1d74..8eaa3085fef1 100644
--- a/dist/windows/installer-translations/galician.nsh
+++ b/dist/windows/installer-translations/galician.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_GALICIAN} "Desinstalando a versión anterior."
LangString launch_qbt ${LANG_GALICIAN} "Iniciar qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_GALICIAN} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_GALICIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_GALICIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_GALICIAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/german.nsh b/dist/windows/installer-translations/german.nsh
index 59aec5957a4c..80f64e40eeaa 100644
--- a/dist/windows/installer-translations/german.nsh
+++ b/dist/windows/installer-translations/german.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_GERMAN} "Vorherige Version wird deinstalliert."
LangString launch_qbt ${LANG_GERMAN} "Starte qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_GERMAN} "Diese Installation funktioniert nur mit einer 64-bit Version von Windows."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_GERMAN} "Diese Installation erfordert mindestens Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_GERMAN} "Diese Installation erfordert mindestens Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_GERMAN} "qBittorrent deinstallieren"
diff --git a/dist/windows/installer-translations/greek.nsh b/dist/windows/installer-translations/greek.nsh
index efdec9547669..77800e4e3b3e 100644
--- a/dist/windows/installer-translations/greek.nsh
+++ b/dist/windows/installer-translations/greek.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_GREEK} "Γίνεται απεγκατάσταση
LangString launch_qbt ${LANG_GREEK} "Εκκίνηση του qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_GREEK} "Αυτό το αρχείο εγκατάστασης λειτουργεί μόνο σε 64-bit εκδόσεις των Windows."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_GREEK} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_GREEK} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_GREEK} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/hebrew.nsh b/dist/windows/installer-translations/hebrew.nsh
index 345365ecd50c..6a5b126d05cd 100644
--- a/dist/windows/installer-translations/hebrew.nsh
+++ b/dist/windows/installer-translations/hebrew.nsh
@@ -1,37 +1,37 @@
;Installer strings
;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)"
-LangString inst_qbt_req ${LANG_HEBREW} "qBittorrent (required)"
+LangString inst_qbt_req ${LANG_HEBREW} "qBittorrent (נדרש)"
;LangString inst_desktop ${LANG_ENGLISH} "Create Desktop Shortcut"
-LangString inst_desktop ${LANG_HEBREW} "Create Desktop Shortcut"
+LangString inst_desktop ${LANG_HEBREW} "צור קיצור דרך בשולחן עבודה"
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
-LangString inst_startmenu ${LANG_HEBREW} "Create Start Menu Shortcut"
+LangString inst_startmenu ${LANG_HEBREW} "צור קיצור דרך ב-Start Menu"
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
-LangString inst_startup ${LANG_HEBREW} "Start qBittorrent on Windows start up"
+LangString inst_startup ${LANG_HEBREW} "התחל את qBittorrent עם עליית Windows"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
-LangString inst_torrent ${LANG_HEBREW} "Open .torrent files with qBittorrent"
+LangString inst_torrent ${LANG_HEBREW} "פתח קבצי .torrent עם qBittorrent"
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
-LangString inst_magnet ${LANG_HEBREW} "Open magnet links with qBittorrent"
+LangString inst_magnet ${LANG_HEBREW} "פתח קישורי מגנט עם qBittorrent"
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
-LangString inst_firewall ${LANG_HEBREW} "Add Windows Firewall rule"
+LangString inst_firewall ${LANG_HEBREW} "הוסף כלל חומת האש של 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_HEBREW} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)"
+LangString inst_pathlimit ${LANG_HEBREW} "השבת את מגבלת אורך הנתיב של Windows (הגבלת MAX_PATH של 260 תווים, דורשת Windows 10 1607 ואילך)"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
-LangString inst_firewallinfo ${LANG_HEBREW} "Adding Windows Firewall rule"
+LangString inst_firewallinfo ${LANG_HEBREW} "מוסיף כלל חומת האש של Windows"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
-LangString inst_warning ${LANG_HEBREW} "qBittorrent is running. Please close the application before installing."
+LangString inst_warning ${LANG_HEBREW} "qBittorrent פועל. אנא סגור את האפליקציה לפני ההתקנה."
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
-LangString inst_uninstall_question ${LANG_HEBREW} "Current version will be uninstalled. User settings and torrents will remain intact."
+LangString inst_uninstall_question ${LANG_HEBREW} "הגרסה הנוכחית תוסר. הגדרות המשתמש והטורנטים יישארו ללא שינוי."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
-LangString inst_unist ${LANG_HEBREW} "Uninstalling previous version."
+LangString inst_unist ${LANG_HEBREW} "מסיר את ההתקנה של הגרסה הקודמת."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
-LangString launch_qbt ${LANG_HEBREW} "Launch qBittorrent."
+LangString launch_qbt ${LANG_HEBREW} "הפעל את qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
-LangString inst_requires_64bit ${LANG_HEBREW} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_HEBREW} "This installer requires at least Windows 10 1809."
+LangString inst_requires_64bit ${LANG_HEBREW} "התקנה זו עובדת רק בגירסאות 64 סיביות של Windows."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_HEBREW} "התקנה זו דורשת לפחות Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
-LangString inst_uninstall_link_description ${LANG_HEBREW} "Uninstall qBittorrent"
+LangString inst_uninstall_link_description ${LANG_HEBREW} "הסר את ההתקנה של qBittorrent"
;------------------------------------
;Uninstaller strings
diff --git a/dist/windows/installer-translations/hungarian.nsh b/dist/windows/installer-translations/hungarian.nsh
index ff1e97568193..b3580a2bdb91 100644
--- a/dist/windows/installer-translations/hungarian.nsh
+++ b/dist/windows/installer-translations/hungarian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_HUNGARIAN} "Előző verzió eltávolítása."
LangString launch_qbt ${LANG_HUNGARIAN} "qBittorrent indítása."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_HUNGARIAN} "A telepítő csak 64-bites Windows verziókon működik."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_HUNGARIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_HUNGARIAN} "A telepítéshez minimum Windows 10 (1809) / Windows Server 2019 szükséges."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_HUNGARIAN} "qBittorrent eltávolítása"
diff --git a/dist/windows/installer-translations/icelandic.nsh b/dist/windows/installer-translations/icelandic.nsh
index d3962cb4af99..b9415596aafc 100644
--- a/dist/windows/installer-translations/icelandic.nsh
+++ b/dist/windows/installer-translations/icelandic.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_ICELANDIC} "Uninstalling previous version."
LangString launch_qbt ${LANG_ICELANDIC} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_ICELANDIC} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_ICELANDIC} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_ICELANDIC} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_ICELANDIC} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/indonesian.nsh b/dist/windows/installer-translations/indonesian.nsh
index 085ec1246ff0..8e96f66bd693 100644
--- a/dist/windows/installer-translations/indonesian.nsh
+++ b/dist/windows/installer-translations/indonesian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_INDONESIAN} "Menghapus versi sebelumnya."
LangString launch_qbt ${LANG_INDONESIAN} "Buka qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_INDONESIAN} "Aplikasi ini hanya berjalan pada versi Windows 64-bit."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_INDONESIAN} "Penginstal ini membutuhkan setidaknya Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_INDONESIAN} "Penginstal ini membutuhkan setidaknya Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_INDONESIAN} "Hapus qBittorrent"
diff --git a/dist/windows/installer-translations/irish.nsh b/dist/windows/installer-translations/irish.nsh
index b5c3b1e4a68a..17bea6893c87 100644
--- a/dist/windows/installer-translations/irish.nsh
+++ b/dist/windows/installer-translations/irish.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_IRISH} "Uninstalling previous version."
LangString launch_qbt ${LANG_IRISH} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_IRISH} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_IRISH} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_IRISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_IRISH} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/italian.nsh b/dist/windows/installer-translations/italian.nsh
index 93203132d685..2668dc5ca66b 100644
--- a/dist/windows/installer-translations/italian.nsh
+++ b/dist/windows/installer-translations/italian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_ITALIAN} "Disinstallazione versione precedente."
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_ITALIAN} "Questo installer funziona solo con versioni di Windows a 64bit."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_ITALIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_ITALIAN} "Questo installer richiede almeno Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_ITALIAN} "Disinstalla qBittorrent"
diff --git a/dist/windows/installer-translations/japanese.nsh b/dist/windows/installer-translations/japanese.nsh
index 0af594bfab5d..8cfef7bf9442 100644
--- a/dist/windows/installer-translations/japanese.nsh
+++ b/dist/windows/installer-translations/japanese.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_JAPANESE} "以前のバージョンをアンイン
LangString launch_qbt ${LANG_JAPANESE} "qBittorrent を起動"
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_JAPANESE} "このインストーラは 64 ビット版の Windows でのみ実行できます。"
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_JAPANESE} "このインストーラの実行には Windows 10 1809 以降が必要です。"
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_JAPANESE} "このインストーラの実行には Windows 10 (1809) / Windows Server 2019 以降が必要です。"
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_JAPANESE} "qBittorrent をアンインストール"
diff --git a/dist/windows/installer-translations/korean.nsh b/dist/windows/installer-translations/korean.nsh
index f1c32a07ea68..db0fddf6dcef 100644
--- a/dist/windows/installer-translations/korean.nsh
+++ b/dist/windows/installer-translations/korean.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_KOREAN} "이전 버전을 제거하는 중입니다
LangString launch_qbt ${LANG_KOREAN} "qBittorrent를 실행합니다."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_KOREAN} "이 설치 프로그램은 64비트 Windows 버전에서만 작동합니다."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_KOREAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_KOREAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_KOREAN} "qBittorrent 제거"
diff --git a/dist/windows/installer-translations/kurdish.nsh b/dist/windows/installer-translations/kurdish.nsh
index a44972d8d16e..c9804082cc90 100644
--- a/dist/windows/installer-translations/kurdish.nsh
+++ b/dist/windows/installer-translations/kurdish.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_KURDISH} "Uninstalling previous version."
LangString launch_qbt ${LANG_KURDISH} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_KURDISH} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_KURDISH} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_KURDISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_KURDISH} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/latvian.nsh b/dist/windows/installer-translations/latvian.nsh
index a345356907ab..0f762f888797 100644
--- a/dist/windows/installer-translations/latvian.nsh
+++ b/dist/windows/installer-translations/latvian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_LATVIAN} "Iepriekšējās versijas atinstalēšana.
LangString launch_qbt ${LANG_LATVIAN} "Palaist qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_LATVIAN} "Šī instalēšanas programma darbojas tikai 64 bitu Windows versijās."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_LATVIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_LATVIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_LATVIAN} "Atinstalēt qBittorrent"
diff --git a/dist/windows/installer-translations/lithuanian.nsh b/dist/windows/installer-translations/lithuanian.nsh
index 2645f1c459b8..1748ecabb8d1 100644
--- a/dist/windows/installer-translations/lithuanian.nsh
+++ b/dist/windows/installer-translations/lithuanian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_LITHUANIAN} "Šalinama ankstesnė versija."
LangString launch_qbt ${LANG_LITHUANIAN} "Paleisti qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_LITHUANIAN} "Šis įdiegėjas veikia tik su 64 bitų Windows versija."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_LITHUANIAN} "Šis įdiegėjas reikalauja bent Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_LITHUANIAN} "Šis įdiegėjas reikalauja bent Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_LITHUANIAN} "Pašalinti qBittorrent"
diff --git a/dist/windows/installer-translations/luxembourgish.nsh b/dist/windows/installer-translations/luxembourgish.nsh
index b12ce3563f01..4a30e954a03b 100644
--- a/dist/windows/installer-translations/luxembourgish.nsh
+++ b/dist/windows/installer-translations/luxembourgish.nsh
@@ -1,60 +1,60 @@
;Installer strings
;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)"
-LangString inst_qbt_req ${LANG_LUXEMBOURGISH} "qBittorrent (required)"
+LangString inst_qbt_req ${LANG_LUXEMBOURGISH} "qBittorrent (noutwendeg)"
;LangString inst_desktop ${LANG_ENGLISH} "Create Desktop Shortcut"
-LangString inst_desktop ${LANG_LUXEMBOURGISH} "Create Desktop Shortcut"
+LangString inst_desktop ${LANG_LUXEMBOURGISH} "Verknëppung um Desktop erstellen"
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
-LangString inst_startmenu ${LANG_LUXEMBOURGISH} "Create Start Menu Shortcut"
+LangString inst_startmenu ${LANG_LUXEMBOURGISH} "Verknëppung am Startmenü erstellen"
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
-LangString inst_startup ${LANG_LUXEMBOURGISH} "Start qBittorrent on Windows start up"
+LangString inst_startup ${LANG_LUXEMBOURGISH} "qBittorrent mat Windows starten"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
-LangString inst_torrent ${LANG_LUXEMBOURGISH} "Open .torrent files with qBittorrent"
+LangString inst_torrent ${LANG_LUXEMBOURGISH} ".torrent-Dateien mat qBittorrent opmaachen"
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
-LangString inst_magnet ${LANG_LUXEMBOURGISH} "Open magnet links with qBittorrent"
+LangString inst_magnet ${LANG_LUXEMBOURGISH} "Magnet-Linken mat qBittorrent opmaachen"
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
-LangString inst_firewall ${LANG_LUXEMBOURGISH} "Add Windows Firewall rule"
+LangString inst_firewall ${LANG_LUXEMBOURGISH} "Reegel an der Windows Firewall dobäisetzen"
;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_LUXEMBOURGISH} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)"
+LangString inst_pathlimit ${LANG_LUXEMBOURGISH} "D'Windows path length (Padlängtbeschränkung) desaktivéieren (260 Zeechen MAX_PATH Beschränkung, erfuerdert min. Windows 10 1607)"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
-LangString inst_firewallinfo ${LANG_LUXEMBOURGISH} "Adding Windows Firewall rule"
+LangString inst_firewallinfo ${LANG_LUXEMBOURGISH} "Reegel an der Windows Firewall dobäisetzen"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
-LangString inst_warning ${LANG_LUXEMBOURGISH} "qBittorrent is running. Please close the application before installing."
+LangString inst_warning ${LANG_LUXEMBOURGISH} "qBittorrent leeft grad. W.e.g. d'Applikatioun zoumaachen ier installéiert gëtt."
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
-LangString inst_uninstall_question ${LANG_LUXEMBOURGISH} "Current version will be uninstalled. User settings and torrents will remain intact."
+LangString inst_uninstall_question ${LANG_LUXEMBOURGISH} "Aktuell Versioun gëtt deinstalléiert. Benotzerastellungen a Torrents bleiwen erhalen."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
-LangString inst_unist ${LANG_LUXEMBOURGISH} "Uninstalling previous version."
+LangString inst_unist ${LANG_LUXEMBOURGISH} "Vireg Versioun gëtt deinstalléiert."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
-LangString launch_qbt ${LANG_LUXEMBOURGISH} "Launch qBittorrent."
+LangString launch_qbt ${LANG_LUXEMBOURGISH} "qBittorrent starten."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
-LangString inst_requires_64bit ${LANG_LUXEMBOURGISH} "This installer works only in 64-bit Windows versions."
+LangString inst_requires_64bit ${LANG_LUXEMBOURGISH} "Dësen Installateur funktionnéiert nëmmen mat 64-Bit Windows Versiounen."
;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_LUXEMBOURGISH} "This installer requires at least Windows 10 1809."
+LangString inst_requires_win10 ${LANG_LUXEMBOURGISH} "Dësen Installateur erfuerdert mindestens Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
-LangString inst_uninstall_link_description ${LANG_LUXEMBOURGISH} "Uninstall qBittorrent"
+LangString inst_uninstall_link_description ${LANG_LUXEMBOURGISH} "qBittorrent deinstalléieren"
;------------------------------------
;Uninstaller strings
;LangString remove_files ${LANG_ENGLISH} "Remove files"
-LangString remove_files ${LANG_LUXEMBOURGISH} "Remove files"
+LangString remove_files ${LANG_LUXEMBOURGISH} "Dateien läschen"
;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts"
-LangString remove_shortcuts ${LANG_LUXEMBOURGISH} "Remove shortcuts"
+LangString remove_shortcuts ${LANG_LUXEMBOURGISH} "Verknëppungen läschen"
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
-LangString remove_associations ${LANG_LUXEMBOURGISH} "Remove file associations"
+LangString remove_associations ${LANG_LUXEMBOURGISH} "Dateiverknëppungen läschen"
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
-LangString remove_registry ${LANG_LUXEMBOURGISH} "Remove registry keys"
+LangString remove_registry ${LANG_LUXEMBOURGISH} "Registry-Schlësselen läschen"
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
-LangString remove_conf ${LANG_LUXEMBOURGISH} "Remove configuration files"
+LangString remove_conf ${LANG_LUXEMBOURGISH} "Konfiguratiounsdateien läschen"
;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule"
-LangString remove_firewall ${LANG_LUXEMBOURGISH} "Remove Windows Firewall rule"
+LangString remove_firewall ${LANG_LUXEMBOURGISH} "Reegel an der Windows Firewall läschen"
;LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule"
-LangString remove_firewallinfo ${LANG_LUXEMBOURGISH} "Removing Windows Firewall rule"
+LangString remove_firewallinfo ${LANG_LUXEMBOURGISH} "Reegel aus der Windows Firewall läschen"
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
-LangString remove_cache ${LANG_LUXEMBOURGISH} "Remove torrents and cached data"
+LangString remove_cache ${LANG_LUXEMBOURGISH} "Torrenten a zwëschegespäichert Donnéeën läschen"
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
-LangString uninst_warning ${LANG_LUXEMBOURGISH} "qBittorrent is running. Please close the application before uninstalling."
+LangString uninst_warning ${LANG_LUXEMBOURGISH} "qBittorrent leeft grad. W.e.g. d'Applikatioun zoumaachen ier deinstalléiert gëtt."
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
-LangString uninst_tor_warn ${LANG_LUXEMBOURGISH} "Not removing .torrent association. It is associated with:"
+LangString uninst_tor_warn ${LANG_LUXEMBOURGISH} "Dateiverknëppung mat der .torrent-Datei gëtt net ewechgeholl, se ass nach verbonnen mat:"
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
-LangString uninst_mag_warn ${LANG_LUXEMBOURGISH} "Not removing magnet association. It is associated with:"
+LangString uninst_mag_warn ${LANG_LUXEMBOURGISH} "Dateiverknëppung mat Magnet-Link gëtt net ewechgeholl, se ass nach verbonnen mat:"
diff --git a/dist/windows/installer-translations/macedonian.nsh b/dist/windows/installer-translations/macedonian.nsh
index 67fe96f5a727..2d8083352506 100644
--- a/dist/windows/installer-translations/macedonian.nsh
+++ b/dist/windows/installer-translations/macedonian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_MACEDONIAN} "Uninstalling previous version."
LangString launch_qbt ${LANG_MACEDONIAN} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_MACEDONIAN} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_MACEDONIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_MACEDONIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_MACEDONIAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/malay.nsh b/dist/windows/installer-translations/malay.nsh
index f6acca8b84b1..2bf915d8bf90 100644
--- a/dist/windows/installer-translations/malay.nsh
+++ b/dist/windows/installer-translations/malay.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_MALAY} "Uninstalling previous version."
LangString launch_qbt ${LANG_MALAY} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_MALAY} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_MALAY} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_MALAY} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_MALAY} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/mongolian.nsh b/dist/windows/installer-translations/mongolian.nsh
index 551b8e36f1be..a1111550412c 100644
--- a/dist/windows/installer-translations/mongolian.nsh
+++ b/dist/windows/installer-translations/mongolian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_MONGOLIAN} "Uninstalling previous version."
LangString launch_qbt ${LANG_MONGOLIAN} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_MONGOLIAN} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_MONGOLIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_MONGOLIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_MONGOLIAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/norwegian.nsh b/dist/windows/installer-translations/norwegian.nsh
index f5155d7c2b92..5406cf7e8364 100644
--- a/dist/windows/installer-translations/norwegian.nsh
+++ b/dist/windows/installer-translations/norwegian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_NORWEGIAN} "Avinstallerer forrige versjon."
LangString launch_qbt ${LANG_NORWEGIAN} "Sett i gang qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_NORWEGIAN} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_NORWEGIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_NORWEGIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_NORWEGIAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/norwegiannynorsk.nsh b/dist/windows/installer-translations/norwegiannynorsk.nsh
index 7db898f28e39..705edd98bab3 100644
--- a/dist/windows/installer-translations/norwegiannynorsk.nsh
+++ b/dist/windows/installer-translations/norwegiannynorsk.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_NORWEGIANNYNORSK} "Uninstalling previous version."
LangString launch_qbt ${LANG_NORWEGIANNYNORSK} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_NORWEGIANNYNORSK} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_NORWEGIANNYNORSK} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_NORWEGIANNYNORSK} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_NORWEGIANNYNORSK} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/polish.nsh b/dist/windows/installer-translations/polish.nsh
index 0cf4065e3f2e..f4a235ee73fe 100644
--- a/dist/windows/installer-translations/polish.nsh
+++ b/dist/windows/installer-translations/polish.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_POLISH} "Odinstalowywanie poprzedniej wersji."
LangString launch_qbt ${LANG_POLISH} "Uruchom qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_POLISH} "Ten instalator działa tylko w 64-bitowych wersjach systemu Windows."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_POLISH} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_POLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_POLISH} "Odinstaluj qBittorrent"
diff --git a/dist/windows/installer-translations/portuguese.nsh b/dist/windows/installer-translations/portuguese.nsh
index f28f11c511a4..c149119f42e3 100644
--- a/dist/windows/installer-translations/portuguese.nsh
+++ b/dist/windows/installer-translations/portuguese.nsh
@@ -7,7 +7,7 @@ LangString inst_desktop ${LANG_PORTUGUESE} "Criar atalho no ambiente de trabalho
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_PORTUGUESE} "Criar atalho no menu Iniciar"
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
-LangString inst_startup ${LANG_PORTUGUESE} "Iniciar o qBittorrent na inicialização do Windows"
+LangString inst_startup ${LANG_PORTUGUESE} "Iniciar o qBittorrent no arranque do Windows"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_PORTUGUESE} "Abrir ficheiros .torrent com o qBittorrent"
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_PORTUGUESE} "A desinstalar versão anterior."
LangString launch_qbt ${LANG_PORTUGUESE} "Iniciar qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_PORTUGUESE} "Este instalador funciona apenas em versões Windows de 64 bits."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_PORTUGUESE} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_PORTUGUESE} "Este instalador requer, pelo menos, o Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_PORTUGUESE} "Desinstalar qBittorrent"
diff --git a/dist/windows/installer-translations/portugueseBR.nsh b/dist/windows/installer-translations/portugueseBR.nsh
index 366833583a4d..ef79df94cbb8 100644
--- a/dist/windows/installer-translations/portugueseBR.nsh
+++ b/dist/windows/installer-translations/portugueseBR.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_PORTUGUESEBR} "Desinstalando a versão anterior."
LangString launch_qbt ${LANG_PORTUGUESEBR} "Executar o qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_PORTUGUESEBR} "Este instalador só funciona nas versões 64 bits do Windows."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_PORTUGUESEBR} "Este instalador requer no mínimo o Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_PORTUGUESEBR} "Este instalador requer no mínimo o Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_PORTUGUESEBR} "Desinstalar o qBittorrent"
diff --git a/dist/windows/installer-translations/romanian.nsh b/dist/windows/installer-translations/romanian.nsh
index 7515165d079f..e60d51da9a5c 100644
--- a/dist/windows/installer-translations/romanian.nsh
+++ b/dist/windows/installer-translations/romanian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_ROMANIAN} "Se dezinstalează versiunea anterioară.
LangString launch_qbt ${LANG_ROMANIAN} "Lansați qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_ROMANIAN} "Acest program de instalare funcționează doar pe versiunile Windows pe 64 de biți."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_ROMANIAN} "Acest program de instalare necesită cel puțin Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_ROMANIAN} "Acest program de instalare necesită cel puțin Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_ROMANIAN} "Dezinstalați qBittorrent"
diff --git a/dist/windows/installer-translations/russian.nsh b/dist/windows/installer-translations/russian.nsh
index eec7de7c8496..01b7e67f6dcc 100644
--- a/dist/windows/installer-translations/russian.nsh
+++ b/dist/windows/installer-translations/russian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_RUSSIAN} "Удаляется старая верс
LangString launch_qbt ${LANG_RUSSIAN} "Запустить qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_RUSSIAN} "Этот установщик работает только на 64-битных версиях Windows."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_RUSSIAN} "Для работы этого установщика требуется Windows 10 1809 или выше."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_RUSSIAN} "Для работы этого установщика требуется Windows 10 (1809) / Windows Server 2019 или выше."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_RUSSIAN} "Удалить qBittorrent"
diff --git a/dist/windows/installer-translations/serbian.nsh b/dist/windows/installer-translations/serbian.nsh
index ddb2574468cc..e21b016f2012 100644
--- a/dist/windows/installer-translations/serbian.nsh
+++ b/dist/windows/installer-translations/serbian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_SERBIAN} "Uninstalling previous version."
LangString launch_qbt ${LANG_SERBIAN} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_SERBIAN} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_SERBIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_SERBIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_SERBIAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/serbianlatin.nsh b/dist/windows/installer-translations/serbianlatin.nsh
index 7062cfb7825a..4509120c6240 100644
--- a/dist/windows/installer-translations/serbianlatin.nsh
+++ b/dist/windows/installer-translations/serbianlatin.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_SERBIANLATIN} "Uninstalling previous version."
LangString launch_qbt ${LANG_SERBIANLATIN} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_SERBIANLATIN} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_SERBIANLATIN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_SERBIANLATIN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_SERBIANLATIN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/simpchinese.nsh b/dist/windows/installer-translations/simpchinese.nsh
index 44c5a3e4b933..f0256e046144 100644
--- a/dist/windows/installer-translations/simpchinese.nsh
+++ b/dist/windows/installer-translations/simpchinese.nsh
@@ -23,13 +23,13 @@ LangString inst_warning ${LANG_SIMPCHINESE} "qBittorrent 正在运行。 安装
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
LangString inst_uninstall_question ${LANG_SIMPCHINESE} "当前版本会被卸载。 用户设置和种子会被完整保留。"
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
-LangString inst_unist ${LANG_SIMPCHINESE} "卸载以前的版本。"
+LangString inst_unist ${LANG_SIMPCHINESE} "正在卸载以前的版本。"
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_SIMPCHINESE} "启动 qBittorrent。"
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_SIMPCHINESE} "此安装程序仅支持 64 位 Windows 系统。"
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_SIMPCHINESE} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_SIMPCHINESE} "此安装程序仅支持 Windows 10 (1809) / Windows Server 2019 或更新的系统。"
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_SIMPCHINESE} "卸载 qBittorrent"
diff --git a/dist/windows/installer-translations/slovak.nsh b/dist/windows/installer-translations/slovak.nsh
index c784748b1630..fd960b65b9e9 100644
--- a/dist/windows/installer-translations/slovak.nsh
+++ b/dist/windows/installer-translations/slovak.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_SLOVAK} "Odinštalácia predchádzajúcej verzie."
LangString launch_qbt ${LANG_SLOVAK} "Spustiť qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_SLOVAK} "Táto inštalácia funguje iba na 64-bitových verziách Windowsu."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_SLOVAK} "Tento inštalátor vyžaduje aspoň Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_SLOVAK} "Tento inštalátor vyžaduje aspoň Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_SLOVAK} "Odinštalovať qBittorrent"
diff --git a/dist/windows/installer-translations/slovenian.nsh b/dist/windows/installer-translations/slovenian.nsh
index da5bd3856b70..9a1e481e25ff 100644
--- a/dist/windows/installer-translations/slovenian.nsh
+++ b/dist/windows/installer-translations/slovenian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_SLOVENIAN} "Uninstalling previous version."
LangString launch_qbt ${LANG_SLOVENIAN} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_SLOVENIAN} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_SLOVENIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_SLOVENIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_SLOVENIAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/spanish.nsh b/dist/windows/installer-translations/spanish.nsh
index 4f25943b715d..9749a0bea0e7 100644
--- a/dist/windows/installer-translations/spanish.nsh
+++ b/dist/windows/installer-translations/spanish.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_SPANISH} "Desinstalando la versión anterior."
LangString launch_qbt ${LANG_SPANISH} "Iniciar qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_SPANISH} "Este instalador solo funciona en versiones de 64-bit de Windows."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_SPANISH} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_SPANISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_SPANISH} "Desinstalar qBittorrent"
diff --git a/dist/windows/installer-translations/spanishinternational.nsh b/dist/windows/installer-translations/spanishinternational.nsh
index c59cfabd55ab..904d86061e3c 100644
--- a/dist/windows/installer-translations/spanishinternational.nsh
+++ b/dist/windows/installer-translations/spanishinternational.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_SPANISHINTERNATIONAL} "Desinstalando la versión an
LangString launch_qbt ${LANG_SPANISHINTERNATIONAL} "Iniciar qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_SPANISHINTERNATIONAL} "Este instalador solo funciona en versiones de 64-bit de Windows."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_SPANISHINTERNATIONAL} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_SPANISHINTERNATIONAL} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_SPANISHINTERNATIONAL} "Desinstalar qBittorrent"
diff --git a/dist/windows/installer-translations/swedish.nsh b/dist/windows/installer-translations/swedish.nsh
index e52cbc31da3e..51912d112e7a 100644
--- a/dist/windows/installer-translations/swedish.nsh
+++ b/dist/windows/installer-translations/swedish.nsh
@@ -7,29 +7,29 @@ LangString inst_desktop ${LANG_SWEDISH} "Skapa skrivbordsgenväg"
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_SWEDISH} "Skapa startmenygenväg"
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
-LangString inst_startup ${LANG_SWEDISH} "Starta qBittorrent vid Windows start"
+LangString inst_startup ${LANG_SWEDISH} "Starta qBittorrent vid Windows-uppstart"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_SWEDISH} "Öppna .torrent-filer med qBittorrent"
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
LangString inst_magnet ${LANG_SWEDISH} "Öppna magnetlänkar med qBittorrent"
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
-LangString inst_firewall ${LANG_SWEDISH} "Lägg till Windows-brandväggregel"
+LangString inst_firewall ${LANG_SWEDISH} "Lägg till Windows-brandväggsregel"
;LangString inst_pathlimit ${LANG_ENGLISH} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)"
LangString inst_pathlimit ${LANG_SWEDISH} "Inaktivera gränsen för Windows-sökvägslängd (260 tecken MAX_PATH-begränsning, kräver Windows 10 1607 eller senare)"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
-LangString inst_firewallinfo ${LANG_SWEDISH} "Lägger till Windows-brandväggregel"
+LangString inst_firewallinfo ${LANG_SWEDISH} "Lägger till Windows-brandväggsregel"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
-LangString inst_warning ${LANG_SWEDISH} "qBittorrent körs. Vänligen stäng programmet innan du installerar."
+LangString inst_warning ${LANG_SWEDISH} "qBittorrent körs. Stäng programmet innan du installerar."
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
-LangString inst_uninstall_question ${LANG_SWEDISH} "Nuvarande version avinstalleras. Användarinställningar och torrenter kommer att förbli intakta."
+LangString inst_uninstall_question ${LANG_SWEDISH} "Aktuell version avinstalleras. Användarinställningar och torrenter kommer att förbli intakta."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_SWEDISH} "Avinstallerar tidigare version."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_SWEDISH} "Kör qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_SWEDISH} "Det här installationsprogrammet fungerar endast i 64-bitars Windows-versioner."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_SWEDISH} "Det här installationsprogrammet kräver minst Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_SWEDISH} "Det här installationsprogrammet kräver minst Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_SWEDISH} "Avinstallera qBittorrent"
@@ -53,7 +53,7 @@ LangString remove_firewallinfo ${LANG_SWEDISH} "Tar bort Windows-brandväggsrege
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
LangString remove_cache ${LANG_SWEDISH} "Ta bort torrenter och cachade data"
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
-LangString uninst_warning ${LANG_SWEDISH} "qBittorrent körs. Vänligen stäng programmet innan du avinstallerar."
+LangString uninst_warning ${LANG_SWEDISH} "qBittorrent körs. Stäng programmet innan du avinstallerar."
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
LangString uninst_tor_warn ${LANG_SWEDISH} "Tar inte bort .torrent-association. Den är associerad med:"
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
diff --git a/dist/windows/installer-translations/thai.nsh b/dist/windows/installer-translations/thai.nsh
index 411c54b2020f..ac003757fa4d 100644
--- a/dist/windows/installer-translations/thai.nsh
+++ b/dist/windows/installer-translations/thai.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_THAI} "Uninstalling previous version."
LangString launch_qbt ${LANG_THAI} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_THAI} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_THAI} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_THAI} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_THAI} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/tradchinese.nsh b/dist/windows/installer-translations/tradchinese.nsh
index 63ba5b70dc2b..49bcff874777 100644
--- a/dist/windows/installer-translations/tradchinese.nsh
+++ b/dist/windows/installer-translations/tradchinese.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_TRADCHINESE} "正在移除先前版本"
LangString launch_qbt ${LANG_TRADCHINESE} "啟動 qBittorrent"
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_TRADCHINESE} "此安裝程式僅支援 64 位元版本的 Windows。"
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_TRADCHINESE} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_TRADCHINESE} "此安裝程式僅支援 Windows 10 (1809) / Windows Server 2019 以上的系統。"
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_TRADCHINESE} "移除 qBittorrent"
diff --git a/dist/windows/installer-translations/turkish.nsh b/dist/windows/installer-translations/turkish.nsh
index 2ddcf44144c3..fd6435f5ca2f 100644
--- a/dist/windows/installer-translations/turkish.nsh
+++ b/dist/windows/installer-translations/turkish.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_TURKISH} "Önceki sürüm kaldırılıyor."
LangString launch_qbt ${LANG_TURKISH} "qBittorrent'i başlat."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_TURKISH} "Bu yükleyici sadece 64-bit Windows sürümlerinde çalışır."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_TURKISH} "Bu yükleyici en az Windows 10 1809 gerektirir."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_TURKISH} "Bu yükleyici en az Windows 10 (1809) / Windows Server 2019 gerektirir."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_TURKISH} "qBittorrent'i kaldır"
diff --git a/dist/windows/installer-translations/ukrainian.nsh b/dist/windows/installer-translations/ukrainian.nsh
index 08539f47dda3..bf6c1b283ed4 100644
--- a/dist/windows/installer-translations/ukrainian.nsh
+++ b/dist/windows/installer-translations/ukrainian.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_UKRAINIAN} "Видалення попередньо
LangString launch_qbt ${LANG_UKRAINIAN} "Запустити qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_UKRAINIAN} "Ця програма установки працює тільки в 64-розрядних версіях Windows."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_UKRAINIAN} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_UKRAINIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_UKRAINIAN} "Uninstall qBittorrent"
diff --git a/dist/windows/installer-translations/uzbek.nsh b/dist/windows/installer-translations/uzbek.nsh
index 283a9293da7e..138fe2717295 100644
--- a/dist/windows/installer-translations/uzbek.nsh
+++ b/dist/windows/installer-translations/uzbek.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_UZBEK} "Oldingi versiyani oʻchirish."
LangString launch_qbt ${LANG_UZBEK} "qBittorrent ishga tushirilsin."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_UZBEK} "Bu oʻrnatuvchi faqat Windows 64-bit versiyalarda ishlaydi."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_UZBEK} "Bu oʻrnatuvchi kamida Windows 10 1809 talab qiladi."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_UZBEK} "Bu oʻrnatuvchi kamida Windows 10 (1809) / Windows Server 2019 talab qiladi."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_UZBEK} "qBittorrent oʻchirilsin"
diff --git a/dist/windows/installer-translations/welsh.nsh b/dist/windows/installer-translations/welsh.nsh
index c816384e56ac..d56987a72fd8 100644
--- a/dist/windows/installer-translations/welsh.nsh
+++ b/dist/windows/installer-translations/welsh.nsh
@@ -28,8 +28,8 @@ LangString inst_unist ${LANG_WELSH} "Uninstalling previous version."
LangString launch_qbt ${LANG_WELSH} "Launch qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
LangString inst_requires_64bit ${LANG_WELSH} "This installer works only in 64-bit Windows versions."
-;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 1809."
-LangString inst_requires_win10 ${LANG_WELSH} "This installer requires at least Windows 10 1809."
+;LangString inst_requires_win10 ${LANG_ENGLISH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
+LangString inst_requires_win10 ${LANG_WELSH} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_WELSH} "Uninstall qBittorrent"
diff --git a/dist/windows/installer.nsh b/dist/windows/installer.nsh
index 09a8ad758554..a6025898de21 100644
--- a/dist/windows/installer.nsh
+++ b/dist/windows/installer.nsh
@@ -116,13 +116,15 @@ Function .onInit
!insertmacro Init "installer"
!insertmacro MUI_LANGDLL_DISPLAY
- ${IfNot} ${AtLeastWaaS} 1809 ; Windows 10 1809. Min supported version by Qt6
- MessageBox MB_OK|MB_ICONEXCLAMATION $(inst_requires_win10)
+ ${IfNot} ${AtLeastWaaS} 1809 ; Windows 10 (1809) / Windows Server 2019. Min supported version by Qt6
+ MessageBox MB_OK|MB_ICONEXCLAMATION $(inst_requires_win10) /SD IDOK
+ SetErrorLevel 1654 # WinError.h: `ERROR_INSTALL_REJECTED`
Abort
${EndIf}
${IfNot} ${RunningX64}
- MessageBox MB_OK|MB_ICONEXCLAMATION $(inst_requires_64bit)
+ MessageBox MB_OK|MB_ICONEXCLAMATION $(inst_requires_64bit) /SD IDOK
+ SetErrorLevel 1654 # WinError.h: `ERROR_INSTALL_REJECTED`
Abort
${EndIf}
@@ -147,9 +149,10 @@ Function check_instance
check:
FindProcDLL::FindProc "qbittorrent.exe"
StrCmp $R0 "1" 0 notfound
- MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(inst_warning) IDRETRY check IDCANCEL done
+ MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(inst_warning) /SD IDCANCEL IDRETRY check IDCANCEL canceled
- done:
+ canceled:
+ SetErrorLevel 15618 # WinError.h: `ERROR_PACKAGES_IN_USE`
Abort
notfound:
diff --git a/dist/windows/uninstaller.nsh b/dist/windows/uninstaller.nsh
index 517604935ba4..51b47a42b2d5 100644
--- a/dist/windows/uninstaller.nsh
+++ b/dist/windows/uninstaller.nsh
@@ -75,15 +75,16 @@ FunctionEnd
Function un.check_instance
- check:
- FindProcDLL::FindProc "qbittorrent.exe"
- StrCmp $R0 "1" 0 notfound
- MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(uninst_warning) IDRETRY check IDCANCEL done
+ check:
+ FindProcDLL::FindProc "qbittorrent.exe"
+ StrCmp $R0 "1" 0 notfound
+ MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(uninst_warning) /SD IDCANCEL IDRETRY check IDCANCEL canceled
- done:
- Abort
+ canceled:
+ SetErrorLevel 15618 # WinError.h: `ERROR_PACKAGES_IN_USE`
+ Abort
- notfound:
+ notfound:
FunctionEnd
diff --git a/doc/en/qbittorrent-nox.1 b/doc/en/qbittorrent-nox.1
index 7d1ee0dd173d..140ad389cac5 100644
--- a/doc/en/qbittorrent-nox.1
+++ b/doc/en/qbittorrent-nox.1
@@ -1,41 +1,44 @@
-.\" Automatically generated by Pandoc 3.1.7
+.\" Automatically generated by Pandoc 3.4
.\"
-.TH "QBITTORRENT-NOX" "1" "January 16th 2010" "Command line Bittorrent client written in C++ / Qt" ""
+.TH "QBITTORRENT\-NOX" "1" "January 16th 2010" "Command line Bittorrent client written in C++ / Qt"
.SH NAME
-qBittorrent-nox - a command line Bittorrent client written in C++ / Qt
+qBittorrent\-nox \- a command line Bittorrent client written in C++ / Qt
.SH SYNOPSIS
-\f[B]qbittorrent-nox\f[R]
-\f[CR][--d|--daemon] [--webui-port=x] [TORRENT_FILE | URL]...\f[R]
+\f[B]qbittorrent\-nox\f[R]
+\f[CR][\-\-d|\-\-daemon] [\-\-webui\-port=x] [TORRENT_FILE | URL]...\f[R]
.PP
-\f[B]qbittorrent-nox\f[R] \f[CR]--help\f[R]
+\f[B]qbittorrent\-nox\f[R] \f[CR]\-\-help\f[R]
.PP
-\f[B]qbittorrent-nox\f[R] \f[CR]--version\f[R]
+\f[B]qbittorrent\-nox\f[R] \f[CR]\-\-version\f[R]
.SH DESCRIPTION
-\f[B]qBittorrent-nox\f[R] is an advanced command-line Bittorrent client
-written in C++ / Qt using the \f[B]libtorrent-rasterbar\f[R] library by
-Arvid Norberg.
-qBittorrent-nox aims to be a good alternative to other command line
+\f[B]qBittorrent\-nox\f[R] is an advanced command\-line Bittorrent
+client written in C++ / Qt using the \f[B]libtorrent\-rasterbar\f[R]
+library by Arvid Norberg.
+qBittorrent\-nox aims to be a good alternative to other command line
bittorrent clients and provides features similar to popular graphical
clients.
.PP
-qBittorrent-nox is fast, stable, light and it supports unicode.
-It also comes with UPnP port forwarding / NAT-PMP, encryption (Vuze
+qBittorrent\-nox is fast, stable, light and it supports unicode.
+It also comes with UPnP port forwarding / NAT\-PMP, encryption (Vuze
compatible), FAST extension (mainline) and PeX support (utorrent
compatible).
.PP
-qBittorrent-nox is meant to be controlled via its feature-rich Web UI
+qBittorrent\-nox is meant to be controlled via its feature\-rich Web UI
which is accessible as a default on http://localhost:8080.
The Web UI access is secured and the default account user name is
\[lq]admin\[rq] with \[lq]adminadmin\[rq] as a password.
.SH OPTIONS
-\f[B]\f[CB]--help\f[B]\f[R] Prints the command line options.
+\f[B]\f[CB]\-\-help\f[B]\f[R] Prints the command line options.
.PP
-\f[B]\f[CB]--version\f[B]\f[R] Prints qbittorrent program version
+\f[B]\f[CB]\-\-version\f[B]\f[R] Prints qbittorrent program version
number.
.PP
-\f[B]\f[CB]--webui-port=x\f[B]\f[R] Changes Web UI port to x (default:
-8080).
+\f[B]\f[CB]\-\-webui\-port=x\f[B]\f[R] Changes Web UI port to x
+(default: 8080).
.SH BUGS
If you find a bug, please report it at https://bugs.qbittorrent.org
.SH AUTHORS
-Christophe Dumez .
+Christophe Dumez \c
+.MT chris@qbittorrent.org
+.ME \c
+\&.
diff --git a/doc/en/qbittorrent.1 b/doc/en/qbittorrent.1
index 4efca9e0d32b..c8737d286d32 100644
--- a/doc/en/qbittorrent.1
+++ b/doc/en/qbittorrent.1
@@ -1,35 +1,38 @@
-.\" Automatically generated by Pandoc 3.1.7
+.\" Automatically generated by Pandoc 3.4
.\"
-.TH "QBITTORRENT" "1" "January 16th 2010" "Bittorrent client written in C++ / Qt" ""
+.TH "QBITTORRENT" "1" "January 16th 2010" "Bittorrent client written in C++ / Qt"
.SH NAME
-qBittorrent - a Bittorrent client written in C++ / Qt
+qBittorrent \- a Bittorrent client written in C++ / Qt
.SH SYNOPSIS
\f[B]qbittorrent\f[R]
-\f[CR][--no-splash] [--webui-port=x] [TORRENT_FILE | URL]...\f[R]
+\f[CR][\-\-no\-splash] [\-\-webui\-port=x] [TORRENT_FILE | URL]...\f[R]
.PP
-\f[B]qbittorrent\f[R] \f[CR]--help\f[R]
+\f[B]qbittorrent\f[R] \f[CR]\-\-help\f[R]
.PP
-\f[B]qbittorrent\f[R] \f[CR]--version\f[R]
+\f[B]qbittorrent\f[R] \f[CR]\-\-version\f[R]
.SH DESCRIPTION
\f[B]qBittorrent\f[R] is an advanced Bittorrent client written in C++ /
-Qt, using the \f[B]libtorrent-rasterbar\f[R] library by Arvid Norberg.
+Qt, using the \f[B]libtorrent\-rasterbar\f[R] library by Arvid Norberg.
qBittorrent is similar to uTorrent.
qBittorrent is fast, stable, light, it supports unicode and it provides
a good integrated search engine.
-It also comes with UPnP port forwarding / NAT-PMP, encryption (Vuze
+It also comes with UPnP port forwarding / NAT\-PMP, encryption (Vuze
compatible), FAST extension (mainline) and PeX support (utorrent
compatible).
.SH OPTIONS
-\f[B]\f[CB]--help\f[B]\f[R] Prints the command line options.
+\f[B]\f[CB]\-\-help\f[B]\f[R] Prints the command line options.
.PP
-\f[B]\f[CB]--version\f[B]\f[R] Prints qbittorrent program version
+\f[B]\f[CB]\-\-version\f[B]\f[R] Prints qbittorrent program version
number.
.PP
-\f[B]\f[CB]--no-splash\f[B]\f[R] Disables splash screen on startup.
+\f[B]\f[CB]\-\-no\-splash\f[B]\f[R] Disables splash screen on startup.
.PP
-\f[B]\f[CB]--webui-port=x\f[B]\f[R] Changes Web UI port to x (default:
-8080).
+\f[B]\f[CB]\-\-webui\-port=x\f[B]\f[R] Changes Web UI port to x
+(default: 8080).
.SH BUGS
If you find a bug, please report it at https://bugs.qbittorrent.org
.SH AUTHORS
-Christophe Dumez .
+Christophe Dumez \c
+.MT chris@qbittorrent.org
+.ME \c
+\&.
diff --git a/doc/ru/qbittorrent-nox.1 b/doc/ru/qbittorrent-nox.1
index ba8713bae179..315753991b6e 100644
--- a/doc/ru/qbittorrent-nox.1
+++ b/doc/ru/qbittorrent-nox.1
@@ -1,7 +1,10 @@
-.\" Automatically generated by Pandoc 3.1.7
+.\" Automatically generated by Pandoc 3.4
.\"
-.TH "QBITTORRENT-NOX" "1" "16 января 2010" "Клиент сети БитТоррент для командной строки" ""
+.TH "QBITTORRENT\-NOX" "1" "16 января 2010" "Клиент сети БитТоррент для командной строки"
.SH НАЗВАНИЕ
-qBittorrent-nox \[em] клиент сети БитТоррент для командной строки.
+qBittorrent\-nox \[em] клиент сети БитТоррент для командной строки.
.SH АВТОРЫ
-Christophe Dumez .
+Christophe Dumez \c
+.MT chris@qbittorrent.org
+.ME \c
+\&.
diff --git a/doc/ru/qbittorrent.1 b/doc/ru/qbittorrent.1
index 2fc395ddde45..7820ac39894c 100644
--- a/doc/ru/qbittorrent.1
+++ b/doc/ru/qbittorrent.1
@@ -1,7 +1,10 @@
-.\" Automatically generated by Pandoc 3.1.7
+.\" Automatically generated by Pandoc 3.4
.\"
-.TH "QBITTORRENT" "1" "16 января 2010" "Клиент сети БитТоррент" ""
+.TH "QBITTORRENT" "1" "16 января 2010" "Клиент сети БитТоррент"
.SH НАЗВАНИЕ
qBittorrent \[em] клиент сети БитТоррент.
.SH АВТОРЫ
-Christophe Dumez .
+Christophe Dumez \c
+.MT chris@qbittorrent.org
+.ME \c
+\&.
diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt
index e4d7747d7349..b5174aa45b16 100644
--- a/src/app/CMakeLists.txt
+++ b/src/app/CMakeLists.txt
@@ -38,6 +38,7 @@ target_sources(qbt_app PRIVATE
applicationinstancemanager.h
cmdoptions.h
filelogger.h
+ legalnotice.h
qtlocalpeer/qtlocalpeer.h
signalhandler.h
upgrade.h
@@ -47,6 +48,7 @@ target_sources(qbt_app PRIVATE
applicationinstancemanager.cpp
cmdoptions.cpp
filelogger.cpp
+ legalnotice.cpp
main.cpp
qtlocalpeer/qtlocalpeer.cpp
signalhandler.cpp
diff --git a/src/app/application.cpp b/src/app/application.cpp
index af8d92b63ac5..a415950d0fe8 100644
--- a/src/app/application.cpp
+++ b/src/app/application.cpp
@@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
- * Copyright (C) 2015 Vladimir Golovnev
+ * Copyright (C) 2015-2024 Vladimir Golovnev
* Copyright (C) 2006 Christophe Dumez
*
* This program is free software; you can redistribute it and/or
@@ -57,7 +57,6 @@
#include
#ifdef Q_OS_WIN
#include
-#include
#endif // Q_OS_WIN
#ifdef Q_OS_MACOS
#include
@@ -70,7 +69,6 @@
#include "base/bittorrent/torrent.h"
#include "base/exceptions.h"
#include "base/global.h"
-#include "base/iconprovider.h"
#include "base/logger.h"
#include "base/net/downloadmanager.h"
#include "base/net/geoipmanager.h"
@@ -93,7 +91,6 @@
#include "upgrade.h"
#ifndef DISABLE_GUI
-#include "gui/guiaddtorrentmanager.h"
#include "gui/desktopintegration.h"
#include "gui/mainwindow.h"
#include "gui/shutdownconfirmdialog.h"
@@ -143,8 +140,8 @@ namespace
if (!addTorrentParams.savePath.isEmpty())
result.append(u"@savePath=" + addTorrentParams.savePath.data());
- if (addTorrentParams.addPaused.has_value())
- result.append(*addTorrentParams.addPaused ? u"@addPaused=1"_s : u"@addPaused=0"_s);
+ if (addTorrentParams.addStopped.has_value())
+ result.append(*addTorrentParams.addStopped ? u"@addStopped=1"_s : u"@addStopped=0"_s);
if (addTorrentParams.skipChecking)
result.append(u"@skipChecking"_s);
@@ -183,9 +180,9 @@ namespace
continue;
}
- if (param.startsWith(u"@addPaused="))
+ if (param.startsWith(u"@addStopped="))
{
- addTorrentParams.addPaused = (QStringView(param).mid(11).toInt() != 0);
+ addTorrentParams.addStopped = (QStringView(param).mid(11).toInt() != 0);
continue;
}
@@ -229,6 +226,7 @@ namespace
Application::Application(int &argc, char **argv)
: BaseApplication(argc, argv)
, m_commandLineArgs(parseCommandLine(Application::arguments()))
+ , m_storeInstanceName(SETTINGS_KEY(u"InstanceName"_s))
, m_storeFileLoggerEnabled(FILELOGGER_SETTINGS_KEY(u"Enabled"_s))
, m_storeFileLoggerBackup(FILELOGGER_SETTINGS_KEY(u"Backup"_s))
, m_storeFileLoggerDeleteOld(FILELOGGER_SETTINGS_KEY(u"DeleteOld"_s))
@@ -253,17 +251,15 @@ Application::Application(int &argc, char **argv)
#if !defined(DISABLE_GUI)
setDesktopFileName(u"org.qbittorrent.qBittorrent"_s);
setQuitOnLastWindowClosed(false);
+ setQuitLockEnabled(false);
QPixmapCache::setCacheLimit(PIXMAP_CACHE_SIZE);
#endif
Logger::initInstance();
const auto portableProfilePath = Path(QCoreApplication::applicationDirPath()) / DEFAULT_PORTABLE_MODE_PROFILE_DIR;
- const bool portableModeEnabled = m_commandLineArgs.profileDir.isEmpty() && portableProfilePath.exists();
-
- const Path profileDir = portableModeEnabled
- ? portableProfilePath
- : m_commandLineArgs.profileDir;
+ const bool portableModeEnabled = m_commandLineArgs.profileDir.isEmpty() && Utils::Fs::isDir(portableProfilePath);
+ const Path profileDir = portableModeEnabled ? portableProfilePath : m_commandLineArgs.profileDir;
Profile::initInstance(profileDir, m_commandLineArgs.configurationName,
(m_commandLineArgs.relativeFastresumePaths || portableModeEnabled));
@@ -272,16 +268,17 @@ Application::Application(int &argc, char **argv)
SettingsStorage::initInstance();
Preferences::initInstance();
- const bool firstTimeUser = !Preferences::instance()->getAcceptedLegal();
- if (!firstTimeUser)
+ const bool firstTimeUser = SettingsStorage::instance()->isEmpty();
+ if (firstTimeUser)
{
- if (!upgrade())
- throw RuntimeError(u"Failed migration of old settings"_s); // Not translatable. Translation isn't configured yet.
- handleChangedDefaults(DefaultPreferencesMode::Legacy);
+ setCurrentMigrationVersion();
+ handleChangedDefaults(DefaultPreferencesMode::Current);
}
else
{
- handleChangedDefaults(DefaultPreferencesMode::Current);
+ if (!upgrade())
+ throw RuntimeError(u"Failed migration of old settings"_s); // Not translatable. Translation isn't configured yet.
+ handleChangedDefaults(DefaultPreferencesMode::Legacy);
}
initializeTranslation();
@@ -292,7 +289,8 @@ Application::Application(int &argc, char **argv)
connect(this, &QGuiApplication::commitDataRequest, this, &Application::shutdownCleanup, Qt::DirectConnection);
#endif
- LogMsg(tr("qBittorrent %1 started", "qBittorrent v3.2.0alpha started").arg(QStringLiteral(QBT_VERSION)));
+ LogMsg(tr("qBittorrent %1 started. Process ID: %2", "qBittorrent v3.2.0alpha started")
+ .arg(QStringLiteral(QBT_VERSION), QString::number(QCoreApplication::applicationPid())));
if (portableModeEnabled)
{
LogMsg(tr("Running in portable mode. Auto detected profile folder at: %1").arg(profileDir.toString()));
@@ -361,6 +359,23 @@ const QBtCommandLineParameters &Application::commandLineArgs() const
return m_commandLineArgs;
}
+QString Application::instanceName() const
+{
+ return m_storeInstanceName;
+}
+
+void Application::setInstanceName(const QString &name)
+{
+ if (name == instanceName())
+ return;
+
+ m_storeInstanceName = name;
+#ifndef DISABLE_GUI
+ if (MainWindow *mw = mainWindow())
+ mw->setTitleSuffix(name);
+#endif
+}
+
int Application::memoryWorkingSetLimit() const
{
return m_storeMemoryWorkingSetLimit.get(512);
@@ -523,7 +538,7 @@ void Application::runExternalProgram(const QString &programTemplate, const BitTo
str.replace(i, 2, torrent->contentPath().toString());
break;
case u'G':
- str.replace(i, 2, torrent->tags().join(u","_s));
+ str.replace(i, 2, Utils::String::joinIntoString(torrent->tags(), u","_s));
break;
case u'I':
str.replace(i, 2, (torrent->infoHash().v1().isValid() ? torrent->infoHash().v1().toString() : u"-"_s));
@@ -564,7 +579,7 @@ void Application::runExternalProgram(const QString &programTemplate, const BitTo
const QString logMsg = tr("Running external program. Torrent: \"%1\". Command: `%2`");
const QString logMsgError = tr("Failed to run external program. Torrent: \"%1\". Command: `%2`");
- // The processing sequenece is different for Windows and other OS, this is intentional
+ // The processing sequence is different for Windows and other OS, this is intentional
#if defined(Q_OS_WIN)
const QString program = replaceVariables(programTemplate);
const std::wstring programWStr = program.toStdWString();
@@ -663,6 +678,24 @@ void Application::sendNotificationEmail(const BitTorrent::Torrent *torrent)
content);
}
+void Application::sendTestEmail() const
+{
+ const Preferences *pref = Preferences::instance();
+ if (pref->isMailNotificationEnabled())
+ {
+ // Prepare mail content
+ const QString content = tr("This is a test email.") + u'\n'
+ + tr("Thank you for using qBittorrent.") + u'\n';
+
+ // Send the notification email
+ auto *smtp = new Net::Smtp();
+ smtp->sendMail(pref->getMailNotificationSender(),
+ pref->getMailNotificationEmail(),
+ tr("Test email"),
+ content);
+ }
+}
+
void Application::torrentAdded(const BitTorrent::Torrent *torrent) const
{
const Preferences *pref = Preferences::instance();
@@ -792,7 +825,6 @@ int Application::exec()
Net::ProxyConfigurationManager::initInstance();
Net::DownloadManager::initInstance();
- IconProvider::initInstance();
BitTorrent::Session::initInstance();
#ifndef DISABLE_GUI
@@ -801,7 +833,7 @@ int Application::exec()
m_desktopIntegration = new DesktopIntegration;
m_desktopIntegration->setToolTip(tr("Loading torrents..."));
#ifndef Q_OS_MACOS
- auto *desktopIntegrationMenu = new QMenu;
+ auto *desktopIntegrationMenu = m_desktopIntegration->menu();
auto *actionExit = new QAction(tr("E&xit"), desktopIntegrationMenu);
actionExit->setIcon(UIThemeManager::instance()->getIcon(u"application-exit"_s));
actionExit->setMenuRole(QAction::QuitRole);
@@ -812,8 +844,6 @@ int Application::exec()
});
desktopIntegrationMenu->addAction(actionExit);
- m_desktopIntegration->setMenu(desktopIntegrationMenu);
-
const bool isHidden = m_desktopIntegration->isActive() && (startUpWindowState() == WindowState::Hidden);
#else
const bool isHidden = false;
@@ -882,7 +912,8 @@ int Application::exec()
const WindowState windowState = (m_startupProgressDialog->windowState() & Qt::WindowMinimized)
? WindowState::Minimized : WindowState::Normal;
#endif
- m_window = new MainWindow(this, windowState);
+ m_window = new MainWindow(this, windowState, instanceName());
+
delete m_startupProgressDialog;
#endif // DISABLE_GUI
@@ -944,7 +975,7 @@ int Application::exec()
return BaseApplication::exec();
}
-bool Application::isRunning()
+bool Application::hasAnotherInstance() const
{
return !m_instanceManager->isFirstInstance();
}
@@ -1334,7 +1365,6 @@ void Application::cleanup()
Net::ProxyConfigurationManager::freeInstance();
Preferences::freeInstance();
SettingsStorage::freeInstance();
- IconProvider::freeInstance();
SearchPluginManager::freeInstance();
Utils::Fs::removeDirRecursively(Utils::Fs::tempPath());
diff --git a/src/app/application.h b/src/app/application.h
index ff7c4ace48c4..ca683fbff495 100644
--- a/src/app/application.h
+++ b/src/app/application.h
@@ -101,10 +101,13 @@ class Application final : public BaseApplication, public BaseIApplication
int exec();
- bool isRunning();
+ bool hasAnotherInstance() const;
bool callMainInstance();
const QBtCommandLineParameters &commandLineArgs() const;
+ QString instanceName() const override;
+ void setInstanceName(const QString &name) override;
+
// FileLogger properties
bool isFileLoggerEnabled() const override;
void setFileLoggerEnabled(bool value) override;
@@ -124,6 +127,8 @@ class Application final : public BaseApplication, public BaseIApplication
int memoryWorkingSetLimit() const override;
void setMemoryWorkingSetLimit(int size) override;
+ void sendTestEmail() const override;
+
#ifdef Q_OS_WIN
MemoryPriority processMemoryPriority() const override;
void setProcessMemoryPriority(MemoryPriority priority) override;
@@ -194,6 +199,7 @@ private slots:
QList m_paramsQueue;
+ SettingValue m_storeInstanceName;
SettingValue m_storeFileLoggerEnabled;
SettingValue m_storeFileLoggerBackup;
SettingValue m_storeFileLoggerDeleteOld;
diff --git a/src/app/cmdoptions.cpp b/src/app/cmdoptions.cpp
index 5b1d957b6668..f6946f68f024 100644
--- a/src/app/cmdoptions.cpp
+++ b/src/app/cmdoptions.cpp
@@ -36,12 +36,14 @@
#include
#include
#include
+#include
#if defined(Q_OS_WIN) && !defined(DISABLE_GUI)
#include
#endif
#include "base/global.h"
+#include "base/utils/fs.h"
#include "base/utils/misc.h"
#include "base/utils/string.h"
@@ -59,7 +61,7 @@ namespace
class Option
{
protected:
- explicit constexpr Option(const char *name, char shortcut = 0)
+ explicit constexpr Option(const QStringView name, const QChar shortcut = QChar::Null)
: m_name {name}
, m_shortcut {shortcut}
{
@@ -67,23 +69,23 @@ namespace
QString fullParameter() const
{
- return u"--" + QString::fromLatin1(m_name);
+ return u"--" + m_name.toString();
}
QString shortcutParameter() const
{
- return u"-" + QChar::fromLatin1(m_shortcut);
+ return u"-" + m_shortcut;
}
bool hasShortcut() const
{
- return m_shortcut != 0;
+ return !m_shortcut.isNull();
}
QString envVarName() const
{
return u"QBT_"
- + QString::fromLatin1(m_name).toUpper().replace(u'-', u'_');
+ + m_name.toString().toUpper().replace(u'-', u'_');
}
public:
@@ -98,15 +100,15 @@ namespace
}
private:
- const char *m_name = nullptr;
- const char m_shortcut;
+ const QStringView m_name;
+ const QChar m_shortcut;
};
// Boolean option.
class BoolOption : protected Option
{
public:
- explicit constexpr BoolOption(const char *name, char shortcut = 0)
+ explicit constexpr BoolOption(const QStringView name, const QChar shortcut = QChar::Null)
: Option {name, shortcut}
{
}
@@ -138,8 +140,8 @@ namespace
struct StringOption : protected Option
{
public:
- explicit constexpr StringOption(const char *name)
- : Option {name, 0}
+ explicit constexpr StringOption(const QStringView name)
+ : Option {name, QChar::Null}
{
}
@@ -180,7 +182,7 @@ namespace
class IntOption : protected StringOption
{
public:
- explicit constexpr IntOption(const char *name)
+ explicit constexpr IntOption(const QStringView name)
: StringOption {name}
{
}
@@ -228,8 +230,8 @@ namespace
class TriStateBoolOption : protected Option
{
public:
- constexpr TriStateBoolOption(const char *name, bool defaultValue)
- : Option {name, 0}
+ constexpr TriStateBoolOption(const QStringView name, const bool defaultValue)
+ : Option {name, QChar::Null}
, m_defaultValue(defaultValue)
{
}
@@ -262,8 +264,8 @@ namespace
}
throw CommandLineParameterError(QCoreApplication::translate("CMD Options", "Parameter '%1' must follow syntax '%1=%2'",
- "e.g. Parameter '--add-paused' must follow syntax "
- "'--add-paused='")
+ "e.g. Parameter '--add-stopped' must follow syntax "
+ "'--add-stopped='")
.arg(fullParameter(), u""_s));
}
@@ -298,32 +300,37 @@ namespace
return arg.section(u'=', 0, 0) == option.fullParameter();
}
- bool m_defaultValue;
+ private:
+ bool m_defaultValue = false;
};
- constexpr const BoolOption SHOW_HELP_OPTION {"help", 'h'};
- constexpr const BoolOption SHOW_VERSION_OPTION {"version", 'v'};
+ constexpr const BoolOption SHOW_HELP_OPTION {u"help", u'h'};
+#if !defined(Q_OS_WIN) || defined(DISABLE_GUI)
+ constexpr const BoolOption SHOW_VERSION_OPTION {u"version", u'v'};
+#endif
+ constexpr const BoolOption CONFIRM_LEGAL_NOTICE {u"confirm-legal-notice"};
#if defined(DISABLE_GUI) && !defined(Q_OS_WIN)
- constexpr const BoolOption DAEMON_OPTION {"daemon", 'd'};
+ constexpr const BoolOption DAEMON_OPTION {u"daemon", u'd'};
#else
- constexpr const BoolOption NO_SPLASH_OPTION {"no-splash"};
+ constexpr const BoolOption NO_SPLASH_OPTION {u"no-splash"};
#endif
- constexpr const IntOption WEBUI_PORT_OPTION {"webui-port"};
- constexpr const IntOption TORRENTING_PORT_OPTION {"torrenting-port"};
- constexpr const StringOption PROFILE_OPTION {"profile"};
- constexpr const StringOption CONFIGURATION_OPTION {"configuration"};
- constexpr const BoolOption RELATIVE_FASTRESUME {"relative-fastresume"};
- constexpr const StringOption SAVE_PATH_OPTION {"save-path"};
- constexpr const TriStateBoolOption PAUSED_OPTION {"add-paused", true};
- constexpr const BoolOption SKIP_HASH_CHECK_OPTION {"skip-hash-check"};
- constexpr const StringOption CATEGORY_OPTION {"category"};
- constexpr const BoolOption SEQUENTIAL_OPTION {"sequential"};
- constexpr const BoolOption FIRST_AND_LAST_OPTION {"first-and-last"};
- constexpr const TriStateBoolOption SKIP_DIALOG_OPTION {"skip-dialog", true};
+ constexpr const IntOption WEBUI_PORT_OPTION {u"webui-port"};
+ constexpr const IntOption TORRENTING_PORT_OPTION {u"torrenting-port"};
+ constexpr const StringOption PROFILE_OPTION {u"profile"};
+ constexpr const StringOption CONFIGURATION_OPTION {u"configuration"};
+ constexpr const BoolOption RELATIVE_FASTRESUME {u"relative-fastresume"};
+ constexpr const StringOption SAVE_PATH_OPTION {u"save-path"};
+ constexpr const TriStateBoolOption STOPPED_OPTION {u"add-stopped", true};
+ constexpr const BoolOption SKIP_HASH_CHECK_OPTION {u"skip-hash-check"};
+ constexpr const StringOption CATEGORY_OPTION {u"category"};
+ constexpr const BoolOption SEQUENTIAL_OPTION {u"sequential"};
+ constexpr const BoolOption FIRST_AND_LAST_OPTION {u"first-and-last"};
+ constexpr const TriStateBoolOption SKIP_DIALOG_OPTION {u"skip-dialog", true};
}
QBtCommandLineParameters::QBtCommandLineParameters(const QProcessEnvironment &env)
- : relativeFastresumePaths(RELATIVE_FASTRESUME.value(env))
+ : confirmLegalNotice(CONFIRM_LEGAL_NOTICE.value(env))
+ , relativeFastresumePaths(RELATIVE_FASTRESUME.value(env))
#ifndef DISABLE_GUI
, noSplash(NO_SPLASH_OPTION.value(env))
#elif !defined(Q_OS_WIN)
@@ -332,7 +339,7 @@ QBtCommandLineParameters::QBtCommandLineParameters(const QProcessEnvironment &en
, webUIPort(WEBUI_PORT_OPTION.value(env, -1))
, torrentingPort(TORRENTING_PORT_OPTION.value(env, -1))
, skipDialog(SKIP_DIALOG_OPTION.value(env))
- , profileDir(PROFILE_OPTION.value(env))
+ , profileDir(Utils::Fs::toAbsolutePath(Path(PROFILE_OPTION.value(env))))
, configurationName(CONFIGURATION_OPTION.value(env))
{
addTorrentParams.savePath = Path(SAVE_PATH_OPTION.value(env));
@@ -340,7 +347,7 @@ QBtCommandLineParameters::QBtCommandLineParameters(const QProcessEnvironment &en
addTorrentParams.skipChecking = SKIP_HASH_CHECK_OPTION.value(env);
addTorrentParams.sequential = SEQUENTIAL_OPTION.value(env);
addTorrentParams.firstLastPiecePriority = FIRST_AND_LAST_OPTION.value(env);
- addTorrentParams.addPaused = PAUSED_OPTION.value(env);
+ addTorrentParams.addStopped = STOPPED_OPTION.value(env);
}
QBtCommandLineParameters parseCommandLine(const QStringList &args)
@@ -365,6 +372,10 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
result.showVersion = true;
}
#endif
+ else if (arg == CONFIRM_LEGAL_NOTICE)
+ {
+ result.confirmLegalNotice = true;
+ }
else if (arg == WEBUI_PORT_OPTION)
{
result.webUIPort = WEBUI_PORT_OPTION.value(arg);
@@ -394,7 +405,7 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
#endif
else if (arg == PROFILE_OPTION)
{
- result.profileDir = Path(PROFILE_OPTION.value(arg));
+ result.profileDir = Utils::Fs::toAbsolutePath(Path(PROFILE_OPTION.value(arg)));
}
else if (arg == RELATIVE_FASTRESUME)
{
@@ -408,9 +419,9 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
{
result.addTorrentParams.savePath = Path(SAVE_PATH_OPTION.value(arg));
}
- else if (arg == PAUSED_OPTION)
+ else if (arg == STOPPED_OPTION)
{
- result.addTorrentParams.addPaused = PAUSED_OPTION.value(arg);
+ result.addTorrentParams.addStopped = STOPPED_OPTION.value(arg);
}
else if (arg == SKIP_HASH_CHECK_OPTION)
{
@@ -484,10 +495,11 @@ QString makeUsage(const QString &prgName)
+ indentation + prgName + u' ' + QCoreApplication::translate("CMD Options", "[options] [( | )...]") + u'\n'
+ QCoreApplication::translate("CMD Options", "Options:") + u'\n'
+ + SHOW_HELP_OPTION.usage() + wrapText(QCoreApplication::translate("CMD Options", "Display this help message and exit")) + u'\n'
#if !defined(Q_OS_WIN) || defined(DISABLE_GUI)
+ SHOW_VERSION_OPTION.usage() + wrapText(QCoreApplication::translate("CMD Options", "Display program version and exit")) + u'\n'
#endif
- + SHOW_HELP_OPTION.usage() + wrapText(QCoreApplication::translate("CMD Options", "Display this help message and exit")) + u'\n'
+ + CONFIRM_LEGAL_NOTICE.usage() + wrapText(QCoreApplication::translate("CMD Options", "Confirm the legal notice")) + u'\n'
+ WEBUI_PORT_OPTION.usage(QCoreApplication::translate("CMD Options", "port"))
+ wrapText(QCoreApplication::translate("CMD Options", "Change the WebUI port"))
+ u'\n'
@@ -513,7 +525,7 @@ QString makeUsage(const QString &prgName)
+ wrapText(QCoreApplication::translate("CMD Options", "Options when adding new torrents:"), 0) + u'\n'
+ SAVE_PATH_OPTION.usage(QCoreApplication::translate("CMD Options", "path")) + wrapText(QCoreApplication::translate("CMD Options", "Torrent save path")) + u'\n'
- + PAUSED_OPTION.usage() + wrapText(QCoreApplication::translate("CMD Options", "Add torrents as started or paused")) + u'\n'
+ + STOPPED_OPTION.usage() + wrapText(QCoreApplication::translate("CMD Options", "Add torrents as running or stopped")) + u'\n'
+ SKIP_HASH_CHECK_OPTION.usage() + wrapText(QCoreApplication::translate("CMD Options", "Skip hash check")) + u'\n'
+ CATEGORY_OPTION.usage(QCoreApplication::translate("CMD Options", "name"))
+ wrapText(QCoreApplication::translate("CMD Options", "Assign torrents to category. If the category doesn't exist, it will be "
diff --git a/src/app/cmdoptions.h b/src/app/cmdoptions.h
index 1c133c413c8d..c4b42053fa24 100644
--- a/src/app/cmdoptions.h
+++ b/src/app/cmdoptions.h
@@ -44,10 +44,11 @@ class QProcessEnvironment;
struct QBtCommandLineParameters
{
bool showHelp = false;
- bool relativeFastresumePaths = false;
#if !defined(Q_OS_WIN) || defined(DISABLE_GUI)
bool showVersion = false;
#endif
+ bool confirmLegalNotice = false;
+ bool relativeFastresumePaths = false;
#ifndef DISABLE_GUI
bool noSplash = false;
#elif !defined(Q_OS_WIN)
diff --git a/src/app/filelogger.cpp b/src/app/filelogger.cpp
index e0cafbb7eda6..5436c13926a3 100644
--- a/src/app/filelogger.cpp
+++ b/src/app/filelogger.cpp
@@ -32,8 +32,8 @@
#include
#include
+#include
#include
-#include
#include "base/global.h"
#include "base/logger.h"
diff --git a/src/app/legalnotice.cpp b/src/app/legalnotice.cpp
new file mode 100644
index 000000000000..af46ee9e5ee3
--- /dev/null
+++ b/src/app/legalnotice.cpp
@@ -0,0 +1,77 @@
+/*
+ * Bittorrent Client using Qt and libtorrent.
+ * Copyright (C) 2023 Mike Tzou (Chocobo1)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * In addition, as a special exception, the copyright holders give permission to
+ * link this program with the OpenSSL project's "OpenSSL" library (or with
+ * modified versions of it that use the same license as the "OpenSSL" library),
+ * and distribute the linked executables. You must obey the GNU General Public
+ * License in all respects for all of the code used other than "OpenSSL". If you
+ * modify file(s), you may extend this exception to your version of the file(s),
+ * but you are not obligated to do so. If you do not wish to do so, delete this
+ * exception statement from your version.
+ */
+
+#include "legalnotice.h"
+
+#ifdef DISABLE_GUI
+#include
+#endif // DISABLE_GUI
+
+#include
+#include
+
+#ifndef DISABLE_GUI
+#include
+#endif // DISABLE_GUI
+
+#include "base/global.h"
+
+#ifndef DISABLE_GUI
+#include "gui/utils.h"
+#endif // DISABLE_GUI
+
+void showLegalNotice(const bool isInteractive)
+{
+ const QString noticeTitle = QCoreApplication::translate("LegalNotice", "Legal Notice");
+ const QString noticeBody = QCoreApplication::translate("LegalNotice", "qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.");
+ const QString noticeEnd = QCoreApplication::translate("LegalNotice", "No further notices will be issued.");
+
+ if (!isInteractive)
+ {
+ const QString legalNotice = u"\n*** %1 ***\n"_s.arg(noticeTitle)
+ + noticeBody + u"\n\n"
+ + QCoreApplication::translate("LegalNotice", "If you have read the legal notice, you can use command line option `--confirm-legal-notice` to suppress this message.");
+ printf("%s\n\n", qUtf8Printable(legalNotice));
+ return;
+ }
+
+#ifdef DISABLE_GUI
+ const QString legalNotice = u"\n*** %1 ***\n"_s.arg(noticeTitle)
+ + noticeBody + u"\n\n"
+ + noticeEnd + u"\n\n"
+ + QCoreApplication::translate("LegalNotice", "Press 'Enter' key to continue...");
+ printf("%s", qUtf8Printable(legalNotice));
+ getchar();
+#else // DISABLE_GUI
+ const QString messageBody = noticeBody + u"\n\n" + noticeEnd;
+ QMessageBox msgBox {QMessageBox::NoIcon, noticeTitle, messageBody, QMessageBox::Ok};
+ msgBox.show(); // Need to be shown first or moveToCenter does not work
+ msgBox.move(Utils::Gui::screenCenter(&msgBox));
+ msgBox.exec();
+#endif // DISABLE_GUI
+}
diff --git a/src/app/legalnotice.h b/src/app/legalnotice.h
new file mode 100644
index 000000000000..62d47cd4f119
--- /dev/null
+++ b/src/app/legalnotice.h
@@ -0,0 +1,31 @@
+/*
+ * Bittorrent Client using Qt and libtorrent.
+ * Copyright (C) 2023 Mike Tzou (Chocobo1)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * In addition, as a special exception, the copyright holders give permission to
+ * link this program with the OpenSSL project's "OpenSSL" library (or with
+ * modified versions of it that use the same license as the "OpenSSL" library),
+ * and distribute the linked executables. You must obey the GNU General Public
+ * License in all respects for all of the code used other than "OpenSSL". If you
+ * modify file(s), you may extend this exception to your version of the file(s),
+ * but you are not obligated to do so. If you do not wish to do so, delete this
+ * exception statement from your version.
+ */
+
+#pragma once
+
+void showLegalNotice(bool isInteractive);
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 6cb174c6c58e..d80629f44aba 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
- * Copyright (C) 2014-2023 Vladimir Golovnev
+ * Copyright (C) 2014-2024 Vladimir Golovnev
* Copyright (C) 2006 Christophe Dumez
*
* This program is free software; you can redistribute it and/or
@@ -55,14 +55,9 @@
#include
#include
#include
-#include
#include
#include
-#ifdef Q_OS_WIN
-#include
-#endif
-
#ifdef QBT_STATIC_QT
#include
Q_IMPORT_PLUGIN(QICOPlugin)
@@ -73,13 +68,15 @@ Q_IMPORT_PLUGIN(QICOPlugin)
#endif // DISABLE_GUI
#include "base/global.h"
+#include "base/logger.h"
#include "base/preferences.h"
#include "base/profile.h"
+#include "base/settingvalue.h"
#include "base/version.h"
#include "application.h"
#include "cmdoptions.h"
+#include "legalnotice.h"
#include "signalhandler.h"
-#include "upgrade.h"
#ifndef DISABLE_GUI
#include "gui/utils.h"
@@ -87,34 +84,107 @@ Q_IMPORT_PLUGIN(QICOPlugin)
using namespace std::chrono_literals;
-void displayVersion();
-bool userAgreesWithLegalNotice();
-void displayBadArgMessage(const QString &message);
-void displayErrorMessage(const QString &message);
+namespace
+{
+ void displayBadArgMessage(const QString &message)
+ {
+ const QString help = QCoreApplication::translate("Main", "Run application with -h option to read about command line parameters.");
+#if defined(Q_OS_WIN) && !defined(DISABLE_GUI)
+ QMessageBox msgBox(QMessageBox::Critical, QCoreApplication::translate("Main", "Bad command line"),
+ (message + u'\n' + help), QMessageBox::Ok);
+ msgBox.show(); // Need to be shown or to moveToCenter does not work
+ msgBox.move(Utils::Gui::screenCenter(&msgBox));
+ msgBox.exec();
+#else
+ const QString errMsg = QCoreApplication::translate("Main", "Bad command line: ") + u'\n'
+ + message + u'\n'
+ + help + u'\n';
+ fprintf(stderr, "%s", qUtf8Printable(errMsg));
+#endif
+ }
+
+ void displayErrorMessage(const QString &message)
+ {
+#ifndef DISABLE_GUI
+ if (QApplication::instance())
+ {
+ QMessageBox msgBox;
+ msgBox.setIcon(QMessageBox::Critical);
+ msgBox.setText(QCoreApplication::translate("Main", "An unrecoverable error occurred."));
+ msgBox.setInformativeText(message);
+ msgBox.show(); // Need to be shown or to moveToCenter does not work
+ msgBox.move(Utils::Gui::screenCenter(&msgBox));
+ msgBox.exec();
+ }
+ else
+ {
+ const QString errMsg = QCoreApplication::translate("Main", "qBittorrent has encountered an unrecoverable error.") + u'\n' + message + u'\n';
+ fprintf(stderr, "%s", qUtf8Printable(errMsg));
+ }
+#else
+ const QString errMsg = QCoreApplication::translate("Main", "qBittorrent has encountered an unrecoverable error.") + u'\n' + message + u'\n';
+ fprintf(stderr, "%s", qUtf8Printable(errMsg));
+#endif
+ }
+
+ void displayVersion()
+ {
+ printf("%s %s\n", qUtf8Printable(qApp->applicationName()), QBT_VERSION);
+ }
#ifndef DISABLE_GUI
-void showSplashScreen();
+ void showSplashScreen()
+ {
+ QPixmap splashImg(u":/icons/splash.png"_s);
+ QPainter painter(&splashImg);
+ const auto version = QStringLiteral(QBT_VERSION);
+ painter.setPen(QPen(Qt::white));
+ painter.setFont(QFont(u"Arial"_s, 22, QFont::Black));
+ painter.drawText(224 - painter.fontMetrics().horizontalAdvance(version), 270, version);
+ QSplashScreen *splash = new QSplashScreen(splashImg);
+ splash->show();
+ QTimer::singleShot(1500ms, Qt::CoarseTimer, splash, &QObject::deleteLater);
+ qApp->processEvents();
+ }
#endif // DISABLE_GUI
#ifdef Q_OS_UNIX
-void adjustFileDescriptorLimit();
+ void adjustFileDescriptorLimit()
+ {
+ rlimit limit {};
+
+ if (getrlimit(RLIMIT_NOFILE, &limit) != 0)
+ return;
+
+ limit.rlim_cur = limit.rlim_max;
+ setrlimit(RLIMIT_NOFILE, &limit);
+ }
+
+ void adjustLocale()
+ {
+ // specify the default locale just in case if user has not set any other locale
+ // only `C` locale is available universally without installing locale packages
+ if (qEnvironmentVariableIsEmpty("LANG"))
+ qputenv("LANG", "C.UTF-8");
+ }
#endif
+}
// Main
int main(int argc, char *argv[])
{
+#ifdef DISABLE_GUI
+ setvbuf(stdout, nullptr, _IONBF, 0);
+#endif
+
#ifdef Q_OS_UNIX
+ adjustLocale();
adjustFileDescriptorLimit();
#endif
// We must save it here because QApplication constructor may change it
const bool isOneArg = (argc == 2);
-#if !defined(DISABLE_GUI) && defined(Q_OS_WIN)
- if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows10)
- QApplication::setStyle(u"Fusion"_s);
-#endif
-
// `app` must be declared out of try block to allow display message box in case of exception
std::unique_ptr app;
try
@@ -125,7 +195,7 @@ int main(int argc, char *argv[])
#ifdef Q_OS_WIN
// QCoreApplication::applicationDirPath() needs an Application object instantiated first
// Let's hope that there won't be a crash before this line
- const char *envName = "_NT_SYMBOL_PATH";
+ const char envName[] = "_NT_SYMBOL_PATH";
const QString envValue = qEnvironmentVariable(envName);
if (envValue.isEmpty())
qputenv(envName, Application::applicationDirPath().toLocal8Bit());
@@ -163,36 +233,21 @@ int main(int argc, char *argv[])
.arg(u"-h (or --help)"_s));
}
- const bool firstTimeUser = !Preferences::instance()->getAcceptedLegal();
- if (firstTimeUser)
- {
-#ifndef DISABLE_GUI
- if (!userAgreesWithLegalNotice())
- return EXIT_SUCCESS;
-#elif defined(Q_OS_WIN)
- if (_isatty(_fileno(stdin))
- && _isatty(_fileno(stdout))
- && !userAgreesWithLegalNotice())
- return EXIT_SUCCESS;
-#else
- if (!params.shouldDaemonize
- && isatty(fileno(stdin))
- && isatty(fileno(stdout))
- && !userAgreesWithLegalNotice())
- return EXIT_SUCCESS;
-#endif
-
- setCurrentMigrationVersion();
- }
-
- // Check if qBittorrent is already running for this user
- if (app->isRunning())
+ // Check if qBittorrent is already running
+ if (app->hasAnotherInstance())
{
#if defined(DISABLE_GUI) && !defined(Q_OS_WIN)
if (params.shouldDaemonize)
{
- throw CommandLineParameterError(QCoreApplication::translate("Main", "You cannot use %1: qBittorrent is already running for this user.")
- .arg(u"-d (or --daemon)"_s));
+ throw CommandLineParameterError(QCoreApplication::translate("Main", "You cannot use %1: qBittorrent is already running.")
+ .arg(u"-d (or --daemon)"_s));
+ }
+
+ // print friendly message if there are no other command line args
+ if (argc == 1)
+ {
+ const QString message = QCoreApplication::translate("Main", "Another qBittorrent instance is already running.");
+ printf("%s\n", qUtf8Printable(message));
}
#endif
@@ -202,27 +257,31 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}
-#ifdef Q_OS_WIN
- // This affects only Windows apparently and Qt5.
- // When QNetworkAccessManager is instantiated it regularly starts polling
- // the network interfaces to see what's available and their status.
- // This polling creates jitter and high ping with wifi interfaces.
- // So here we disable it for lack of better measure.
- // It will also spew this message in the console: QObject::startTimer: Timers cannot have negative intervals
- // For more info see:
- // 1. https://github.com/qbittorrent/qBittorrent/issues/4209
- // 2. https://bugreports.qt.io/browse/QTBUG-40332
- // 3. https://bugreports.qt.io/browse/QTBUG-46015
-
- qputenv("QT_BEARER_POLL_TIMEOUT", QByteArray::number(-1));
-#endif // Q_OS_WIN
+ CachedSettingValue legalNoticeShown {u"LegalNotice/Accepted"_s, false};
+ if (params.confirmLegalNotice)
+ legalNoticeShown = true;
+
+ if (!legalNoticeShown)
+ {
+#ifndef DISABLE_GUI
+ const bool isInteractive = true;
+#elif defined(Q_OS_WIN)
+ const bool isInteractive = (_isatty(_fileno(stdin)) != 0) && (_isatty(_fileno(stdout)) != 0);
+#else
+ // when run in daemon mode user can only dismiss the notice with command line option
+ const bool isInteractive = !params.shouldDaemonize
+ && ((isatty(fileno(stdin)) != 0) && (isatty(fileno(stdout)) != 0));
+#endif
+ showLegalNotice(isInteractive);
+ if (isInteractive)
+ legalNoticeShown = true;
+ }
#ifdef Q_OS_MACOS
// Since Apple made difficult for users to set PATH, we set here for convenience.
// Users are supposed to install Homebrew Python for search function.
// For more info see issue #5571.
- QByteArray path = "/usr/local/bin:";
- path += qgetenv("PATH");
+ const QByteArray path = "/usr/local/bin:" + qgetenv("PATH");
qputenv("PATH", path.constData());
// On OS X the standard is to not show icons in the menus
@@ -235,19 +294,27 @@ int main(int argc, char *argv[])
#if defined(DISABLE_GUI) && !defined(Q_OS_WIN)
if (params.shouldDaemonize)
{
- app.reset(); // Destroy current application
- if (daemon(1, 0) == 0)
+ app.reset(); // Destroy current application instance
+ if (::daemon(1, 0) == 0)
{
app = std::make_unique(argc, argv);
- if (app->isRunning())
+ if (app->hasAnotherInstance())
{
- // Another instance had time to start.
+ // It is undefined behavior to write to log file since there is another qbt instance
+ // in play. But we still do it since there is chance that the log message will survive.
+ const QString errorMessage = QCoreApplication::translate("Main", "Found unexpected qBittorrent instance. Exiting this instance. Current process ID: %1.")
+ .arg(QString::number(QCoreApplication::applicationPid()));
+ LogMsg(errorMessage, Log::CRITICAL);
+ // stdout, stderr is closed so we can't use them
return EXIT_FAILURE;
}
}
else
{
- qCritical("Something went wrong while daemonizing, exiting...");
+ const QString errorMessage = QCoreApplication::translate("Main", "Error when daemonizing. Reason: \"%1\". Error code: %2.")
+ .arg(QString::fromLocal8Bit(strerror(errno)), QString::number(errno));
+ LogMsg(errorMessage, Log::CRITICAL);
+ qCritical("%s", qUtf8Printable(errorMessage));
return EXIT_FAILURE;
}
}
@@ -271,117 +338,3 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}
}
-
-#if !defined(DISABLE_GUI)
-void showSplashScreen()
-{
- QPixmap splashImg(u":/icons/splash.png"_s);
- QPainter painter(&splashImg);
- const auto version = QStringLiteral(QBT_VERSION);
- painter.setPen(QPen(Qt::white));
- painter.setFont(QFont(u"Arial"_s, 22, QFont::Black));
- painter.drawText(224 - painter.fontMetrics().horizontalAdvance(version), 270, version);
- QSplashScreen *splash = new QSplashScreen(splashImg);
- splash->show();
- QTimer::singleShot(1500ms, Qt::CoarseTimer, splash, &QObject::deleteLater);
- qApp->processEvents();
-}
-#endif // DISABLE_GUI
-
-void displayVersion()
-{
- printf("%s %s\n", qUtf8Printable(qApp->applicationName()), QBT_VERSION);
-}
-
-void displayBadArgMessage(const QString &message)
-{
- const QString help = QCoreApplication::translate("Main", "Run application with -h option to read about command line parameters.");
-#if defined(Q_OS_WIN) && !defined(DISABLE_GUI)
- QMessageBox msgBox(QMessageBox::Critical, QCoreApplication::translate("Main", "Bad command line"),
- (message + u'\n' + help), QMessageBox::Ok);
- msgBox.show(); // Need to be shown or to moveToCenter does not work
- msgBox.move(Utils::Gui::screenCenter(&msgBox));
- msgBox.exec();
-#else
- const QString errMsg = QCoreApplication::translate("Main", "Bad command line: ") + u'\n'
- + message + u'\n'
- + help + u'\n';
- fprintf(stderr, "%s", qUtf8Printable(errMsg));
-#endif
-}
-
-void displayErrorMessage(const QString &message)
-{
-#ifndef DISABLE_GUI
- if (QApplication::instance())
- {
- QMessageBox msgBox;
- msgBox.setIcon(QMessageBox::Critical);
- msgBox.setText(QCoreApplication::translate("Main", "An unrecoverable error occurred."));
- msgBox.setInformativeText(message);
- msgBox.show(); // Need to be shown or to moveToCenter does not work
- msgBox.move(Utils::Gui::screenCenter(&msgBox));
- msgBox.exec();
- }
- else
- {
- const QString errMsg = QCoreApplication::translate("Main", "qBittorrent has encountered an unrecoverable error.") + u'\n' + message + u'\n';
- fprintf(stderr, "%s", qUtf8Printable(errMsg));
- }
-#else
- const QString errMsg = QCoreApplication::translate("Main", "qBittorrent has encountered an unrecoverable error.") + u'\n' + message + u'\n';
- fprintf(stderr, "%s", qUtf8Printable(errMsg));
-#endif
-}
-
-bool userAgreesWithLegalNotice()
-{
- Preferences *const pref = Preferences::instance();
- Q_ASSERT(!pref->getAcceptedLegal());
-
-#ifdef DISABLE_GUI
- const QString eula = u"\n*** %1 ***\n"_s.arg(QCoreApplication::translate("Main", "Legal Notice"))
- + QCoreApplication::translate("Main", "qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.") + u"\n\n"
- + QCoreApplication::translate("Main", "No further notices will be issued.") + u"\n\n"
- + QCoreApplication::translate("Main", "Press %1 key to accept and continue...").arg(u"'y'"_s) + u'\n';
- printf("%s", qUtf8Printable(eula));
-
- const char ret = getchar(); // Read pressed key
- if ((ret == 'y') || (ret == 'Y'))
- {
- // Save the answer
- pref->setAcceptedLegal(true);
- return true;
- }
-#else
- QMessageBox msgBox;
- msgBox.setText(QCoreApplication::translate("Main", "qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.\n\nNo further notices will be issued."));
- msgBox.setWindowTitle(QCoreApplication::translate("Main", "Legal notice"));
- msgBox.addButton(QCoreApplication::translate("Main", "Cancel"), QMessageBox::RejectRole);
- const QAbstractButton *agreeButton = msgBox.addButton(QCoreApplication::translate("Main", "I Agree"), QMessageBox::AcceptRole);
- msgBox.show(); // Need to be shown or to moveToCenter does not work
- msgBox.move(Utils::Gui::screenCenter(&msgBox));
- msgBox.exec();
- if (msgBox.clickedButton() == agreeButton)
- {
- // Save the answer
- pref->setAcceptedLegal(true);
- return true;
- }
-#endif // DISABLE_GUI
-
- return false;
-}
-
-#ifdef Q_OS_UNIX
-void adjustFileDescriptorLimit()
-{
- rlimit limit {};
-
- if (getrlimit(RLIMIT_NOFILE, &limit) != 0)
- return;
-
- limit.rlim_cur = limit.rlim_max;
- setrlimit(RLIMIT_NOFILE, &limit);
-}
-#endif
diff --git a/src/app/qtlocalpeer/qtlocalpeer.cpp b/src/app/qtlocalpeer/qtlocalpeer.cpp
index 2ad65f31a8e2..cc97eb4642c2 100644
--- a/src/app/qtlocalpeer/qtlocalpeer.cpp
+++ b/src/app/qtlocalpeer/qtlocalpeer.cpp
@@ -74,6 +74,7 @@
#include
#endif
+#include
#include
#include
#include
@@ -90,7 +91,7 @@ namespace QtLP_Private
#endif
}
-const char ACK[] = "ack";
+const QByteArray ACK = QByteArrayLiteral("ack");
QtLocalPeer::QtLocalPeer(const QString &path, QObject *parent)
: QObject(parent)
@@ -169,7 +170,7 @@ bool QtLocalPeer::sendMessage(const QString &message, const int timeout)
{
res &= socket.waitForReadyRead(timeout); // wait for ack
if (res)
- res &= (socket.read(qstrlen(ACK)) == ACK);
+ res &= (socket.read(ACK.size()) == ACK);
}
return res;
}
@@ -220,7 +221,7 @@ void QtLocalPeer::receiveConnection()
return;
}
QString message(QString::fromUtf8(uMsg));
- socket->write(ACK, qstrlen(ACK));
+ socket->write(ACK);
socket->waitForBytesWritten(1000);
socket->waitForDisconnected(1000); // make sure client reads ack
delete socket;
diff --git a/src/app/qtlocalpeer/qtlockedfile.h b/src/app/qtlocalpeer/qtlockedfile.h
index 63d78aaecd5a..3ea32c61a7df 100644
--- a/src/app/qtlocalpeer/qtlockedfile.h
+++ b/src/app/qtlocalpeer/qtlockedfile.h
@@ -71,8 +71,8 @@
#include
#ifdef Q_OS_WIN
+#include
#include
-#include
#endif
namespace QtLP_Private
@@ -105,7 +105,7 @@ namespace QtLP_Private
Qt::HANDLE m_writeMutex = nullptr;
Qt::HANDLE m_readMutex = nullptr;
- QVector m_readMutexes;
+ QList m_readMutexes;
QString m_mutexName;
#endif
diff --git a/src/app/signalhandler.cpp b/src/app/signalhandler.cpp
index f5ef5263c9d5..1116b5a34260 100644
--- a/src/app/signalhandler.cpp
+++ b/src/app/signalhandler.cpp
@@ -34,7 +34,6 @@
#include
#include
-#include
#ifdef Q_OS_UNIX
#include
diff --git a/src/app/upgrade.cpp b/src/app/upgrade.cpp
index 15e07772425c..5a9d9b896478 100644
--- a/src/app/upgrade.cpp
+++ b/src/app/upgrade.cpp
@@ -32,6 +32,7 @@
#include
#include
+#include "base/bittorrent/sharelimitaction.h"
#include "base/bittorrent/torrentcontentlayout.h"
#include "base/global.h"
#include "base/logger.h"
@@ -45,7 +46,7 @@
namespace
{
- const int MIGRATION_VERSION = 6;
+ const int MIGRATION_VERSION = 8;
const QString MIGRATION_VERSION_KEY = u"Meta/MigrationVersion"_s;
void exportWebUIHttpsFiles()
@@ -437,6 +438,46 @@ namespace
settingsStorage->storeValue(key, u"zh_CN"_s);
}
}
+
+ void migrateShareLimitActionSettings()
+ {
+ auto *settingsStorage = SettingsStorage::instance();
+ const auto oldKey = u"BitTorrent/Session/MaxRatioAction"_s;
+ const auto newKey = u"BitTorrent/Session/ShareLimitAction"_s;
+ const auto value = settingsStorage->loadValue(oldKey);
+
+ switch (value)
+ {
+ case 0:
+ settingsStorage->storeValue(newKey, BitTorrent::ShareLimitAction::Stop);
+ break;
+ case 1:
+ settingsStorage->storeValue(newKey, BitTorrent::ShareLimitAction::Remove);
+ break;
+ case 2:
+ settingsStorage->storeValue(newKey, BitTorrent::ShareLimitAction::EnableSuperSeeding);
+ break;
+ case 3:
+ settingsStorage->storeValue(newKey, BitTorrent::ShareLimitAction::RemoveWithContent);
+ break;
+ default:
+ LogMsg(QCoreApplication::translate("Upgrade", "Invalid value found in configuration file, reverting it to default. Key: \"%1\". Invalid value: \"%2\".")
+ .arg(oldKey, QString::number(value)), Log::WARNING);
+ break;
+ }
+
+ settingsStorage->removeValue(oldKey);
+ }
+
+ void migrateAddPausedSetting()
+ {
+ auto *settingsStorage = SettingsStorage::instance();
+ const auto oldKey = u"BitTorrent/Session/AddTorrentPaused"_s;
+ const auto newKey = u"BitTorrent/Session/AddTorrentStopped"_s;
+
+ settingsStorage->storeValue(newKey, settingsStorage->loadValue(oldKey));
+ settingsStorage->removeValue(oldKey);
+ }
}
bool upgrade()
@@ -475,6 +516,12 @@ bool upgrade()
if (version < 6)
migrateProxySettings();
+ if (version < 7)
+ migrateShareLimitActionSettings();
+
+ if (version < 8)
+ migrateAddPausedSetting();
+
version = MIGRATION_VERSION;
}
diff --git a/src/base/3rdparty/expected.hpp b/src/base/3rdparty/expected.hpp
index a1ddc6f0e5f4..305f3abadd69 100644
--- a/src/base/3rdparty/expected.hpp
+++ b/src/base/3rdparty/expected.hpp
@@ -13,8 +13,8 @@
#define NONSTD_EXPECTED_LITE_HPP
#define expected_lite_MAJOR 0
-#define expected_lite_MINOR 6
-#define expected_lite_PATCH 3
+#define expected_lite_MINOR 8
+#define expected_lite_PATCH 0
#define expected_lite_VERSION expected_STRINGIFY(expected_lite_MAJOR) "." expected_STRINGIFY(expected_lite_MINOR) "." expected_STRINGIFY(expected_lite_PATCH)
@@ -66,6 +66,21 @@
# define nsel_P0323R 7
#endif
+// Monadic operations proposal revisions:
+//
+// P2505R0: 0 (2021-12-12)
+// P2505R1: 1 (2022-02-10)
+// P2505R2: 2 (2022-04-15)
+// P2505R3: 3 (2022-06-05)
+// P2505R4: 4 (2022-06-15)
+// P2505R5: 5 (2022-09-20) *
+//
+// expected-lite uses 5
+
+#ifndef nsel_P2505R
+# define nsel_P2505R 5
+#endif
+
// Control presence of C++ exception handling (try and auto discover):
#ifndef nsel_CONFIG_NO_EXCEPTIONS
@@ -216,8 +231,24 @@ inline in_place_t in_place_index( detail::in_place_index_tag = detail::in_pla
namespace nonstd {
using std::expected;
-// ...
-}
+ using std::unexpected;
+ using std::bad_expected_access;
+ using std::unexpect_t;
+ using std::unexpect;
+
+ //[[deprecated("replace unexpected_type with unexpected")]]
+
+ template< typename E >
+ using unexpected_type = unexpected;
+
+ // Unconditionally provide make_unexpected():
+
+ template< typename E>
+ constexpr auto make_unexpected( E && value ) -> unexpected< typename std::decay::type >
+ {
+ return unexpected< typename std::decay::type >( std::forward(value) );
+ }
+} // namespace nonstd
#else // nsel_USES_STD_EXPECTED
@@ -316,16 +347,6 @@ namespace nonstd {
#define nsel_REQUIRES_A(...) \
, typename std::enable_if< (__VA_ARGS__), void*>::type = nullptr
-// Presence of language and library features:
-
-#ifdef _HAS_CPP0X
-# define nsel_HAS_CPP0X _HAS_CPP0X
-#else
-# define nsel_HAS_CPP0X 0
-#endif
-
-//#define nsel_CPP11_140 (nsel_CPP11_OR_GREATER || nsel_COMPILER_MSVC_VER >= 1900)
-
// Clang, GNUC, MSVC warning suppression macros:
#ifdef __clang__
@@ -335,20 +356,23 @@ namespace nonstd {
#endif // __clang__
#if nsel_COMPILER_MSVC_VERSION >= 140
-# pragma warning( push )
-# define nsel_DISABLE_MSVC_WARNINGS(codes) __pragma( warning(disable: codes) )
+# define nsel_DISABLE_MSVC_WARNINGS(codes) __pragma( warning(push) ) __pragma( warning(disable: codes) )
#else
# define nsel_DISABLE_MSVC_WARNINGS(codes)
#endif
#ifdef __clang__
-# define nsel_RESTORE_WARNINGS() _Pragma("clang diagnostic pop")
+# define nsel_RESTORE_WARNINGS() _Pragma("clang diagnostic pop")
+# define nsel_RESTORE_MSVC_WARNINGS()
#elif defined __GNUC__
-# define nsel_RESTORE_WARNINGS() _Pragma("GCC diagnostic pop")
+# define nsel_RESTORE_WARNINGS() _Pragma("GCC diagnostic pop")
+# define nsel_RESTORE_MSVC_WARNINGS()
#elif nsel_COMPILER_MSVC_VERSION >= 140
-# define nsel_RESTORE_WARNINGS() __pragma( warning( pop ) )
+# define nsel_RESTORE_WARNINGS() __pragma( warning( pop ) )
+# define nsel_RESTORE_MSVC_WARNINGS() nsel_RESTORE_WARNINGS()
#else
# define nsel_RESTORE_WARNINGS()
+# define nsel_RESTORE_MSVC_WARNINGS()
#endif
// Suppress the following MSVC (GSL) warnings:
@@ -356,6 +380,30 @@ namespace nonstd {
nsel_DISABLE_MSVC_WARNINGS( 26409 )
+// Presence of language and library features:
+
+#ifdef _HAS_CPP0X
+# define nsel_HAS_CPP0X _HAS_CPP0X
+#else
+# define nsel_HAS_CPP0X 0
+#endif
+
+// Presence of language and library features:
+
+#define nsel_CPP17_000 (nsel_CPP17_OR_GREATER)
+
+// Presence of C++17 language features:
+
+#define nsel_HAVE_DEPRECATED nsel_CPP17_000
+
+// C++ feature usage:
+
+#if nsel_HAVE_DEPRECATED
+# define nsel_deprecated(msg) [[deprecated(msg)]]
+#else
+# define nsel_deprecated(msg) /*[[deprecated]]*/
+#endif
+
//
// expected:
//
@@ -452,8 +500,162 @@ class expected;
namespace detail {
+#if nsel_P2505R >= 3
+template< typename T >
+struct is_expected : std::false_type {};
+
+template< typename T, typename E >
+struct is_expected< expected< T, E > > : std::true_type {};
+#endif // nsel_P2505R >= 3
+
/// discriminated union to hold value or 'error'.
+template< typename T, typename E >
+class storage_t_noncopy_nonmove_impl
+{
+ template< typename, typename > friend class nonstd::expected_lite::expected;
+
+public:
+ using value_type = T;
+ using error_type = E;
+
+ // no-op construction
+ storage_t_noncopy_nonmove_impl() {}
+ ~storage_t_noncopy_nonmove_impl() {}
+
+ explicit storage_t_noncopy_nonmove_impl( bool has_value )
+ : m_has_value( has_value )
+ {}
+
+ void construct_value()
+ {
+ new( &m_value ) value_type();
+ }
+
+ // void construct_value( value_type const & e )
+ // {
+ // new( &m_value ) value_type( e );
+ // }
+
+ // void construct_value( value_type && e )
+ // {
+ // new( &m_value ) value_type( std::move( e ) );
+ // }
+
+ template< class... Args >
+ void emplace_value( Args&&... args )
+ {
+ new( &m_value ) value_type( std::forward(args)...);
+ }
+
+ template< class U, class... Args >
+ void emplace_value( std::initializer_list il, Args&&... args )
+ {
+ new( &m_value ) value_type( il, std::forward(args)... );
+ }
+
+ void destruct_value()
+ {
+ m_value.~value_type();
+ }
+
+ // void construct_error( error_type const & e )
+ // {
+ // // new( &m_error ) error_type( e );
+ // }
+
+ // void construct_error( error_type && e )
+ // {
+ // // new( &m_error ) error_type( std::move( e ) );
+ // }
+
+ template< class... Args >
+ void emplace_error( Args&&... args )
+ {
+ new( &m_error ) error_type( std::forward(args)...);
+ }
+
+ template< class U, class... Args >
+ void emplace_error( std::initializer_list il, Args&&... args )
+ {
+ new( &m_error ) error_type( il, std::forward(args)... );
+ }
+
+ void destruct_error()
+ {
+ m_error.~error_type();
+ }
+
+ constexpr value_type const & value() const &
+ {
+ return m_value;
+ }
+
+ value_type & value() &
+ {
+ return m_value;
+ }
+
+ constexpr value_type const && value() const &&
+ {
+ return std::move( m_value );
+ }
+
+ nsel_constexpr14 value_type && value() &&
+ {
+ return std::move( m_value );
+ }
+
+ value_type const * value_ptr() const
+ {
+ return &m_value;
+ }
+
+ value_type * value_ptr()
+ {
+ return &m_value;
+ }
+
+ error_type const & error() const &
+ {
+ return m_error;
+ }
+
+ error_type & error() &
+ {
+ return m_error;
+ }
+
+ constexpr error_type const && error() const &&
+ {
+ return std::move( m_error );
+ }
+
+ nsel_constexpr14 error_type && error() &&
+ {
+ return std::move( m_error );
+ }
+
+ bool has_value() const
+ {
+ return m_has_value;
+ }
+
+ void set_has_value( bool v )
+ {
+ m_has_value = v;
+ }
+
+private:
+ union
+ {
+ value_type m_value;
+ error_type m_error;
+ };
+
+ bool m_has_value = false;
+};
+
template< typename T, typename E >
class storage_t_impl
{
@@ -471,6 +673,11 @@ class storage_t_impl
: m_has_value( has_value )
{}
+ void construct_value()
+ {
+ new( &m_value ) value_type();
+ }
+
void construct_value( value_type const & e )
{
new( &m_value ) value_type( e );
@@ -684,16 +891,23 @@ struct storage_t_impl
template< typename T, typename E, bool isConstructable, bool isMoveable >
class storage_t
{
+public:
+};
+
+template< typename T, typename E >
+class storage_t : public storage_t_noncopy_nonmove_impl
+{
public:
storage_t() = default;
~storage_t() = default;
explicit storage_t( bool has_value )
- : storage_t_impl( has_value )
+ : storage_t_noncopy_nonmove_impl( has_value )
{}
storage_t( storage_t const & other ) = delete;
storage_t( storage_t && other ) = delete;
+
};
template< typename T, typename E >
@@ -832,6 +1046,146 @@ class storage_t : public storage_t_impl
}
};
+#if nsel_P2505R >= 3
+// C++11 invoke implementation
+template< typename >
+struct is_reference_wrapper : std::false_type {};
+template< typename T >
+struct is_reference_wrapper< std::reference_wrapper< T > > : std::true_type {};
+
+template< typename FnT, typename ClassT, typename ObjectT, typename... Args
+ nsel_REQUIRES_T(
+ std::is_function::value
+ && ( std::is_same< ClassT, typename std20::remove_cvref< ObjectT >::type >::value
+ || std::is_base_of< ClassT, typename std20::remove_cvref< ObjectT >::type >::value )
+ )
+>
+nsel_constexpr auto invoke_member_function_impl( FnT ClassT::* memfnptr, ObjectT && obj, Args && ... args )
+ noexcept( noexcept( (std::forward< ObjectT >( obj ).*memfnptr)( std::forward< Args >( args )... ) ) )
+ -> decltype( (std::forward< ObjectT >( obj ).*memfnptr)( std::forward< Args >( args )...) )
+{
+ return (std::forward< ObjectT >( obj ).*memfnptr)( std::forward< Args >( args )... );
+}
+
+template< typename FnT, typename ClassT, typename ObjectT, typename... Args
+ nsel_REQUIRES_T(
+ std::is_function::value
+ && is_reference_wrapper< typename std20::remove_cvref< ObjectT >::type >::value
+ )
+>
+nsel_constexpr auto invoke_member_function_impl( FnT ClassT::* memfnptr, ObjectT && obj, Args && ... args )
+ noexcept( noexcept( (obj.get().*memfnptr)( std::forward< Args >( args ) ... ) ) )
+ -> decltype( (obj.get().*memfnptr)( std::forward< Args >( args ) ... ) )
+{
+ return (obj.get().*memfnptr)( std::forward< Args >( args ) ... );
+}
+
+template< typename FnT, typename ClassT, typename ObjectT, typename... Args
+ nsel_REQUIRES_T(
+ std::is_function::value
+ && !std::is_same< ClassT, typename std20::remove_cvref< ObjectT >::type >::value
+ && !std::is_base_of< ClassT, typename std20::remove_cvref< ObjectT >::type >::value
+ && !is_reference_wrapper< typename std20::remove_cvref< ObjectT >::type >::value
+ )
+>
+nsel_constexpr auto invoke_member_function_impl( FnT ClassT::* memfnptr, ObjectT && obj, Args && ... args )
+ noexcept( noexcept( ((*std::forward< ObjectT >( obj )).*memfnptr)( std::forward< Args >( args ) ... ) ) )
+ -> decltype( ((*std::forward< ObjectT >( obj )).*memfnptr)( std::forward< Args >( args ) ... ) )
+{
+ return ((*std::forward(obj)).*memfnptr)( std::forward< Args >( args ) ... );
+}
+
+template< typename MemberT, typename ClassT, typename ObjectT
+ nsel_REQUIRES_T(
+ std::is_same< ClassT, typename std20::remove_cvref< ObjectT >::type >::value
+ || std::is_base_of< ClassT, typename std20::remove_cvref< ObjectT >::type >::value
+ )
+>
+nsel_constexpr auto invoke_member_object_impl( MemberT ClassT::* memobjptr, ObjectT && obj )
+ noexcept( noexcept( std::forward< ObjectT >( obj ).*memobjptr ) )
+ -> decltype( std::forward< ObjectT >( obj ).*memobjptr )
+{
+ return std::forward< ObjectT >( obj ).*memobjptr;
+}
+
+template< typename MemberT, typename ClassT, typename ObjectT
+ nsel_REQUIRES_T(
+ is_reference_wrapper< typename std20::remove_cvref< ObjectT >::type >::value
+ )
+>
+nsel_constexpr auto invoke_member_object_impl( MemberT ClassT::* memobjptr, ObjectT && obj )
+ noexcept( noexcept( obj.get().*memobjptr ) )
+ -> decltype( obj.get().*memobjptr )
+{
+ return obj.get().*memobjptr;
+}
+
+template< typename MemberT, typename ClassT, typename ObjectT
+ nsel_REQUIRES_T(
+ !std::is_same< ClassT, typename std20::remove_cvref< ObjectT >::type >::value
+ && !std::is_base_of< ClassT, typename std20::remove_cvref< ObjectT >::type >::value
+ && !is_reference_wrapper< typename std20::remove_cvref< ObjectT >::type >::value
+ )
+>
+nsel_constexpr auto invoke_member_object_impl( MemberT ClassT::* memobjptr, ObjectT && obj )
+ noexcept( noexcept( (*std::forward< ObjectT >( obj )).*memobjptr ) )
+ -> decltype( (*std::forward< ObjectT >( obj )).*memobjptr )
+{
+ return (*std::forward< ObjectT >( obj )).*memobjptr;
+}
+
+template< typename F, typename... Args
+ nsel_REQUIRES_T(
+ std::is_member_function_pointer< typename std20::remove_cvref< F >::type >::value
+ )
+>
+nsel_constexpr auto invoke( F && f, Args && ... args )
+ noexcept( noexcept( invoke_member_function_impl( std::forward< F >( f ), std::forward< Args >( args ) ... ) ) )
+ -> decltype( invoke_member_function_impl( std::forward< F >( f ), std::forward< Args >( args ) ... ) )
+{
+ return invoke_member_function_impl( std::forward< F >( f ), std::forward< Args >( args ) ... );
+}
+
+template< typename F, typename... Args
+ nsel_REQUIRES_T(
+ std::is_member_object_pointer< typename std20::remove_cvref< F >::type >::value
+ )
+>
+nsel_constexpr auto invoke( F && f, Args && ... args )
+ noexcept( noexcept( invoke_member_object_impl( std::forward< F >( f ), std::forward< Args >( args ) ... ) ) )
+ -> decltype( invoke_member_object_impl( std::forward< F >( f ), std::forward< Args >( args ) ... ) )
+{
+ return invoke_member_object_impl( std::forward< F >( f ), std::forward< Args >( args ) ... );
+}
+
+template< typename F, typename... Args
+ nsel_REQUIRES_T(
+ !std::is_member_function_pointer< typename std20::remove_cvref< F >::type >::value
+ && !std::is_member_object_pointer< typename std20::remove_cvref< F >::type >::value
+ )
+>
+nsel_constexpr auto invoke( F && f, Args && ... args )
+ noexcept( noexcept( std::forward< F >( f )( std::forward< Args >( args ) ... ) ) )
+ -> decltype( std::forward< F >( f )( std::forward< Args >( args ) ... ) )
+{
+ return std::forward< F >( f )( std::forward< Args >( args ) ... );
+}
+
+template< typename F, typename ... Args >
+using invoke_result_nocvref_t = typename std20::remove_cvref< decltype( invoke( std::declval< F >(), std::declval< Args >()... ) ) >::type;
+
+#if nsel_P2505R >= 5
+template< typename F, typename ... Args >
+using transform_invoke_result_t = typename std::remove_cv< decltype( invoke( std::declval< F >(), std::declval< Args >()... ) ) >::type;
+#else
+template< typename F, typename ... Args >
+using transform_invoke_result_t = invoke_result_nocvref_t
+#endif // nsel_P2505R >= 5
+
+template< typename T >
+struct valid_expected_value_type : std::integral_constant< bool, std::is_destructible< T >::value && !std::is_reference< T >::value && !std::is_array< T >::value > {};
+
+#endif // nsel_P2505R >= 3
} // namespace detail
/// x.x.5 Unexpected object type; unexpected_type; C++17 and later can also use aliased type unexpected.
@@ -898,7 +1252,7 @@ class unexpected_type
)
>
constexpr explicit unexpected_type( unexpected_type const & error )
- : m_error( E{ error.value() } )
+ : m_error( E{ error.error() } )
{}
template< typename E2
@@ -916,7 +1270,7 @@ class unexpected_type
)
>
constexpr /*non-explicit*/ unexpected_type( unexpected_type const & error )
- : m_error( error.value() )
+ : m_error( error.error() )
{}
template< typename E2
@@ -934,7 +1288,7 @@ class unexpected_type
)
>
constexpr explicit unexpected_type( unexpected_type && error )
- : m_error( E{ std::move( error.value() ) } )
+ : m_error( E{ std::move( error.error() ) } )
{}
template< typename E2
@@ -952,7 +1306,7 @@ class unexpected_type
)
>
constexpr /*non-explicit*/ unexpected_type( unexpected_type && error )
- : m_error( std::move( error.value() ) )
+ : m_error( std::move( error.error() ) )
{}
// x.x.5.2.2 Assignment
@@ -963,55 +1317,89 @@ class unexpected_type
template< typename E2 = E >
nsel_constexpr14 unexpected_type & operator=( unexpected_type const & other )
{
- unexpected_type{ other.value() }.swap( *this );
+ unexpected_type{ other.error() }.swap( *this );
return *this;
}
template< typename E2 = E >
nsel_constexpr14 unexpected_type & operator=( unexpected_type && other )
{
- unexpected_type{ std::move( other.value() ) }.swap( *this );
+ unexpected_type{ std::move( other.error() ) }.swap( *this );
return *this;
}
// x.x.5.2.3 Observers
- nsel_constexpr14 E & value() & noexcept
+ nsel_constexpr14 E & error() & noexcept
{
return m_error;
}
- constexpr E const & value() const & noexcept
+ constexpr E const & error() const & noexcept
{
return m_error;
}
#if !nsel_COMPILER_GNUC_VERSION || nsel_COMPILER_GNUC_VERSION >= 490
- nsel_constexpr14 E && value() && noexcept
+ nsel_constexpr14 E && error() && noexcept
{
return std::move( m_error );
}
- constexpr E const && value() const && noexcept
+ constexpr E const && error() const && noexcept
{
return std::move( m_error );
}
#endif
- // x.x.5.2.4 Swap
+ // x.x.5.2.3 Observers - deprecated
- template< typename U=E >
- nsel_REQUIRES_R( void,
- std17::is_swappable::value
- )
- swap( unexpected_type & other ) noexcept (
- std17::is_nothrow_swappable::value
- )
+ nsel_deprecated("replace value() with error()")
+
+ nsel_constexpr14 E & value() & noexcept
{
- using std::swap;
- swap( m_error, other.m_error );
+ return m_error;
+ }
+
+ nsel_deprecated("replace value() with error()")
+
+ constexpr E const & value() const & noexcept
+ {
+ return m_error;
+ }
+
+#if !nsel_COMPILER_GNUC_VERSION || nsel_COMPILER_GNUC_VERSION >= 490
+
+ nsel_deprecated("replace value() with error()")
+
+ nsel_constexpr14 E && value() && noexcept
+ {
+ return std::move( m_error );
+ }
+
+ nsel_deprecated("replace value() with error()")
+
+ constexpr E const && value() const && noexcept
+ {
+ return std::move( m_error );
+ }
+
+#endif
+
+ // x.x.5.2.4 Swap
+
+ template< typename U=E >
+ nsel_REQUIRES_R( void,
+ std17::is_swappable::value
+ )
+ swap( unexpected_type & other ) noexcept (
+ std17::is_nothrow_swappable::value
+ )
+ {
+ using std::swap;
+ swap( m_error, other.m_error );
}
// TODO: ??? unexpected_type: in-class friend operator==, !=
@@ -1081,7 +1469,7 @@ class unexpected_type< std::exception_ptr >
template< typename E1, typename E2 >
constexpr bool operator==( unexpected_type const & x, unexpected_type const & y )
{
- return x.value() == y.value();
+ return x.error() == y.error();
}
template< typename E1, typename E2 >
@@ -1095,7 +1483,7 @@ constexpr bool operator!=( unexpected_type const & x, unexpected_type co
template< typename E >
constexpr bool operator<( unexpected_type const & x, unexpected_type const & y )
{
- return x.value() < y.value();
+ return x.error() < y.error();
}
template< typename E >
@@ -1340,6 +1728,24 @@ struct error_traits< std::error_code >
#endif // nsel_CONFIG_NO_EXCEPTIONS
+#if nsel_P2505R >= 3
+namespace detail {
+
+// from https://en.cppreference.com/w/cpp/utility/expected/unexpected:
+// "the type of the unexpected value. The type must not be an array type, a non-object type, a specialization of std::unexpected, or a cv-qualified type."
+template< typename T >
+struct valid_unexpected_type : std::integral_constant< bool,
+ std::is_same< T, typename std20::remove_cvref< T >::type >::value
+ && std::is_object< T >::value
+ && !std::is_array< T >::value
+> {};
+
+template< typename T >
+struct valid_unexpected_type< unexpected_type< T > > : std::false_type {};
+
+} // namespace detail
+#endif // nsel_P2505R >= 3
+
} // namespace expected_lite
// provide nonstd::unexpected_type:
@@ -1380,7 +1786,7 @@ class expected
nsel_constexpr14 expected()
: contained( true )
{
- contained.construct_value( value_type() );
+ contained.construct_value();
}
nsel_constexpr14 expected( expected const & ) = default;
@@ -1534,7 +1940,7 @@ class expected
nsel_constexpr14 explicit expected( nonstd::unexpected_type const & error )
: contained( false )
{
- contained.construct_error( E{ error.value() } );
+ contained.construct_error( E{ error.error() } );
}
template< typename G = E
@@ -1546,7 +1952,7 @@ class expected
nsel_constexpr14 /*non-explicit*/ expected( nonstd::unexpected_type const & error )
: contained( false )
{
- contained.construct_error( error.value() );
+ contained.construct_error( error.error() );
}
template< typename G = E
@@ -1558,7 +1964,7 @@ class expected
nsel_constexpr14 explicit expected( nonstd::unexpected_type && error )
: contained( false )
{
- contained.construct_error( E{ std::move( error.value() ) } );
+ contained.construct_error( E{ std::move( error.error() ) } );
}
template< typename G = E
@@ -1570,7 +1976,7 @@ class expected
nsel_constexpr14 /*non-explicit*/ expected( nonstd::unexpected_type && error )
: contained( false )
{
- contained.construct_error( std::move( error.value() ) );
+ contained.construct_error( std::move( error.error() ) );
}
// in-place construction, value
@@ -1675,7 +2081,7 @@ class expected
>
expected & operator=( nonstd::unexpected_type const & error )
{
- expected( unexpect, error.value() ).swap( *this );
+ expected( unexpect, error.error() ).swap( *this );
return *this;
}
@@ -1688,7 +2094,7 @@ class expected
>
expected & operator=( nonstd::unexpected_type && error )
{
- expected( unexpect, std::move( error.value() ) ).swap( *this );
+ expected( unexpect, std::move( error.error() ) ).swap( *this );
return *this;
}
@@ -1791,6 +2197,8 @@ class expected
return contained.has_value();
}
+ nsel_DISABLE_MSVC_WARNINGS( 4702 ) // warning C4702: unreachable code, see issue 65.
+
constexpr value_type const & value() const &
{
return has_value()
@@ -1804,6 +2212,7 @@ class expected
? ( contained.value() )
: ( error_traits::rethrow( contained.error() ), contained.value() );
}
+ nsel_RESTORE_MSVC_WARNINGS()
#if !nsel_COMPILER_GNUC_VERSION || nsel_COMPILER_GNUC_VERSION >= 490
@@ -1885,6 +2294,316 @@ class expected
: static_cast( std::forward( v ) );
}
+#if nsel_P2505R >= 4
+ template< typename G = E
+ nsel_REQUIRES_T(
+ std::is_copy_constructible< E >::value
+ && std::is_convertible< G, E >::value
+ )
+ >
+ nsel_constexpr error_type error_or( G && e ) const &
+ {
+ return has_value()
+ ? static_cast< E >( std::forward< G >( e ) )
+ : contained.error();
+ }
+
+ template< typename G = E
+ nsel_REQUIRES_T(
+ std::is_move_constructible< E >::value
+ && std::is_convertible< G, E >::value
+ )
+ >
+ nsel_constexpr14 error_type error_or( G && e ) &&
+ {
+ return has_value()
+ ? static_cast< E >( std::forward< G >( e ) )
+ : std::move( contained.error() );
+ }
+#endif // nsel_P2505R >= 4
+
+#if nsel_P2505R >= 3
+ // Monadic operations (P2505)
+ template< typename F
+ nsel_REQUIRES_T(
+ detail::is_expected < detail::invoke_result_nocvref_t< F, value_type & > > ::value
+ && std::is_same< typename detail::invoke_result_nocvref_t< F, value_type & >::error_type, error_type >::value
+ && std::is_constructible< error_type, error_type & >::value
+ )
+ >
+ nsel_constexpr14 detail::invoke_result_nocvref_t< F, value_type & > and_then( F && f ) &
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F, value_type & >( detail::invoke( std::forward< F >( f ), value() ) )
+ : detail::invoke_result_nocvref_t< F, value_type & >( unexpect, error() );
+ }
+
+ template >::value
+ && std::is_same< typename detail::invoke_result_nocvref_t< F, const value_type & >::error_type, error_type >::value
+ && std::is_constructible< error_type, const error_type & >::value
+ )
+ >
+ nsel_constexpr detail::invoke_result_nocvref_t< F, const value_type & > and_then( F && f ) const &
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F, const value_type & >( detail::invoke( std::forward< F >( f ), value() ) )
+ : detail::invoke_result_nocvref_t< F, const value_type & >( unexpect, error() );
+ }
+
+#if !nsel_COMPILER_GNUC_VERSION || nsel_COMPILER_GNUC_VERSION >= 490
+ template >::value
+ && std::is_same< typename detail::invoke_result_nocvref_t< F, value_type && >::error_type, error_type >::value
+ && std::is_constructible< error_type, error_type && >::value
+ )
+ >
+ nsel_constexpr14 detail::invoke_result_nocvref_t< F, value_type && > and_then( F && f ) &&
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F, value_type && >( detail::invoke( std::forward< F >( f ), std::move( value() ) ) )
+ : detail::invoke_result_nocvref_t< F, value_type && >( unexpect, std::move( error() ) );
+ }
+
+ template >::value
+ && std::is_same< typename detail::invoke_result_nocvref_t< F, const value_type & >::error_type, error_type >::value
+ && std::is_constructible< error_type, const error_type && >::value
+ )
+ >
+ nsel_constexpr detail::invoke_result_nocvref_t< F, const value_type && > and_then( F && f ) const &&
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F, const value_type && >( detail::invoke( std::forward< F >( f ), std::move( value() ) ) )
+ : detail::invoke_result_nocvref_t< F, const value_type && >( unexpect, std::move( error() ) );
+ }
+#endif
+
+ template >::value
+ && std::is_same< typename detail::invoke_result_nocvref_t< F, error_type & >::value_type, value_type >::value
+ && std::is_constructible< value_type, value_type & >::value
+ )
+ >
+ nsel_constexpr14 detail::invoke_result_nocvref_t< F, error_type & > or_else( F && f ) &
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F, error_type & >( value() )
+ : detail::invoke_result_nocvref_t< F, error_type & >( detail::invoke( std::forward< F >( f ), error() ) );
+ }
+
+ template >::value
+ && std::is_same< typename detail::invoke_result_nocvref_t< F, const error_type & >::value_type, value_type >::value
+ && std::is_constructible< value_type, const value_type & >::value
+ )
+ >
+ nsel_constexpr detail::invoke_result_nocvref_t< F, const error_type & > or_else( F && f ) const &
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F, const error_type & >( value() )
+ : detail::invoke_result_nocvref_t< F, const error_type & >( detail::invoke( std::forward< F >( f ), error() ) );
+ }
+
+#if !nsel_COMPILER_GNUC_VERSION || nsel_COMPILER_GNUC_VERSION >= 490
+ template >::value
+ && std::is_same< typename detail::invoke_result_nocvref_t< F, error_type && >::value_type, value_type >::value
+ && std::is_constructible< value_type, value_type && >::value
+ )
+ >
+ nsel_constexpr14 detail::invoke_result_nocvref_t< F, error_type && > or_else( F && f ) &&
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F, error_type && >( std::move( value() ) )
+ : detail::invoke_result_nocvref_t< F, error_type && >( detail::invoke( std::forward< F >( f ), std::move( error() ) ) );
+ }
+
+ template >::value
+ && std::is_same< typename detail::invoke_result_nocvref_t< F, const error_type && >::value_type, value_type >::value
+ && std::is_constructible< value_type, const value_type && >::value
+ )
+ >
+ nsel_constexpr detail::invoke_result_nocvref_t< F, const error_type && > or_else( F && f ) const &&
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F, const error_type && >( std::move( value() ) )
+ : detail::invoke_result_nocvref_t< F, const error_type && >( detail::invoke( std::forward< F >( f ), std::move( error() ) ) );
+ }
+#endif
+
+ template::value
+ && !std::is_void< detail::transform_invoke_result_t< F, value_type & > >::value
+ && detail::valid_expected_value_type< detail::transform_invoke_result_t< F, value_type & > >::value
+ )
+ >
+ nsel_constexpr14 expected< detail::transform_invoke_result_t< F, value_type & >, error_type > transform( F && f ) &
+ {
+ return has_value()
+ ? expected< detail::transform_invoke_result_t< F, value_type & >, error_type >( detail::invoke( std::forward< F >( f ), **this ) )
+ : make_unexpected( error() );
+ }
+
+ template::value
+ && std::is_void< detail::transform_invoke_result_t< F, value_type & > >::value
+ )
+ >
+ nsel_constexpr14 expected< void, error_type > transform( F && f ) &
+ {
+ return has_value()
+ ? ( detail::invoke( std::forward< F >( f ), **this ), expected< void, error_type >() )
+ : make_unexpected( error() );
+ }
+
+ template::value
+ && !std::is_void< detail::transform_invoke_result_t< F, const value_type & > >::value
+ && detail::valid_expected_value_type< detail::transform_invoke_result_t< F, const value_type & > >::value
+ )
+ >
+ nsel_constexpr expected< detail::transform_invoke_result_t< F, const value_type & >, error_type > transform( F && f ) const &
+ {
+ return has_value()
+ ? expected< detail::transform_invoke_result_t< F, const value_type & >, error_type >( detail::invoke( std::forward< F >( f ), **this ) )
+ : make_unexpected( error() );
+ }
+
+ template::value
+ && std::is_void< detail::transform_invoke_result_t< F, const value_type & > >::value
+ )
+ >
+ nsel_constexpr expected< void, error_type > transform( F && f ) const &
+ {
+ return has_value()
+ ? ( detail::invoke( std::forward< F >( f ), **this ), expected< void, error_type >() )
+ : make_unexpected( error() );
+ }
+
+#if !nsel_COMPILER_GNUC_VERSION || nsel_COMPILER_GNUC_VERSION >= 490
+ template::value
+ && !std::is_void< detail::transform_invoke_result_t< F, value_type && > >::value
+ && detail::valid_expected_value_type< detail::transform_invoke_result_t< F, value_type && > >::value
+ )
+ >
+ nsel_constexpr14 expected< detail::transform_invoke_result_t< F, value_type && >, error_type > transform( F && f ) &&
+ {
+ return has_value()
+ ? expected< detail::transform_invoke_result_t< F, value_type && >, error_type >( detail::invoke( std::forward< F >( f ), std::move( **this ) ) )
+ : make_unexpected( std::move( error() ) );
+ }
+
+ template::value
+ && std::is_void< detail::transform_invoke_result_t< F, value_type && > >::value
+ )
+ >
+ nsel_constexpr14 expected< void, error_type > transform( F && f ) &&
+ {
+ return has_value()
+ ? ( detail::invoke( std::forward< F >( f ), **this ), expected< void, error_type >() )
+ : make_unexpected( std::move( error() ) );
+ }
+
+ template::value
+ && !std::is_void< detail::transform_invoke_result_t< F, const value_type && > >::value
+ && detail::valid_expected_value_type< detail::transform_invoke_result_t< F, const value_type && > >::value
+ )
+ >
+ nsel_constexpr expected< detail::transform_invoke_result_t< F, const value_type && >, error_type > transform( F && f ) const &&
+ {
+ return has_value()
+ ? expected< detail::transform_invoke_result_t< F, const value_type && >, error_type >( detail::invoke( std::forward< F >( f ), std::move( **this ) ) )
+ : make_unexpected( std::move( error() ) );
+ }
+
+ template::value
+ && std::is_void< detail::transform_invoke_result_t< F, const value_type && > >::value
+ )
+ >
+ nsel_constexpr expected< void, error_type > transform( F && f ) const &&
+ {
+ return has_value()
+ ? ( detail::invoke( std::forward< F >( f ), **this ), expected< void, error_type >() )
+ : make_unexpected( std::move( error() ) );
+ }
+#endif
+
+ template >::value
+ && std::is_constructible< value_type, value_type & >::value
+ )
+ >
+ nsel_constexpr14 expected< value_type, detail::transform_invoke_result_t< F, error_type & > > transform_error( F && f ) &
+ {
+ return has_value()
+ ? expected< value_type, detail::transform_invoke_result_t< F, error_type & > >( in_place, **this )
+ : make_unexpected( detail::invoke( std::forward< F >( f ), error() ) );
+ }
+
+ template >::value
+ && std::is_constructible< value_type, const value_type & >::value
+ )
+ >
+ nsel_constexpr expected< value_type, detail::transform_invoke_result_t< F, const error_type & > > transform_error( F && f ) const &
+ {
+ return has_value()
+ ? expected< value_type, detail::transform_invoke_result_t< F, const error_type & > >( in_place, **this )
+ : make_unexpected( detail::invoke( std::forward< F >( f ), error() ) );
+ }
+
+#if !nsel_COMPILER_GNUC_VERSION || nsel_COMPILER_GNUC_VERSION >= 490
+ template >::value
+ && std::is_constructible< value_type, value_type && >::value
+ )
+ >
+ nsel_constexpr14 expected< value_type, detail::transform_invoke_result_t< F, error_type && > > transform_error( F && f ) &&
+ {
+ return has_value()
+ ? expected< value_type, detail::transform_invoke_result_t< F, error_type && > >( in_place, std::move( **this ) )
+ : make_unexpected( detail::invoke( std::forward< F >( f ), std::move( error() ) ) );
+ }
+
+ template >::value
+ && std::is_constructible< value_type, const value_type && >::value
+ )
+ >
+ nsel_constexpr expected< value_type, detail::transform_invoke_result_t< F, const error_type && > > transform_error( F && f ) const &&
+ {
+ return has_value()
+ ? expected< value_type, detail::transform_invoke_result_t< F, const error_type && > >( in_place, std::move( **this ) )
+ : make_unexpected( detail::invoke( std::forward< F >( f ), std::move( error() ) ) );
+ }
+#endif
+#endif // nsel_P2505R >= 3
// unwrap()
// template
@@ -1961,7 +2680,7 @@ class expected
nsel_constexpr14 explicit expected( nonstd::unexpected_type const & error )
: contained( false )
{
- contained.construct_error( E{ error.value() } );
+ contained.construct_error( E{ error.error() } );
}
template< typename G = E
@@ -1972,7 +2691,7 @@ class expected
nsel_constexpr14 /*non-explicit*/ expected( nonstd::unexpected_type const & error )
: contained( false )
{
- contained.construct_error( error.value() );
+ contained.construct_error( error.error() );
}
template< typename G = E
@@ -1983,7 +2702,7 @@ class expected
nsel_constexpr14 explicit expected( nonstd::unexpected_type && error )
: contained( false )
{
- contained.construct_error( E{ std::move( error.value() ) } );
+ contained.construct_error( E{ std::move( error.error() ) } );
}
template< typename G = E
@@ -1994,7 +2713,7 @@ class expected
nsel_constexpr14 /*non-explicit*/ expected( nonstd::unexpected_type && error )
: contained( false )
{
- contained.construct_error( std::move( error.value() ) );
+ contained.construct_error( std::move( error.error() ) );
}
template< typename... Args
@@ -2131,6 +2850,305 @@ class expected
return ! has_value() && std::is_base_of< Ex, ContainedEx>::value;
}
+#if nsel_P2505R >= 4
+ template< typename G = E
+ nsel_REQUIRES_T(
+ std::is_copy_constructible< E >::value
+ && std::is_convertible< G, E >::value
+ )
+ >
+ nsel_constexpr error_type error_or( G && e ) const &
+ {
+ return has_value()
+ ? static_cast< E >( std::forward< G >( e ) )
+ : contained.error();
+ }
+
+ template< typename G = E
+ nsel_REQUIRES_T(
+ std::is_move_constructible< E >::value
+ && std::is_convertible< G, E >::value
+ )
+ >
+ nsel_constexpr14 error_type error_or( G && e ) &&
+ {
+ return has_value()
+ ? static_cast< E >( std::forward< G >( e ) )
+ : std::move( contained.error() );
+ }
+#endif // nsel_P2505R >= 4
+
+#if nsel_P2505R >= 3
+ // Monadic operations (P2505)
+ template >::value
+ && std::is_same< typename detail::invoke_result_nocvref_t< F >::error_type, error_type >::value
+ && std::is_constructible< error_type, error_type & >::value
+ )
+ >
+ nsel_constexpr14 detail::invoke_result_nocvref_t< F > and_then( F && f ) &
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F >( detail::invoke( std::forward< F >( f ) ) )
+ : detail::invoke_result_nocvref_t< F >( unexpect, error() );
+ }
+
+ template >::value
+ && std::is_same< typename detail::invoke_result_nocvref_t< F >::error_type, error_type >::value
+ && std::is_constructible< error_type, const error_type & >::value
+ )
+ >
+ nsel_constexpr detail::invoke_result_nocvref_t< F > and_then( F && f ) const &
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F >( detail::invoke( std::forward< F >( f ) ) )
+ : detail::invoke_result_nocvref_t< F >( unexpect, error() );
+ }
+
+#if !nsel_COMPILER_GNUC_VERSION || nsel_COMPILER_GNUC_VERSION >= 490
+ template >::value
+ && std::is_same< typename detail::invoke_result_nocvref_t< F >::error_type, error_type >::value
+ && std::is_constructible< error_type, error_type && >::value
+ )
+ >
+ nsel_constexpr14 detail::invoke_result_nocvref_t< F > and_then( F && f ) &&
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F >( detail::invoke( std::forward< F >( f ) ) )
+ : detail::invoke_result_nocvref_t< F >( unexpect, std::move( error() ) );
+ }
+
+ template >::value
+ && std::is_same< typename detail::invoke_result_nocvref_t< F >::error_type, error_type >::value
+ && std::is_constructible< error_type, const error_type && >::value
+ )
+ >
+ nsel_constexpr detail::invoke_result_nocvref_t< F > and_then( F && f ) const &&
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F >( detail::invoke( std::forward< F >( f ) ) )
+ : detail::invoke_result_nocvref_t< F >( unexpect, std::move( error() ) );
+ }
+#endif
+
+ template >::value
+ && std::is_void< typename detail::invoke_result_nocvref_t< F, error_type & >::value_type >::value
+ )
+ >
+ nsel_constexpr14 detail::invoke_result_nocvref_t< F, error_type & > or_else( F && f ) &
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F, error_type & >()
+ : detail::invoke_result_nocvref_t< F, error_type & >( detail::invoke( std::forward< F >( f ), error() ) );
+ }
+
+ template >::value
+ && std::is_void< typename detail::invoke_result_nocvref_t< F, const error_type & >::value_type >::value
+ )
+ >
+ nsel_constexpr detail::invoke_result_nocvref_t< F, const error_type & > or_else( F && f ) const &
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F, const error_type & >()
+ : detail::invoke_result_nocvref_t< F, const error_type & >( detail::invoke( std::forward< F >( f ), error() ) );
+ }
+
+#if !nsel_COMPILER_GNUC_VERSION || nsel_COMPILER_GNUC_VERSION >= 490
+ template >::value
+ && std::is_void< typename detail::invoke_result_nocvref_t< F, error_type && >::value_type >::value
+ )
+ >
+ nsel_constexpr14 detail::invoke_result_nocvref_t< F, error_type && > or_else( F && f ) &&
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F, error_type && >()
+ : detail::invoke_result_nocvref_t< F, error_type && >( detail::invoke( std::forward< F >( f ), std::move( error() ) ) );
+ }
+
+ template >::value
+ && std::is_void< typename detail::invoke_result_nocvref_t< F, const error_type && >::value_type >::value
+ )
+ >
+ nsel_constexpr detail::invoke_result_nocvref_t< F, const error_type && > or_else( F && f ) const &&
+ {
+ return has_value()
+ ? detail::invoke_result_nocvref_t< F, const error_type && >()
+ : detail::invoke_result_nocvref_t< F, const error_type && >( detail::invoke( std::forward< F >( f ), std::move( error() ) ) );
+ }
+#endif
+
+ template::value
+ && !std::is_void< detail::transform_invoke_result_t< F > >::value
+ )
+ >
+ nsel_constexpr14 expected< detail::transform_invoke_result_t< F >, error_type > transform( F && f ) &
+ {
+ return has_value()
+ ? expected< detail::transform_invoke_result_t< F >, error_type >( detail::invoke( std::forward< F >( f ) ) )
+ : make_unexpected( error() );
+ }
+
+ template::value
+ && std::is_void< detail::transform_invoke_result_t< F > >::value
+ )
+ >
+ nsel_constexpr14 expected< void, error_type > transform( F && f ) &
+ {
+ return has_value()
+ ? ( detail::invoke( std::forward< F >( f ) ), expected< void, error_type >() )
+ : make_unexpected( error() );
+ }
+
+ template::value
+ && !std::is_void< detail::transform_invoke_result_t< F > >::value
+ )
+ >
+ nsel_constexpr expected< detail::transform_invoke_result_t< F >, error_type > transform( F && f ) const &
+ {
+ return has_value()
+ ? expected< detail::transform_invoke_result_t< F >, error_type >( detail::invoke( std::forward< F >( f ) ) )
+ : make_unexpected( error() );
+ }
+
+ template::value
+ && std::is_void< detail::transform_invoke_result_t< F > >::value
+ )
+ >
+ nsel_constexpr expected< void, error_type > transform( F && f ) const &
+ {
+ return has_value()
+ ? ( detail::invoke( std::forward< F >( f ) ), expected< void, error_type >() )
+ : make_unexpected( error() );
+ }
+
+#if !nsel_COMPILER_GNUC_VERSION || nsel_COMPILER_GNUC_VERSION >= 490
+ template::value
+ && !std::is_void< detail::transform_invoke_result_t< F > >::value
+ )
+ >
+ nsel_constexpr14 expected< detail::transform_invoke_result_t< F >, error_type > transform( F && f ) &&
+ {
+ return has_value()
+ ? expected< detail::transform_invoke_result_t< F >, error_type >( detail::invoke( std::forward< F >( f ) ) )
+ : make_unexpected( error() );
+ }
+
+ template::value
+ && std::is_void< detail::transform_invoke_result_t< F > >::value
+ )
+ >
+ nsel_constexpr14 expected< void, error_type > transform( F && f ) &&
+ {
+ return has_value()
+ ? ( detail::invoke( std::forward< F >( f ) ), expected< void, error_type >() )
+ : make_unexpected( error() );
+ }
+
+ template::value
+ && !std::is_void< detail::transform_invoke_result_t< F > >::value
+ )
+ >
+ nsel_constexpr expected< detail::transform_invoke_result_t< F >, error_type > transform( F && f ) const &&
+ {
+ return has_value()
+ ? expected< detail::transform_invoke_result_t< F >, error_type >( detail::invoke( std::forward< F >( f ) ) )
+ : make_unexpected( error() );
+ }
+
+ template::value
+ && std::is_void< detail::transform_invoke_result_t< F > >::value
+ )
+ >
+ nsel_constexpr expected< void, error_type > transform( F && f ) const &&
+ {
+ return has_value()
+ ? ( detail::invoke( std::forward< F >( f ) ), expected< void, error_type >() )
+ : make_unexpected( error() );
+ }
+#endif
+
+ template >::value
+ )
+ >
+ nsel_constexpr14 expected< void, detail::transform_invoke_result_t< F, error_type & > > transform_error( F && f ) &
+ {
+ return has_value()
+ ? expected< void, detail::transform_invoke_result_t< F, error_type & > >()
+ : make_unexpected( detail::invoke( std::forward< F >( f ), error() ) );
+ }
+
+ template >::value
+ )
+ >
+ nsel_constexpr expected< void, detail::transform_invoke_result_t< F, const error_type & > > transform_error( F && f ) const &
+ {
+ return has_value()
+ ? expected< void, detail::transform_invoke_result_t< F, const error_type & > >()
+ : make_unexpected( detail::invoke( std::forward< F >( f ), error() ) );
+ }
+
+#if !nsel_COMPILER_GNUC_VERSION || nsel_COMPILER_GNUC_VERSION >= 490
+ template >::value
+ )
+ >
+ nsel_constexpr14 expected< void, detail::transform_invoke_result_t< F, error_type && > > transform_error( F && f ) &&
+ {
+ return has_value()
+ ? expected< void, detail::transform_invoke_result_t< F, error_type && > >()
+ : make_unexpected( detail::invoke( std::forward< F >( f ), std::move( error() ) ) );
+ }
+
+ template >::value
+ )
+ >
+ nsel_constexpr expected< void, detail::transform_invoke_result_t< F, const error_type && > > transform_error( F && f ) const &&
+ {
+ return has_value()
+ ? expected< void, detail::transform_invoke_result_t< F, const error_type && > >()
+ : make_unexpected( detail::invoke( std::forward< F >( f ), std::move( error() ) ) );
+ }
+#endif
+#endif // nsel_P2505R >= 3
+
// template constexpr 'see below' unwrap() const&;
//
// template 'see below' unwrap() &&;
diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt
index 0b517c7fb819..5d2f9cf0e3be 100644
--- a/src/base/CMakeLists.txt
+++ b/src/base/CMakeLists.txt
@@ -7,6 +7,7 @@ add_library(qbt_base STATIC
asyncfilestorage.h
bittorrent/abstractfilestorage.h
bittorrent/addtorrentparams.h
+ bittorrent/announcetimepoint.h
bittorrent/bandwidthscheduler.h
bittorrent/bencoderesumedatastorage.h
bittorrent/cachestatus.h
@@ -14,6 +15,7 @@ add_library(qbt_base STATIC
bittorrent/common.h
bittorrent/customstorage.h
bittorrent/dbresumedatastorage.h
+ bittorrent/downloadpathoption.h
bittorrent/downloadpriority.h
bittorrent/extensiondata.h
bittorrent/filesearcher.h
@@ -31,16 +33,24 @@ add_library(qbt_base STATIC
bittorrent/session.h
bittorrent/sessionimpl.h
bittorrent/sessionstatus.h
+ bittorrent/sharelimitaction.h
bittorrent/speedmonitor.h
+ bittorrent/sslparameters.h
bittorrent/torrent.h
bittorrent/torrentcontenthandler.h
bittorrent/torrentcontentlayout.h
+ bittorrent/torrentcontentremoveoption.h
+ bittorrent/torrentcontentremover.h
+ bittorrent/torrentcreationmanager.h
+ bittorrent/torrentcreationtask.h
bittorrent/torrentcreator.h
bittorrent/torrentdescriptor.h
bittorrent/torrentimpl.h
bittorrent/torrentinfo.h
bittorrent/tracker.h
bittorrent/trackerentry.h
+ bittorrent/trackerentrystatus.h
+ concepts/explicitlyconvertibleto.h
concepts/stringable.h
digest32.h
exceptions.h
@@ -53,7 +63,6 @@ add_library(qbt_base STATIC
http/responsegenerator.h
http/server.h
http/types.h
- iconprovider.h
indexrange.h
interfaces/iapplication.h
logger.h
@@ -85,6 +94,7 @@ add_library(qbt_base STATIC
search/searchhandler.h
search/searchpluginmanager.h
settingsstorage.h
+ tag.h
tagset.h
torrentfileguard.h
torrentfileswatcher.h
@@ -93,15 +103,18 @@ add_library(qbt_base STATIC
unicodestrings.h
utils/bytearray.h
utils/compare.h
+ utils/datetime.h
utils/foreignapps.h
utils/fs.h
utils/gzip.h
utils/io.h
utils/misc.h
utils/net.h
+ utils/number.h
utils/os.h
utils/password.h
utils/random.h
+ utils/sslkey.h
utils/string.h
utils/thread.h
utils/version.h
@@ -118,6 +131,7 @@ add_library(qbt_base STATIC
bittorrent/categoryoptions.cpp
bittorrent/customstorage.cpp
bittorrent/dbresumedatastorage.cpp
+ bittorrent/downloadpathoption.cpp
bittorrent/downloadpriority.cpp
bittorrent/filesearcher.cpp
bittorrent/filterparserthread.cpp
@@ -131,14 +145,19 @@ add_library(qbt_base STATIC
bittorrent/resumedatastorage.cpp
bittorrent/sessionimpl.cpp
bittorrent/speedmonitor.cpp
+ bittorrent/sslparameters.cpp
bittorrent/torrent.cpp
bittorrent/torrentcontenthandler.cpp
+ bittorrent/torrentcontentremover.cpp
+ bittorrent/torrentcreationmanager.cpp
+ bittorrent/torrentcreationtask.cpp
bittorrent/torrentcreator.cpp
bittorrent/torrentdescriptor.cpp
bittorrent/torrentimpl.cpp
bittorrent/torrentinfo.cpp
bittorrent/tracker.cpp
bittorrent/trackerentry.cpp
+ bittorrent/trackerentrystatus.cpp
exceptions.cpp
http/connection.cpp
http/httperror.cpp
@@ -146,7 +165,6 @@ add_library(qbt_base STATIC
http/responsebuilder.cpp
http/responsegenerator.cpp
http/server.cpp
- iconprovider.cpp
logger.cpp
net/dnsupdater.cpp
net/downloadhandlerimpl.cpp
@@ -174,21 +192,25 @@ add_library(qbt_base STATIC
search/searchhandler.cpp
search/searchpluginmanager.cpp
settingsstorage.cpp
+ tag.cpp
tagset.cpp
torrentfileguard.cpp
torrentfileswatcher.cpp
torrentfilter.cpp
utils/bytearray.cpp
utils/compare.cpp
+ utils/datetime.cpp
utils/foreignapps.cpp
utils/fs.cpp
utils/gzip.cpp
utils/io.cpp
utils/misc.cpp
utils/net.cpp
+ utils/number.cpp
utils/os.cpp
utils/password.cpp
utils/random.cpp
+ utils/sslkey.cpp
utils/string.cpp
utils/thread.cpp
utils/version.cpp
@@ -196,11 +218,16 @@ add_library(qbt_base STATIC
target_link_libraries(qbt_base
PRIVATE
- OpenSSL::Crypto OpenSSL::SSL
+ OpenSSL::Crypto
+ OpenSSL::SSL
ZLIB::ZLIB
PUBLIC
LibtorrentRasterbar::torrent-rasterbar
- Qt::Core Qt::Network Qt::Sql Qt::Xml
+ Qt::Core
+ Qt::CorePrivate
+ Qt::Network
+ Qt::Sql
+ Qt::Xml
qbt_common_cfg
)
@@ -215,7 +242,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
${IOKit_LIBRARY}
)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
- target_link_libraries(qbt_base PRIVATE Iphlpapi)
+ target_link_libraries(qbt_base PRIVATE Iphlpapi PowrProf)
endif()
if (NOT GUI)
diff --git a/src/base/addtorrentmanager.cpp b/src/base/addtorrentmanager.cpp
index a094dbd85acc..ce446a72b739 100644
--- a/src/base/addtorrentmanager.cpp
+++ b/src/base/addtorrentmanager.cpp
@@ -157,10 +157,36 @@ void AddTorrentManager::handleAddTorrentFailed(const QString &source, const QStr
emit addTorrentFailed(source, reason);
}
-void AddTorrentManager::handleDuplicateTorrent(const QString &source, BitTorrent::Torrent *torrent, const QString &message)
+void AddTorrentManager::handleDuplicateTorrent(const QString &source
+ , const BitTorrent::TorrentDescriptor &torrentDescr, BitTorrent::Torrent *existingTorrent)
{
+ const bool hasMetadata = torrentDescr.info().has_value();
+ if (hasMetadata)
+ {
+ // Trying to set metadata to existing torrent in case if it has none
+ existingTorrent->setMetadata(*torrentDescr.info());
+ }
+
+ const bool isPrivate = existingTorrent->isPrivate() || (hasMetadata && torrentDescr.info()->isPrivate());
+ QString message;
+ if (!btSession()->isMergeTrackersEnabled())
+ {
+ message = tr("Merging of trackers is disabled");
+ }
+ else if (isPrivate)
+ {
+ message = tr("Trackers cannot be merged because it is a private torrent");
+ }
+ else
+ {
+ // merge trackers and web seeds
+ existingTorrent->addTrackers(torrentDescr.trackers());
+ existingTorrent->addUrlSeeds(torrentDescr.urlSeeds());
+ message = tr("Trackers are merged from new source");
+ }
+
LogMsg(tr("Detected an attempt to add a duplicate torrent. Source: %1. Existing torrent: %2. Result: %3")
- .arg(source, torrent->name(), message));
+ .arg(source, existingTorrent->name(), message));
emit addTorrentFailed(source, message);
}
@@ -169,11 +195,9 @@ void AddTorrentManager::setTorrentFileGuard(const QString &source, std::shared_p
m_guardedTorrentFiles.emplace(source, std::move(torrentFileGuard));
}
-void AddTorrentManager::releaseTorrentFileGuard(const QString &source)
+std::shared_ptr AddTorrentManager::releaseTorrentFileGuard(const QString &source)
{
- auto torrentFileGuard = m_guardedTorrentFiles.take(source);
- if (torrentFileGuard)
- torrentFileGuard->setAutoRemove(false);
+ return m_guardedTorrentFiles.take(source);
}
bool AddTorrentManager::processTorrent(const QString &source, const BitTorrent::TorrentDescriptor &torrentDescr
@@ -184,32 +208,7 @@ bool AddTorrentManager::processTorrent(const QString &source, const BitTorrent::
if (BitTorrent::Torrent *torrent = btSession()->findTorrent(infoHash))
{
// a duplicate torrent is being added
-
- const bool hasMetadata = torrentDescr.info().has_value();
- if (hasMetadata)
- {
- // Trying to set metadata to existing torrent in case if it has none
- torrent->setMetadata(*torrentDescr.info());
- }
-
- if (!btSession()->isMergeTrackersEnabled())
- {
- handleDuplicateTorrent(source, torrent, tr("Merging of trackers is disabled"));
- return false;
- }
-
- const bool isPrivate = torrent->isPrivate() || (hasMetadata && torrentDescr.info()->isPrivate());
- if (isPrivate)
- {
- handleDuplicateTorrent(source, torrent, tr("Trackers cannot be merged because it is a private torrent"));
- return false;
- }
-
- // merge trackers and web seeds
- torrent->addTrackers(torrentDescr.trackers());
- torrent->addUrlSeeds(torrentDescr.urlSeeds());
-
- handleDuplicateTorrent(source, torrent, tr("Trackers are merged from new source"));
+ handleDuplicateTorrent(source, torrentDescr, torrent);
return false;
}
diff --git a/src/base/addtorrentmanager.h b/src/base/addtorrentmanager.h
index ef31ae4da12f..0e2fc6f497b6 100644
--- a/src/base/addtorrentmanager.h
+++ b/src/base/addtorrentmanager.h
@@ -72,9 +72,9 @@ class AddTorrentManager : public ApplicationComponent
bool addTorrentToSession(const QString &source, const BitTorrent::TorrentDescriptor &torrentDescr
, const BitTorrent::AddTorrentParams &addTorrentParams);
void handleAddTorrentFailed(const QString &source, const QString &reason);
- void handleDuplicateTorrent(const QString &source, BitTorrent::Torrent *torrent, const QString &message);
+ void handleDuplicateTorrent(const QString &source, const BitTorrent::TorrentDescriptor &torrentDescr, BitTorrent::Torrent *existingTorrent);
void setTorrentFileGuard(const QString &source, std::shared_ptr torrentFileGuard);
- void releaseTorrentFileGuard(const QString &source);
+ std::shared_ptr releaseTorrentFileGuard(const QString &source);
private:
void onDownloadFinished(const Net::DownloadResult &result);
diff --git a/src/base/asyncfilestorage.cpp b/src/base/asyncfilestorage.cpp
index 6424b18623d9..ba96aa09f47a 100644
--- a/src/base/asyncfilestorage.cpp
+++ b/src/base/asyncfilestorage.cpp
@@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
- * Copyright (C) 2017 Vladimir Golovnev
+ * Copyright (C) 2017-2024 Vladimir Golovnev
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -34,31 +34,56 @@
#include "base/utils/fs.h"
#include "base/utils/io.h"
+QHash> AsyncFileStorage::m_reservedPaths;
+QReadWriteLock AsyncFileStorage::m_reservedPathsLock;
+
AsyncFileStorage::AsyncFileStorage(const Path &storageFolderPath, QObject *parent)
: QObject(parent)
, m_storageDir(storageFolderPath)
- , m_lockFile((m_storageDir / Path(u"storage.lock"_s)).data())
{
Q_ASSERT(m_storageDir.isAbsolute());
- if (!Utils::Fs::mkpath(m_storageDir))
- throw AsyncFileStorageError(tr("Could not create directory '%1'.").arg(m_storageDir.toString()));
+ const Path lockFilePath = m_storageDir / Path(u"storage.lock"_s);
- // TODO: This folder locking approach does not work for UNIX systems. Implement it.
- if (!m_lockFile.open(QFile::WriteOnly))
- throw AsyncFileStorageError(m_lockFile.errorString());
-}
+ {
+ const QReadLocker readLocker {&m_reservedPathsLock};
+ m_lockFile = m_reservedPaths.value(lockFilePath).lock();
+ }
-AsyncFileStorage::~AsyncFileStorage()
-{
- m_lockFile.close();
- m_lockFile.remove();
+ if (!m_lockFile)
+ {
+ const QWriteLocker writeLocker {&m_reservedPathsLock};
+ if (std::weak_ptr &lockFile = m_reservedPaths[lockFilePath]; lockFile.expired()) [[likely]]
+ {
+ if (!Utils::Fs::mkpath(m_storageDir))
+ throw AsyncFileStorageError(tr("Could not create directory '%1'.").arg(m_storageDir.toString()));
+
+ auto lockFileDeleter = [](QFile *file)
+ {
+ file->close();
+ file->remove();
+ delete file;
+ };
+ m_lockFile = std::shared_ptr(new QFile(lockFilePath.data()), std::move(lockFileDeleter));
+
+ // TODO: This folder locking approach does not work for UNIX systems. Implement it.
+ if (!m_lockFile->open(QFile::WriteOnly))
+ throw AsyncFileStorageError(m_lockFile->errorString());
+
+ lockFile = m_lockFile;
+ }
+ else
+ {
+ m_lockFile = lockFile.lock();
+ }
+ }
}
+AsyncFileStorage::~AsyncFileStorage() = default;
+
void AsyncFileStorage::store(const Path &filePath, const QByteArray &data)
{
- QMetaObject::invokeMethod(this, [this, data, filePath]() { store_impl(filePath, data); }
- , Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, [this, data, filePath] { store_impl(filePath, data); }, Qt::QueuedConnection);
}
Path AsyncFileStorage::storageDir() const
diff --git a/src/base/asyncfilestorage.h b/src/base/asyncfilestorage.h
index 2943ee2125cd..47937de1e7d1 100644
--- a/src/base/asyncfilestorage.h
+++ b/src/base/asyncfilestorage.h
@@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
- * Copyright (C) 2017 Vladimir Golovnev
+ * Copyright (C) 2017-2024 Vladimir Golovnev
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -28,19 +28,23 @@
#pragma once
+#include
+
#include
+#include
#include
+#include
#include "base/exceptions.h"
#include "base/path.h"
-class AsyncFileStorageError : public RuntimeError
+class AsyncFileStorageError final : public RuntimeError
{
public:
using RuntimeError::RuntimeError;
};
-class AsyncFileStorage : public QObject
+class AsyncFileStorage final : public QObject
{
Q_OBJECT
Q_DISABLE_COPY_MOVE(AsyncFileStorage)
@@ -60,5 +64,8 @@ class AsyncFileStorage : public QObject
Q_INVOKABLE void store_impl(const Path &fileName, const QByteArray &data);
Path m_storageDir;
- QFile m_lockFile;
+ std::shared_ptr m_lockFile;
+
+ static QHash> m_reservedPaths;
+ static QReadWriteLock m_reservedPathsLock;
};
diff --git a/src/base/bittorrent/abstractfilestorage.cpp b/src/base/bittorrent/abstractfilestorage.cpp
index c55ef8e52b6f..ccd501c5b179 100644
--- a/src/base/bittorrent/abstractfilestorage.cpp
+++ b/src/base/bittorrent/abstractfilestorage.cpp
@@ -30,7 +30,7 @@
#include
#include
-#include
+#include
#include "base/exceptions.h"
#include "base/path.h"
@@ -71,7 +71,7 @@ void BitTorrent::AbstractFileStorage::renameFolder(const Path &oldFolderPath, co
if (newFolderPath.isAbsolute())
throw RuntimeError(tr("Absolute path isn't allowed: '%1'.").arg(newFolderPath.toString()));
- QVector renamingFileIndexes;
+ QList renamingFileIndexes;
renamingFileIndexes.reserve(filesCount());
for (int i = 0; i < filesCount(); ++i)
diff --git a/src/base/bittorrent/addtorrentparams.cpp b/src/base/bittorrent/addtorrentparams.cpp
index e78939232c8e..d284b36d36ea 100644
--- a/src/base/bittorrent/addtorrentparams.cpp
+++ b/src/base/bittorrent/addtorrentparams.cpp
@@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
- * Copyright (C) 2015-2023 Vladimir Golovnev
+ * Copyright (C) 2015-2024 Vladimir Golovnev
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -28,12 +28,11 @@
#include "addtorrentparams.h"
-#include
-
#include
#include
#include
+#include "base/utils/sslkey.h"
#include "base/utils/string.h"
const QString PARAM_CATEGORY = u"category"_s;
@@ -44,6 +43,7 @@ const QString PARAM_DOWNLOADPATH = u"download_path"_s;
const QString PARAM_OPERATINGMODE = u"operating_mode"_s;
const QString PARAM_QUEUETOP = u"add_to_top_of_queue"_s;
const QString PARAM_STOPPED = u"stopped"_s;
+const QString PARAM_STOPCONDITION = u"stop_condition"_s;
const QString PARAM_SKIPCHECKING = u"skip_checking"_s;
const QString PARAM_CONTENTLAYOUT = u"content_layout"_s;
const QString PARAM_AUTOTMM = u"use_auto_tmm"_s;
@@ -51,7 +51,11 @@ const QString PARAM_UPLOADLIMIT = u"upload_limit"_s;
const QString PARAM_DOWNLOADLIMIT = u"download_limit"_s;
const QString PARAM_SEEDINGTIMELIMIT = u"seeding_time_limit"_s;
const QString PARAM_INACTIVESEEDINGTIMELIMIT = u"inactive_seeding_time_limit"_s;
+const QString PARAM_SHARELIMITACTION = u"share_limit_action"_s;
const QString PARAM_RATIOLIMIT = u"ratio_limit"_s;
+const QString PARAM_SSL_CERTIFICATE = u"ssl_certificate"_s;
+const QString PARAM_SSL_PRIVATEKEY = u"ssl_private_key"_s;
+const QString PARAM_SSL_DHPARAMS = u"ssl_dh_params"_s;
namespace
{
@@ -59,7 +63,7 @@ namespace
{
TagSet tags;
for (const QJsonValue &jsonVal : jsonArr)
- tags.insert(jsonVal.toString());
+ tags.insert(Tag(jsonVal.toString()));
return tags;
}
@@ -67,8 +71,8 @@ namespace
QJsonArray serializeTagSet(const TagSet &tags)
{
QJsonArray arr;
- for (const QString &tag : tags)
- arr.append(tag);
+ for (const Tag &tag : tags)
+ arr.append(tag.toString());
return arr;
}
@@ -93,75 +97,76 @@ namespace
}
template
- Enum getEnum(const QJsonObject &jsonObj, const QString &key)
+ Enum getEnum(const QJsonObject &jsonObj, const QString &key, const Enum defaultValue = {})
{
const QJsonValue jsonVal = jsonObj.value(key);
- return Utils::String::toEnum(jsonVal.toString(), {});
+ return Utils::String::toEnum(jsonVal.toString(), defaultValue);
}
}
-bool BitTorrent::operator==(const AddTorrentParams &lhs, const AddTorrentParams &rhs)
-{
- return std::tie(lhs.name, lhs.category, lhs.tags,
- lhs.savePath, lhs.useDownloadPath, lhs.downloadPath,
- lhs.sequential, lhs.firstLastPiecePriority, lhs.addForced,
- lhs.addToQueueTop, lhs.addPaused, lhs.stopCondition,
- lhs.filePaths, lhs.filePriorities, lhs.skipChecking,
- lhs.contentLayout, lhs.useAutoTMM, lhs.uploadLimit,
- lhs.downloadLimit, lhs.seedingTimeLimit, lhs.inactiveSeedingTimeLimit, lhs.ratioLimit)
- == std::tie(rhs.name, rhs.category, rhs.tags,
- rhs.savePath, rhs.useDownloadPath, rhs.downloadPath,
- rhs.sequential, rhs.firstLastPiecePriority, rhs.addForced,
- rhs.addToQueueTop, rhs.addPaused, rhs.stopCondition,
- rhs.filePaths, rhs.filePriorities, rhs.skipChecking,
- rhs.contentLayout, rhs.useAutoTMM, rhs.uploadLimit,
- rhs.downloadLimit, rhs.seedingTimeLimit, rhs.inactiveSeedingTimeLimit, rhs.ratioLimit);
-}
-
BitTorrent::AddTorrentParams BitTorrent::parseAddTorrentParams(const QJsonObject &jsonObj)
{
- AddTorrentParams params;
- params.category = jsonObj.value(PARAM_CATEGORY).toString();
- params.tags = parseTagSet(jsonObj.value(PARAM_TAGS).toArray());
- params.savePath = Path(jsonObj.value(PARAM_SAVEPATH).toString());
- params.useDownloadPath = getOptionalBool(jsonObj, PARAM_USEDOWNLOADPATH);
- params.downloadPath = Path(jsonObj.value(PARAM_DOWNLOADPATH).toString());
- params.addForced = (getEnum(jsonObj, PARAM_OPERATINGMODE) == BitTorrent::TorrentOperatingMode::Forced);
- params.addToQueueTop = getOptionalBool(jsonObj, PARAM_QUEUETOP);
- params.addPaused = getOptionalBool(jsonObj, PARAM_STOPPED);
- params.skipChecking = jsonObj.value(PARAM_SKIPCHECKING).toBool();
- params.contentLayout = getOptionalEnum(jsonObj, PARAM_CONTENTLAYOUT);
- params.useAutoTMM = getOptionalBool(jsonObj, PARAM_AUTOTMM);
- params.uploadLimit = jsonObj.value(PARAM_UPLOADLIMIT).toInt(-1);
- params.downloadLimit = jsonObj.value(PARAM_DOWNLOADLIMIT).toInt(-1);
- params.seedingTimeLimit = jsonObj.value(PARAM_SEEDINGTIMELIMIT).toInt(BitTorrent::Torrent::USE_GLOBAL_SEEDING_TIME);
- params.inactiveSeedingTimeLimit = jsonObj.value(PARAM_INACTIVESEEDINGTIMELIMIT).toInt(BitTorrent::Torrent::USE_GLOBAL_INACTIVE_SEEDING_TIME);
- params.ratioLimit = jsonObj.value(PARAM_RATIOLIMIT).toDouble(BitTorrent::Torrent::USE_GLOBAL_RATIO);
-
+ const AddTorrentParams params
+ {
+ .name = {},
+ .category = jsonObj.value(PARAM_CATEGORY).toString(),
+ .tags = parseTagSet(jsonObj.value(PARAM_TAGS).toArray()),
+ .savePath = Path(jsonObj.value(PARAM_SAVEPATH).toString()),
+ .useDownloadPath = getOptionalBool(jsonObj, PARAM_USEDOWNLOADPATH),
+ .downloadPath = Path(jsonObj.value(PARAM_DOWNLOADPATH).toString()),
+ .addForced = (getEnum(jsonObj, PARAM_OPERATINGMODE) == TorrentOperatingMode::Forced),
+ .addToQueueTop = getOptionalBool(jsonObj, PARAM_QUEUETOP),
+ .addStopped = getOptionalBool(jsonObj, PARAM_STOPPED),
+ .stopCondition = getOptionalEnum(jsonObj, PARAM_STOPCONDITION),
+ .filePaths = {},
+ .filePriorities = {},
+ .skipChecking = jsonObj.value(PARAM_SKIPCHECKING).toBool(),
+ .contentLayout = getOptionalEnum(jsonObj, PARAM_CONTENTLAYOUT),
+ .useAutoTMM = getOptionalBool(jsonObj, PARAM_AUTOTMM),
+ .uploadLimit = jsonObj.value(PARAM_UPLOADLIMIT).toInt(-1),
+ .downloadLimit = jsonObj.value(PARAM_DOWNLOADLIMIT).toInt(-1),
+ .seedingTimeLimit = jsonObj.value(PARAM_SEEDINGTIMELIMIT).toInt(Torrent::USE_GLOBAL_SEEDING_TIME),
+ .inactiveSeedingTimeLimit = jsonObj.value(PARAM_INACTIVESEEDINGTIMELIMIT).toInt(Torrent::USE_GLOBAL_INACTIVE_SEEDING_TIME),
+ .ratioLimit = jsonObj.value(PARAM_RATIOLIMIT).toDouble(Torrent::USE_GLOBAL_RATIO),
+ .shareLimitAction = getEnum(jsonObj, PARAM_SHARELIMITACTION, ShareLimitAction::Default),
+ .sslParameters =
+ {
+ .certificate = QSslCertificate(jsonObj.value(PARAM_SSL_CERTIFICATE).toString().toLatin1()),
+ .privateKey = Utils::SSLKey::load(jsonObj.value(PARAM_SSL_PRIVATEKEY).toString().toLatin1()),
+ .dhParams = jsonObj.value(PARAM_SSL_DHPARAMS).toString().toLatin1()
+ }
+ };
return params;
}
QJsonObject BitTorrent::serializeAddTorrentParams(const AddTorrentParams ¶ms)
{
- QJsonObject jsonObj {
+ QJsonObject jsonObj
+ {
{PARAM_CATEGORY, params.category},
{PARAM_TAGS, serializeTagSet(params.tags)},
{PARAM_SAVEPATH, params.savePath.data()},
{PARAM_DOWNLOADPATH, params.downloadPath.data()},
{PARAM_OPERATINGMODE, Utils::String::fromEnum(params.addForced
- ? BitTorrent::TorrentOperatingMode::Forced : BitTorrent::TorrentOperatingMode::AutoManaged)},
+ ? TorrentOperatingMode::Forced : TorrentOperatingMode::AutoManaged)},
{PARAM_SKIPCHECKING, params.skipChecking},
{PARAM_UPLOADLIMIT, params.uploadLimit},
{PARAM_DOWNLOADLIMIT, params.downloadLimit},
{PARAM_SEEDINGTIMELIMIT, params.seedingTimeLimit},
{PARAM_INACTIVESEEDINGTIMELIMIT, params.inactiveSeedingTimeLimit},
- {PARAM_RATIOLIMIT, params.ratioLimit}
+ {PARAM_SHARELIMITACTION, Utils::String::fromEnum(params.shareLimitAction)},
+ {PARAM_RATIOLIMIT, params.ratioLimit},
+ {PARAM_SSL_CERTIFICATE, QString::fromLatin1(params.sslParameters.certificate.toPem())},
+ {PARAM_SSL_PRIVATEKEY, QString::fromLatin1(params.sslParameters.privateKey.toPem())},
+ {PARAM_SSL_DHPARAMS, QString::fromLatin1(params.sslParameters.dhParams)}
};
if (params.addToQueueTop)
jsonObj[PARAM_QUEUETOP] = *params.addToQueueTop;
- if (params.addPaused)
- jsonObj[PARAM_STOPPED] = *params.addPaused;
+ if (params.addStopped)
+ jsonObj[PARAM_STOPPED] = *params.addStopped;
+ if (params.stopCondition)
+ jsonObj[PARAM_STOPCONDITION] = Utils::String::fromEnum(*params.stopCondition);
if (params.contentLayout)
jsonObj[PARAM_CONTENTLAYOUT] = Utils::String::fromEnum(*params.contentLayout);
if (params.useAutoTMM)
diff --git a/src/base/bittorrent/addtorrentparams.h b/src/base/bittorrent/addtorrentparams.h
index 63ec0e4e700a..a2de0b725689 100644
--- a/src/base/bittorrent/addtorrentparams.h
+++ b/src/base/bittorrent/addtorrentparams.h
@@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
- * Copyright (C) 2015-2023 Vladimir Golovnev
+ * Copyright (C) 2015-2024 Vladimir Golovnev
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -30,12 +30,14 @@
#include
+#include
#include
#include
-#include
#include "base/path.h"
#include "base/tagset.h"
+#include "sharelimitaction.h"
+#include "sslparameters.h"
#include "torrent.h"
#include "torrentcontentlayout.h"
@@ -57,10 +59,10 @@ namespace BitTorrent
bool firstLastPiecePriority = false;
bool addForced = false;
std::optional addToQueueTop;
- std::optional addPaused;
+ std::optional addStopped;
std::optional stopCondition;
PathList filePaths; // used if TorrentInfo is set
- QVector filePriorities; // used if TorrentInfo is set
+ QList filePriorities; // used if TorrentInfo is set
bool skipChecking = false;
std::optional contentLayout;
std::optional useAutoTMM;
@@ -69,9 +71,11 @@ namespace BitTorrent
int seedingTimeLimit = Torrent::USE_GLOBAL_SEEDING_TIME;
int inactiveSeedingTimeLimit = Torrent::USE_GLOBAL_INACTIVE_SEEDING_TIME;
qreal ratioLimit = Torrent::USE_GLOBAL_RATIO;
- };
+ ShareLimitAction shareLimitAction = ShareLimitAction::Default;
+ SSLParameters sslParameters;
- bool operator==(const AddTorrentParams &lhs, const AddTorrentParams &rhs);
+ friend bool operator==(const AddTorrentParams &lhs, const AddTorrentParams &rhs) = default;
+ };
AddTorrentParams parseAddTorrentParams(const QJsonObject &jsonObj);
QJsonObject serializeAddTorrentParams(const AddTorrentParams ¶ms);
diff --git a/src/base/bittorrent/announcetimepoint.h b/src/base/bittorrent/announcetimepoint.h
new file mode 100644
index 000000000000..1dd65eea72e4
--- /dev/null
+++ b/src/base/bittorrent/announcetimepoint.h
@@ -0,0 +1,36 @@
+/*
+ * Bittorrent Client using Qt and libtorrent.
+ * Copyright (C) 2024 Vladimir Golovnev
+ *
+ * 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
+
+namespace BitTorrent
+{
+ using AnnounceTimePoint = std::chrono::high_resolution_clock::time_point;
+}
diff --git a/src/base/bittorrent/bandwidthscheduler.cpp b/src/base/bittorrent/bandwidthscheduler.cpp
index bb8d1d0a8890..5463cc36eae8 100644
--- a/src/base/bittorrent/bandwidthscheduler.cpp
+++ b/src/base/bittorrent/bandwidthscheduler.cpp
@@ -102,7 +102,7 @@ bool BandwidthScheduler::isTimeForAlternative() const
alternative = !alternative;
break;
default:
- Q_ASSERT(false);
+ Q_UNREACHABLE();
break;
}
}
diff --git a/src/base/bittorrent/bencoderesumedatastorage.cpp b/src/base/bittorrent/bencoderesumedatastorage.cpp
index 4e6d0e46ef04..1b6adfc96063 100644
--- a/src/base/bittorrent/bencoderesumedatastorage.cpp
+++ b/src/base/bittorrent/bencoderesumedatastorage.cpp
@@ -40,7 +40,6 @@
#include
#include
-#include "base/algorithm.h"
#include "base/exceptions.h"
#include "base/global.h"
#include "base/logger.h"
@@ -49,6 +48,7 @@
#include "base/tagset.h"
#include "base/utils/fs.h"
#include "base/utils/io.h"
+#include "base/utils/sslkey.h"
#include "base/utils/string.h"
#include "infohash.h"
#include "loadtorrentparams.h"
@@ -64,7 +64,7 @@ namespace BitTorrent
void store(const TorrentID &id, const LoadTorrentParams &resumeData) const;
void remove(const TorrentID &id) const;
- void storeQueue(const QVector &queue) const;
+ void storeQueue(const QList &queue) const;
private:
const Path m_resumeDataDir;
@@ -73,10 +73,20 @@ namespace BitTorrent
namespace
{
+ const char KEY_SSL_CERTIFICATE[] = "qBt-sslCertificate";
+ const char KEY_SSL_PRIVATE_KEY[] = "qBt-sslPrivateKey";
+ const char KEY_SSL_DH_PARAMS[] = "qBt-sslDhParams";
+
template
QString fromLTString(const LTStr &str)
{
- return QString::fromUtf8(str.data(), static_cast(str.size()));
+ return QString::fromUtf8(str.data(), static_cast(str.size()));
+ }
+
+ template
+ QByteArray toByteArray(const LTStr &str)
+ {
+ return {str.data(), static_cast(str.size())};
}
using ListType = lt::entry::list_type;
@@ -85,8 +95,8 @@ namespace
{
ListType entryList;
entryList.reserve(input.size());
- for (const QString &setValue : input)
- entryList.emplace_back(setValue.toStdString());
+ for (const Tag &setValue : input)
+ entryList.emplace_back(setValue.toString().toStdString());
return entryList;
}
}
@@ -105,7 +115,7 @@ BitTorrent::BencodeResumeDataStorage::BencodeResumeDataStorage(const Path &path,
}
const QRegularExpression filenamePattern {u"^([A-Fa-f0-9]{40})\\.fastresume$"_s};
- const QStringList filenames = QDir(path.data()).entryList(QStringList(u"*.fastresume"_s), QDir::Files, QDir::Unsorted);
+ const QStringList filenames = QDir(path.data()).entryList({u"*.fastresume"_s}, QDir::Files);
m_registeredTorrents.reserve(filenames.size());
for (const QString &filename : filenames)
@@ -121,10 +131,11 @@ BitTorrent::BencodeResumeDataStorage::BencodeResumeDataStorage(const Path &path,
m_asyncWorker->moveToThread(m_ioThread.get());
connect(m_ioThread.get(), &QThread::finished, m_asyncWorker, &QObject::deleteLater);
+ m_ioThread->setObjectName("BencodeResumeDataStorage m_ioThread");
m_ioThread->start();
}
-QVector BitTorrent::BencodeResumeDataStorage::registeredTorrents() const
+QList BitTorrent::BencodeResumeDataStorage::registeredTorrents() const
{
return m_registeredTorrents;
}
@@ -220,14 +231,16 @@ BitTorrent::LoadResumeDataResult BitTorrent::BencodeResumeDataStorage::loadTorre
torrentParams.firstLastPiecePriority = resumeDataRoot.dict_find_int_value("qBt-firstLastPiecePriority");
torrentParams.seedingTimeLimit = resumeDataRoot.dict_find_int_value("qBt-seedingTimeLimit", Torrent::USE_GLOBAL_SEEDING_TIME);
torrentParams.inactiveSeedingTimeLimit = resumeDataRoot.dict_find_int_value("qBt-inactiveSeedingTimeLimit", Torrent::USE_GLOBAL_INACTIVE_SEEDING_TIME);
+ torrentParams.shareLimitAction = Utils::String::toEnum(
+ fromLTString(resumeDataRoot.dict_find_string_value("qBt-shareLimitAction")), ShareLimitAction::Default);
torrentParams.savePath = Profile::instance()->fromPortablePath(
- Path(fromLTString(resumeDataRoot.dict_find_string_value("qBt-savePath"))));
+ Path(fromLTString(resumeDataRoot.dict_find_string_value("qBt-savePath"))));
torrentParams.useAutoTMM = torrentParams.savePath.isEmpty();
if (!torrentParams.useAutoTMM)
{
torrentParams.downloadPath = Profile::instance()->fromPortablePath(
- Path(fromLTString(resumeDataRoot.dict_find_string_value("qBt-downloadPath"))));
+ Path(fromLTString(resumeDataRoot.dict_find_string_value("qBt-downloadPath"))));
}
// TODO: The following code is deprecated. Replace with the commented one after several releases in 4.4.x.
@@ -250,7 +263,13 @@ BitTorrent::LoadResumeDataResult BitTorrent::BencodeResumeDataStorage::loadTorre
// === END REPLACEMENT CODE === //
torrentParams.stopCondition = Utils::String::toEnum(
- fromLTString(resumeDataRoot.dict_find_string_value("qBt-stopCondition")), Torrent::StopCondition::None);
+ fromLTString(resumeDataRoot.dict_find_string_value("qBt-stopCondition")), Torrent::StopCondition::None);
+ torrentParams.sslParameters =
+ {
+ .certificate = QSslCertificate(toByteArray(resumeDataRoot.dict_find_string_value(KEY_SSL_CERTIFICATE))),
+ .privateKey = Utils::SSLKey::load(toByteArray(resumeDataRoot.dict_find_string_value(KEY_SSL_PRIVATE_KEY))),
+ .dhParams = toByteArray(resumeDataRoot.dict_find_string_value(KEY_SSL_DH_PARAMS))
+ };
const lt::string_view ratioLimitString = resumeDataRoot.dict_find_string_value("qBt-ratioLimit");
if (ratioLimitString.empty())
@@ -263,7 +282,7 @@ BitTorrent::LoadResumeDataResult BitTorrent::BencodeResumeDataStorage::loadTorre
{
for (int i = 0; i < tagsNode.list_size(); ++i)
{
- const QString tag = fromLTString(tagsNode.list_string_value_at(i));
+ const Tag tag {fromLTString(tagsNode.list_string_value_at(i))};
torrentParams.tags.insert(tag);
}
}
@@ -274,7 +293,6 @@ BitTorrent::LoadResumeDataResult BitTorrent::BencodeResumeDataStorage::loadTorre
if (!metadata.isEmpty())
{
- const auto *pref = Preferences::instance();
const lt::bdecode_node torentInfoRoot = lt::bdecode(metadata, ec
, nullptr, pref->getBdecodeDepthLimit(), pref->getBdecodeTokenLimit());
if (ec)
@@ -288,6 +306,16 @@ BitTorrent::LoadResumeDataResult BitTorrent::BencodeResumeDataStorage::loadTorre
return nonstd::make_unexpected(tr("Cannot parse torrent info: %1").arg(QString::fromStdString(ec.message())));
p.ti = torrentInfo;
+
+#ifdef QBT_USES_LIBTORRENT2
+ if (((p.info_hashes.has_v1() && (p.info_hashes.v1 != p.ti->info_hashes().v1))
+ || (p.info_hashes.has_v2() && (p.info_hashes.v2 != p.ti->info_hashes().v2))))
+#else
+ if (!p.info_hash.is_all_zeros() && (p.info_hash != p.ti->info_hash()))
+#endif
+ {
+ return nonstd::make_unexpected(tr("Mismatching info-hash detected in resume data"));
+ }
}
p.save_path = Profile::instance()->fromPortablePath(
@@ -326,7 +354,7 @@ void BitTorrent::BencodeResumeDataStorage::remove(const TorrentID &id) const
});
}
-void BitTorrent::BencodeResumeDataStorage::storeQueue(const QVector &queue) const
+void BitTorrent::BencodeResumeDataStorage::storeQueue(const QList &queue) const
{
QMetaObject::invokeMethod(m_asyncWorker, [this, queue]()
{
@@ -391,6 +419,8 @@ void BitTorrent::BencodeResumeDataStorage::Worker::store(const TorrentID &id, co
data["qBt-ratioLimit"] = static_cast(resumeData.ratioLimit * 1000);
data["qBt-seedingTimeLimit"] = resumeData.seedingTimeLimit;
data["qBt-inactiveSeedingTimeLimit"] = resumeData.inactiveSeedingTimeLimit;
+ data["qBt-shareLimitAction"] = Utils::String::fromEnum(resumeData.shareLimitAction).toStdString();
+
data["qBt-category"] = resumeData.category.toStdString();
data["qBt-tags"] = setToEntryList(resumeData.tags);
data["qBt-name"] = resumeData.name.toStdString();
@@ -399,6 +429,13 @@ void BitTorrent::BencodeResumeDataStorage::Worker::store(const TorrentID &id, co
data["qBt-firstLastPiecePriority"] = resumeData.firstLastPiecePriority;
data["qBt-stopCondition"] = Utils::String::fromEnum(resumeData.stopCondition).toStdString();
+ if (!resumeData.sslParameters.certificate.isNull())
+ data[KEY_SSL_CERTIFICATE] = resumeData.sslParameters.certificate.toPem().toStdString();
+ if (!resumeData.sslParameters.privateKey.isNull())
+ data[KEY_SSL_PRIVATE_KEY] = resumeData.sslParameters.privateKey.toPem().toStdString();
+ if (!resumeData.sslParameters.dhParams.isEmpty())
+ data[KEY_SSL_DH_PARAMS] = resumeData.sslParameters.dhParams.toStdString();
+
if (!resumeData.useAutoTMM)
{
data["qBt-savePath"] = Profile::instance()->toPortablePath(resumeData.savePath).data().toStdString();
@@ -423,7 +460,7 @@ void BitTorrent::BencodeResumeDataStorage::Worker::remove(const TorrentID &id) c
Utils::Fs::removeFile(m_resumeDataDir / torrentFilename);
}
-void BitTorrent::BencodeResumeDataStorage::Worker::storeQueue(const QVector &queue) const
+void BitTorrent::BencodeResumeDataStorage::Worker::storeQueue(const QList &queue) const
{
QByteArray data;
data.reserve(((BitTorrent::TorrentID::length() * 2) + 1) * queue.size());
diff --git a/src/base/bittorrent/bencoderesumedatastorage.h b/src/base/bittorrent/bencoderesumedatastorage.h
index 9e7820e99017..38c10d865ef6 100644
--- a/src/base/bittorrent/bencoderesumedatastorage.h
+++ b/src/base/bittorrent/bencoderesumedatastorage.h
@@ -29,7 +29,7 @@
#pragma once
#include
-#include
+#include
#include "base/pathfwd.h"
#include "base/utils/thread.h"
@@ -37,7 +37,6 @@
#include "resumedatastorage.h"
class QByteArray;
-class QThread;
namespace BitTorrent
{
@@ -49,18 +48,18 @@ namespace BitTorrent
public:
explicit BencodeResumeDataStorage(const Path &path, QObject *parent = nullptr);
- QVector registeredTorrents() const override;
+ QList registeredTorrents() const override;
LoadResumeDataResult load(const TorrentID &id) const override;
void store(const TorrentID &id, const LoadTorrentParams &resumeData) const override;
void remove(const TorrentID &id) const override;
- void storeQueue(const QVector &queue) const override;
+ void storeQueue(const QList &queue) const override;
private:
void doLoadAll() const override;
void loadQueue(const Path &queueFilename);
LoadResumeDataResult loadTorrentResumeData(const QByteArray &data, const QByteArray &metadata) const;
- QVector m_registeredTorrents;
+ QList m_registeredTorrents;
Utils::Thread::UniquePtr m_ioThread;
class Worker;
diff --git a/src/base/bittorrent/categoryoptions.cpp b/src/base/bittorrent/categoryoptions.cpp
index d4f250e79d8f..fec609ff7e5e 100644
--- a/src/base/bittorrent/categoryoptions.cpp
+++ b/src/base/bittorrent/categoryoptions.cpp
@@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
- * Copyright (C) 2021 Vladimir Golovnev
+ * Copyright (C) 2021-2023 Vladimir Golovnev
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -67,12 +67,6 @@ QJsonObject BitTorrent::CategoryOptions::toJSON() const
};
}
-bool BitTorrent::operator==(const BitTorrent::CategoryOptions::DownloadPathOption &left, const BitTorrent::CategoryOptions::DownloadPathOption &right)
-{
- return ((left.enabled == right.enabled)
- && (left.path == right.path));
-}
-
bool BitTorrent::operator==(const BitTorrent::CategoryOptions &left, const BitTorrent::CategoryOptions &right)
{
return ((left.savePath == right.savePath)
diff --git a/src/base/bittorrent/categoryoptions.h b/src/base/bittorrent/categoryoptions.h
index 6f834ea486e2..cbf8fedcefa7 100644
--- a/src/base/bittorrent/categoryoptions.h
+++ b/src/base/bittorrent/categoryoptions.h
@@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
- * Copyright (C) 2021 Vladimir Golovnev
+ * Copyright (C) 2021-2023 Vladimir Golovnev
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -33,6 +33,7 @@
#include
#include "base/path.h"
+#include "downloadpathoption.h"
class QJsonObject;
@@ -40,12 +41,6 @@ namespace BitTorrent
{
struct CategoryOptions
{
- struct DownloadPathOption
- {
- bool enabled;
- Path path;
- };
-
Path savePath;
std::optional downloadPath;
@@ -53,6 +48,5 @@ namespace BitTorrent
QJsonObject toJSON() const;
};
- bool operator==(const CategoryOptions::DownloadPathOption &left, const CategoryOptions::DownloadPathOption &right);
bool operator==(const CategoryOptions &left, const CategoryOptions &right);
}
diff --git a/src/base/bittorrent/customstorage.cpp b/src/base/bittorrent/customstorage.cpp
index c4957ef075ed..9134b1507d23 100644
--- a/src/base/bittorrent/customstorage.cpp
+++ b/src/base/bittorrent/customstorage.cpp
@@ -240,11 +240,11 @@ void CustomDiskIOThread::handleCompleteFiles(lt::storage_index_t storage, const
lt::storage_interface *customStorageConstructor(const lt::storage_params ¶ms, lt::file_pool &pool)
{
- return new CustomStorage {params, pool};
+ return new CustomStorage(params, pool);
}
CustomStorage::CustomStorage(const lt::storage_params ¶ms, lt::file_pool &filePool)
- : lt::default_storage {params, filePool}
+ : lt::default_storage(params, filePool)
, m_savePath {params.path}
{
}
diff --git a/src/base/bittorrent/dbresumedatastorage.cpp b/src/base/bittorrent/dbresumedatastorage.cpp
index 3d92d3628345..d9320e5286da 100644
--- a/src/base/bittorrent/dbresumedatastorage.cpp
+++ b/src/base/bittorrent/dbresumedatastorage.cpp
@@ -41,6 +41,7 @@
#include
#include
+#include