Compare commits

..

1 Commits

Author SHA1 Message Date
sledgehammer999
b9164adb7a Bump to 4.4.0 2022-01-06 20:41:17 +02:00
1223 changed files with 158691 additions and 233238 deletions

View File

@@ -51,14 +51,8 @@ before_build:
build_script:
- cd "%REPO_DIR%"
# lupdate chokes when it parses headers from system inludes, especially Boost
# it also chokes with the sources from src/app/qtlocalpeer (formerly qtsingleapplication)
# Workaround: temporarily rename them to run lupdate with the .pro file
- RENAME conf.pri conf.pri.temp
- RENAME src\app\qtlocalpeer qtlocalpeer.temp
- lupdate qbittorrent.pro
- RENAME conf.pri.temp conf.pri
- RENAME src\app\qtlocalpeer.temp qtlocalpeer
# scan only as lupdate is prone to hang
- lupdate -extensions c,cpp,h,hpp,ui .
- qmake qbittorrent.pro && cd src && qmake src.pro
- jom -j2 -f Makefile.Release

8
.gitattributes vendored
View File

@@ -1,7 +1,7 @@
core.eol=lf
* text eol=lf
*.icns binary
*.ico binary
*.png binary
*.qm binary
*.zip binary
*.png binary
*.ico binary
*.qm binary
*.icns binary

View File

@@ -14,7 +14,7 @@ body:
#### 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.
- (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.
- 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.
- 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.

View File

@@ -2,22 +2,16 @@ name: CI - File health
on: [pull_request, push]
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@v3
uses: actions/checkout@v2
- name: Install tools
uses: actions/setup-python@v4
with:
python-version: "*"
uses: actions/setup-python@v2
- name: Check files
uses: pre-commit/action@v3.0.0
uses: pre-commit/action@v2.0.3

View File

@@ -1,11 +1,6 @@
name: CI - macOS
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs:
ci:
name: Build
@@ -14,44 +9,34 @@ jobs:
strategy:
fail-fast: false
matrix:
libt_version: ["2.0.7", "1.2.17"]
libt_version: ["2.0.5", "1.2.15"]
qbt_gui: ["GUI=ON", "GUI=OFF"]
qt_version: ["5.15.2", "6.2.0"]
exclude:
- libt_version: "1.2.17"
- libt_version: "1.2.15"
qt_version: "6.2.0"
env:
boost_path: "${{ github.workspace }}/../boost"
openssl_root: /usr/local/opt/openssl@1.1
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Install dependencies
run: |
brew update > /dev/null
brew install \
cmake ninja \
openssl@1.1 zlib
boost openssl@1.1 zlib
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
- name: Install boost
run: |
curl \
-L \
-o "${{ runner.temp }}/boost.tar.bz2" \
"https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2"
tar -xf "${{ runner.temp }}/boost.tar.bz2" -C "${{ github.workspace }}/.."
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
- name: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt_version }}
@@ -69,7 +54,6 @@ jobs:
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBOOST_ROOT="${{ env.boost_path }}" \
-Ddeprecated-functions=OFF \
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
cmake --build build
@@ -78,50 +62,43 @@ jobs:
- name: Build qBittorrent (Qt5)
if: ${{ startsWith(matrix.qt_version, 5) }}
run: |
lupdate -extensions c,cpp,h,hpp,ui ./
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_FLAGS="-Werror -Wno-error=deprecated-declarations" \
-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 }}
cmake --build build --target qbt_update_translations
cmake --build build
cmake --build build --target check
- name: Build qBittorrent (Qt6)
if: ${{ startsWith(matrix.qt_version, 6) }}
run: |
lupdate -extensions c,cpp,h,hpp,ui ./
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_FLAGS="-Werror -Wno-error=deprecated-declarations" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBOOST_ROOT="${{ env.boost_path }}" \
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
-DQT6=ON \
-DTESTING=ON \
-DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }}
cmake --build build --target qbt_update_translations
cmake --build build
cmake --build build --target check
- name: Prepare build artifacts
run: |
mkdir upload
mv build/qbittorrent*.app upload
mkdir upload/cmake
cp build/compile_commands.json upload/cmake
mkdir upload/cmake/libtorrent
cp libtorrent/build/compile_commands.json upload/cmake/libtorrent
- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: build-info_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
path: upload

View File

@@ -1,29 +1,24 @@
name: CI - Ubuntu
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs:
ci:
name: Build
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
libt_version: ["2.0.7", "1.2.17"]
libt_version: ["2.0.5", "1.2.15"]
qbt_gui: ["GUI=ON", "GUI=OFF"]
qt_version: ["5.15.2", "6.2.0"]
exclude:
- libt_version: "1.2.17"
- libt_version: "1.2.15"
qt_version: "6.2.0"
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Install dependencies
run: |
@@ -40,7 +35,7 @@ jobs:
max_size=2G
- name: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt_version }}
@@ -64,38 +59,32 @@ jobs:
- name: Build qBittorrent (Qt5)
if: ${{ startsWith(matrix.qt_version, 5) }}
run: |
lupdate -extensions c,cpp,h,hpp,ui ./
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_FLAGS="-Werror -Wno-error=deprecated-declarations" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DTESTING=ON \
-DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }}
cmake --build build --target qbt_update_translations
cmake --build build
cmake --build build --target check
DESTDIR="qbittorrent" cmake --install build
- name: Build qBittorrent (Qt6)
if: ${{ startsWith(matrix.qt_version, 6) }}
run: |
lupdate -extensions c,cpp,h,hpp,ui ./
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_FLAGS="-Werror" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DQT6=ON \
-DTESTING=ON \
-DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }}
cmake --build build --target qbt_update_translations
cmake --build build
cmake --build build --target check
DESTDIR="qbittorrent" cmake --install build
- name: Prepare build artifacts
@@ -107,7 +96,7 @@ jobs:
cp libtorrent/build/compile_commands.json upload/cmake/libtorrent
- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: build-info_ubuntu-x64_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
name: build-info_ubuntu-20.04-x64_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
path: upload

View File

@@ -2,10 +2,6 @@ name: CI - WebUI
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs:
ci:
name: Check
@@ -17,10 +13,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Setup nodejs
uses: actions/setup-node@v3
uses: actions/setup-node@v2
with:
node-version: 'lts/*'

View File

@@ -1,11 +1,6 @@
name: CI - Windows
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs:
ci:
name: Build
@@ -14,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
libt_version: ["2.0.7", "1.2.17"]
libt_version: ["2.0.5", "1.2.15"]
env:
boost_path: "${{ github.workspace }}/../boost"
@@ -22,7 +17,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Setup devcmd
uses: ilammy/msvc-dev-cmd@v1
@@ -34,10 +29,11 @@ jobs:
# 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@v10
uses: lukka/run-vcpkg@v7
with:
vcpkgDirectory: C:/vcpkg
doNotUpdateVcpkg: true # the preinstalled vcpkg is updated regularly
setupOnly: true
- name: Install dependencies from vcpkg
run: |
@@ -67,16 +63,16 @@ jobs:
- name: Install boost
run: |
aria2c `
"https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.7z" `
"https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.7z" `
-d "${{ runner.temp }}" `
-o "boost.7z"
7z x "${{ runner.temp }}/boost.7z" -o"${{ github.workspace }}/.."
move "${{ github.workspace }}/../boost_*" "${{ env.boost_path }}"
- name: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v2
with:
version: "6.3.0"
version: "5.15.2"
- name: Install libtorrent
run: |
@@ -90,7 +86,6 @@ jobs:
-B build `
-G "Ninja" `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_CXX_FLAGS=/guard:cf `
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
-DCMAKE_INSTALL_PREFIX="${{ env.libtorrent_path }}" `
-DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
@@ -104,24 +99,20 @@ jobs:
- name: Build qBittorrent
run: |
lupdate -extensions c,cpp,h,hpp,ui .
cmake `
-B build `
-G "Ninja" `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_CXX_FLAGS="/WX" `
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
-DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
-DBOOST_ROOT="${{ env.boost_path }}" `
-DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/lib/cmake/LibtorrentRasterbar" `
-DMSVC_RUNTIME_DYNAMIC=OFF `
-DQT6=ON `
-DTESTING=ON `
-DVCPKG_TARGET_TRIPLET=x64-windows-static-release `
-DVERBOSE_CONFIGURE=ON `
--graphviz=build/target_graph.dot
cmake --build build --target qbt_update_translations
cmake --build build
cmake --build build --target check
- name: Prepare build artifacts
run: |
@@ -130,24 +121,25 @@ jobs:
copy build/qbittorrent.pdb upload
copy dist/windows/qt.conf upload
# runtimes
copy "${{ env.Qt6_DIR }}/bin/Qt6Core.dll" upload
copy "${{ env.Qt6_DIR }}/bin/Qt6Gui.dll" upload
copy "${{ env.Qt6_DIR }}/bin/Qt6Network.dll" upload
copy "${{ env.Qt6_DIR }}/bin/Qt6Sql.dll" upload
copy "${{ env.Qt6_DIR }}/bin/Qt6Svg.dll" upload
copy "${{ env.Qt6_DIR }}/bin/Qt6Widgets.dll" upload
copy "${{ env.Qt6_DIR }}/bin/Qt6Xml.dll" upload
copy "${{ env.Qt5_DIR }}/bin/Qt5Core.dll" upload
copy "${{ env.Qt5_DIR }}/bin/Qt5Gui.dll" upload
copy "${{ env.Qt5_DIR }}/bin/Qt5Network.dll" upload
copy "${{ env.Qt5_DIR }}/bin/Qt5Sql.dll" upload
copy "${{ env.Qt5_DIR }}/bin/Qt5Svg.dll" upload
copy "${{ env.Qt5_DIR }}/bin/Qt5Widgets.dll" upload
copy "${{ env.Qt5_DIR }}/bin/Qt5WinExtras.dll" upload
copy "${{ env.Qt5_DIR }}/bin/Qt5Xml.dll" upload
mkdir upload/plugins/iconengines
copy "${{ env.Qt6_DIR }}/plugins/iconengines/qsvgicon.dll" upload/plugins/iconengines
copy "${{ env.Qt5_DIR }}/plugins/iconengines/qsvgicon.dll" upload/plugins/iconengines
mkdir upload/plugins/imageformats
copy "${{ env.Qt6_DIR }}/plugins/imageformats/qico.dll" upload/plugins/imageformats
copy "${{ env.Qt6_DIR }}/plugins/imageformats/qsvg.dll" upload/plugins/imageformats
copy "${{ env.Qt5_DIR }}/plugins/imageformats/qico.dll" upload/plugins/imageformats
copy "${{ env.Qt5_DIR }}/plugins/imageformats/qsvg.dll" upload/plugins/imageformats
mkdir upload/plugins/platforms
copy "${{ env.Qt6_DIR }}/plugins/platforms/qwindows.dll" upload/plugins/platforms
copy "${{ env.Qt5_DIR }}/plugins/platforms/qwindows.dll" upload/plugins/platforms
mkdir upload/plugins/sqldrivers
copy "${{ env.Qt6_DIR }}/plugins/sqldrivers/qsqlite.dll" upload/plugins/sqldrivers
copy "${{ env.Qt5_DIR }}/plugins/sqldrivers/qsqlite.dll" upload/plugins/sqldrivers
mkdir upload/plugins/styles
copy "${{ env.Qt6_DIR }}/plugins/styles/qwindowsvistastyle.dll" upload/plugins/styles
copy "${{ env.Qt5_DIR }}/plugins/styles/qwindowsvistastyle.dll" upload/plugins/styles
# cmake additionals
mkdir upload/cmake
copy build/compile_commands.json upload/cmake
@@ -156,7 +148,7 @@ jobs:
copy libtorrent/build/compile_commands.json upload/cmake/libtorrent
- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: qBittorrent-CI_Windows-x64_libtorrent-${{ matrix.libt_version }}
path: upload

View File

@@ -8,11 +8,10 @@ on:
jobs:
coverity_scan:
name: Scan
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Install dependencies
run: |
@@ -22,14 +21,14 @@ jobs:
libboost-dev libssl-dev zlib1g-dev
- name: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v2
with:
version: "6.3.0"
version: "5.15.2"
- name: Install libtorrent
run: |
git clone \
--branch "v2.0.7" \
--branch "v2.0.5" \
--depth 1 \
--recurse-submodules \
https://github.com/arvidn/libtorrent.git

View File

@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Mark and close stale PRs
uses: actions/stale@v5
uses: actions/stale@v4
with:
stale-pr-message: "This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity."
close-pr-message: "This PR was closed because it has been stalled for some time with no activity."

View File

@@ -5,15 +5,11 @@ repos:
name: Check newline characters in <translation> tag
entry: .github/workflows/check_translation_tag.py
language: script
exclude: |
(?x)^(
src/lang/.*
)$
types_or:
- ts
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.3.0
rev: v4.0.1
hooks:
- id: check-json
name: Check JSON files

87
AUTHORS
View File

@@ -29,8 +29,16 @@ Code from other projects:
copyright: Dan Haim <negativeiq@users.sourceforge.net>
license: BSD
* file src/app/stacktrace.h
copyright: Timo Bingmann from http://idlebox.net/
license: WTFPL v2.0
* file src/app/stacktrace_win.h
copyright: Quassel Project
license: GPLv2/3
Images Authors:
* files: src/icons/qbittorrent-tray.svg
* files: src/icons/skin/qbittorrent-tray.svg (and related pngs)
copyright: Provided by HVS <hvs linuxmail org> (raster first proposal) and Atif Afzal(@atfzl github) <atif5801@gmail.com> (vectorized and modified)
license: GPLv2+
@@ -38,53 +46,56 @@ Images Authors:
copyright: 'uknown.svg' (LGPLv3+) from Oxygen Icon Theme was used as base which was slightly modified and 'qbittorrent-tray.svg' (GPLv2+) was overlayed above it.
license: GPLv3+
* files: src/icons/flags/*.svg
copyright: lipis/flag-icons
license: MIT
url: https://github.com/lipis/flag-icons/
* files: src/icons/*.png
copyright: Gnome Icon Theme
license: GPLv2
url: http://ftp.acc.umu.se/pub/GNOME/sources/gnome-icon-theme
* file: src/webui/www/private/images/tabs.gif
* files: src/oxygen/*.png
copyright: Oxygen Icon Theme (KDE)
license: LGPL
url: http://www.oxygen-icons.org
* files: src/icons/flags/*.svg
copyright: lipis/flag-icon-css
license: MIT
url: https://github.com/lipis/flag-icon-css/
* files: src/icons/skin/*.png
files: src/menuicons/YYxYY/*.png
copyright: Mateusz Tobola <tobejodok@qbittorrent.org>
license: GPLv2
* file: src/icons/tabs.gif
copyright: Greg Houston <gregory.houston@gmail.com>
license: MIT
* file: src/icons/qbittorrent-tray-dark.svg src/icons/qbittorrent-tray-light.svg
* file: src/icons/skin/qbittorrent_mono*
copyright: Daniel Eguren <deguren@gmail.com>
modified by: Nowshed H. Imran <nowshed.imran@gmail.com> (@now-im)
license: LGPL
* folder: src/icons/
files: application-rss+xml.svg, application-x-mswinurl.svg, connected.svg, disconnected.svg, checked-completed.svg, configure.svg,
edit-copy.svg, edit-rename.svg, folder-documents.svg, folder-new.svg, folder-remote.svg, go-bottom.svg, go-down.svg, go-top.svg,
go-up.svg, hash.svg, inode-directory.svg, insert-link.svg, kt-magnet.svg, media-playback-pause.svg, media-playback-start.svg,
media-seek-forward.svg, network-connect.svg, object-locked.svg, queued.svg, ratio.svg, reannounce.svg, slow_off.svg, slow.svg,
speedometer.svg, system-log-out.svg, tags.svg, task-complete.svg, task-reject.svg, tracker-error.svg, tracker-warning.svg,
trackerless.svg, trackers.svg, view-categories.svg
copyright: Nowshed H. Imran <nowshed.imran@gmail.com> (@now-im) modified from La-Capitaine icon theme (https://github.com/keeferrourke/la-capitaine-icon-theme)
license: GPLv3+
* file: src/search_engine/engines/btjunkie.png
copyright: Downloaded from btjunkie.org
* folder: src/icons/
files: application-exit.svg, collapse.svg, dialog-warning.svg, edit-find-user.svg, edit-find.svg, filter-all.svg, firewalled.svg,
help-about.svg, help-contents.svg, ip-blocked.svg, list-remove.svg, loading.svg, mail-folder-inbox.svg, name.svg, network-server.svg,
office-chart-line.svg, plugins.svg, preferences-desktop.svg, preferences-other.svg, preferences-system-network.svg, security-high.svg,
security-low.svg, set-location.svg, torrent-creator.svg, user-group-delete.svg, user-group-new.svg, view-preview.svg, view-refresh.svg,
view-statistics.svg, wallet-open.svg, webuiapplication-exit.svg, collapse.svg, dialog-warning.svg, edit-find-user.svg, edit-find.svg,
filter-all.svg, firewalled.svg, help-about.svg, help-contents.svg, ip-blocked.svg, list-remove.svg, loading.svg, mail-folder-inbox.svg,
name.svg, network-server.svg, office-chart-line.svg, plugins.svg, preferences-desktop.svg, preferences-other.svg,
preferences-system-network.svg, security-high.svg, security-low.svg, set-location.svg, torrent-creator.svg, user-group-delete.svg,
user-group-new.svg, view-preview.svg, view-refresh.svg, view-statistics.svg, wallet-open.svg, webui.svg
copyright: Nowshed H. Imran <nowshed.imran@gmail.com> (@now-im) modified from Ionicons icon theme (https://github.com/ionic-team/ionicons)
license: MIT
* file: src/search_engine/engines/isohunt.png
copyright: Downloaded from isohunt.com
* folder: src/icons/
files: force-recheck.svg
copyright: Nowshed H. Imran <nowshed.imran@gmail.com> (@now-im) modified from Font-Awesome icon theme (https://github.com/FortAwesome/Font-Awesome)
license: CC BY 4.0 License
* file: src/search_engine/engines/mininova.png
copyright: Downloaded from mininova.org
* folder: src/icons/
files: downloading.svg, edit-clear.svg, error.svg, filter-active.svg, filter-inactive.svg, filter-stalled.svg, kt-set-max-download-speed.svg,
kt-set-max-upload-speed.svg, list-add.svg, preferences-web-browser-cookies.svg, stalledDL.svg, stalledUP.svg
copyright: Nowshed H. Imran <nowshed.imran@gmail.com> (@now-im)
license: BSD 2-Clause License
* file: src/search_engine/engines/piratebay.png
copyright: Downloaded from thepiratebay.org
* file: src/search_engine/engines/torrentreactor.png
copyright: Downloaded from torrentreactor.net
* file: src/icons/oxygen/checked.png
copyright: Victor Buinsky <allok.victor@gmail.com>
* file: src/icons/skin/ratio.png
copyright: Fatcow Web Hosting
license: Creative Commons Attribution 3.0 License
url: http://www.fatcow.com/free-icons
Translations authors:
* files: src/lang/*.ts

View File

@@ -1,65 +1,67 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR) # Policies <= CMP0097 default to NEW
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
project(qBittorrent
DESCRIPTION "The qBittorrent BitTorrent client"
HOMEPAGE_URL "https://www.qbittorrent.org/"
LANGUAGES CXX
)
# use CONFIG mode first in find_package
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
# version requirements - older versions may work, but you are on your own
set(minBoostVersion 1.71)
set(minBoostVersion 1.65)
set(minQt5Version 5.15.2)
set(minQt6Version 6.2)
set(minOpenSSLVersion 1.1.1)
set(minLibtorrent1Version 1.2.14)
set(minLibtorrentVersion 2.0.7)
set(minLibtorrentVersion 2.0.4)
set(minZlibVersion 1.2.11)
# features (some are platform-specific)
include(CheckCXXSourceCompiles) # TODO: migrate to CheckSourceCompiles in CMake >= 3.19
include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
include(FeatureSummary)
include(FeatureOptionsSetup)
# features, list is loosely sorted by user's interests
feature_option(QT6 "Use Qt6" OFF)
feature_option(STACKTRACE "Enable stacktraces" ON)
feature_option(GUI "Build GUI application" ON)
feature_option(WEBUI "Enable built-in HTTP server for remote control" ON)
feature_option(QT6 "Build with Qt 6 instead of Qt 5" OFF)
feature_option(STACKTRACE "Enable stacktrace support" ON)
feature_option(TESTING "Build internal testing suite" OFF)
feature_option(WEBUI "Enables built-in HTTP server for headless use" ON)
feature_option(VERBOSE_CONFIGURE "Show information about PACKAGES_FOUND and PACKAGES_NOT_FOUND in the configure output (only useful for debugging the CMake build scripts)" OFF)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
feature_option_dependent(DBUS
"Enable support for notifications and power-management features via D-Bus on Linux"
"Enables support for notifications and power-management features on Linux via D-Bus"
ON "GUI" OFF
)
feature_option_dependent(SYSTEMD
"Install systemd service file. Target directory is overridable with `SYSTEMD_SERVICES_INSTALL_DIR` variable"
"Install systemd service file to a directory manually overridable with Systemd_SERVICES_INSTALL_DIR"
OFF "NOT GUI" OFF
)
if (STACKTRACE)
check_cxx_source_compiles(
"#include <execinfo.h>
int main(){return 0;}"
QBITTORRENT_HAS_EXECINFO_H
)
if (NOT QBITTORRENT_HAS_EXECINFO_H)
message(FATAL_ERROR "execinfo.h header file not found.\n"
"Please either disable the STACKTRACE feature or use a libc that has this header file, such as glibc (GNU libc)."
)
endif()
endif()
elseif (MSVC)
feature_option(MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" ON)
endif()
include(GNUInstallDirs)
add_subdirectory(src)
add_subdirectory(dist)
if (VERBOSE_CONFIGURE)
feature_summary(WHAT ALL)
else()
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
endif()
# go check the packages
include(CheckPackages)
# configure for specific platform
include(CommonConfig)
# Generate version header
configure_file("src/base/version.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/src/base/version.h" @ONLY)
add_subdirectory(src)
add_subdirectory(dist)
if (TESTING)
add_subdirectory(test)
endif()

View File

@@ -1,7 +1,6 @@
# Coding Guidelines
All new code **must** follow the following coding guidelines.
All new code **must** follow the following coding guidelines. \
If you make changes in a file that still uses another coding style, make sure that you follow these guidelines for your changes. \
For programming languages other than C++ (e.g. JavaScript) used in this repository and submodules, unless otherwise specified, coding guidelines listed here applies as much as possible.
@@ -457,8 +456,8 @@ class ExampleWidget : public QWidget
* Prefer pre-increment, pre-decrement operators
```c++
++i, --j; // yes
i++, j--; // no
++i, --j; // Yes
i++, j--; // No
```
* private/public/protected must not be indented

View File

@@ -23,7 +23,7 @@ Read the respective section to find out more.
* **Be patient.** The development team is small and resource limited. Developers and contributors take from their free time to analyze the problem and fix the issue. :clock3:
* Harsh words or threats won't help your situation. Your complaint will (very likely) be **ignored.** :fearful:
* Harsh words or threats won't help your situation. What's worse, your complain will (very likely) be **ignored.** :fearful:
# Submitting an issue/bug report
@@ -39,7 +39,7 @@ Developers and contributors are not supposed to deal with issues for which littl
Positive contributions are those which are reported with efforts to find the actual cause of an issue, or at the very least efforts were made to narrow it as much as possible.
Requiring people to investigate as much as possible before opening an issue avoids burdening the project with invalid issues or issues unrelated to qBittorrent.
Requiring people to investigate as much as possible before opening an issue will more than likely avoid burdening the project with invalid issues or issues unrelated to qBittorrent.
The following are _not_ bug reports. **Check the [wiki][wiki-url], [forum][forum-url] or other places for help and support for issues like these**:

349
COPYING
View File

@@ -1,6 +1,6 @@
The qBittorrent source code is licensed under the GNU General Public License, version 2 or (at your option) any later version (GPLv2+).
However, the binary distribution is licensed under GNU General Public License, version 3 or (at your option) any later version (GPLv3+),
because it contains GPLv3+ assets (eg images). In both cases, the following special exception is added:
qBittorrent is licensed under the GNU General Public License either version 2,
or (at your option) any later version with the addition of the following
special exception:
In addition, as a special exception, the copyright holders give permission to
link this program with the OpenSSL project's "OpenSSL" library (or with
@@ -13,5 +13,344 @@ exception statement from your version.
See also the AUTHORS file
See COPYING.GPLv2 file for the GPLv2
See COPYING.GPLv3 file for the GPLv3
----------
GNU GENERAL PUBLIC LICENSE
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.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
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.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 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, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -1,5 +1,3 @@
Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.5.0
Thu Jan 06 2022 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.4.0
- FEATURE: Support for v2 torrents along with libtorrent 2.0.x support (glassez, Chocobo1)
- FEATURE: Support for Qt6 (glassez)

View File

@@ -3,15 +3,15 @@ qBittorrent - A BitTorrent client in C++ / Qt
1) Install these dependencies:
- Boost >= 1.71
- Boost >= 1.65
- libtorrent-rasterbar 1.2.14 - 1.2.x || 2.0.7 - 2.0.x
- libtorrent-rasterbar 1.2.14 - 1.2.x || 2.0.4 - 2.0.x
* By Arvid Norberg, https://www.libtorrent.org/
* Be careful: another library (the one used by rTorrent) uses a similar name
- OpenSSL >= 1.1.1
- Qt 5.15.2 - 5.x || 6.2.0 - 6.x
- Qt 5.15.2 - 5.x
- zlib >= 1.2.11

4
NEWS Normal file
View File

@@ -0,0 +1,4 @@
See Changelog
*******************************************
Christophe dumez - chris@qbittorrent.org

1
TODO Normal file
View File

@@ -0,0 +1 @@
See https://blueprints.launchpad.net/qbittorrent/

View File

@@ -1,67 +0,0 @@
# use CONFIG mode first in find_package
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
macro(find_libtorrent version)
if (UNIX AND (NOT APPLE) AND (NOT CYGWIN))
find_package(LibtorrentRasterbar QUIET ${version} COMPONENTS torrent-rasterbar)
if (NOT LibtorrentRasterbar_FOUND)
include(FindPkgConfig)
pkg_check_modules(LibtorrentRasterbar IMPORTED_TARGET GLOBAL "libtorrent-rasterbar>=${version}")
if (NOT LibtorrentRasterbar_FOUND)
message(
FATAL_ERROR
"Package LibtorrentRasterbar >= ${version} not found"
" with CMake or pkg-config.\n- Set LibtorrentRasterbar_DIR to a directory containing"
" a LibtorrentRasterbarConfig.cmake file or add the installation prefix of LibtorrentRasterbar"
" to CMAKE_PREFIX_PATH.\n- Alternatively, make sure there is a valid libtorrent-rasterbar.pc"
" file in your system's pkg-config search paths (use the system environment variable PKG_CONFIG_PATH"
" to specify additional search paths if needed)."
)
endif()
add_library(LibtorrentRasterbar::torrent-rasterbar ALIAS PkgConfig::LibtorrentRasterbar)
# force a fake package to show up in the feature summary
set_property(GLOBAL APPEND PROPERTY
PACKAGES_FOUND
"LibtorrentRasterbar via pkg-config (version >= ${version})"
)
set_package_properties("LibtorrentRasterbar via pkg-config (version >= ${version})"
PROPERTIES
TYPE REQUIRED
)
else()
set_package_properties(LibtorrentRasterbar PROPERTIES TYPE REQUIRED)
endif()
else()
find_package(LibtorrentRasterbar ${version} REQUIRED COMPONENTS torrent-rasterbar)
endif()
endmacro()
find_libtorrent(${minLibtorrent1Version})
if (LibtorrentRasterbar_FOUND AND (LibtorrentRasterbar_VERSION VERSION_GREATER_EQUAL 2.0))
find_libtorrent(${minLibtorrentVersion})
endif()
# force variable type so that it always shows up in ccmake/cmake-gui frontends
set_property(CACHE LibtorrentRasterbar_DIR PROPERTY TYPE PATH)
find_package(Boost ${minBoostVersion} REQUIRED)
find_package(OpenSSL ${minOpenSSLVersion} REQUIRED)
find_package(ZLIB ${minZlibVersion} REQUIRED)
if (QT6)
find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS Core Network Sql Xml LinguistTools)
if (DBUS)
find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS DBus)
set_package_properties(Qt6DBus PROPERTIES
DESCRIPTION "Qt6 module for inter-process communication over the D-Bus protocol"
PURPOSE "Required by the DBUS feature"
)
endif()
else()
find_package(Qt5 ${minQt5Version} REQUIRED COMPONENTS Core Network Sql Xml LinguistTools)
if (DBUS)
find_package(Qt5 ${minQt5Version} REQUIRED COMPONENTS DBus)
set_package_properties(Qt5DBus PROPERTIES
DESCRIPTION "Qt5 module for inter-process communication over the D-Bus protocol"
PURPOSE "Required by the DBUS feature"
)
endif()
endif()

View File

@@ -1,106 +0,0 @@
# Set platform variables and create some interface-only library targets
# that some or all other targets will link to, either directly or transitively,
# to consume common compile options/definitions
# treat value specified by the CXX_STANDARD target property as a requirement by default
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTORCC_OPTIONS --compress 9 --threshold 5)
add_library(qbt_common_cfg INTERFACE)
# Full C++ 17 support is required
# See also https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html
# for a breakdown of the features that CMake recognizes for each C++ standard
target_compile_features(qbt_common_cfg INTERFACE
cxx_std_17
)
target_compile_definitions(qbt_common_cfg INTERFACE
QT_DISABLE_DEPRECATED_BEFORE=0x050f02
QT_NO_CAST_FROM_ASCII
QT_NO_CAST_TO_ASCII
QT_NO_CAST_FROM_BYTEARRAY
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
QT_USE_QSTRINGBUILDER
QT_STRICT_ITERATORS
$<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG_OUTPUT>
)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
target_compile_definitions(qbt_common_cfg INTERFACE
_DARWIN_FEATURE_64_BIT_INODE
)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_compile_definitions(qbt_common_cfg INTERFACE
NTDDI_VERSION=0x06010000
_WIN32_WINNT=0x0601
_WIN32_IE=0x0601
WIN32_LEAN_AND_MEAN
NOMINMAX
UNICODE
_UNICODE
)
endif()
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
target_compile_options(qbt_common_cfg INTERFACE
-Wall
-Wextra
-Wcast-qual
-Wcast-align
-Winvalid-pch
-Woverloaded-virtual
-Wold-style-cast
-Wnon-virtual-dtor
-pedantic
-pedantic-errors
)
# Clang 11 still doesn't support -Wstrict-null-sentinel
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wstrict-null-sentinel SNS_SUPPORT)
if (SNS_SUPPORT)
target_compile_options(qbt_common_cfg INTERFACE -Wstrict-null-sentinel)
endif()
endif()
if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
target_compile_options(qbt_common_cfg INTERFACE
-Wno-range-loop-analysis
)
endif()
if (MINGW)
target_link_options(qbt_common_cfg INTERFACE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:LINKER:--dynamicbase>)
endif()
if (MSVC)
target_compile_options(qbt_common_cfg INTERFACE
/guard:cf
/utf-8
# https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
/Zc:__cplusplus
)
target_link_options(qbt_common_cfg INTERFACE
/guard:cf
$<$<NOT:$<CONFIG:Debug>>:/OPT:REF /OPT:ICF>
# suppress linking warning due to /INCREMENTAL and /OPT:ICF being both ON
$<$<CONFIG:RelWithDebInfo>:/INCREMENTAL:NO>
)
if (MSVC_RUNTIME_DYNAMIC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
endif()
if (LibtorrentRasterbar_VERSION VERSION_GREATER_EQUAL ${minLibtorrentVersion})
target_compile_definitions(qbt_common_cfg INTERFACE QBT_USES_LIBTORRENT2)
endif()

View File

@@ -1,25 +0,0 @@
# Return Qt translations files as list of paths
# It will return .qm files of qt/qtbase that aren't stub files.
# Requires that Qt has been found first because it depends on qmake being available
function(qbt_get_qt_translations qt_translations)
get_target_property(QT_QMAKE_EXECUTABLE Qt::qmake IMPORTED_LOCATION)
execute_process(COMMAND "${QT_QMAKE_EXECUTABLE}" -query QT_INSTALL_TRANSLATIONS
OUTPUT_VARIABLE QT_TRANSLATIONS_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
FILE(GLOB QT_TEMP_TRANSLATIONS CONFIGURE_DEPENDS
"${QT_TRANSLATIONS_DIR}/qt_??.qm"
"${QT_TRANSLATIONS_DIR}/qt_??_??.qm"
"${QT_TRANSLATIONS_DIR}/qtbase_??.qm"
"${QT_TRANSLATIONS_DIR}/qtbase_??_??.qm")
foreach(TRANSLATION ${QT_TEMP_TRANSLATIONS})
FILE(SIZE "${TRANSLATION}" translation_size)
# Consider files less than 10KB as stub translations
if (translation_size GREATER_EQUAL 10240)
list(APPEND QT_FINAL_TRANSLATIONS "${TRANSLATION}")
endif()
endforeach()
SET(${qt_translations} ${QT_FINAL_TRANSLATIONS} PARENT_SCOPE)
endfunction()

View File

@@ -0,0 +1,102 @@
# Set common variables and create some interface-only library targets
# that some or all other targets will link to, either directly or transitively,
# to consume common compile options/definitions
macro(qbt_common_config)
# treat value specified by the CXX_STANDARD target property as a requirement by default
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_library(qbt_common_cfg INTERFACE)
# Full C++ 17 support is required
# See also https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html
# for a breakdown of the features that CMake recognizes for each C++ standard
target_compile_features(qbt_common_cfg INTERFACE
cxx_std_17
)
target_compile_definitions(qbt_common_cfg INTERFACE
QT_DISABLE_DEPRECATED_BEFORE=0x050f02
QT_NO_CAST_TO_ASCII
QT_NO_CAST_FROM_BYTEARRAY
QT_USE_QSTRINGBUILDER
QT_STRICT_ITERATORS
$<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG_OUTPUT>
)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
target_compile_definitions(qbt_common_cfg INTERFACE
_DARWIN_FEATURE_64_BIT_INODE
)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_compile_definitions(qbt_common_cfg INTERFACE
NTDDI_VERSION=0x06010000
_WIN32_WINNT=0x0601
_WIN32_IE=0x0601
WIN32_LEAN_AND_MEAN
NOMINMAX
UNICODE
_UNICODE
)
endif()
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
target_compile_options(qbt_common_cfg INTERFACE
-Wall
-Wextra
-Wcast-qual
-Wcast-align
-Winvalid-pch
-Woverloaded-virtual
-Wold-style-cast
-Wnon-virtual-dtor
-pedantic
-pedantic-errors
)
# Clang 11 still doesn't support -Wstrict-null-sentinel
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wstrict-null-sentinel SNS_SUPPORT)
if (SNS_SUPPORT)
target_compile_options(qbt_common_cfg INTERFACE -Wstrict-null-sentinel)
endif()
endif()
if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
target_compile_options(qbt_common_cfg INTERFACE
-Wno-range-loop-analysis
)
endif()
if (MINGW)
target_link_options(qbt_common_cfg INTERFACE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:LINKER:--dynamicbase>)
endif()
if (MSVC_RUNTIME_DYNAMIC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
if (MSVC)
target_compile_options(qbt_common_cfg INTERFACE
/guard:cf
/utf-8
# https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
/Zc:__cplusplus
)
target_link_options(qbt_common_cfg INTERFACE
/guard:cf
$<$<NOT:$<CONFIG:Debug>>:/OPT:REF /OPT:ICF>
# suppress linking warning due to /INCREMENTAL and /OPT:ICF being both ON
$<$<CONFIG:RelWithDebInfo>:/INCREMENTAL:NO>
)
endif()
if (LibtorrentRasterbar_VERSION VERSION_GREATER_EQUAL ${minLibtorrentVersion})
target_compile_definitions(qbt_common_cfg INTERFACE QBT_USES_LIBTORRENT2)
endif()
endmacro(qbt_common_config)

View File

@@ -37,8 +37,8 @@ DEFINES += BOOST_ALL_NO_LIB
# Use one of the following options
DEFINES += BOOST_SYSTEM_STATIC_LINK
#DEFINES += BOOST_SYSTEM_DYN_LINK
# Enable it if compiling with libtorrent 3.x
#DEFINES += BOOST_SYSTEM_USE_UTF8
# Enable if encountered build error with boost version <= 1.59
#DEFINES += BOOST_NO_CXX11_RVALUE_REFERENCES
# Enable if libtorrent was built with this flag defined
#DEFINES += TORRENT_NO_DEPRECATE

83
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for qbittorrent v4.5.0beta1.
# Generated by GNU Autoconf 2.71 for qbittorrent v4.4.0.
#
# Report bugs to <bugs.qbittorrent.org>.
#
@@ -611,8 +611,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='qbittorrent'
PACKAGE_TARNAME='qbittorrent'
PACKAGE_VERSION='v4.5.0beta1'
PACKAGE_STRING='qbittorrent v4.5.0beta1'
PACKAGE_VERSION='v4.4.0'
PACKAGE_STRING='qbittorrent v4.4.0'
PACKAGE_BUGREPORT='bugs.qbittorrent.org'
PACKAGE_URL='https://www.qbittorrent.org/'
@@ -1329,7 +1329,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures qbittorrent v4.5.0beta1 to adapt to many kinds of systems.
\`configure' configures qbittorrent v4.4.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1400,7 +1400,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of qbittorrent v4.5.0beta1:";;
short | recursive ) echo "Configuration of qbittorrent v4.4.0:";;
esac
cat <<\_ACEOF
@@ -1533,7 +1533,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
qbittorrent configure v4.5.0beta1
qbittorrent configure v4.4.0
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1648,7 +1648,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by qbittorrent $as_me v4.5.0beta1, which was
It was created by qbittorrent $as_me v4.4.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@@ -4779,7 +4779,7 @@ fi
# Define the identity of the package.
PACKAGE='qbittorrent'
VERSION='v4.5.0beta1'
VERSION='v4.4.0'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -5707,11 +5707,11 @@ if test "x$want_boost" = "xyes"
then :
if test "x1.71" = "x"
if test "x1.65" = "x"
then :
_AX_BOOST_BASE_TONUMERICVERSION_req="1.20.0"
else $as_nop
_AX_BOOST_BASE_TONUMERICVERSION_req="1.71"
_AX_BOOST_BASE_TONUMERICVERSION_req="1.65"
fi
_AX_BOOST_BASE_TONUMERICVERSION_req_shorten=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([0-9]*\.[0-9]*\)'`
_AX_BOOST_BASE_TONUMERICVERSION_req_major=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([0-9]*\)'`
@@ -5741,7 +5741,7 @@ fi
libsubdirs="lib64 libx32 lib lib64" ;; #(
mips*64*) :
libsubdirs="lib64 lib32 lib lib64" ;; #(
ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64|e2k) :
ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64) :
libsubdirs="lib64 lib lib64" ;; #(
*) :
libsubdirs="lib"
@@ -5751,8 +5751,6 @@ esac
case ${host_cpu} in #(
i?86) :
multiarch_libsubdir="lib/i386-${host_os}" ;; #(
armv7l) :
multiarch_libsubdir="lib/arm-${host_os}" ;; #(
*) :
multiarch_libsubdir="lib/${host_cpu}-${host_os}"
;;
@@ -5761,8 +5759,8 @@ esac
if test "x$_AX_BOOST_BASE_boost_path" != "x"
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.71 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"" >&5
printf %s "checking for boostlib >= 1.71 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.65 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"" >&5
printf %s "checking for boostlib >= 1.65 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"... " >&6; }
if test -d "$_AX_BOOST_BASE_boost_path/include" && test -r "$_AX_BOOST_BASE_boost_path/include"
then :
@@ -5770,8 +5768,8 @@ then :
printf "%s\n" "yes" >&6; }
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include"
for _AX_BOOST_BASE_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.71 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"" >&5
printf %s "checking for boostlib >= 1.71 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.65 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"" >&5
printf %s "checking for boostlib >= 1.65 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"... " >&6; }
if test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp"
then :
@@ -5816,8 +5814,8 @@ then :
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_lib_path"
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.71 ($WANT_BOOST_VERSION)" >&5
printf %s "checking for boostlib >= 1.71 ($WANT_BOOST_VERSION)... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.65 ($WANT_BOOST_VERSION)" >&5
printf %s "checking for boostlib >= 1.65 ($WANT_BOOST_VERSION)... " >&6; }
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
@@ -5988,8 +5986,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test "x$succeeded" != "xyes" ; then
if test "x$_version" = "x0" ; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: We could not detect the boost libraries (version 1.71 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&5
printf "%s\n" "$as_me: We could not detect the boost libraries (version 1.71 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: We could not detect the boost libraries (version 1.65 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&5
printf "%s\n" "$as_me: We could not detect the boost libraries (version 1.65 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&6;}
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Your boost libraries seems to old (version $_version)." >&5
printf "%s\n" "$as_me: Your boost libraries seems to old (version $_version)." >&6;}
@@ -6022,21 +6020,40 @@ LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"
# taken from ax_boost_base.m4
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <boost/version.hpp>
int
main (void)
{
(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < (106000))]));
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
else $as_nop
QBT_ADD_DEFINES="$QBT_ADD_DEFINES BOOST_NO_CXX11_RVALUE_REFERENCES"
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libtorrent-rasterbar >= 2.0.7" >&5
printf %s "checking for libtorrent-rasterbar >= 2.0.7... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libtorrent-rasterbar >= 2.0.4" >&5
printf %s "checking for libtorrent-rasterbar >= 2.0.4... " >&6; }
if test -n "$libtorrent_CFLAGS"; then
pkg_cv_libtorrent_CFLAGS="$libtorrent_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar >= 2.0.7\""; } >&5
($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar >= 2.0.7") 2>&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar >= 2.0.4\""; } >&5
($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar >= 2.0.4") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_libtorrent_CFLAGS=`$PKG_CONFIG --cflags "libtorrent-rasterbar >= 2.0.7" 2>/dev/null`
pkg_cv_libtorrent_CFLAGS=`$PKG_CONFIG --cflags "libtorrent-rasterbar >= 2.0.4" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -6048,12 +6065,12 @@ if test -n "$libtorrent_LIBS"; then
pkg_cv_libtorrent_LIBS="$libtorrent_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar >= 2.0.7\""; } >&5
($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar >= 2.0.7") 2>&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar >= 2.0.4\""; } >&5
($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar >= 2.0.4") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_libtorrent_LIBS=`$PKG_CONFIG --libs "libtorrent-rasterbar >= 2.0.7" 2>/dev/null`
pkg_cv_libtorrent_LIBS=`$PKG_CONFIG --libs "libtorrent-rasterbar >= 2.0.4" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -6074,9 +6091,9 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
libtorrent_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libtorrent-rasterbar >= 2.0.7" 2>&1`
libtorrent_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libtorrent-rasterbar >= 2.0.4" 2>&1`
else
libtorrent_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libtorrent-rasterbar >= 2.0.7" 2>&1`
libtorrent_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libtorrent-rasterbar >= 2.0.4" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$libtorrent_PKG_ERRORS" >&5
@@ -7237,7 +7254,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by qbittorrent $as_me v4.5.0beta1, which was
This file was extended by qbittorrent $as_me v4.4.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -7297,7 +7314,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
qbittorrent config.status v4.5.0beta1
qbittorrent config.status v4.4.0
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"

View File

@@ -1,4 +1,4 @@
AC_INIT([qbittorrent], [v4.5.0beta1], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
AC_INIT([qbittorrent], [v4.4.0], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
: ${CFLAGS=""}
@@ -8,7 +8,7 @@ AC_PROG_CXX
AC_PROG_SED
AC_LANG(C++)
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([foreign])
AM_INIT_AUTOMAKE
# use compiler from env variables if available
QBT_CC="$CC"
@@ -174,7 +174,7 @@ AS_CASE(["x$enable_qt_dbus"],
AC_MSG_ERROR([Unknown option "$enable_qt_dbus". Use either "yes" or "no".])])
AX_BOOST_BASE([1.71],
AX_BOOST_BASE([1.65],
[AC_MSG_NOTICE([Boost CXXFLAGS: "$BOOST_CPPFLAGS"])
AC_MSG_NOTICE([Boost LDFLAGS: "$BOOST_LDFLAGS"])],
[AC_MSG_ERROR([Could not find Boost])])
@@ -187,8 +187,11 @@ m4_define([DETECT_BOOST_VERSION_PROGRAM],
[AC_LANG_PROGRAM([[#include <boost/version.hpp>]],
[[(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < ($1))]));]])])
AC_COMPILE_IFELSE([DETECT_BOOST_VERSION_PROGRAM(106000)], [],
[QBT_ADD_DEFINES="$QBT_ADD_DEFINES BOOST_NO_CXX11_RVALUE_REFERENCES"])
PKG_CHECK_MODULES(libtorrent,
[libtorrent-rasterbar >= 2.0.7],
[libtorrent-rasterbar >= 2.0.4],
[CXXFLAGS="$libtorrent_CFLAGS $CXXFLAGS" LIBS="$libtorrent_LIBS $LIBS" QBT_ADD_DEFINES="$QBT_ADD_DEFINES QBT_USES_LIBTORRENT2"],
[PKG_CHECK_MODULES(libtorrent,
[libtorrent-rasterbar >= 1.2.14 libtorrent-rasterbar < 2],

8
dist/docker/.env vendored
View File

@@ -1,8 +0,0 @@
# refer to Readme.md for an explanation of the variables
QBT_EULA=
QBT_VERSION=devel
QBT_WEBUI_PORT=8080
QBT_CONFIG_PATH=<your_path>/config
QBT_DOWNLOADS_PATH=<your_path>/downloads

View File

@@ -1,62 +0,0 @@
# image for building
FROM alpine:latest AS builder
ARG QBT_VERSION
# alpine linux qbittorrent package: https://git.alpinelinux.org/aports/tree/community/qbittorrent/APKBUILD
RUN \
apk --update-cache add \
boost-dev \
cmake \
g++ \
libtorrent-rasterbar-dev \
ninja \
qt6-qtbase-dev \
qt6-qttools-dev
RUN \
if [ "$QBT_VERSION" = "devel" ]; then \
wget https://github.com/qbittorrent/qBittorrent/archive/refs/heads/master.zip && \
unzip master.zip && \
cd qBittorrent-master ; \
else \
wget "https://github.com/qbittorrent/qBittorrent/archive/refs/tags/release-${QBT_VERSION}.tar.gz" && \
tar -xf "release-${QBT_VERSION}.tar.gz" && \
cd "qBittorrent-release-${QBT_VERSION}" ; \
fi && \
cmake \
-B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DGUI=OFF \
-DQT6=ON \
-DSTACKTRACE=OFF && \
cmake --build build && \
cmake --install build
# image for running
FROM alpine:latest
RUN \
apk --no-cache add \
doas \
libtorrent-rasterbar \
python3 \
qt6-qtbase \
tini
RUN \
adduser \
-D \
-H \
-s /sbin/nologin \
-u 1000 \
qbtUser && \
echo "permit nopass :root" >> "/etc/doas.d/doas.conf"
COPY --from=builder /usr/local/bin/qbittorrent-nox /usr/bin/qbittorrent-nox
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/sbin/tini", "-g", "--", "/entrypoint.sh"]

101
dist/docker/Readme.md vendored
View File

@@ -1,101 +0,0 @@
# qBittorrent-nox Docker Image
This Dockerfile allows you to build a Docker Image containing qBittorrent-nox
## Prerequisites
In order to build/run this image you'll need Docker installed: https://docs.docker.com/get-docker/
If you don't need the GUI, you can just install Docker Engine: https://docs.docker.com/engine/install/
It is also recommended to install Docker Compose as it can significantly ease the process: https://docs.docker.com/compose/install/
## Building Docker Image
* If you are using Docker (not Docker Compose) then run the following commands in this folder:
```shell
export \
QBT_VERSION=devel
docker build \
--build-arg QBT_VERSION \
-t qbittorrent-nox:"$QBT_VERSION" \
.
```
* If you are using Docker Compose then you should edit `.env` file first.
You can find an explanation of the variables in the following [Parameters](#parameters) section. \
Then run the following commands in this folder:
```shell
docker compose build \
--build-arg QBT_VERSION
```
### Parameters
#### Environment variables
* `QBT_EULA` \
This environment variable defines whether you accept the end-user license agreement (EULA) of qBittorrent. \
**Put `accept` only if you understand and accepted the EULA.** You can find
the EULA [here](https://github.com/qbittorrent/qBittorrent/blob/56667e717b82c79433ecb8a5ff6cc2d7b315d773/src/app/main.cpp#L320-L323).
* `QBT_VERSION` \
This environment variable specifies the version of qBittorrent-nox to be built. \
For example, `4.4.0` is a valid entry. You can find all tagged versions [here](https://github.com/qbittorrent/qBittorrent/tags). \
Or you can put `devel` to build the latest development version.
* `QBT_WEBUI_PORT` \
This environment variable sets the port number which qBittorrent WebUI will be binded to.
#### Volumes
There are some paths involved:
* `<your_path>/config` \
Full path to a folder on your host machine which will store qBittorrent configurations.
Using relative path won't work.
* `<your_path>/downloads` \
Full path to a folder on your host machine which will store the files downloaded by qBittorrent.
Using relative path won't work.
## Running container
* Using Docker (not Docker Compose), simply run:
```shell
export \
QBT_EULA=accept \
QBT_VERSION=devel \
QBT_WEBUI_PORT=8080 \
QBT_CONFIG_PATH="/tmp/bbb/config"
QBT_DOWNLOADS_PATH="/tmp/bbb/downloads"
docker run \
-t \
--read-only \
--rm \
--tmpfs /tmp \
--name qbittorrent-nox \
-e QBT_EULA \
-e QBT_WEBUI_PORT \
-p "$QBT_WEBUI_PORT":"$QBT_WEBUI_PORT"/tcp \
-p 6881:6881/tcp \
-p 6881:6881/udp \
-v "$QBT_CONFIG_PATH":/config \
-v "$QBT_DOWNLOADS_PATH":/downloads \
qbittorrent-nox:"$QBT_VERSION"
```
* Using Docker Compose:
```shell
docker compose up
```
Then you can login at: `http://127.0.0.1:8080`
## Stopping container
* Using Docker (not Docker Compose):
```shell
docker stop -t 1800 qbittorrent-nox
```
* Using Docker Compose:
```shell
docker compose down
```

View File

@@ -1,25 +0,0 @@
version: "3.9"
services:
qbittorrent-nox:
build: .
container_name: qbittorrent-nox
environment:
- QBT_EULA=${QBT_EULA}
- QBT_VERSION=${QBT_VERSION}
- QBT_WEBUI_PORT=${QBT_WEBUI_PORT}
image: qbittorrent-nox:${QBT_VERSION}
ports:
# for bittorrent traffic
- 6881:6881/tcp
- 6881:6881/udp
# for WebUI
- ${QBT_WEBUI_PORT}:${QBT_WEBUI_PORT}/tcp
read_only: true
stop_grace_period: 30m
tmpfs:
- /tmp
tty: true
volumes:
- ${QBT_CONFIG_PATH}:/config
- ${QBT_DOWNLOADS_PATH}:/downloads

View File

@@ -1,35 +0,0 @@
#!/bin/sh
downloadsPath="/downloads"
profilePath="/config"
qbtConfigFile="$profilePath/qBittorrent/config/qBittorrent.conf"
if [ ! -f "$qbtConfigFile" ]; then
mkdir -p "$(dirname $qbtConfigFile)"
cat << EOF > "$qbtConfigFile"
[BitTorrent]
Session\DefaultSavePath=/downloads
Session\Port=6881
Session\TempPath=/downloads/temp
[LegalNotice]
Accepted=false
EOF
if [ "$QBT_EULA" = "accept" ]; then
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1true|}}' "$qbtConfigFile"
else
sed -i '/^\[LegalNotice\]$/{$!{N;s|\(\[LegalNotice\]\nAccepted=\).*|\1false|}}' "$qbtConfigFile"
fi
fi
# those are owned by root by default
# don't change existing files owner in `$downloadsPath`
chown qbtUser:qbtUser "$downloadsPath"
chown qbtUser:qbtUser -R "$profilePath"
doas -u qbtUser \
qbittorrent-nox \
--profile="$profilePath" \
--webui-port="$QBT_WEBUI_PORT" \
"$@"

2
dist/mac/Info.plist vendored
View File

@@ -55,7 +55,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.5.0</string>
<string>4.4.0</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>

BIN
dist/qt-translations/qt_fa.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qt_gl.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qt_lt.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qt_pt.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qt_sl.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qt_sv.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qt_zh_CN.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_ar.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_bg.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_ca.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_cs.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_da.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_de.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_es.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_fi.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_fr.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_gd.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_he.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_hu.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_it.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_ja.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_ko.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_lv.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_pl.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_ru.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_sk.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_tr.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_uk.qm vendored Normal file

Binary file not shown.

BIN
dist/qt-translations/qtbase_zh_TW.qm vendored Normal file

Binary file not shown.

View File

@@ -3,7 +3,7 @@
<component type="desktop">
<id>org.qbittorrent.qBittorrent</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later and OpenSSL</project_license>
<project_license>GPL-2.0 and OpenSSL</project_license>
<name>qBittorrent</name>
<summary>An open-source Bittorrent client</summary>
<description>
@@ -74,6 +74,6 @@
<url type="translate">https://github.com/qbittorrent/qBittorrent/wiki/How-to-translate-qBittorrent</url>
<content_rating type="oars-1.1"/>
<releases>
<release version="4.5.0" date="2022-01-06"/>
<release version="4.4.0" date="2022-01-06"/>
</releases>
</component>

View File

@@ -11,7 +11,9 @@ Type=Application
StartupNotify=false
StartupWMClass=qbittorrent
Keywords=bittorrent;torrent;magnet;download;p2p;
SingleMainWindow=true
# Translations
# Translations
Comment[af]=Aflaai en deel lêers oor BitTorrent
@@ -101,10 +103,10 @@ Name[it]=qBittorrent
Comment[ja]=BitTorrent でファイルをダウンロードおよび共有します
GenericName[ja]=BitTorrent クライアント
Name[ja]=qBittorrent
Comment[ka]=გადმოტვირთე და გააზიარე ფაილები BitTorrent-ის საშუალებით
Comment[ka]=ჩამოტვირთე და გააზიარე ფაილები Bittorrent-ის საშუალებით
GenericName[ka]=BitTorrent კლიენტი
Name[ka]=qBittorrent
Comment[ko]=BitTorrent를 통 파일 내려받기 및 공유
Comment[ko]=BitTorrent를 통 파일 다운로드 및 공유
GenericName[ko]=BitTorrent 클라이언트
Name[ko]=qBittorrent
Comment[lt]=Atsisiųskite bei dalinkitės failais BitTorrent tinkle
@@ -113,8 +115,6 @@ Name[lt]=qBittorrent
Comment[mk]=Превземајте и споделувајте фајлови преку BitTorrent
GenericName[mk]=BitTorrent клиент
Name[mk]=qBittorrent
Comment[my]=တောရန့်ဖြင့်ဖိုင်များဒေါင်းလုဒ်ဆွဲရန်နှင့်မျှဝေရန်
GenericName[my]=တောရန့်စီမံခန့်ခွဲသည့်အရာ
Name[my]=qBittorrent
Comment[nb]=Last ned og del filer over BitTorrent
GenericName[nb]=BitTorrent-klient
@@ -171,7 +171,7 @@ Name[ur]=qBittorrent
Comment[uk]=Завантажуйте та поширюйте файли через BitTorrent
GenericName[uk]=BitTorrent-клієнт
Name[uk]=qBittorrent
Comment[vi]=Tải xuống và chia sẻ tệp qua BitTorrent
Comment[vi]=Tải về và chia sẻ tệp qua BitTorrent
GenericName[vi]=Máy khách BitTorrent
Name[vi]=qBittorrent
Comment[zh_HK]=經由BitTorrent下載並分享檔案

View File

@@ -38,12 +38,10 @@ installer-translations
translations
qt_ar.qm
...
(All the .qm files found in the 'translations' folder of your Qt install. Those files differ between Qt5 and Qt6.
You will need the files that conform to this globbing expression 'qt_??.qm qt_??_??.qm qtbase_??.qm qtbase_??_??.qm'.
Some of those files will be stubs. Filter any file that is smaller than 10KB in size.
Alternatively you can use the 'gather_qt_translations.py' script found in the same folder as this file.
Run it with '--help' to see its usage.
**YOU MUST** edit the list of .qm files in the 'installer.nsi' to match whatever files are in the 'translations' subfolder.)
(all the .qm files found in the 'translations' folder of your Qt install. Those files differ between Qt4 and Qt5.
If you want to distribute Qt4 translations it is better to use the ones found in this repo under the path "dist/qt-translations".
They contain extra languages not distributed via the official qt4 sources.
Don't forget to edit the filelist in installer.nsi + uninstaller.nsi to include all your .qm files.)
qt_zh_TW.qm
installer.nsi
license.txt
@@ -57,7 +55,7 @@ uninstaller.nsi
5. "license.txt" is a text file that contains the text rendered
from src\gui\gpl.html
from src\gui\gpl.html or the text contained in COPYING
6. "qbittorrent.exe" is the compiled binary file.
SCRIPT HACKERS:

View File

@@ -1,31 +0,0 @@
#!/usr/bin/env python3
import argparse
import glob
import os
import shutil
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")
parser.add_argument("nsis_packaging_folder", help="NSIS packaging translations folder")
args = parser.parse_args()
tmp_translations: List[str] = glob.glob(f'{args.qt_translations_folder}/qt_??.qm')
tmp_translations += glob.glob(f'{args.qt_translations_folder}/qt_??_??.qm')
tmp_translations += glob.glob(f'{args.qt_translations_folder}/qtbase_??.qm')
tmp_translations += glob.glob(f'{args.qt_translations_folder}qtbase_??_??.qm')
filtered = filter(isNotStub, tmp_translations)
for file in filtered:
shutil.copy2(file, args.nsis_packaging_folder)
return 0
if __name__ == '__main__':
sys.exit(main())

View File

@@ -3,27 +3,27 @@
;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)"
LangString inst_qbt_req ${LANG_FRENCH} "qBittorrent (requis)"
;LangString inst_dekstop ${LANG_ENGLISH} "Create Desktop Shortcut"
LangString inst_dekstop ${LANG_FRENCH} "Créer un Raccourci sur le Bureau"
LangString inst_dekstop ${LANG_FRENCH} "Créer Raccourci 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 Raccourci dans le Menu Démarrer"
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
LangString inst_startup ${LANG_FRENCH} "Démarrez qBittorrent au démarrage de Windows"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_FRENCH} "Ouvrir les fichiers .torrent avec qBittorrent"
LangString inst_torrent ${LANG_FRENCH} "Ouvrir fichiers .torrent avec qBittorrent"
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
LangString inst_magnet ${LANG_FRENCH} "Ouvrir les liens magnet avec qBittorrent"
LangString inst_magnet ${LANG_FRENCH} "Ouvrir liens magnet avec qBittorrent"
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_FRENCH} "Ajouter une règle au Pare-Feu de Windows"
LangString inst_firewall ${LANG_FRENCH} "Ajouter règle Pare-Feu 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_FRENCH} "Désactiver la limite de taille du chemin de Windows (limitation de MAX_PATH 260 caractères, nécessite Windows 10 1607 ou plus)"
LangString inst_pathlimit ${LANG_FRENCH} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_FRENCH} "Ajout d'une règle au Pare-Feu de Windows"
LangString inst_firewallinfo ${LANG_FRENCH} "Ajout règle Pare-Feu Windows"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_FRENCH} "qBittorrent est en cours d'exécution. Veuillez fermer l'application avant l'installation."
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
LangString inst_uninstall_question ${LANG_FRENCH} "Une installation précédente a été détectée. Elle sera désinstallée en conservant les réglages utilisateur."
LangString inst_uninstall_question ${LANG_FRENCH} "Une installation précédente a été détectée. Elle sera désinstallée sans supprimer les réglages utilisateur."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_FRENCH} "Désinstallation de la version antérieure."
LangString inst_unist ${LANG_FRENCH} "Désinstallation de la version précédente."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_FRENCH} "Lancer qBittorrent."
;LangString inst_requires_64bit ${LANG_ENGLISH} "This installer works only in 64-bit Windows versions."
@@ -31,27 +31,27 @@ LangString inst_requires_64bit ${LANG_FRENCH} "Cet installateur ne fonctionne qu
;LangString inst_requires_win7 ${LANG_ENGLISH} "This qBittorrent version requires at least Windows 7."
LangString inst_requires_win7 ${LANG_FRENCH} "Cette version de qBittorrent nécessite au moins Windows 7."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_FRENCH} "Désinstaller qBittorrent"
LangString inst_uninstall_link_description ${LANG_FRENCH} "Uninstall qBittorrent"
;------------------------------------
;Uninstaller strings
;LangString remove_files ${LANG_ENGLISH} "Remove files"
LangString remove_files ${LANG_FRENCH} "Supprimer les fichiers"
LangString remove_files ${LANG_FRENCH} "Supprimer fichiers"
;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts"
LangString remove_shortcuts ${LANG_FRENCH} "Supprimer les raccourcis"
LangString remove_shortcuts ${LANG_FRENCH} "Supprimer raccourcis"
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
LangString remove_associations ${LANG_FRENCH} "Supprimer les associations de fichiers"
LangString remove_associations ${LANG_FRENCH} "Supprimer associations de fichiers"
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
LangString remove_registry ${LANG_FRENCH} "Supprimer les clés de registre"
LangString remove_registry ${LANG_FRENCH} "Supprimer clés de registre"
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
LangString remove_conf ${LANG_FRENCH} "Supprimer les fichiers de configuration"
LangString remove_conf ${LANG_FRENCH} "Supprimer fichiers de configuration"
;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule"
LangString remove_firewall ${LANG_FRENCH} "Supprimer la règle du Pare-Feu de Windows"
LangString remove_firewall ${LANG_FRENCH} "Supprimer règle Pare-Feu Windows"
;LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule"
LangString remove_firewallinfo ${LANG_FRENCH} "Suppression de la règle du Pare-Feu de Windows"
LangString remove_firewallinfo ${LANG_FRENCH} "Suppression règle Pare-Feu Windows"
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
LangString remove_cache ${LANG_FRENCH} "Supprimer les torrents et données cachées"
LangString remove_cache ${LANG_FRENCH} "Supprimer torrents et données cachées"
;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. Veuillez fermer l'application avant la désinstallation."
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"

View File

@@ -19,9 +19,9 @@ LangString inst_pathlimit ${LANG_ITALIAN} "Disabilita limite lunghezza percorsi
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_ITALIAN} "Aggiunta regola al firewall di Windows"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_ITALIAN} "qBittorrent è in esecuzione.$\r$\nChiudilo prima di procedere con l'installazione."
LangString inst_warning ${LANG_ITALIAN} "qBittorrent è in esecuzione. Chiudilo prima di procedere con l'installazione."
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
LangString inst_uninstall_question ${LANG_ITALIAN} "La versione attuale verrà disinstallata.$\r$\nLe impostazioni utente e i torrent rimarranno invariati."
LangString inst_uninstall_question ${LANG_ITALIAN} "La versione attuale verrà disinstallata. Le impostazioni utente e i torrent rimarranno invariati."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_ITALIAN} "Disinstallazione versione precedente."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
@@ -53,8 +53,8 @@ LangString remove_firewallinfo ${LANG_ITALIAN} "Rimozione regola dal firewall di
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
LangString remove_cache ${LANG_ITALIAN} "Rimuovi torrent e dati nella cache"
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_ITALIAN} "qBittorrent è in esecuzione.$\r$\nChiudilo prima di procedere con la disinstallazione."
LangString uninst_warning ${LANG_ITALIAN} "qBittorrent è in esecuzione. Chiudilo prima di procedere con la disinstallazione."
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
LangString uninst_tor_warn ${LANG_ITALIAN} "Associazione file .torrent non rimossa.$\r$\nFile associati con:"
LangString uninst_tor_warn ${LANG_ITALIAN} "Associazione file .torrent non rimossa. File associati con:"
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
LangString uninst_mag_warn ${LANG_ITALIAN} "Associazione file magnet non rimossa.$\r$\nFile associati con:"
LangString uninst_mag_warn ${LANG_ITALIAN} "Associazione file magnet non rimossa. File associati con:"

View File

@@ -1,11 +1,11 @@
;Installer strings
;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)"
LangString inst_qbt_req ${LANG_KOREAN} "qBittorrent (필요)"
LangString inst_qbt_req ${LANG_KOREAN} "qBittorrent (필요)"
;LangString inst_dekstop ${LANG_ENGLISH} "Create Desktop Shortcut"
LangString inst_dekstop ${LANG_KOREAN} "바탕화면 바로 가기 만들기"
LangString inst_dekstop ${LANG_KOREAN} "바탕화면 바로가기 만들기"
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_KOREAN} "시작 메뉴 바로 가기 만들기"
LangString inst_startmenu ${LANG_KOREAN} "시작 메뉴 바로가기 만들기"
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
LangString inst_startup ${LANG_KOREAN} "Windows 시작 시 qBittorrent 시작"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
@@ -15,23 +15,23 @@ LangString inst_magnet ${LANG_KOREAN} "qBittorrent로 자석 링크 열기"
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_KOREAN} "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_KOREAN} "Windows 경로 길이 제한 비활성화 (260자 MAX_PATH 제한, Windows 10 1607 이상 필요)"
LangString inst_pathlimit ${LANG_KOREAN} "Windows 경로 길이 제한 비활성화(260자 MAX_PATH 제한, Windows 10 1607 이상 필요)"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_KOREAN} "Windows 방화벽 규칙 추가하는 중"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_KOREAN} "qBittorrent가 실행 중입니다. 설치하기 전에 응용 프로그램을 닫으십시오."
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
LangString inst_uninstall_question ${LANG_KOREAN} "현재 버전이 제됩니다. 사용자 설정과 토렌트는 그대로 유지됩니다."
LangString inst_uninstall_question ${LANG_KOREAN} "현재 버전이 제됩니다. 사용자 설정과 토렌트는 그대로 유지됩니다."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_KOREAN} "이전 버전을 제하는 중입니다."
LangString inst_unist ${LANG_KOREAN} "이전 버전을 제하는 중입니다."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
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_64bit ${LANG_KOREAN} "이 설치 프로그램은 64비트 윈도우즈 버전에서만 작동합니다."
;LangString inst_requires_win7 ${LANG_ENGLISH} "This qBittorrent version requires at least Windows 7."
LangString inst_requires_win7 ${LANG_KOREAN} "이 qBittorrent 버전에는 Windows 7 이상이 필요합니다."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_KOREAN} "qBittorrent 제"
LangString inst_uninstall_link_description ${LANG_KOREAN} "qBittorrent "
;------------------------------------
;Uninstaller strings
@@ -39,7 +39,7 @@ LangString inst_uninstall_link_description ${LANG_KOREAN} "qBittorrent 제거"
;LangString remove_files ${LANG_ENGLISH} "Remove files"
LangString remove_files ${LANG_KOREAN} "파일 제거"
;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts"
LangString remove_shortcuts ${LANG_KOREAN} "바로 가기 제거"
LangString remove_shortcuts ${LANG_KOREAN} "바로가기 제거"
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
LangString remove_associations ${LANG_KOREAN} "파일 연결 제거"
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"

View File

@@ -1,60 +1,60 @@
;Installer strings
;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)"
LangString inst_qbt_req ${LANG_LATVIAN} "qBittorrent (nepieciešams)"
LangString inst_qbt_req ${LANG_LATVIAN} "qBittorrent (required)"
;LangString inst_dekstop ${LANG_ENGLISH} "Create Desktop Shortcut"
LangString inst_dekstop ${LANG_LATVIAN} "Izveidot saīsni uz darbvirsmas"
LangString inst_dekstop ${LANG_LATVIAN} "Create Desktop Shortcut"
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_LATVIAN} "Izveidot izvēlnes Sākt saīsnes"
LangString inst_startmenu ${LANG_LATVIAN} "Create Start Menu Shortcut"
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
LangString inst_startup ${LANG_LATVIAN} "Startēt qBittorrent Windows startēšanas laikā"
LangString inst_startup ${LANG_LATVIAN} "Start qBittorrent on Windows start up"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_LATVIAN} "Atvērt .torrent failus ar qBittorrent"
LangString inst_torrent ${LANG_LATVIAN} "Open .torrent files with qBittorrent"
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
LangString inst_magnet ${LANG_LATVIAN} "Atvērt magnētu saites ar qBittorrent"
LangString inst_magnet ${LANG_LATVIAN} "Open magnet links with qBittorrent"
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_LATVIAN} "Pievienot Windows ugunsmūra noteikumu"
LangString inst_firewall ${LANG_LATVIAN} "Add Windows Firewall rule"
;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_LATVIAN} "Atspējot Windows ceļa garuma ierobežojumu (260 rakstzīmju MAX_PATH ierobežojums, nepieciešams Windows 10 1607 vai jaunāka versija)"
LangString inst_pathlimit ${LANG_LATVIAN} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_LATVIAN} "Windows ugunsmūra noteikumu pievienošana"
LangString inst_firewallinfo ${LANG_LATVIAN} "Adding Windows Firewall rule"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_LATVIAN} "qBittorrent darbojas. Lūdzu, aizveriet programmu pirms instalēšanas."
LangString inst_warning ${LANG_LATVIAN} "qBittorrent is running. Please close the application before installing."
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
LangString inst_uninstall_question ${LANG_LATVIAN} "Pašreizējā versija tiks atinstalēta. Lietotāju iestatījumi un torrenti paliks neskarti."
LangString inst_uninstall_question ${LANG_LATVIAN} "Current version will be uninstalled. User settings and torrents will remain intact."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_LATVIAN} "Iepriekšējās versijas atinstalēšana."
LangString inst_unist ${LANG_LATVIAN} "Uninstalling previous version."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_LATVIAN} "Palaist qBittorrent."
LangString launch_qbt ${LANG_LATVIAN} "Launch 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 versis."
LangString inst_requires_64bit ${LANG_LATVIAN} "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_LATVIAN} "Šai qBittorrent versijai ir nepieciešama vismaz Windows 7."
LangString inst_requires_win7 ${LANG_LATVIAN} "This qBittorrent version requires at least Windows 7."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_LATVIAN} "Atinstalēt qBittorrent"
LangString inst_uninstall_link_description ${LANG_LATVIAN} "Uninstall qBittorrent"
;------------------------------------
;Uninstaller strings
;LangString remove_files ${LANG_ENGLISH} "Remove files"
LangString remove_files ${LANG_LATVIAN} "Dzēš failus"
LangString remove_files ${LANG_LATVIAN} "Remove files"
;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts"
LangString remove_shortcuts ${LANG_LATVIAN} "Dzēš saīsnes"
LangString remove_shortcuts ${LANG_LATVIAN} "Remove shortcuts"
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
LangString remove_associations ${LANG_LATVIAN} "Noņem failu asociācijas"
LangString remove_associations ${LANG_LATVIAN} "Remove file associations"
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
LangString remove_registry ${LANG_LATVIAN} "Dzēš reģistra atslēgas"
LangString remove_registry ${LANG_LATVIAN} "Remove registry keys"
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
LangString remove_conf ${LANG_LATVIAN} "Dzēš konfigurācijas failus"
LangString remove_conf ${LANG_LATVIAN} "Remove configuration files"
;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule"
LangString remove_firewall ${LANG_LATVIAN} "Dzēst Windows ugunsmūra noteikumu"
LangString remove_firewall ${LANG_LATVIAN} "Remove Windows Firewall rule"
;LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule"
LangString remove_firewallinfo ${LANG_LATVIAN} "Dzēš Windows ugunsmūra noteikumu"
LangString remove_firewallinfo ${LANG_LATVIAN} "Removing Windows Firewall rule"
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
LangString remove_cache ${LANG_LATVIAN} "Dzēš torrentus un kešatmiņas datus"
LangString remove_cache ${LANG_LATVIAN} "Remove torrents and cached data"
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_LATVIAN} "qBittorrent darbojas. Lūdzu, aizveriet programmu pirms atinstalēšanas."
LangString uninst_warning ${LANG_LATVIAN} "qBittorrent is running. Please close the application before uninstalling."
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
LangString uninst_tor_warn ${LANG_LATVIAN} "Netiek dzēsta .torrent asociācija. Tā ir saistīta ar:"
LangString uninst_tor_warn ${LANG_LATVIAN} "Not removing .torrent association. It is associated with:"
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
LangString uninst_mag_warn ${LANG_LATVIAN} "Netiek dzēsta magnēta asociācija. Tā ir saistīta ar:"
LangString uninst_mag_warn ${LANG_LATVIAN} "Not removing magnet association. It is associated with:"

View File

@@ -15,23 +15,23 @@ LangString inst_magnet ${LANG_PORTUGUESE} "Abrir ligações magnet com o qBittor
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_PORTUGUESE} "Adicionar regra à firewall do 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_PORTUGUESE} "Desativar o limite do tamanho do caminho do Windows (limitação de MAX_PATH de 260 caracteres, requer o Windows 10 1607 ou superior)"
LangString inst_pathlimit ${LANG_PORTUGUESE} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_PORTUGUESE} "A adicionar regra à firewall do Windows"
LangString inst_firewallinfo ${LANG_PORTUGUESE} "Adicionando regra à firewall do Windows"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_PORTUGUESE} "O qBittorrent está a ser executado. Por favor, feche a aplicação antes de instalar esta versão."
LangString inst_warning ${LANG_PORTUGUESE} "O qBittorrent está a ser executado. Feche a aplicação antes de instalar esta versão."
;LangString inst_uninstall_question ${LANG_ENGLISH} "Current version will be uninstalled. User settings and torrents will remain intact."
LangString inst_uninstall_question ${LANG_PORTUGUESE} "A versão atual será desinstalada. As definições do utilizador e os torrents permanecerão intactas."
LangString inst_uninstall_question ${LANG_PORTUGUESE} "Uma antiga instalação foi encontrada.Essa mesma será desinstalada sem apagar as definições do usuário."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_PORTUGUESE} "A desinstalar versão anterior."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
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_64bit ${LANG_PORTUGUESE} "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_PORTUGUESE} "Esta versão qBittorrent requer pelo menos o Windows 7."
LangString inst_requires_win7 ${LANG_PORTUGUESE} "This qBittorrent version requires at least Windows 7."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_PORTUGUESE} "Desinstalar qBittorrent"
LangString inst_uninstall_link_description ${LANG_PORTUGUESE} "Uninstall qBittorrent"
;------------------------------------
;Uninstaller strings
@@ -41,7 +41,7 @@ LangString remove_files ${LANG_PORTUGUESE} "Remover ficheiros"
;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts"
LangString remove_shortcuts ${LANG_PORTUGUESE} "Remover atalhos"
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
LangString remove_associations ${LANG_PORTUGUESE} "Remover associação de ficheiros"
LangString remove_associations ${LANG_PORTUGUESE} "Remove associação de ficheiros"
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
LangString remove_registry ${LANG_PORTUGUESE} "Remover chaves de registo"
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
@@ -49,12 +49,12 @@ LangString remove_conf ${LANG_PORTUGUESE} "Remover ficheiros de configuração"
;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule"
LangString remove_firewall ${LANG_PORTUGUESE} "Remover regra da firewall do Windows"
;LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule"
LangString remove_firewallinfo ${LANG_PORTUGUESE} "A remover regra da firewall do Windows"
LangString remove_firewallinfo ${LANG_PORTUGUESE} "Removendo regra da firewall do Windows"
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
LangString remove_cache ${LANG_PORTUGUESE} "Remover torrents e dados guardados"
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_PORTUGUESE} "O qBittorrent está a ser executado. Por favor, feche a aplicação antes de desinstalar esta versão."
LangString uninst_warning ${LANG_PORTUGUESE} "O qBittorrent está a ser executado. Feche a aplicação antes de desinstalar esta versão."
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
LangString uninst_tor_warn ${LANG_PORTUGUESE} "Não pode remover a associação do .torrent. Está associado a:"
LangString uninst_tor_warn ${LANG_PORTUGUESE} "Associação .torrent não removida. Ficheiros associados a:"
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
LangString uninst_mag_warn ${LANG_PORTUGUESE} "Não pode remover a associação do magnet. Está associado a:"
LangString uninst_mag_warn ${LANG_PORTUGUESE} "Associação magnet nã removida. Ligações associadas a:"

View File

@@ -7,7 +7,7 @@ LangString inst_dekstop ${LANG_SPANISH} "Crear un acceso directo en el escritori
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_SPANISH} "Crear un acceso directo en el menú inicio"
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
LangString inst_startup ${LANG_SPANISH} "Iniciar qBittorrent en el inicio de Windows"
LangString inst_startup ${LANG_SPANISH} "Inicie qBittorrent en el inicio de Windows"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_SPANISH} "Abrir archivos .torrent con qBittorrent"
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
@@ -15,7 +15,7 @@ LangString inst_magnet ${LANG_SPANISH} "Abrir enlaces magnet con qBittorrent"
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_SPANISH} "Añadir regla al Firewall de 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_SPANISH} "Deshabilitar límite de caracteres del PATH de Windows (limitación MAX_PATH de 260 caracteres, requiere Windows 10 1607 o superior)"
LangString inst_pathlimit ${LANG_SPANISH} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_SPANISH} "Añadiendo regla al Firewall de Windows"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
@@ -29,9 +29,9 @@ 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_win7 ${LANG_ENGLISH} "This qBittorrent version requires at least Windows 7."
LangString inst_requires_win7 ${LANG_SPANISH} "Esta versión de qBittorrent requiere Windows 7 o superior."
LangString inst_requires_win7 ${LANG_SPANISH} "This qBittorrent version requires at least Windows 7."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_SPANISH} "Desinstalar qBittorrent"
LangString inst_uninstall_link_description ${LANG_SPANISH} "Uninstall qBittorrent"
;------------------------------------
;Uninstaller strings
@@ -41,7 +41,7 @@ LangString remove_files ${LANG_SPANISH} "Quitar archivos"
;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts"
LangString remove_shortcuts ${LANG_SPANISH} "Quitar accesos directos"
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
LangString remove_associations ${LANG_SPANISH} "Deshacer asociaciones de archivos"
LangString remove_associations ${LANG_SPANISH} "Deshacer asociaciones"
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
LangString remove_registry ${LANG_SPANISH} "Eliminar claves del registro"
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"

View File

@@ -7,7 +7,7 @@ LangString inst_dekstop ${LANG_SPANISHINTERNATIONAL} "Crear un acceso directo en
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_SPANISHINTERNATIONAL} "Crear un acceso directo en el menú inicio"
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
LangString inst_startup ${LANG_SPANISHINTERNATIONAL} "Iniciar qBittorrent en el inicio de Windows"
LangString inst_startup ${LANG_SPANISHINTERNATIONAL} "Inicie qBittorrent en el inicio de Windows"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_SPANISHINTERNATIONAL} "Abrir archivos .torrent con qBittorrent"
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
@@ -15,7 +15,7 @@ LangString inst_magnet ${LANG_SPANISHINTERNATIONAL} "Abrir enlaces magnet con qB
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_SPANISHINTERNATIONAL} "Añadir regla al Firewall de 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_SPANISHINTERNATIONAL} "Deshabilitar límite de caracteres del PATH de Windows (limitación MAX_PATH de 260 caracteres, requiere Windows 10 1607 o superior)"
LangString inst_pathlimit ${LANG_SPANISHINTERNATIONAL} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_SPANISHINTERNATIONAL} "Añadiendo regla al Firewall de Windows"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
@@ -29,9 +29,9 @@ 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_win7 ${LANG_ENGLISH} "This qBittorrent version requires at least Windows 7."
LangString inst_requires_win7 ${LANG_SPANISHINTERNATIONAL} "Esta versión de qBittorrent requiere Windows 7 o superior."
LangString inst_requires_win7 ${LANG_SPANISHINTERNATIONAL} "This qBittorrent version requires at least Windows 7."
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
LangString inst_uninstall_link_description ${LANG_SPANISHINTERNATIONAL} "Desinstalar qBittorrent"
LangString inst_uninstall_link_description ${LANG_SPANISHINTERNATIONAL} "Uninstall qBittorrent"
;------------------------------------
;Uninstaller strings
@@ -41,7 +41,7 @@ LangString remove_files ${LANG_SPANISHINTERNATIONAL} "Quitar archivos"
;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts"
LangString remove_shortcuts ${LANG_SPANISHINTERNATIONAL} "Quitar accesos directos"
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
LangString remove_associations ${LANG_SPANISHINTERNATIONAL} "Deshacer asociaciones de archivos"
LangString remove_associations ${LANG_SPANISHINTERNATIONAL} "Deshacer asociaciones"
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
LangString remove_registry ${LANG_SPANISHINTERNATIONAL} "Eliminar claves del registro"
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"

View File

@@ -28,7 +28,7 @@ XPStyle on
!define CSIDL_LOCALAPPDATA '0x1C' ;Local Application Data path
; Program specific
!define PROG_VERSION "4.5.0"
!define PROG_VERSION "4.4.0"
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun

View File

@@ -33,7 +33,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 49
#serial 47
# example boost program (need to pass version)
m4_define([_AX_BOOST_BASE_PROGRAM],
@@ -114,7 +114,7 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
AS_CASE([${host_cpu}],
[x86_64],[libsubdirs="lib64 libx32 lib lib64"],
[mips*64*],[libsubdirs="lib64 lib32 lib lib64"],
[ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64|e2k],[libsubdirs="lib64 lib lib64"],
[ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64],[libsubdirs="lib64 lib lib64"],
[libsubdirs="lib"]
)
@@ -123,7 +123,6 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
dnl are almost assuredly the ones desired.
AS_CASE([${host_cpu}],
[i?86],[multiarch_libsubdir="lib/i386-${host_os}"],
[armv7l],[multiarch_libsubdir="lib/arm-${host_os}"],
[multiarch_libsubdir="lib/${host_cpu}-${host_os}"]
)

View File

@@ -7,31 +7,13 @@ else {
include(conf.pri)
}
# Custom function
# Return Qt translations files as list of paths
# It will return .qm files of qt/qtbase that aren't stub files.
defineReplace(qbt_get_qt_translations) {
# The $$[] syntax queries qmake properties
TMP_TRANSLATIONS = $$files($$[QT_INSTALL_TRANSLATIONS]/qt_??.qm)
TMP_TRANSLATIONS += $$files($$[QT_INSTALL_TRANSLATIONS]/qt_??_??.qm)
TMP_TRANSLATIONS += $$files($$[QT_INSTALL_TRANSLATIONS]/qtbase_??.qm)
TMP_TRANSLATIONS += $$files($$[QT_INSTALL_TRANSLATIONS]/qtbase_??_??.qm)
# Consider files less than 10KB as stub translations
for (TRANSLATION, TMP_TRANSLATIONS) {
TRANSLATION_SIZE = $$system("stat -f%z $${TRANSLATION}", true, EXIT_STATUS)
equals(EXIT_STATUS, 0):!lessThan(TRANSLATION_SIZE, 10240): FINAL_TRANSLATIONS += $${TRANSLATION}
}
return($$FINAL_TRANSLATIONS)
}
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.15
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
DEFINES += _DARWIN_FEATURE_64_BIT_INODE
LIBS += -framework Carbon -framework IOKit -framework AppKit
QT_LANG_PATH = ../dist/qt-translations
DIST_PATH = ../dist/mac
document_icon.path = Contents/Resources
@@ -43,7 +25,15 @@ qt_conf.files = $$DIST_PATH/qt.conf
QMAKE_BUNDLE_DATA += qt_conf
qt_translations.path = Contents/translations
qt_translations.files = $$qbt_get_qt_translations()
qt_translations.files = $$files($$QT_LANG_PATH/qtbase_*.qm)
qt_translations.files += \
$$QT_LANG_PATH/qt_fa.qm \
$$QT_LANG_PATH/qt_gl.qm \
$$QT_LANG_PATH/qt_lt.qm \
$$QT_LANG_PATH/qt_pt.qm \
$$QT_LANG_PATH/qt_sl.qm \
$$QT_LANG_PATH/qt_sv.qm \
$$QT_LANG_PATH/qt_zh_CN.qm
QMAKE_BUNDLE_DATA += qt_translations
ICON = $$DIST_PATH/qbittorrent_mac.icns

View File

@@ -1,12 +1,98 @@
macro(find_libtorrent version)
if (UNIX AND (NOT APPLE) AND (NOT CYGWIN))
find_package(LibtorrentRasterbar QUIET ${version} COMPONENTS torrent-rasterbar)
if (NOT LibtorrentRasterbar_FOUND)
include(FindPkgConfig)
pkg_check_modules(LibtorrentRasterbar IMPORTED_TARGET GLOBAL "libtorrent-rasterbar>=${version}")
if (NOT LibtorrentRasterbar_FOUND)
message(
FATAL_ERROR
"Package LibtorrentRasterbar >= ${version} not found"
" with CMake or pkg-config.\n- Set LibtorrentRasterbar_DIR to a directory containing"
" a LibtorrentRasterbarConfig.cmake file or add the installation prefix of LibtorrentRasterbar"
" to CMAKE_PREFIX_PATH.\n- Alternatively, make sure there is a valid libtorrent-rasterbar.pc"
" file in your system's pkg-config search paths (use the system environment variable PKG_CONFIG_PATH"
" to specify additional search paths if needed)."
)
endif()
add_library(LibtorrentRasterbar::torrent-rasterbar ALIAS PkgConfig::LibtorrentRasterbar)
# force a fake package to show up in the feature summary
set_property(GLOBAL APPEND PROPERTY
PACKAGES_FOUND
"LibtorrentRasterbar via pkg-config (version >= ${version})"
)
set_package_properties("LibtorrentRasterbar via pkg-config (version >= ${version})"
PROPERTIES
TYPE REQUIRED
)
else()
set_package_properties(LibtorrentRasterbar PROPERTIES TYPE REQUIRED)
endif()
else()
find_package(LibtorrentRasterbar ${version} REQUIRED COMPONENTS torrent-rasterbar)
endif()
endmacro()
find_libtorrent(${minLibtorrent1Version})
if (LibtorrentRasterbar_FOUND AND (LibtorrentRasterbar_VERSION VERSION_GREATER_EQUAL 2.0))
find_libtorrent(${minLibtorrentVersion})
endif()
# force variable type so that it always shows up in ccmake/cmake-gui frontends
set_property(CACHE LibtorrentRasterbar_DIR PROPERTY TYPE PATH)
find_package(Boost ${minBoostVersion} REQUIRED)
find_package(OpenSSL ${minOpenSSLVersion} REQUIRED)
find_package(ZLIB ${minZlibVersion} REQUIRED)
if (QT6)
find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS Core Network Sql Xml LinguistTools)
if (DBUS)
find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS DBus)
set_package_properties(Qt6DBus PROPERTIES
DESCRIPTION "Qt6 module for inter-process communication over the D-Bus protocol"
PURPOSE "Required by the DBUS feature"
)
endif()
else()
find_package(Qt5 ${minQt5Version} REQUIRED COMPONENTS Core Network Sql Xml LinguistTools)
if (DBUS)
find_package(Qt5 ${minQt5Version} REQUIRED COMPONENTS DBus)
set_package_properties(Qt5DBus PROPERTIES
DESCRIPTION "Qt5 module for inter-process communication over the D-Bus protocol"
PURPOSE "Required by the DBUS feature"
)
endif()
endif()
# automatically call Qt moc, rcc and uic as needed for all targets by default
set(CMAKE_AUTORCC_OPTIONS --compress 9 --threshold 5)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
# create interface-only target libraries with common compile options/definitions to link to
include(MacroQbtCommonConfig)
qbt_common_config()
# include directories - ideally, would be done per target instead of global directory scope
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(app)
add_subdirectory(base)
if (GUI)
if (QT6)
find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS Widgets Svg)
else()
find_package(Qt5 ${minQt5Version} REQUIRED COMPONENTS Widgets Svg)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
find_package(Qt5 ${minQt5Version} REQUIRED COMPONENTS WinExtras)
endif()
endif()
add_subdirectory(gui)
endif()
if (WEBUI)
add_subdirectory(webui)
endif()
add_subdirectory(app)

View File

@@ -1,19 +1,8 @@
file(GLOB QBT_TS_FILES "${qBittorrent_SOURCE_DIR}/src/lang/*.ts")
# Custom target to update .ts files and include new strings from source files
# Depends on Qt's LinguistTools
get_target_property(QT_LUPDATE_EXECUTABLE Qt::lupdate IMPORTED_LOCATION)
add_custom_target(qbt_update_translations
COMMAND ${QT_LUPDATE_EXECUTABLE} -extensions ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx
${qBittorrent_SOURCE_DIR}
-ts ${QBT_TS_FILES}
WORKING_DIRECTORY "${qBittorrent_SOURCE_DIR}"
VERBATIM
COMMAND_EXPAND_LISTS)
# Generate and configure translation files
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Based on https://gist.github.com/giraldeau/546ba5512a74dfe9d8ea0862d66db412
file(GLOB QBT_TS_FILES "${qBittorrent_SOURCE_DIR}/src/lang/*.ts")
set_source_files_properties(${QBT_TS_FILES} PROPERTIES OUTPUT_LOCATION "${qBittorrent_BINARY_DIR}/src/lang")
qt_add_translation(QBT_QM_FILES ${QBT_TS_FILES} OPTIONS -silent)
configure_file("${qBittorrent_SOURCE_DIR}/src/lang/lang.qrc" "${qBittorrent_BINARY_DIR}/src/lang/lang.qrc" COPYONLY)
@@ -27,6 +16,11 @@ if (WEBUI)
"${qBittorrent_BINARY_DIR}/src/webui/www/translations/webui_translations.qrc" COPYONLY)
endif()
FILE(GLOB QT_TRANSLATIONS "${qBittorrent_SOURCE_DIR}/dist/qt-translations/qtbase_*.qm")
foreach(EXTRA_TRANSLATION IN ITEMS "fa" "gl" "lt" "pt" "sl" "sv" "zh_CN")
list(APPEND QT_TRANSLATIONS "${qBittorrent_SOURCE_DIR}/dist/qt-translations/qt_${EXTRA_TRANSLATION}.qm")
endforeach()
# Executable target configuration
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
@@ -39,7 +33,6 @@ target_sources(qbt_app PRIVATE
cmdoptions.h
filelogger.h
qtlocalpeer/qtlocalpeer.h
signalhandler.h
upgrade.h
# sources
@@ -49,7 +42,6 @@ target_sources(qbt_app PRIVATE
filelogger.cpp
main.cpp
qtlocalpeer/qtlocalpeer.cpp
signalhandler.cpp
upgrade.cpp
# resources
@@ -73,17 +65,16 @@ endif()
# Additional platform specific configuration
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
set_source_files_properties(${QT_TRANSLATIONS} PROPERTIES MACOSX_PACKAGE_LOCATION translations)
set_source_files_properties(
"${qBittorrent_SOURCE_DIR}/dist/mac/qt.conf"
"${qBittorrent_SOURCE_DIR}/dist/mac/qBitTorrentDocument.icns"
"${qBittorrent_SOURCE_DIR}/dist/mac/qbittorrent_mac.icns"
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
include(FindQtTranslations)
qbt_get_qt_translations(QT_TRANSLATIONS)
set_source_files_properties(${QT_TRANSLATIONS} PROPERTIES MACOSX_PACKAGE_LOCATION translations)
set_source_files_properties(
"${qBittorrent_SOURCE_DIR}/dist/mac/qt.conf"
"${qBittorrent_SOURCE_DIR}/dist/mac/qBitTorrentDocument.icns"
"${qBittorrent_SOURCE_DIR}/dist/mac/qbittorrent_mac.icns"
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
# provide variables for substitution in dist/mac/Info.plist
get_target_property(EXECUTABLE_NAME qbt_app OUTPUT_NAME)
# This variable name should be changed once qmake is no longer used. Refer to the discussion in PR #14813
@@ -112,45 +103,43 @@ endif()
# Additional feature dependent configuration
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
if (GUI)
target_link_libraries(qbt_app PRIVATE qbt_gui)
if ((CMAKE_SYSTEM_NAME STREQUAL "Windows") OR (CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
qt_import_plugins(qbt_app INCLUDE Qt::QSvgIconPlugin Qt::QSvgPlugin)
endif()
endif()
if (STACKTRACE)
target_compile_definitions(qbt_app PRIVATE STACKTRACE)
target_sources(qbt_app PRIVATE
stacktrace.h
stacktrace.cpp
)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_sources(qbt_app PRIVATE stacktrace_win.h)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
target_compile_definitions(qbt_app PRIVATE BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED)
target_link_options(qbt_app PUBLIC -rdynamic)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(qbt_app PUBLIC ${CMAKE_DL_LIBS})
target_link_options(qbt_app PUBLIC -rdynamic)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if (GUI)
target_sources(qbt_app PRIVATE
stacktracedialog.h
stacktracedialog.cpp
stacktracedialog.ui
)
endif()
# i686 arch on Windows requires frame pointer preservation
if (MSVC)
target_compile_options(qbt_app PRIVATE /Zi)
target_link_options(qbt_app PUBLIC
/DEBUG
/PDBALTPATH:$<TARGET_PDB_FILE_NAME:qbt_app>
)
target_link_options(qbt_app PUBLIC LINKER:/DEBUG)
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
target_compile_options(qbt_app PRIVATE /Oy-)
target_compile_options(qbt_app PRIVATE /Oy)
endif()
else()
target_link_options(qbt_app PUBLIC LINKER:--export-dynamic)
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
target_compile_options(qbt_app PRIVATE -fno-omit-frame-pointer)
endif()
endif()
target_link_libraries(qbt_app PUBLIC dbghelp)
else()
target_sources(qbt_app PRIVATE stacktrace.h)
endif()
endif()
if (GUI)
target_link_libraries(qbt_app PRIVATE qbt_gui)
if ((CMAKE_SYSTEM_NAME STREQUAL "Windows") OR (CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
qt_import_plugins(qbt_app INCLUDE Qt::QSvgIconPlugin Qt::QSvgPlugin)
endif()
endif()

View File

@@ -6,7 +6,6 @@ HEADERS += \
$$PWD/cmdoptions.h \
$$PWD/filelogger.h \
$$PWD/qtlocalpeer/qtlocalpeer.h \
$$PWD/signalhandler.h \
$$PWD/upgrade.h
SOURCES += \
@@ -16,10 +15,18 @@ SOURCES += \
$$PWD/filelogger.cpp \
$$PWD/main.cpp \
$$PWD/qtlocalpeer/qtlocalpeer.cpp \
$$PWD/signalhandler.cpp \
$$PWD/upgrade.cpp
stacktrace {
HEADERS += $$PWD/stacktrace.h
SOURCES += $$PWD/stacktrace.cpp
unix {
HEADERS += $$PWD/stacktrace.h
}
else {
HEADERS += $$PWD/stacktrace_win.h
!nogui {
HEADERS += $$PWD/stacktracedialog.h
SOURCES += $$PWD/stacktracedialog.cpp
FORMS += $$PWD/stacktracedialog.ui
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,5 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2022 Mike Tzou (Chocobo1)
* Copyright (C) 2015, 2019 Vladimir Golovnev <glassez@yandex.ru>
* Copyright (C) 2006 Christophe Dumez
*
@@ -30,26 +29,30 @@
#pragma once
#include <QtGlobal>
#include <QAtomicInt>
#include <QCoreApplication>
#include <QPointer>
#include <QStringList>
#include <QTranslator>
#ifndef DISABLE_GUI
#include <QApplication>
#endif
using BaseApplication = QApplication;
class MainWindow;
#ifdef Q_OS_WIN
class QSessionManager;
#endif // Q_OS_WIN
#else
#include <QCoreApplication>
using BaseApplication = QCoreApplication;
#endif // DISABLE_GUI
#include "base/bittorrent/addtorrentparams.h"
#include "base/interfaces/iapplication.h"
#include "base/path.h"
#include "base/settingvalue.h"
#include "base/types.h"
#include "cmdoptions.h"
#ifndef DISABLE_GUI
#include "gui/interfaces/iguiapplication.h"
#ifndef DISABLE_WEBUI
class WebUI;
#endif
class ApplicationInstanceManager;
@@ -66,28 +69,7 @@ namespace RSS
class AutoDownloader;
}
#ifndef DISABLE_GUI
class QProgressDialog;
class DesktopIntegration;
class MainWindow;
using BaseApplication = QApplication;
using BaseIApplication = IGUIApplication;
#ifdef Q_OS_WIN
class QSessionManager;
#endif
#else // DISABLE_GUI
using BaseApplication = QCoreApplication;
using BaseIApplication = IApplication;
#endif // DISABLE_GUI
#ifndef DISABLE_WEBUI
class WebUI;
#endif
class Application final : public BaseApplication, public BaseIApplication
class Application final : public BaseApplication
{
Q_OBJECT
Q_DISABLE_COPY_MOVE(Application)
@@ -96,98 +78,73 @@ public:
Application(int &argc, char **argv);
~Application() override;
int exec(const QStringList &params);
bool isRunning();
int exec(const QStringList &params);
bool sendParams(const QStringList &params);
#ifndef DISABLE_GUI
QPointer<MainWindow> mainWindow();
#endif
const QBtCommandLineParameters &commandLineArgs() const;
// FileLogger properties
bool isFileLoggerEnabled() const override;
void setFileLoggerEnabled(bool value) override;
Path fileLoggerPath() const override;
void setFileLoggerPath(const Path &path) override;
bool isFileLoggerBackup() const override;
void setFileLoggerBackup(bool value) override;
bool isFileLoggerDeleteOld() const override;
void setFileLoggerDeleteOld(bool value) override;
int fileLoggerMaxSize() const override;
void setFileLoggerMaxSize(int bytes) override;
int fileLoggerAge() const override;
void setFileLoggerAge(int value) override;
int fileLoggerAgeType() const override;
void setFileLoggerAgeType(int value) override;
int memoryWorkingSetLimit() const override;
void setMemoryWorkingSetLimit(int size) override;
#ifdef Q_OS_WIN
MemoryPriority processMemoryPriority() const override;
void setProcessMemoryPriority(MemoryPriority priority) override;
#endif
bool isFileLoggerEnabled() const;
void setFileLoggerEnabled(bool value);
QString fileLoggerPath() const;
void setFileLoggerPath(const QString &path);
bool isFileLoggerBackup() const;
void setFileLoggerBackup(bool value);
bool isFileLoggerDeleteOld() const;
void setFileLoggerDeleteOld(bool value);
int fileLoggerMaxSize() const;
void setFileLoggerMaxSize(int bytes);
int fileLoggerAge() const;
void setFileLoggerAge(int value);
int fileLoggerAgeType() const;
void setFileLoggerAgeType(int value);
protected:
#ifndef DISABLE_GUI
DesktopIntegration *desktopIntegration() override;
MainWindow *mainWindow() override;
bool isTorrentAddedNotificationsEnabled() const override;
void setTorrentAddedNotificationsEnabled(bool value) override;
#endif
private slots:
void processMessage(const QString &message);
void torrentAdded(const BitTorrent::Torrent *torrent) const;
void torrentFinished(const BitTorrent::Torrent *torrent);
void allTorrentsFinished();
void cleanup();
#if (!defined(DISABLE_GUI) && defined(Q_OS_WIN))
void shutdownCleanup(QSessionManager &manager);
#endif
private:
struct AddTorrentParams
{
QString torrentSource;
BitTorrent::AddTorrentParams torrentParams;
std::optional<bool> skipTorrentDialog;
};
void initializeTranslation();
AddTorrentParams parseParams(const QStringList &params) const;
void processParams(const AddTorrentParams &params);
void runExternalProgram(const QString &programTemplate, const BitTorrent::Torrent *torrent) const;
void sendNotificationEmail(const BitTorrent::Torrent *torrent);
#ifdef QBT_USES_LIBTORRENT2
void applyMemoryWorkingSetLimit() const;
#endif
#ifdef Q_OS_WIN
void applyMemoryPriority() const;
void adjustThreadPriority() const;
#endif
#ifndef DISABLE_GUI
void createStartupProgressDialog();
#ifdef Q_OS_MACOS
bool event(QEvent *) override;
#endif
#endif
private slots:
void processMessage(const QString &message);
void torrentFinished(BitTorrent::Torrent *const torrent);
void allTorrentsFinished();
void cleanup();
#if (!defined(DISABLE_GUI) && defined(Q_OS_WIN))
void shutdownCleanup(QSessionManager &manager);
#endif
private:
void initializeTranslation();
void processParams(const QStringList &params);
void runExternalProgram(const BitTorrent::Torrent *torrent) const;
void sendNotificationEmail(const BitTorrent::Torrent *torrent);
ApplicationInstanceManager *m_instanceManager = nullptr;
QAtomicInt m_isCleanupRun;
bool m_isProcessingParamsAllowed = false;
bool m_running;
ShutdownDialogAction m_shutdownAct;
QBtCommandLineParameters m_commandLineArgs;
#ifndef DISABLE_GUI
QPointer<MainWindow> m_window;
#endif
#ifndef DISABLE_WEBUI
WebUI *m_webui = nullptr;
#endif
// FileLog
QPointer<FileLogger> m_fileLogger;
QTranslator m_qtTranslator;
QTranslator m_translator;
QList<AddTorrentParams> m_paramsQueue;
QStringList m_paramsQueue;
SettingValue<bool> m_storeFileLoggerEnabled;
SettingValue<bool> m_storeFileLoggerBackup;
@@ -195,22 +152,5 @@ private:
SettingValue<int> m_storeFileLoggerMaxSize;
SettingValue<int> m_storeFileLoggerAge;
SettingValue<int> m_storeFileLoggerAgeType;
SettingValue<Path> m_storeFileLoggerPath;
SettingValue<int> m_storeMemoryWorkingSetLimit;
#ifdef Q_OS_WIN
SettingValue<MemoryPriority> m_processMemoryPriority;
#endif
#ifndef DISABLE_GUI
SettingValue<bool> m_storeNotificationTorrentAdded;
DesktopIntegration *m_desktopIntegration = nullptr;
MainWindow *m_window = nullptr;
QProgressDialog *m_startupProgressDialog = nullptr;
#endif
#ifndef DISABLE_WEBUI
WebUI *m_webui = nullptr;
#endif
SettingValue<QString> m_storeFileLoggerPath;
};

View File

@@ -37,19 +37,18 @@
#include <QSharedMemory>
#endif
#include "base/path.h"
#include "qtlocalpeer/qtlocalpeer.h"
ApplicationInstanceManager::ApplicationInstanceManager(const Path &instancePath, QObject *parent)
ApplicationInstanceManager::ApplicationInstanceManager(const QString &instancePath, QObject *parent)
: QObject {parent}
, m_peer {new QtLocalPeer(instancePath.data(), this)}
, m_peer {new QtLocalPeer {instancePath, this}}
, m_isFirstInstance {!m_peer->isClient()}
{
connect(m_peer, &QtLocalPeer::messageReceived, this, &ApplicationInstanceManager::messageReceived);
#ifdef Q_OS_WIN
const QString sharedMemoryKey = instancePath.data() + u"/shared-memory";
auto sharedMem = new QSharedMemory(sharedMemoryKey, this);
const QString sharedMemoryKey = instancePath + QLatin1String {"/shared-memory"};
auto sharedMem = new QSharedMemory {sharedMemoryKey, this};
if (m_isFirstInstance)
{
// First instance creates shared memory and store PID

View File

@@ -30,8 +30,6 @@
#include <QObject>
#include "base/pathfwd.h"
class QtLocalPeer;
class ApplicationInstanceManager final : public QObject
@@ -40,7 +38,7 @@ class ApplicationInstanceManager final : public QObject
Q_DISABLE_COPY_MOVE(ApplicationInstanceManager)
public:
explicit ApplicationInstanceManager(const Path &instancePath, QObject *parent = nullptr);
explicit ApplicationInstanceManager(const QString &instancePath, QObject *parent = nullptr);
bool isFirstInstance() const;
@@ -51,6 +49,6 @@ signals:
void messageReceived(const QString &message);
private:
QtLocalPeer *m_peer = nullptr;
QtLocalPeer *m_peer;
const bool m_isFirstInstance;
};

View File

@@ -35,6 +35,7 @@
#include <QDebug>
#include <QFileInfo>
#include <QProcessEnvironment>
#include <QTextStream>
#if defined(Q_OS_WIN) && !defined(DISABLE_GUI)
#include <QMessageBox>
@@ -66,12 +67,12 @@ namespace
QString fullParameter() const
{
return u"--" + QString::fromLatin1(m_name);
return QLatin1String("--") + QLatin1String(m_name);
}
QString shortcutParameter() const
{
return u"-" + QChar::fromLatin1(m_shortcut);
return QLatin1String("-") + QLatin1Char(m_shortcut);
}
bool hasShortcut() const
@@ -81,23 +82,23 @@ namespace
QString envVarName() const
{
return u"QBT_"
+ QString::fromLatin1(m_name).toUpper().replace(u'-', u'_');
return QLatin1String("QBT_")
+ QString::fromLatin1(m_name).toUpper().replace(QLatin1Char('-'), QLatin1Char('_'));
}
public:
static QString padUsageText(const QString &usage)
{
QString res = QString(USAGE_INDENTATION, u' ') + usage;
QString res = QString(USAGE_INDENTATION, ' ') + usage;
if ((USAGE_TEXT_COLUMN - usage.length() - 4) > 0)
return res + QString((USAGE_TEXT_COLUMN - usage.length() - 4), u' ');
return res + QString(USAGE_TEXT_COLUMN - usage.length() - 4, ' ');
return res;
}
private:
const char *m_name = nullptr;
const char *m_name;
const char m_shortcut;
};
@@ -110,32 +111,32 @@ namespace
{
}
bool operator==(const QString &arg) const
{
return (hasShortcut() && ((arg.size() == 2) && (arg == shortcutParameter())))
|| (arg == fullParameter());
}
bool value(const QProcessEnvironment &env) const
{
QString val = env.value(envVarName());
// we accept "1" and "true" (upper or lower cased) as boolean 'true' values
return ((val == u"1") || (val.toUpper() == u"TRUE"));
return ((val == QLatin1String("1")) || (val.toUpper() == QLatin1String("TRUE")));
}
QString usage() const
{
QString res;
if (hasShortcut())
res += shortcutParameter() + u" | ";
res += shortcutParameter() + QLatin1String(" | ");
res += fullParameter();
return padUsageText(res);
}
friend bool operator==(const BoolOption &option, const QString &arg)
{
return (option.hasShortcut() && ((arg.size() == 2) && (option.shortcutParameter() == arg)))
|| (option.fullParameter() == arg);
}
};
bool operator==(const QString &arg, const BoolOption &option)
bool operator==(const QString &s, const BoolOption &o)
{
return (option == arg);
return o == s;
}
// Option with string value. May not have a shortcut
@@ -147,42 +148,42 @@ namespace
{
}
bool operator==(const QString &arg) const
{
return arg.startsWith(parameterAssignment());
}
QString value(const QString &arg) const
{
QStringList parts = arg.split(u'=');
QStringList parts = arg.split(QLatin1Char('='));
if (parts.size() == 2)
return Utils::String::unquote(parts[1], u"'\""_qs);
return Utils::String::unquote(parts[1], QLatin1String("'\""));
throw CommandLineParameterError(QObject::tr("Parameter '%1' must follow syntax '%1=%2'",
"e.g. Parameter '--webui-port' must follow syntax '--webui-port=value'")
.arg(fullParameter(), u"<value>"_qs));
.arg(fullParameter(), QLatin1String("<value>")));
}
QString value(const QProcessEnvironment &env, const QString &defaultValue = {}) const
{
QString val = env.value(envVarName());
return val.isEmpty() ? defaultValue : Utils::String::unquote(val, u"'\""_qs);
return val.isEmpty() ? defaultValue : Utils::String::unquote(val, QLatin1String("'\""));
}
QString usage(const QString &valueName) const
{
return padUsageText(parameterAssignment() + u'<' + valueName + u'>');
}
friend bool operator==(const StringOption &option, const QString &arg)
{
return arg.startsWith(option.parameterAssignment());
return padUsageText(parameterAssignment() + QLatin1Char('<') + valueName + QLatin1Char('>'));
}
private:
QString parameterAssignment() const
{
return fullParameter() + u'=';
return fullParameter() + QLatin1Char('=');
}
};
bool operator==(const QString &arg, const StringOption &option)
bool operator==(const QString &s, const StringOption &o)
{
return (option == arg);
return o == s;
}
// Option with integer value. May not have a shortcut
@@ -194,6 +195,7 @@ namespace
{
}
using StringOption::operator==;
using StringOption::usage;
int value(const QString &arg) const
@@ -204,7 +206,7 @@ namespace
if (!ok)
throw CommandLineParameterError(QObject::tr("Parameter '%1' must follow syntax '%1=%2'",
"e.g. Parameter '--webui-port' must follow syntax '--webui-port=<value>'")
.arg(fullParameter(), u"<integer value>"_qs));
.arg(fullParameter(), QLatin1String("<integer value>")));
return res;
}
@@ -223,16 +225,11 @@ namespace
}
return res;
}
friend bool operator==(const IntOption &option, const QString &arg)
{
return (static_cast<StringOption>(option) == arg);
}
};
bool operator==(const QString &arg, const IntOption &option)
bool operator==(const QString &s, const IntOption &o)
{
return (option == arg);
return o == s;
}
// Option that is explicitly set to true or false, and whose value is undefined when unspecified.
@@ -246,14 +243,20 @@ namespace
{
}
bool operator==(const QString &arg) const
{
QStringList parts = arg.split(QLatin1Char('='));
return parts[0] == fullParameter();
}
QString usage() const
{
return padUsageText(fullParameter() + u"=<true|false>");
return padUsageText(fullParameter() + QLatin1String("=<true|false>"));
}
std::optional<bool> value(const QString &arg) const
{
QStringList parts = arg.split(u'=');
QStringList parts = arg.split(QLatin1Char('='));
if (parts.size() == 1)
{
@@ -263,11 +266,11 @@ namespace
{
QString val = parts[1];
if ((val.toUpper() == u"TRUE") || (val == u"1"))
if ((val.toUpper() == QLatin1String("TRUE")) || (val == QLatin1String("1")))
{
return true;
}
if ((val.toUpper() == u"FALSE") || (val == u"0"))
if ((val.toUpper() == QLatin1String("FALSE")) || (val == QLatin1String("0")))
{
return false;
}
@@ -276,46 +279,41 @@ namespace
throw CommandLineParameterError(QObject::tr("Parameter '%1' must follow syntax '%1=%2'",
"e.g. Parameter '--add-paused' must follow syntax "
"'--add-paused=<true|false>'")
.arg(fullParameter(), u"<true|false>"_qs));
.arg(fullParameter(), QLatin1String("<true|false>")));
}
std::optional<bool> value(const QProcessEnvironment &env) const
{
const QString val = env.value(envVarName(), u"-1"_qs);
const QString val = env.value(envVarName(), "-1");
if (val.isEmpty())
{
return m_defaultValue;
}
if (val == u"-1")
if (val == QLatin1String("-1"))
{
return std::nullopt;
}
if ((val.toUpper() == u"TRUE") || (val == u"1"))
if ((val.toUpper() == QLatin1String("TRUE")) || (val == QLatin1String("1")))
{
return true;
}
if ((val.toUpper() == u"FALSE") || (val == u"0"))
if ((val.toUpper() == QLatin1String("FALSE")) || (val == QLatin1String("0")))
{
return false;
}
qDebug() << QObject::tr("Expected %1 in environment variable '%2', but got '%3'")
.arg(u"true|false"_qs, envVarName(), val);
.arg(QLatin1String("true|false"), envVarName(), val);
return std::nullopt;
}
friend bool operator==(const TriStateBoolOption &option, const QString &arg)
{
return arg.section(u'=', 0, 0) == option.fullParameter();
}
bool m_defaultValue;
};
bool operator==(const QString &arg, const TriStateBoolOption &option)
bool operator==(const QString &s, const TriStateBoolOption &o)
{
return (option == arg);
return o == s;
}
constexpr const BoolOption SHOW_HELP_OPTION {"help", 'h'};
@@ -374,25 +372,25 @@ QStringList QBtCommandLineParameters::paramList() const
// torrent paths or URLs.
if (!savePath.isEmpty())
result.append(u"@savePath=" + savePath.data());
result.append(QLatin1String("@savePath=") + savePath);
if (addPaused.has_value())
result.append(*addPaused ? u"@addPaused=1"_qs : u"@addPaused=0"_qs);
result.append(*addPaused ? QLatin1String {"@addPaused=1"} : QLatin1String {"@addPaused=0"});
if (skipChecking)
result.append(u"@skipChecking"_qs);
result.append(QLatin1String("@skipChecking"));
if (!category.isEmpty())
result.append(u"@category=" + category);
result.append(QLatin1String("@category=") + category);
if (sequential)
result.append(u"@sequential"_qs);
result.append(QLatin1String("@sequential"));
if (firstLastPiecePriority)
result.append(u"@firstLastPiecePriority"_qs);
result.append(QLatin1String("@firstLastPiecePriority"));
if (skipDialog.has_value())
result.append(*skipDialog ? u"@skipDialog=1"_qs : u"@skipDialog=0"_qs);
result.append(*skipDialog ? QLatin1String {"@skipDialog=1"} : QLatin1String {"@skipDialog=0"});
result += torrents;
return result;
@@ -406,8 +404,8 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
{
const QString &arg = args[i];
if ((arg.startsWith(u"--") && !arg.endsWith(u".torrent"))
|| (arg.startsWith(u'-') && (arg.size() == 2)))
if ((arg.startsWith("--") && !arg.endsWith(".torrent"))
|| (arg.startsWith('-') && (arg.size() == 2)))
{
// Parse known parameters
if (arg == SHOW_HELP_OPTION)
@@ -425,7 +423,7 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
result.webUiPort = WEBUI_PORT_OPTION.value(arg);
if ((result.webUiPort < 1) || (result.webUiPort > 65535))
throw CommandLineParameterError(QObject::tr("%1 must specify a valid port (1 to 65535).")
.arg(u"--webui-port"_qs));
.arg(QLatin1String("--webui-port")));
}
#ifndef DISABLE_GUI
else if (arg == NO_SPLASH_OPTION)
@@ -440,7 +438,7 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
#endif
else if (arg == PROFILE_OPTION)
{
result.profileDir = Path(PROFILE_OPTION.value(arg));
result.profileDir = PROFILE_OPTION.value(arg);
}
else if (arg == RELATIVE_FASTRESUME)
{
@@ -452,7 +450,7 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
}
else if (arg == SAVE_PATH_OPTION)
{
result.savePath = Path(SAVE_PATH_OPTION.value(arg));
result.savePath = SAVE_PATH_OPTION.value(arg);
}
else if (arg == PAUSED_OPTION)
{
@@ -502,7 +500,7 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
QString wrapText(const QString &text, int initialIndentation = USAGE_TEXT_COLUMN, int wrapAtColumn = WRAP_AT_COLUMN)
{
QStringList words = text.split(u' ');
QStringList words = text.split(' ');
QStringList lines = {words.first()};
int currentLineMaxLength = wrapAtColumn - initialIndentation;
@@ -510,71 +508,73 @@ QString wrapText(const QString &text, int initialIndentation = USAGE_TEXT_COLUMN
{
if (lines.last().length() + word.length() + 1 < currentLineMaxLength)
{
lines.last().append(u' ' + word);
lines.last().append(' ' + word);
}
else
{
lines.append(QString(initialIndentation, u' ') + word);
lines.append(QString(initialIndentation, ' ') + word);
currentLineMaxLength = wrapAtColumn;
}
}
return lines.join(u'\n');
return lines.join('\n');
}
QString makeUsage(const QString &prgName)
{
const QString indentation {USAGE_INDENTATION, u' '};
QString text;
QTextStream stream(&text, QIODevice::WriteOnly);
QString indentation = QString(USAGE_INDENTATION, ' ');
const QString text = QObject::tr("Usage:") + u'\n'
+ indentation + prgName + u' ' + QObject::tr("[options] [(<filename> | <url>)...]") + u'\n'
stream << QObject::tr("Usage:") << '\n'
<< indentation << prgName << QLatin1String(" [options] [(<filename> | <url>)...]") << '\n'
+ QObject::tr("Options:") + u'\n'
<< QObject::tr("Options:") << '\n'
#if !defined(Q_OS_WIN) || defined(DISABLE_GUI)
+ SHOW_VERSION_OPTION.usage() + wrapText(QObject::tr("Display program version and exit")) + u'\n'
<< SHOW_VERSION_OPTION.usage() << wrapText(QObject::tr("Display program version and exit")) << '\n'
#endif
+ SHOW_HELP_OPTION.usage() + wrapText(QObject::tr("Display this help message and exit")) + u'\n'
+ WEBUI_PORT_OPTION.usage(QObject::tr("port"))
+ wrapText(QObject::tr("Change the Web UI port"))
+ u'\n'
<< SHOW_HELP_OPTION.usage() << wrapText(QObject::tr("Display this help message and exit")) << '\n'
<< WEBUI_PORT_OPTION.usage(QObject::tr("port"))
<< wrapText(QObject::tr("Change the Web UI port"))
<< '\n'
#ifndef DISABLE_GUI
+ NO_SPLASH_OPTION.usage() + wrapText(QObject::tr("Disable splash screen")) + u'\n'
<< NO_SPLASH_OPTION.usage() << wrapText(QObject::tr("Disable splash screen")) << '\n'
#elif !defined(Q_OS_WIN)
+ DAEMON_OPTION.usage() + wrapText(QObject::tr("Run in daemon-mode (background)")) + u'\n'
<< DAEMON_OPTION.usage() << wrapText(QObject::tr("Run in daemon-mode (background)")) << '\n'
#endif
//: Use appropriate short form or abbreviation of "directory"
+ PROFILE_OPTION.usage(QObject::tr("dir"))
+ wrapText(QObject::tr("Store configuration files in <dir>")) + u'\n'
+ CONFIGURATION_OPTION.usage(QObject::tr("name"))
+ wrapText(QObject::tr("Store configuration files in directories qBittorrent_<name>")) + u'\n'
+ RELATIVE_FASTRESUME.usage()
+ wrapText(QObject::tr("Hack into libtorrent fastresume files and make file paths relative "
"to the profile directory")) + u'\n'
+ Option::padUsageText(QObject::tr("files or URLs"))
+ wrapText(QObject::tr("Download the torrents passed by the user")) + u'\n'
+ u'\n'
<< PROFILE_OPTION.usage(QObject::tr("dir"))
<< wrapText(QObject::tr("Store configuration files in <dir>")) << '\n'
<< CONFIGURATION_OPTION.usage(QObject::tr("name"))
<< wrapText(QObject::tr("Store configuration files in directories qBittorrent_<name>")) << '\n'
<< RELATIVE_FASTRESUME.usage()
<< wrapText(QObject::tr("Hack into libtorrent fastresume files and make file paths relative "
"to the profile directory")) << '\n'
<< Option::padUsageText(QObject::tr("files or URLs"))
<< wrapText(QObject::tr("Download the torrents passed by the user")) << '\n'
<< '\n'
+ wrapText(QObject::tr("Options when adding new torrents:"), 0) + u'\n'
+ SAVE_PATH_OPTION.usage(QObject::tr("path")) + wrapText(QObject::tr("Torrent save path")) + u'\n'
+ PAUSED_OPTION.usage() + wrapText(QObject::tr("Add torrents as started or paused")) + u'\n'
+ SKIP_HASH_CHECK_OPTION.usage() + wrapText(QObject::tr("Skip hash check")) + u'\n'
+ CATEGORY_OPTION.usage(QObject::tr("name"))
+ wrapText(QObject::tr("Assign torrents to category. If the category doesn't exist, it will be "
"created.")) + u'\n'
+ SEQUENTIAL_OPTION.usage() + wrapText(QObject::tr("Download files in sequential order")) + u'\n'
+ FIRST_AND_LAST_OPTION.usage()
+ wrapText(QObject::tr("Download first and last pieces first")) + u'\n'
+ SKIP_DIALOG_OPTION.usage()
+ wrapText(QObject::tr("Specify whether the \"Add New Torrent\" dialog opens when adding a "
"torrent.")) + u'\n'
+ u'\n'
<< wrapText(QObject::tr("Options when adding new torrents:"), 0) << '\n'
<< SAVE_PATH_OPTION.usage(QObject::tr("path")) << wrapText(QObject::tr("Torrent save path")) << '\n'
<< PAUSED_OPTION.usage() << wrapText(QObject::tr("Add torrents as started or paused")) << '\n'
<< SKIP_HASH_CHECK_OPTION.usage() << wrapText(QObject::tr("Skip hash check")) << '\n'
<< CATEGORY_OPTION.usage(QObject::tr("name"))
<< wrapText(QObject::tr("Assign torrents to category. If the category doesn't exist, it will be "
"created.")) << '\n'
<< SEQUENTIAL_OPTION.usage() << wrapText(QObject::tr("Download files in sequential order")) << '\n'
<< FIRST_AND_LAST_OPTION.usage()
<< wrapText(QObject::tr("Download first and last pieces first")) << '\n'
<< SKIP_DIALOG_OPTION.usage()
<< wrapText(QObject::tr("Specify whether the \"Add New Torrent\" dialog opens when adding a "
"torrent.")) << '\n'
<< '\n'
+ wrapText(QObject::tr("Option values may be supplied via environment variables. For option named "
<< wrapText(QObject::tr("Option values may be supplied via environment variables. For option named "
"'parameter-name', environment variable name is 'QBT_PARAMETER_NAME' (in upper "
"case, '-' replaced with '_'). To pass flag values, set the variable to '1' or "
"'TRUE'. For example, to disable the splash screen: "), 0) + u'\n'
+ u"QBT_NO_SPLASH=1 " + prgName + u'\n'
+ wrapText(QObject::tr("Command line parameters take precedence over environment variables"), 0) + u'\n';
"'TRUE'. For example, to disable the splash screen: "), 0) << "\n"
<< QLatin1String("QBT_NO_SPLASH=1 ") << prgName << '\n'
<< wrapText(QObject::tr("Command line parameters take precedence over environment variables"), 0) << '\n';
return text;
}

View File

@@ -36,7 +36,6 @@
#include <QStringList>
#include "base/exceptions.h"
#include "base/path.h"
class QProcessEnvironment;
@@ -59,9 +58,9 @@ struct QBtCommandLineParameters
std::optional<bool> addPaused;
std::optional<bool> skipDialog;
QStringList torrents;
Path profileDir;
QString profileDir;
QString configurationName;
Path savePath;
QString savePath;
QString category;
QString unknownParameter;

View File

@@ -44,9 +44,7 @@ namespace
const std::chrono::seconds FLUSH_INTERVAL {2};
}
FileLogger::FileLogger(const Path &path, const bool backup
, const int maxSize, const bool deleteOld, const int age
, const FileLogAgeType ageType)
FileLogger::FileLogger(const QString &path, const bool backup, const int maxSize, const bool deleteOld, const int age, const FileLogAgeType ageType)
: m_backup(backup)
, m_maxSize(maxSize)
{
@@ -70,26 +68,27 @@ FileLogger::~FileLogger()
closeLogFile();
}
void FileLogger::changePath(const Path &newPath)
void FileLogger::changePath(const QString &newPath)
{
// compare paths as strings to perform case sensitive comparison on all the platforms
if (newPath.data() == m_path.parentPath().data())
return;
const QDir dir(newPath);
dir.mkpath(newPath);
const QString tmpPath = dir.absoluteFilePath("qbittorrent.log");
closeLogFile();
if (tmpPath != m_path)
{
m_path = tmpPath;
m_path = newPath / Path(u"qbittorrent.log"_qs);
m_logFile.setFileName(m_path.data());
Utils::Fs::mkpath(newPath);
openLogFile();
closeLogFile();
m_logFile.setFileName(m_path);
openLogFile();
}
}
void FileLogger::deleteOld(const int age, const FileLogAgeType ageType)
{
const QDateTime date = QDateTime::currentDateTime();
const QDir dir {m_path.parentPath().data()};
const QFileInfoList fileList = dir.entryInfoList(QStringList(u"qbittorrent.log.bak*"_qs)
const QDir dir(Utils::Fs::branchPath(m_path));
const QFileInfoList fileList = dir.entryInfoList(QStringList("qbittorrent.log.bak*")
, (QDir::Files | QDir::Writable), (QDir::Time | QDir::Reversed));
for (const QFileInfo &file : fileList)
@@ -108,7 +107,7 @@ void FileLogger::deleteOld(const int age, const FileLogAgeType ageType)
}
if (modificationDate > date)
break;
Utils::Fs::removeFile(Path(file.absoluteFilePath()));
Utils::Fs::forceRemove(file.absoluteFilePath());
}
}
@@ -134,33 +133,33 @@ void FileLogger::addLogMessage(const Log::Msg &msg)
switch (msg.type)
{
case Log::INFO:
stream << QStringView(u"(I) ");
stream << "(I) ";
break;
case Log::WARNING:
stream << QStringView(u"(W) ");
stream << "(W) ";
break;
case Log::CRITICAL:
stream << QStringView(u"(C) ");
stream << "(C) ";
break;
default:
stream << QStringView(u"(N) ");
stream << "(N) ";
}
stream << QDateTime::fromSecsSinceEpoch(msg.timestamp).toString(Qt::ISODate) << QStringView(u" - ") << msg.message << QChar(u'\n');
stream << QDateTime::fromMSecsSinceEpoch(msg.timestamp).toString(Qt::ISODate) << " - " << msg.message << '\n';
if (m_backup && (m_logFile.size() >= m_maxSize))
{
closeLogFile();
int counter = 0;
Path backupLogFilename = m_path + u".bak";
QString backupLogFilename = m_path + ".bak";
while (backupLogFilename.exists())
while (QFile::exists(backupLogFilename))
{
++counter;
backupLogFilename = m_path + u".bak" + QString::number(counter);
backupLogFilename = m_path + ".bak" + QString::number(counter);
}
Utils::Fs::renameFile(m_path, backupLogFilename);
QFile::rename(m_path, backupLogFilename);
openLogFile();
}
else

View File

@@ -32,8 +32,6 @@
#include <QObject>
#include <QTimer>
#include "base/path.h"
namespace Log
{
struct Msg;
@@ -52,10 +50,10 @@ public:
YEARS
};
FileLogger(const Path &path, bool backup, int maxSize, bool deleteOld, int age, FileLogAgeType ageType);
FileLogger(const QString &path, bool backup, int maxSize, bool deleteOld, int age, FileLogAgeType ageType);
~FileLogger();
void changePath(const Path &newPath);
void changePath(const QString &newPath);
void deleteOld(int age, FileLogAgeType ageType);
void setBackup(bool value);
void setMaxSize(int value);
@@ -68,7 +66,7 @@ private:
void openLogFile();
void closeLogFile();
Path m_path;
QString m_path;
bool m_backup;
int m_maxSize;
QFile m_logFile;

View File

@@ -29,19 +29,16 @@
#include <QtGlobal>
#include <chrono>
#include <csignal>
#include <cstdlib>
#include <memory>
#ifdef Q_OS_UNIX
#if defined(Q_OS_UNIX)
#include <sys/resource.h>
#endif
#ifndef Q_OS_WIN
#ifndef Q_OS_HAIKU
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
#include <unistd.h>
#endif // Q_OS_HAIKU
#elif defined DISABLE_GUI
#elif defined Q_OS_WIN && defined DISABLE_GUI
#include <io.h>
#endif
@@ -63,41 +60,74 @@
Q_IMPORT_PLUGIN(QICOPlugin)
#endif // QBT_STATIC_QT
#else // DISABLE_GUI
#else
// NoGUI-only includes
#include <cstdio>
#endif // DISABLE_GUI
#include "base/global.h"
#ifdef STACKTRACE
#ifdef Q_OS_UNIX
#include "stacktrace.h"
#else
#include "stacktrace_win.h"
#ifndef DISABLE_GUI
#include "stacktracedialog.h"
#endif // DISABLE_GUI
#endif // Q_OS_UNIX
#endif //STACKTRACE
#include "base/preferences.h"
#include "base/profile.h"
#include "base/version.h"
#include "application.h"
#include "cmdoptions.h"
#include "signalhandler.h"
#include "upgrade.h"
#ifndef DISABLE_GUI
#include "gui/utils.h"
#endif
using namespace std::chrono_literals;
// Signal handlers
void sigNormalHandler(int signum);
#ifdef STACKTRACE
void sigAbnormalHandler(int signum);
#endif
// sys_signame[] is only defined in BSD
const char *const sysSigName[] =
{
#if defined(Q_OS_WIN)
"", "", "SIGINT", "", "SIGILL", "", "SIGABRT_COMPAT", "", "SIGFPE", "",
"", "SIGSEGV", "", "", "", "SIGTERM", "", "", "", "",
"", "SIGBREAK", "SIGABRT", "", "", "", "", "", "", "",
"", ""
#else
"", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT", "SIGBUS", "SIGFPE", "SIGKILL",
"SIGUSR1", "SIGSEGV", "SIGUSR2", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGSTKFLT", "SIGCHLD", "SIGCONT", "SIGSTOP",
"SIGTSTP", "SIGTTIN", "SIGTTOU", "SIGURG", "SIGXCPU", "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGWINCH", "SIGIO",
"SIGPWR", "SIGUNUSED"
#endif
};
#if !(defined Q_OS_WIN && !defined DISABLE_GUI) && !defined Q_OS_HAIKU
void reportToUser(const char *str);
#endif
void displayVersion();
bool userAgreesWithLegalNotice();
void displayBadArgMessage(const QString &message);
#ifndef DISABLE_GUI
#if !defined(DISABLE_GUI)
void showSplashScreen();
#endif // DISABLE_GUI
#ifdef Q_OS_UNIX
#if defined(Q_OS_UNIX)
void adjustFileDescriptorLimit();
#endif
// Main
int main(int argc, char *argv[])
{
#ifdef Q_OS_UNIX
#if defined(Q_OS_UNIX)
adjustFileDescriptorLimit();
#endif
@@ -134,20 +164,24 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}
throw CommandLineParameterError(QObject::tr("%1 must be the single command line parameter.")
.arg(u"-v (or --version)"_qs));
.arg(QLatin1String("-v (or --version)")));
}
#endif
if (params.showHelp)
{
if (isOneArg)
{
displayUsage(QString::fromLocal8Bit(argv[0]));
displayUsage(argv[0]);
return EXIT_SUCCESS;
}
throw CommandLineParameterError(QObject::tr("%1 must be the single command line parameter.")
.arg(u"-h (or --help)"_qs));
.arg(QLatin1String("-h (or --help)")));
}
// Set environment variable
if (!qputenv("QBITTORRENT", QBT_VERSION))
fprintf(stderr, "Couldn't set environment variable...\n");
const bool firstTimeUser = !Preferences::instance()->getAcceptedLegal();
if (firstTimeUser)
{
@@ -177,9 +211,11 @@ int main(int argc, char *argv[])
if (params.shouldDaemonize)
{
throw CommandLineParameterError(QObject::tr("You cannot use %1: qBittorrent is already running for this user.")
.arg(u"-d (or --daemon)"_qs));
.arg(QLatin1String("-d (or --daemon)")));
}
else
#endif
qDebug("qBittorrent is already running for this user.");
QThread::msleep(300);
app->sendParams(params.paramList());
@@ -187,7 +223,7 @@ int main(int argc, char *argv[])
return EXIT_SUCCESS;
}
#ifdef Q_OS_WIN
#if defined(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.
@@ -206,7 +242,7 @@ int main(int argc, char *argv[])
#endif
#endif // Q_OS_WIN
#ifdef Q_OS_MACOS
#if defined(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.
@@ -265,7 +301,12 @@ int main(int argc, char *argv[])
showSplashScreen();
#endif
registerSignalHandlers();
signal(SIGINT, sigNormalHandler);
signal(SIGTERM, sigNormalHandler);
#ifdef STACKTRACE
signal(SIGABRT, sigAbnormalHandler);
signal(SIGSEGV, sigAbnormalHandler);
#endif
return app->exec(params.paramList());
}
@@ -276,18 +317,75 @@ int main(int argc, char *argv[])
}
}
#if !(defined Q_OS_WIN && !defined DISABLE_GUI) && !defined Q_OS_HAIKU
void reportToUser(const char *str)
{
const size_t strLen = strlen(str);
#ifndef Q_OS_WIN
if (write(STDERR_FILENO, str, strLen) < static_cast<ssize_t>(strLen))
{
const auto dummy = write(STDOUT_FILENO, str, strLen);
#else
if (_write(STDERR_FILENO, str, strLen) < static_cast<ssize_t>(strLen))
{
const auto dummy = _write(STDOUT_FILENO, str, strLen);
#endif
Q_UNUSED(dummy);
}
}
#endif
void sigNormalHandler(int signum)
{
#if !(defined Q_OS_WIN && !defined DISABLE_GUI) && !defined Q_OS_HAIKU
const char msg1[] = "Catching signal: ";
const char msg2[] = "\nExiting cleanly\n";
reportToUser(msg1);
reportToUser(sysSigName[signum]);
reportToUser(msg2);
#endif // !defined Q_OS_WIN && !defined Q_OS_HAIKU
signal(signum, SIG_DFL);
qApp->exit(); // unsafe, but exit anyway
}
#ifdef STACKTRACE
void sigAbnormalHandler(int signum)
{
const char *sigName = sysSigName[signum];
#if !(defined Q_OS_WIN && !defined DISABLE_GUI) && !defined Q_OS_HAIKU
const char msg[] = "\n\n*************************************************************\n"
"Please file a bug report at http://bug.qbittorrent.org and provide the following information:\n\n"
"qBittorrent version: " QBT_VERSION "\n\n"
"Caught signal: ";
reportToUser(msg);
reportToUser(sigName);
reportToUser("\n");
print_stacktrace(); // unsafe
#endif
#if defined Q_OS_WIN && !defined DISABLE_GUI
StacktraceDialog dlg; // unsafe
dlg.setStacktraceString(QLatin1String(sigName), straceWin::getBacktrace());
dlg.exec();
#endif
signal(signum, SIG_DFL);
raise(signum);
}
#endif // STACKTRACE
#if !defined(DISABLE_GUI)
void showSplashScreen()
{
QPixmap splashImg(u":/icons/splash.png"_qs);
QPixmap splashImg(":/icons/splash.png");
QPainter painter(&splashImg);
const auto version = QStringLiteral(QBT_VERSION);
const QString version = QBT_VERSION;
painter.setPen(QPen(Qt::white));
painter.setFont(QFont(u"Arial"_qs, 22, QFont::Black));
painter.setFont(QFont("Arial", 22, QFont::Black));
painter.drawText(224 - painter.fontMetrics().horizontalAdvance(version), 270, version);
QSplashScreen *splash = new QSplashScreen(splashImg);
splash->show();
QTimer::singleShot(1500ms, splash, &QObject::deleteLater);
QTimer::singleShot(1500, splash, &QObject::deleteLater);
qApp->processEvents();
}
#endif // DISABLE_GUI
@@ -302,14 +400,14 @@ void displayBadArgMessage(const QString &message)
const QString help = QObject::tr("Run application with -h option to read about command line parameters.");
#if defined(Q_OS_WIN) && !defined(DISABLE_GUI)
QMessageBox msgBox(QMessageBox::Critical, QObject::tr("Bad command line"),
(message + u'\n' + help), QMessageBox::Ok);
message + QLatin1Char('\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 = QObject::tr("Bad command line: ") + u'\n'
+ message + u'\n'
+ help + u'\n';
const QString errMsg = QObject::tr("Bad command line: ") + '\n'
+ message + '\n'
+ help + '\n';
fprintf(stderr, "%s", qUtf8Printable(errMsg));
#endif
}
@@ -320,10 +418,10 @@ bool userAgreesWithLegalNotice()
Q_ASSERT(!pref->getAcceptedLegal());
#ifdef DISABLE_GUI
const QString eula = u"\n*** %1 ***\n"_qs.arg(QObject::tr("Legal Notice"))
+ QObject::tr("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"
+ QObject::tr("No further notices will be issued.") + u"\n\n"
+ QObject::tr("Press %1 key to accept and continue...").arg(u"'y'"_qs) + u'\n';
const QString eula = QString::fromLatin1("\n*** %1 ***\n").arg(QObject::tr("Legal Notice"))
+ QObject::tr("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\n"
+ QObject::tr("No further notices will be issued.") + "\n\n"
+ QObject::tr("Press %1 key to accept and continue...").arg("'y'") + '\n';
printf("%s", qUtf8Printable(eula));
const char ret = getchar(); // Read pressed key
@@ -353,7 +451,7 @@ bool userAgreesWithLegalNotice()
return false;
}
#ifdef Q_OS_UNIX
#if defined(Q_OS_UNIX)
void adjustFileDescriptorLimit()
{
rlimit limit {};

View File

@@ -94,12 +94,12 @@ const char ACK[] = "ack";
QtLocalPeer::QtLocalPeer(const QString &path, QObject *parent)
: QObject(parent)
, m_socketName(path + u"/ipc-socket")
, m_socketName(path + QLatin1String("/ipc-socket"))
, m_server(new QLocalServer(this))
{
m_server->setSocketOptions(QLocalServer::UserAccessOption);
m_lockFile.setFileName(path + u"/lockfile");
m_lockFile.setFileName(path + QLatin1String("/lockfile"));
m_lockFile.open(QIODevice::ReadWrite);
}

View File

@@ -80,18 +80,16 @@ Qt::HANDLE QtLockedFile::getMutexHandle(const int idx, const bool doCreate)
if (m_mutexName.isEmpty())
{
QFileInfo fi(*this);
m_mutexName = u"QtLockedFile mutex " + fi.absoluteFilePath().toLower();
m_mutexName = QString::fromLatin1("QtLockedFile mutex ") + fi.absoluteFilePath().toLower();
}
QString mname = m_mutexName;
if (idx >= 0)
mname += QString::number(idx);
const std::wstring mnameWStr = mname.toStdWString();
if (doCreate)
{
const Qt::HANDLE mutex = ::CreateMutexW(NULL, FALSE, mnameWStr.c_str());
const Qt::HANDLE mutex = ::CreateMutexW(NULL, FALSE, reinterpret_cast<const TCHAR *>(mname.utf16()));
if (!mutex)
{
qErrnoWarning("QtLockedFile::lock(): CreateMutex failed");
@@ -102,7 +100,7 @@ Qt::HANDLE QtLockedFile::getMutexHandle(const int idx, const bool doCreate)
}
else
{
const Qt::HANDLE mutex = ::OpenMutexW((SYNCHRONIZE | MUTEX_MODIFY_STATE), FALSE, mnameWStr.c_str());
const Qt::HANDLE mutex = ::OpenMutexW((SYNCHRONIZE | MUTEX_MODIFY_STATE), FALSE, reinterpret_cast<const TCHAR *>(mname.utf16()));
if (!mutex)
{
if (GetLastError() != ERROR_FILE_NOT_FOUND)

View File

@@ -1,129 +0,0 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2022 Mike Tzou (Chocobo1)
* Copyright (C) 2014 Vladimir Golovnev <glassez@yandex.ru>
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
*
* 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 "signalhandler.h"
#include <QtGlobal>
#include <algorithm>
#include <csignal>
#include <tuple>
#ifdef Q_OS_UNIX
#include <unistd.h>
#elif defined Q_OS_WIN
#include <io.h>
#endif
#include <QCoreApplication>
#include "base/version.h"
#ifdef STACKTRACE
#include "stacktrace.h"
#ifndef DISABLE_GUI
#include "gui/stacktracedialog.h"
#endif
#endif //STACKTRACE
namespace
{
// sys_signame[] is only defined in BSD
const char *const sysSigName[] =
{
#ifdef Q_OS_WIN
"", "", "SIGINT", "", "SIGILL", "", "SIGABRT_COMPAT", "", "SIGFPE", "",
"", "SIGSEGV", "", "", "", "SIGTERM", "", "", "", "",
"", "SIGBREAK", "SIGABRT", "", "", "", "", "", "", "",
"", ""
#else
"", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT", "SIGBUS", "SIGFPE", "SIGKILL",
"SIGUSR1", "SIGSEGV", "SIGUSR2", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGSTKFLT", "SIGCHLD", "SIGCONT", "SIGSTOP",
"SIGTSTP", "SIGTTIN", "SIGTTOU", "SIGURG", "SIGXCPU", "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGWINCH", "SIGIO",
"SIGPWR", "SIGUNUSED"
#endif
};
void safePrint(const char *str)
{
const size_t strLen = strlen(str);
#ifdef Q_OS_WIN
if (_write(_fileno(stderr), str, static_cast<unsigned int>(strLen)) < static_cast<int>(strLen))
std::ignore = _write(_fileno(stdout), str, static_cast<unsigned int>(strLen));
#else
if (write(STDERR_FILENO, str, strLen) < static_cast<ssize_t>(strLen))
std::ignore = write(STDOUT_FILENO, str, strLen);
#endif
}
void normalExitHandler(const int signum)
{
const char *msgs[] = {"Catching signal: ", sysSigName[signum], "\nExiting cleanly\n"};
std::for_each(std::begin(msgs), std::end(msgs), safePrint);
signal(signum, SIG_DFL);
QCoreApplication::exit(); // unsafe, but exit anyway
}
#ifdef STACKTRACE
void abnormalExitHandler(const int signum)
{
const char msg[] = "\n\n*************************************************************\n"
"Please file a bug report at http://bug.qbittorrent.org and provide the following information:\n\n"
"qBittorrent version: " QBT_VERSION "\n\n"
"Caught signal: ";
const char *sigName = sysSigName[signum];
const std::string stacktrace = getStacktrace();
const char *msgs[] = {msg, sigName, "\n```\n", stacktrace.c_str(), "```\n\n"};
std::for_each(std::begin(msgs), std::end(msgs), safePrint);
#ifndef DISABLE_GUI
StacktraceDialog dlg; // unsafe
dlg.setText(QString::fromLatin1(sigName), QString::fromStdString(stacktrace));
dlg.exec();
#endif
signal(signum, SIG_DFL);
raise(signum);
}
#endif // STACKTRACE
}
void registerSignalHandlers()
{
signal(SIGINT, normalExitHandler);
signal(SIGTERM, normalExitHandler);
#ifdef STACKTRACE
signal(SIGABRT, abnormalExitHandler);
signal(SIGSEGV, abnormalExitHandler);
#endif
}

View File

@@ -1,33 +0,0 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2022 Mike Tzou (Chocobo1)
* Copyright (C) 2014 Vladimir Golovnev <glassez@yandex.ru>
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
*
* 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 registerSignalHandlers();

View File

@@ -1,36 +0,0 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2022 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 "stacktrace.h"
#include <boost/stacktrace.hpp>
std::string getStacktrace()
{
return boost::stacktrace::to_string(boost::stacktrace::stacktrace());
}

View File

@@ -1,33 +1,116 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2022 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.
*/
// stacktrace.h (c) 2008, Timo Bingmann from http://idlebox.net/
// published under the WTFPL v2.0
#pragma once
#ifndef _STACKTRACE_H_
#define _STACKTRACE_H_
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <execinfo.h>
#include <cxxabi.h>
std::string getStacktrace();
#include <vector>
/** Print a demangled stack backtrace of the caller function to FILE* out. */
static inline void print_stacktrace(FILE *out = stderr, unsigned int max_frames = 63)
{
fprintf(out, "Stack trace:\n");
// storage array for stack trace address data
std::vector<void *> addrlist(max_frames + 1);
// retrieve current stack addresses
int addrlen = backtrace(addrlist.data(), addrlist.size());
if (addrlen == 0)
{
fprintf(out, " <empty, possibly corrupt>\n");
return;
}
// resolve addresses into strings containing "filename(function+address)",
// this array must be free()-ed
char * *symbollist = backtrace_symbols(addrlist.data(), addrlen);
// allocate string which will be filled with the demangled function name
size_t funcnamesize = 256;
char *funcname = static_cast<char *>(malloc(funcnamesize));
int functionNamesFound = 0;
// iterate over the returned symbol lines. skip the first, it is the
// address of this function.
for (int i = 2; i < addrlen; i++)
{
char *begin_name = 0, *begin_offset = 0, *end_offset = 0;
// find parentheses and +address offset surrounding the mangled name:
// ./module(function+0x15c) [0x8048a6d]
// fprintf(out, "%s TT\n", symbollist[i]);
for (char *p = symbollist[i]; *p; ++p)
{
if (*p == '(')
{
begin_name = p;
}
else if (*p == '+')
{
begin_offset = p;
}
else if ((*p == ')') && begin_offset)
{
end_offset = p;
break;
}
}
if (begin_name && begin_offset && end_offset
&& (begin_name < begin_offset))
{
*begin_name++ = '\0';
*begin_offset++ = '\0';
*end_offset = '\0';
// mangled name is now in [begin_name, begin_offset) and caller
// offset in [begin_offset, end_offset). now apply
// __cxa_demangle():
int status;
char *ret = abi::__cxa_demangle(begin_name,
funcname, &funcnamesize, &status);
if (status == 0)
{
funcname = ret; // use possibly realloc()-ed string
fprintf(out, " %s : %s+%s %s\n",
symbollist[i], funcname, begin_offset, ++end_offset);
}
else
{
// demangling failed. Output function name as a C function with
// no arguments.
fprintf(out, " %s : %s()+%s %s\n",
symbollist[i], begin_name, begin_offset, ++end_offset);
}
++functionNamesFound;
}
else
{
// couldn't parse the line? print the whole line.
fprintf(out, " %s\n", symbollist[i]);
}
}
if (!functionNamesFound)
{
fprintf(out, "There were no function names found in the stack trace\n."
"Seems like debug symbols are not installed, and the stack trace is useless.\n");
}
if (functionNamesFound < addrlen - 2)
{
fprintf(out, "Consider installing debug symbols for packages containing files with empty"
" function names (i.e. empty braces \"()\") to make your stack trace more useful\n");
}
free(funcname);
free(symbollist);
}
#endif // _STACKTRACE_H_

357
src/app/stacktrace_win.h Normal file
View File

@@ -0,0 +1,357 @@
/***************************************************************************
* Copyright (C) 2005-09 by the Quassel Project *
* devel@quassel-irc.org *
* *
* 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) version 3. *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#pragma once
#include <windows.h>
#include <dbghelp.h>
#include <stdio.h>
#include <QCoreApplication>
#include <QDir>
#include <QTextStream>
#ifdef __MINGW32__
#include <cxxabi.h>
#endif
namespace straceWin
{
void loadHelpStackFrame(IMAGEHLP_STACK_FRAME&, const STACKFRAME64&);
BOOL CALLBACK EnumSymbolsCB(PSYMBOL_INFO, ULONG, PVOID);
BOOL CALLBACK EnumModulesCB(LPCSTR, DWORD64, PVOID);
const QString getBacktrace();
struct EnumModulesContext;
// Also works for MinGW64
#ifdef __MINGW32__
void demangle(QString& str);
#endif
QString getSourcePathAndLineNumber(HANDLE hProcess, DWORD64 addr);
bool makeRelativePath(const QString& dir, QString& file);
}
#ifdef __MINGW32__
void straceWin::demangle(QString& str)
{
char const* inStr = qPrintable("_" + str); // Really need that underline or demangling will fail
int status = 0;
size_t outSz = 0;
char* demangled_name = abi::__cxa_demangle(inStr, 0, &outSz, &status);
if (status == 0)
{
str = QString::fromLocal8Bit(demangled_name);
if (outSz > 0)
free(demangled_name);
}
}
#endif
void straceWin::loadHelpStackFrame(IMAGEHLP_STACK_FRAME& ihsf, const STACKFRAME64& stackFrame)
{
ZeroMemory(&ihsf, sizeof(IMAGEHLP_STACK_FRAME));
ihsf.InstructionOffset = stackFrame.AddrPC.Offset;
ihsf.FrameOffset = stackFrame.AddrFrame.Offset;
}
BOOL CALLBACK straceWin::EnumSymbolsCB(PSYMBOL_INFO symInfo, ULONG size, PVOID user)
{
Q_UNUSED(size)
auto params = static_cast<QStringList *>(user);
if (symInfo->Flags & SYMFLAG_PARAMETER)
params->append(symInfo->Name);
return TRUE;
}
struct straceWin::EnumModulesContext
{
HANDLE hProcess;
QTextStream& stream;
EnumModulesContext(HANDLE hProcess, QTextStream& stream): hProcess(hProcess), stream(stream) {}
};
BOOL CALLBACK straceWin::EnumModulesCB(LPCSTR ModuleName, DWORD64 BaseOfDll, PVOID UserContext)
{
Q_UNUSED(ModuleName)
IMAGEHLP_MODULE64 mod;
auto context = static_cast<EnumModulesContext *>(UserContext);
mod.SizeOfStruct = sizeof(IMAGEHLP_MODULE64);
if(SymGetModuleInfo64(context->hProcess, BaseOfDll, &mod))
{
QString moduleBase = QString::fromLatin1("0x%1").arg(BaseOfDll, 16, 16, QLatin1Char('0'));
QString line = QString::fromLatin1("%1 %2 Image: %3")
.arg(mod.ModuleName, -25)
.arg(moduleBase, -13)
.arg(mod.LoadedImageName);
context->stream << line << '\n';
QString pdbName(mod.LoadedPdbName);
if(!pdbName.isEmpty())
{
QString line2 = QString::fromLatin1("%1 %2")
.arg("", 35)
.arg(pdbName);
context->stream << line2 << '\n';
}
}
return TRUE;
}
/**
* Cuts off leading 'dir' path from 'file' path, otherwise leaves it unchanged
* returns true if 'dir' is an ancestor of 'file', otherwise - false
*/
bool straceWin::makeRelativePath(const QString& dir, QString& file)
{
QString d = QDir::toNativeSeparators(QDir(dir).absolutePath());
QString f = QDir::toNativeSeparators(QFileInfo(file).absoluteFilePath());
// append separator at the end of dir
QChar separator = QDir::separator();
if (!d.isEmpty() && (d[d.length() - 1] != separator))
d += separator;
if (f.startsWith(d, Qt::CaseInsensitive))
{
f.remove(0, d.length());
file.swap(f);
return true;
}
return false;
}
QString straceWin::getSourcePathAndLineNumber(HANDLE hProcess, DWORD64 addr)
{
IMAGEHLP_LINE64 line {};
line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
DWORD dwDisplacement = 0;
if (SymGetLineFromAddr64(hProcess, addr, &dwDisplacement, &line))
{
QString path(line.FileName);
#if defined STACKTRACE_WIN_PROJECT_PATH || defined STACKTRACE_WIN_MAKEFILE_PATH
#define STACKTRACE_WIN_QUOTE(x) #x
#define STACKTRACE_WIN_STRING(x) STACKTRACE_WIN_QUOTE(x)
//prune leading project directory path or build target directory path
bool success = false;
#ifdef STACKTRACE_WIN_PROJECT_PATH
QString projectPath(STACKTRACE_WIN_STRING(STACKTRACE_WIN_PROJECT_PATH));
success = makeRelativePath(projectPath, path);
#endif
#ifdef STACKTRACE_WIN_MAKEFILE_PATH
if (!success)
{
QString targetPath(STACKTRACE_WIN_STRING(STACKTRACE_WIN_MAKEFILE_PATH));
makeRelativePath(targetPath, path);
}
#endif
#endif
return QString::fromLatin1("%1 : %2").arg(path).arg(line.LineNumber);
}
return QString();
}
#if defined( _M_IX86 ) && defined(Q_CC_MSVC)
// Disable global optimization and ignore /GS waning caused by
// inline assembly.
// not needed with mingw cause we can tell mingw which registers we use
#pragma optimize("g", off)
#pragma warning(push)
#pragma warning(disable : 4748)
#endif
const QString straceWin::getBacktrace()
{
DWORD MachineType;
CONTEXT Context;
STACKFRAME64 StackFrame;
#ifdef _M_IX86
ZeroMemory(&Context, sizeof(CONTEXT));
Context.ContextFlags = CONTEXT_CONTROL;
#ifdef __MINGW32__
asm ("Label:\n\t"
"movl %%ebp,%0;\n\t"
"movl %%esp,%1;\n\t"
"movl $Label,%%eax;\n\t"
"movl %%eax,%2;\n\t"
: "=r" (Context.Ebp),"=r" (Context.Esp),"=r" (Context.Eip)
: //no input
: "eax");
#else
_asm
{
Label:
mov [Context.Ebp], ebp;
mov [Context.Esp], esp;
mov eax, [Label];
mov [Context.Eip], eax;
}
#endif
#else
RtlCaptureContext(&Context);
#endif
ZeroMemory(&StackFrame, sizeof(STACKFRAME64));
#ifdef _M_IX86
MachineType = IMAGE_FILE_MACHINE_I386;
StackFrame.AddrPC.Offset = Context.Eip;
StackFrame.AddrPC.Mode = AddrModeFlat;
StackFrame.AddrFrame.Offset = Context.Ebp;
StackFrame.AddrFrame.Mode = AddrModeFlat;
StackFrame.AddrStack.Offset = Context.Esp;
StackFrame.AddrStack.Mode = AddrModeFlat;
#elif _M_X64
MachineType = IMAGE_FILE_MACHINE_AMD64;
StackFrame.AddrPC.Offset = Context.Rip;
StackFrame.AddrPC.Mode = AddrModeFlat;
StackFrame.AddrFrame.Offset = Context.Rsp;
StackFrame.AddrFrame.Mode = AddrModeFlat;
StackFrame.AddrStack.Offset = Context.Rsp;
StackFrame.AddrStack.Mode = AddrModeFlat;
#elif _M_IA64
MachineType = IMAGE_FILE_MACHINE_IA64;
StackFrame.AddrPC.Offset = Context.StIIP;
StackFrame.AddrPC.Mode = AddrModeFlat;
StackFrame.AddrFrame.Offset = Context.IntSp;
StackFrame.AddrFrame.Mode = AddrModeFlat;
StackFrame.AddrBStore.Offset = Context.RsBSP;
StackFrame.AddrBStore.Mode = AddrModeFlat;
StackFrame.AddrStack.Offset = Context.IntSp;
StackFrame.AddrStack.Mode = AddrModeFlat;
#else
#error "Unsupported platform"
#endif
QString log;
QTextStream logStream(&log);
logStream << "```\n";
HANDLE hProcess = GetCurrentProcess();
HANDLE hThread = GetCurrentThread();
SymInitializeW(hProcess, QCoreApplication::applicationDirPath().toStdWString().c_str(), TRUE);
DWORD64 dwDisplacement;
ULONG64 buffer[(sizeof(SYMBOL_INFO) +
MAX_SYM_NAME * sizeof(TCHAR) +
sizeof(ULONG64) - 1) / sizeof(ULONG64)];
auto pSymbol = reinterpret_cast<PSYMBOL_INFO>(buffer);
pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO);
pSymbol->MaxNameLen = MAX_SYM_NAME;
IMAGEHLP_MODULE64 mod;
mod.SizeOfStruct = sizeof(IMAGEHLP_MODULE64);
IMAGEHLP_STACK_FRAME ihsf;
ZeroMemory(&ihsf, sizeof(IMAGEHLP_STACK_FRAME));
int i = 0;
while(StackWalk64(MachineType, hProcess, hThread, &StackFrame, &Context, NULL, NULL, NULL, NULL))
{
if(i == 128)
break;
loadHelpStackFrame(ihsf, StackFrame);
if(StackFrame.AddrPC.Offset != 0)
{ // Valid frame.
QString fileName("???");
if(SymGetModuleInfo64(hProcess, ihsf.InstructionOffset, &mod))
{
fileName = QString(mod.ImageName);
int slashPos = fileName.lastIndexOf('\\');
if(slashPos != -1)
fileName = fileName.mid(slashPos + 1);
}
QString funcName;
QString sourceFile;
if(SymFromAddr(hProcess, ihsf.InstructionOffset, &dwDisplacement, pSymbol))
{
funcName = QString(pSymbol->Name);
#ifdef __MINGW32__
demangle(funcName);
#endif
// now ihsf.InstructionOffset points to the instruction that follows CALL instruction
// decrease the query address by one byte to point somewhere in the CALL instruction byte sequence
sourceFile = getSourcePathAndLineNumber(hProcess, ihsf.InstructionOffset - 1);
}
else
{
funcName = QString::fromLatin1("0x%1").arg(ihsf.InstructionOffset, 8, 16, QLatin1Char('0'));
}
SymSetContext(hProcess, &ihsf, NULL);
#ifndef __MINGW32__
QStringList params;
SymEnumSymbols(hProcess, 0, NULL, EnumSymbolsCB, (PVOID)&params);
#endif
QString insOffset = QString::fromLatin1("0x%1").arg(ihsf.InstructionOffset, 16, 16, QLatin1Char('0'));
QString formatLine = "#%1 %2 %3 %4";
#ifndef __MINGW32__
formatLine += "(%5)";
#endif
QString debugLine = formatLine
.arg(i, 3, 10)
.arg(fileName, -20)
.arg(insOffset, -11)
.arg(funcName)
#ifndef __MINGW32__
.arg(params.join(", "));
if (!sourceFile.isEmpty())
debugLine += QString::fromLatin1("[ %1 ]").arg(sourceFile);
#else
;
#endif
logStream << debugLine << '\n';
i++;
}
else
{
break; // we're at the end.
}
}
//logStream << "\n\nList of linked Modules:\n";
//EnumModulesContext modulesContext(hProcess, logStream);
//SymEnumerateModules64(hProcess, EnumModulesCB, (PVOID)&modulesContext);
SymCleanup(hProcess);
logStream << "```";
return log;
}
#if defined(_M_IX86) && defined(Q_CC_MSVC)
#pragma warning(pop)
#pragma optimize("g", on)
#endif

View File

@@ -47,11 +47,10 @@ StacktraceDialog::~StacktraceDialog()
delete m_ui;
}
void StacktraceDialog::setText(const QString &signalName, const QString &stacktrace)
void StacktraceDialog::setStacktraceString(const QString &sigName, const QString &trace)
{
// try not to call signal-unsafe functions
const QString htmlStr = QStringLiteral(
// try to call Qt function as less as possible
const QString htmlStr = QString(
"<p align=center><b><font size=7 color=red>"
"qBittorrent has crashed"
"</font></b></p>"
@@ -71,7 +70,7 @@ void StacktraceDialog::setText(const QString &signalName, const QString &stacktr
"OS version: %6<br/><br/>"
"Caught signal: %7"
"</font></p>"
"<pre><code>```\n%8\n```</code></pre>"
"<pre><code>%8</code></pre>"
"<br/><hr><br/><br/>")
.arg(QString::number(QT_POINTER_SIZE * 8)
, Utils::Misc::libtorrentVersionString()
@@ -79,8 +78,8 @@ void StacktraceDialog::setText(const QString &signalName, const QString &stacktr
, Utils::Misc::opensslVersionString()
, Utils::Misc::zlibVersionString()
, Utils::Misc::osName()
, signalName
, stacktrace);
, sigName
, trace);
m_ui->errorText->setHtml(htmlStr);
}

View File

@@ -45,8 +45,8 @@ public:
explicit StacktraceDialog(QWidget *parent = nullptr);
~StacktraceDialog() override;
void setText(const QString &signalName, const QString &stacktrace);
void setStacktraceString(const QString &sigName, const QString &trace);
private:
Ui::StacktraceDialog *m_ui = nullptr;
Ui::StacktraceDialog *m_ui;
};

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>StacktraceDialog</class>
<widget class="QDialog" name="StacktraceDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>480</height>
</rect>
</property>
<property name="windowTitle">
<string>Crash info</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextBrowser" name="errorText">
<property name="html">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

Some files were not shown because too many files have changed in this diff Show More