1
mirror of https://github.com/qbittorrent/qBittorrent synced 2025-11-02 08:10:54 +01:00

Compare commits

..

1 Commits

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

93
.appveyor.yml Normal file
View File

@@ -0,0 +1,93 @@
version: '{branch}-{build}'
# Do not build on tags (GitHub only)
skip_tags: true
image: Visual Studio 2022
branches:
except: # blacklist
- coverity_scan
environment:
REPO_DIR: &REPO_DIR c:\qbittorrent
CACHE_DIR: &CACHE_DIR c:\qbt_cache
QBT_VER_URL: https://builds.shiki.hu/appveyor/version_64
QBT_LIB_URL: https://builds.shiki.hu/appveyor/qbt_libraries_64.7z
# project directory
clone_folder: *REPO_DIR
# cache size should < 100MB (after compressing with fastest option):
# see: https://www.appveyor.com/docs/build-cache#save-update-cache-before-build-finishes
cache:
- *CACHE_DIR
clone_depth: 50
install:
# check if library needs update
- appveyor DownloadFile "%QBT_VER_URL%" -FileName "c:\version_new" && SET /P newVersion=<"c:\version_new"
- IF EXIST "%CACHE_DIR%\version" (SET /P oldVersion=<"%CACHE_DIR%\version")
- IF NOT EXIST "%CACHE_DIR%\version" (SET updateCache=1)
- IF NOT "%oldVersion%" == "%newVersion%" (SET updateCache=1)
# update library
- IF "%updateCache%" == "1" (ECHO "--- Will redownload libraries ---" &&
RMDIR /S /Q "%CACHE_DIR%" & MKDIR "%CACHE_DIR%" &&
appveyor DownloadFile "%QBT_LIB_URL%" -FileName "c:\qbt_lib.7z" && 7z x "c:\qbt_lib.7z" -o"%CACHE_DIR%" > nul &&
COPY "c:\version_new" "%CACHE_DIR%\version")
# Qt stay compressed in cache
- 7z x "%CACHE_DIR%\qt5_64.7z" -o"c:\qbt" > nul
before_build:
# setup env
- CALL "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
- SET PATH=%PATH%;C:\Qt\5.15.2\msvc2019_64\bin;%CACHE_DIR%\jom
# setup project
- COPY /Y "%CACHE_DIR%\conf.pri" "%REPO_DIR%"
# workarounds
- MKLINK /J "c:\qbt\base" "%CACHE_DIR%\base"
build_script:
- cd "%REPO_DIR%"
# 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
after_build:
- cd "%REPO_DIR%"
- MKDIR upload
- COPY dist\windows\qt.conf upload
- COPY src\release\qbittorrent.exe upload
- COPY src\release\qbittorrent.pdb upload
- COPY "%CACHE_DIR%\base\bin\libcrypto-1_1-x64.dll" upload
- COPY "%CACHE_DIR%\base\bin\libssl-1_1-x64.dll" upload
- COPY "%CACHE_DIR%\base\lib\torrent-rasterbar.dll" upload
- COPY "%CACHE_DIR%\base\lib\zlib1.dll" upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Core.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Gui.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Network.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Sql.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Svg.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Widgets.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5WinExtras.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Xml.dll upload
- MKDIR upload\plugins\iconengines
- COPY C:\Qt\5.15.2\msvc2019_64\plugins\iconengines\qsvgicon.dll upload\plugins\iconengines
- MKDIR upload\plugins\imageformats
- COPY C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qico.dll upload\plugins\imageformats
- COPY C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qsvg.dll upload\plugins\imageformats
- MKDIR upload\plugins\platforms
- COPY C:\Qt\5.15.2\msvc2019_64\plugins\platforms\qwindows.dll upload\plugins\platforms
- MKDIR upload\plugins\sqldrivers
- COPY C:\Qt\5.15.2\msvc2019_64\plugins\sqldrivers\qsqlite.dll upload\plugins\sqldrivers
- MKDIR upload\plugins\styles
- COPY C:\Qt\5.15.2\msvc2019_64\plugins\styles\qwindowsvistastyle.dll upload\plugins\styles
test: off
artifacts:
- path: upload
name: qBittorrent-Appveyor_Windows-x64

View File

@@ -1,81 +0,0 @@
Checks: >
bugprone-*,
cert-*,
concurrency-*,
cppcoreguidelines-*,
misc-*,
modernize-*,
performance-*,
portability-*,
readability-*,
-# not applicable at all,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-macro-parentheses,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-const-cast,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
-cppcoreguidelines-virtual-class-destructor,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-unused-parameters,
-modernize-avoid-c-arrays,
-modernize-pass-by-value,
-modernize-use-auto,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-named-parameter,
-readability-redundant-access-specifiers,
-readability-simplify-boolean-expr,
-readability-uppercase-literal-suffix,
-# only sometimes useful,
-bugprone-narrowing-conversions,
-cert-dcl58-cpp,
-cert-err33-c,
-cert-err58-cpp,
-clang-analyzer-core.CallAndMessage,
-clang-analyzer-cplusplus.NewDelete,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-concurrency-mt-unsafe,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-prefer-member-initializer,
-cppcoreguidelines-pro-type-static-cast-downcast,
-misc-definitions-in-headers,
-modernize-concat-nested-namespaces,
-modernize-loop-convert,
-modernize-raw-string-literal,
-modernize-unary-static-assert,
-performance-no-automatic-move,
-readability-convert-member-functions-to-static,
-readability-else-after-return,
-readability-redundant-declaration,
-# obsoleted,
-cert-dcl21-cpp
CheckOptions:
- { key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors, value: true }
- { key: modernize-use-override.IgnoreDestructors, value: true }
- { key: performance-for-range-copy.AllowedTypes, value: "QJsonValue" }
- { key: performance-for-range-copy.WarnOnAllAutoCopies, value: true }
- { key: readability-braces-around-statements.ShortStatementLines, value: 3 }
HeaderFilterRegex: ".+/src/.*\\.h"
WarningsAsErrors: "*"

View File

@@ -1,10 +1,8 @@
# EditorConfig is awesome: https://EditorConfig.org # EditorConfig is awesome: http://EditorConfig.org
root = true root = true
[*] [*]
charset = utf-8
end_of_line = lf
indent_style = space indent_style = space
indent_size = 4 indent_size = 4
insert_final_newline = true insert_final_newline = true

11
.gitattributes vendored
View File

@@ -1,10 +1,7 @@
core.eol=lf core.eol=lf
* text eol=lf * text eol=lf
*.icns binary
*.ico binary
*.png binary
*.qm binary
*.zip binary *.zip binary
*.png binary
dist/windows/license.txt text eol=crlf *.ico binary
test/testdata/crlf.txt text eol=crlf *.qm binary
*.icns binary

View File

@@ -14,7 +14,7 @@ body:
#### Prerequisites before submitting an issue! #### 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. - 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).** - 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. - 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/)**. - 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. - Verify that the **[wiki](https://github.com/qbittorrent/qBittorrent/wiki)** did not contain a suitable solution either.

2
.github/SUPPORT.md vendored
View File

@@ -9,7 +9,7 @@ For such questions, use one of the following community support resources:
* The [discussions section][discussions-url] * The [discussions section][discussions-url]
* The [official forum][forum-url] * The official forum [official forum][forum-url]
* The [qBittorrent subreddit][subreddit-url] * The [qBittorrent subreddit][subreddit-url]

View File

@@ -1,15 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
commit-message:
prefix: "GHA CI"
groups:
github-actions:
patterns:
- "*"
labels:
- "CI"
schedule:
interval: "monthly"

View File

@@ -30,7 +30,6 @@ from typing import Optional, Sequence
import argparse import argparse
import re import re
def main(argv: Optional[Sequence[str]] = None) -> int: def main(argv: Optional[Sequence[str]] = None) -> int:
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to check') parser.add_argument('filenames', nargs='*', help='Filenames to check')
@@ -48,12 +47,12 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
for line in file: for line in file:
if (match := regex.match(line)) is not None: if (match := regex.match(line)) is not None:
error_buffer += str(f"Defect file: \"{filename}\"\n" error_buffer += str(f"Defect file: \"{filename}\"\n"
f"Line: {line_counter}\n" f"Line: {line_counter}\n"
f"Column span: {match.span()}\n" f"Column span: {match.span()}\n"
f"Part: \"{match.group()}\"\n\n") f"Part: \"{match.group()}\"\n\n")
line_counter += 1 line_counter += 1
except UnicodeDecodeError: except UnicodeDecodeError as error:
# not a text file, skip # not a text file, skip
continue continue
@@ -65,6 +64,5 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
return 0 return 0
if __name__ == '__main__': if __name__ == '__main__':
exit(main()) exit(main())

View File

@@ -2,43 +2,16 @@ name: CI - File health
on: [pull_request, push] on: [pull_request, push]
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs: jobs:
ci: ci:
name: Check name: Check
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v2
- name: Install tools - name: Install tools
uses: actions/setup-python@v5 uses: actions/setup-python@v2
with:
python-version: "*"
- name: Check files - name: Check files
uses: pre-commit/action@v3.0.1 uses: pre-commit/action@v2.0.3
- name: Check doc
env:
pandoc_path: "${{ github.workspace }}/../pandoc"
run: |
# install pandoc
curl \
-L \
-o "${{ runner.temp }}/pandoc.tar.gz" \
"https://github.com/jgm/pandoc/releases/download/3.1.7/pandoc-3.1.7-linux-amd64.tar.gz"
tar -xf "${{ runner.temp }}/pandoc.tar.gz" -C "${{ github.workspace }}/.."
mv "${{ github.workspace }}/.."/pandoc-* "${{ env.pandoc_path }}"
# run pandoc
for lang in doc/*/; do
"${{ env.pandoc_path }}/bin/pandoc" -f markdown -t man -s "$lang/qbittorrent.1.md" -o "$lang/qbittorrent.1"
"${{ env.pandoc_path }}/bin/pandoc" -f markdown -t man -s "$lang/qbittorrent-nox.1.md" -o "$lang/qbittorrent-nox.1"
done
# check diff, ignore "Automatically generated by ..." part
git diff -I '\.\\".*' --exit-code

View File

@@ -1,14 +1,6 @@
name: CI - macOS name: CI - macOS
on: [pull_request, push] on: [pull_request, push]
permissions:
actions: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs: jobs:
ci: ci:
name: Build name: Build
@@ -17,64 +9,36 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
libt_version: ["2.0.10", "1.2.19"] libt_version: ["2.0.5", "1.2.15"]
qbt_gui: ["GUI=ON", "GUI=OFF"] qbt_gui: ["GUI=ON", "GUI=OFF"]
qt_version: ["6.7.0"] qt_version: ["5.15.2", "6.2.0"]
exclude:
- libt_version: "1.2.15"
qt_version: "6.2.0"
env: env:
boost_path: "${{ github.workspace }}/../boost" openssl_root: /usr/local/opt/openssl@1.1
libtorrent_path: "${{ github.workspace }}/../libtorrent"
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v2
- name: Install dependencies - name: Install dependencies
uses: Wandalen/wretry.action@v3 run: |
env: brew update > /dev/null
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 brew install \
HOMEBREW_NO_INSTALL_CLEANUP: 1 cmake ninja \
with: boost openssl@1.1 zlib
attempt_delay: 20000
attempt_limit: 6
command: |
brew update > /dev/null
brew install \
cmake ninja \
openssl@3 zlib
- name: Setup ccache - name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1 uses: Chocobo1/setup-ccache-action@v1
with: with:
store_cache: ${{ github.ref == 'refs/heads/master' }}
update_packager_index: false update_packager_index: false
ccache_options: |
max_size=2G
- name: Install boost
env:
BOOST_MAJOR_VERSION: "1"
BOOST_MINOR_VERSION: "85"
BOOST_PATCH_VERSION: "0"
run: |
boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
set +e
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
if [ "$_exitCode" -ne "0" ]; then
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
fi
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v4 uses: jurplel/install-qt-action@v2
with: with:
version: ${{ matrix.qt_version }} version: ${{ matrix.qt_version }}
archives: qtbase qtdeclarative qtsvg qttools
# Not sure why Qt made a hard dependency on qtdeclarative, try removing it when Qt > 6.4.0
cache: true
- name: Install libtorrent - name: Install libtorrent
run: | run: |
@@ -82,68 +46,59 @@ jobs:
--branch v${{ matrix.libt_version }} \ --branch v${{ matrix.libt_version }} \
--depth 1 \ --depth 1 \
--recurse-submodules \ --recurse-submodules \
https://github.com/arvidn/libtorrent.git \ https://github.com/arvidn/libtorrent.git
${{ env.libtorrent_path }} cd libtorrent
cd ${{ env.libtorrent_path }}
cmake \ cmake \
-B build \ -B build \
-G "Ninja" \ -G "Ninja" \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_STANDARD=17 \ -DCMAKE_CXX_STANDARD=17 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBOOST_ROOT="${{ env.boost_path }}" \ -Ddeprecated-functions=OFF \
-Ddeprecated-functions=OFF -DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
cmake --build build cmake --build build
sudo cmake --install build sudo cmake --install build
- name: Build qBittorrent - name: Build qBittorrent (Qt5)
if: ${{ startsWith(matrix.qt_version, 5) }}
run: | run: |
CXXFLAGS="$CXXFLAGS -Werror -Wno-error=deprecated-declarations" \ lupdate -extensions c,cpp,h,hpp,ui ./
LDFLAGS="$LDFLAGS -gz" \
cmake \ cmake \
-B build \ -B build \
-G "Ninja" \ -G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -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
- 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_EXPORT_COMPILE_COMMANDS=ON \
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
-DQT6=ON \
-DVERBOSE_CONFIGURE=ON \ -DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }} -D${{ matrix.qbt_gui }}
cmake --build build --target qbt_update_translations
cmake --build build cmake --build build
cmake --build build --target check
- name: Prepare build artifacts - name: Prepare build artifacts
run: | run: |
# create .dmg
appName="qbittorrent"
if [ "${{ matrix.qbt_gui }}" = "GUI=OFF" ]; then
appName="qbittorrent-nox"
fi
# package
pushd build
PACKAGE_RETRY=0
while [ "$PACKAGE_RETRY" -lt "3" ]; do
macdeployqt "$appName.app" -dmg -no-strip
if [ -f "$appName.dmg" ]; then
break
fi
sleep 5
PACKAGE_RETRY=$((PACKAGE_RETRY + 1))
echo "Retry $PACKAGE_RETRY..."
done
popd
# prepare upload folder
mkdir upload mkdir upload
cp "build/$appName.dmg" upload mv build/qbittorrent*.app upload
mkdir upload/cmake mkdir upload/cmake
cp build/compile_commands.json upload/cmake cp build/compile_commands.json upload/cmake
mkdir upload/cmake/libtorrent mkdir upload/cmake/libtorrent
cp ${{ env.libtorrent_path }}/build/compile_commands.json upload/cmake/libtorrent cp libtorrent/build/compile_commands.json upload/cmake/libtorrent
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v2
with: with:
name: qBittorrent-CI_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 path: upload

View File

@@ -1,89 +0,0 @@
name: CI - Python
on: [pull_request, push]
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs:
ci:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup python (auxiliary scripts)
uses: actions/setup-python@v5
with:
python-version: '3' # use default version
- name: Install tools (auxiliary scripts)
run: pip install bandit pycodestyle pyflakes
- name: Gather files (auxiliary scripts)
run: |
export "PY_FILES=$(find . -type f -name '*.py' ! -path '*searchengine*' -printf '%p ')"
echo $PY_FILES
echo "PY_FILES=$PY_FILES" >> "$GITHUB_ENV"
- name: Lint code (auxiliary scripts)
run: |
pyflakes $PY_FILES
bandit --skip B314,B405 $PY_FILES
- name: Format code (auxiliary scripts)
run: |
pycodestyle \
--max-line-length=1000 \
--statistics \
$PY_FILES
- name: Build code (auxiliary scripts)
run: |
python -m compileall $PY_FILES
- name: Setup python (search engine)
uses: actions/setup-python@v5
with:
python-version: '3.7'
- name: Install tools (search engine)
run: pip install bandit mypy pycodestyle pyflakes pyright
- name: Gather files (search engine)
run: |
export "PY_FILES=$(find . -type f -name '*.py' -path '*searchengine*' ! -name 'socks.py' -printf '%p ')"
echo $PY_FILES
echo "PY_FILES=$PY_FILES" >> "$GITHUB_ENV"
- name: Check typings (search engine)
run: |
MYPYPATH="src/searchengine/nova3" \
mypy \
--follow-imports skip \
--strict \
$PY_FILES
pyright \
$PY_FILES
- name: Lint code (search engine)
run: |
pyflakes $PY_FILES
bandit --skip B110,B310,B314,B405 $PY_FILES
- name: Format code (search engine)
run: |
pycodestyle \
--ignore=E265,E402 \
--max-line-length=1000 \
--statistics \
$PY_FILES
- name: Build code (search engine)
run: |
python -m compileall $PY_FILES

View File

@@ -1,74 +1,43 @@
name: CI - Ubuntu name: CI - Ubuntu
on: [pull_request, push] on: [pull_request, push]
permissions:
actions: write
security-events: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs: jobs:
ci: ci:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-20.04
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
libt_version: ["2.0.10", "1.2.19"] libt_version: ["2.0.5", "1.2.15"]
qbt_gui: ["GUI=ON", "GUI=OFF"] qbt_gui: ["GUI=ON", "GUI=OFF"]
qt_version: ["6.5.2"] qt_version: ["5.15.2", "6.2.0"]
exclude:
env: - libt_version: "1.2.15"
boost_path: "${{ github.workspace }}/../boost" qt_version: "6.2.0"
harden_flags: "-D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS"
libtorrent_path: "${{ github.workspace }}/../libtorrent"
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v2
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt update sudo apt update
sudo apt install \ sudo apt install \
build-essential cmake ninja-build \ build-essential cmake ninja-build pkg-config \
libssl-dev libxkbcommon-x11-dev libxcb-cursor-dev zlib1g-dev libboost-dev libssl-dev zlib1g-dev
- name: Setup ccache - name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1 uses: Chocobo1/setup-ccache-action@v1
with: with:
store_cache: ${{ github.ref == 'refs/heads/master' }}
update_packager_index: false update_packager_index: false
ccache_options: | ccache_options: |
max_size=2G max_size=2G
- name: Install boost
env:
BOOST_MAJOR_VERSION: "1"
BOOST_MINOR_VERSION: "76"
BOOST_PATCH_VERSION: "0"
run: |
boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
set +e
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
if [ "$_exitCode" -ne "0" ]; then
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
fi
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v4 uses: jurplel/install-qt-action@v2
with: with:
version: ${{ matrix.qt_version }} version: ${{ matrix.qt_version }}
archives: icu qtbase qtdeclarative qtsvg qttools
cache: true
- name: Install libtorrent - name: Install libtorrent
run: | run: |
@@ -76,53 +45,47 @@ jobs:
--branch v${{ matrix.libt_version }} \ --branch v${{ matrix.libt_version }} \
--depth 1 \ --depth 1 \
--recurse-submodules \ --recurse-submodules \
https://github.com/arvidn/libtorrent.git \ https://github.com/arvidn/libtorrent.git
${{ env.libtorrent_path }} cd libtorrent
cd ${{ env.libtorrent_path }}
CXXFLAGS="$CXXFLAGS ${{ env.harden_flags }}" \
cmake \ cmake \
-B build \ -B build \
-G "Ninja" \ -G "Ninja" \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBOOST_ROOT="${{ env.boost_path }}" \
-Ddeprecated-functions=OFF -Ddeprecated-functions=OFF
cmake --build build cmake --build build
sudo cmake --install build sudo cmake --install build
# to avoid scanning 3rdparty codebases, initialize it just before building qbt - name: Build qBittorrent (Qt5)
- name: Initialize CodeQL if: ${{ startsWith(matrix.qt_version, 5) }}
uses: github/codeql-action/init@v3
if: startsWith(matrix.libt_version, 2) && (matrix.qbt_gui == 'GUI=ON')
with:
config-file: ./.github/workflows/helper/codeql/cpp.yaml
languages: cpp
- name: Build qBittorrent
run: | run: |
CXXFLAGS="$CXXFLAGS ${{ env.harden_flags }} -Werror" \ lupdate -extensions c,cpp,h,hpp,ui ./
LDFLAGS="$LDFLAGS -gz" \
cmake \ cmake \
-B build \ -B build \
-G "Ninja" \ -G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBOOST_ROOT="${{ env.boost_path }}" \
-DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_INSTALL_PREFIX="/usr" \
-DTESTING=ON \
-DVERBOSE_CONFIGURE=ON \ -DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }} -D${{ matrix.qbt_gui }}
cmake --build build --target qbt_update_translations
cmake --build build cmake --build build
cmake --build build --target check
DESTDIR="qbittorrent" cmake --install build DESTDIR="qbittorrent" cmake --install build
- name: Run CodeQL analysis - name: Build qBittorrent (Qt6)
uses: github/codeql-action/analyze@v3 if: ${{ startsWith(matrix.qt_version, 6) }}
if: startsWith(matrix.libt_version, 2) && (matrix.qbt_gui == 'GUI=ON') run: |
with: lupdate -extensions c,cpp,h,hpp,ui ./
category: ${{ github.base_ref || github.ref_name }} cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DQT6=ON \
-DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }}
cmake --build build
DESTDIR="qbittorrent" cmake --install build
- name: Prepare build artifacts - name: Prepare build artifacts
run: | run: |
@@ -130,40 +93,10 @@ jobs:
mkdir upload/cmake mkdir upload/cmake
cp build/compile_commands.json upload/cmake cp build/compile_commands.json upload/cmake
mkdir upload/cmake/libtorrent mkdir upload/cmake/libtorrent
cp ${{ env.libtorrent_path }}/build/compile_commands.json upload/cmake/libtorrent cp libtorrent/build/compile_commands.json upload/cmake/libtorrent
- name: Install AppImage
run: |
curl \
-L \
-Z \
-O https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage \
-O https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage \
-O https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage
chmod +x \
linuxdeploy-x86_64.AppImage \
linuxdeploy-plugin-qt-x86_64.AppImage \
linuxdeploy-plugin-appimage-x86_64.AppImage
- name: Prepare files for AppImage
if: matrix.qbt_gui == 'GUI=OFF'
run: |
mkdir -p qbittorrent/usr/share/applications
cp .github/workflows/helper/appimage/org.qbittorrent.qBittorrent.desktop qbittorrent/usr/share/applications/org.qbittorrent.qBittorrent.desktop
mkdir -p qbittorrent/usr/share/icons/hicolor/scalable/apps
cp dist/unix/menuicons/scalable/apps/qbittorrent.svg qbittorrent/usr/share/icons/hicolor/scalable/apps/qbittorrent.svg
- name: Package AppImage
run: |
./linuxdeploy-x86_64.AppImage --appdir qbittorrent --plugin qt
rm qbittorrent/apprun-hooks/*
cp .github/workflows/helper/appimage/export_vars.sh qbittorrent/apprun-hooks/export_vars.sh
NO_APPSTREAM=1 \
OUTPUT=upload/qbittorrent-CI_Ubuntu_x86_64.AppImage \
./linuxdeploy-x86_64.AppImage --appdir qbittorrent --output appimage
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v2
with: with:
name: qBittorrent-CI_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 path: upload

View File

@@ -2,13 +2,6 @@ name: CI - WebUI
on: [pull_request, push] on: [pull_request, push]
permissions:
security-events: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs: jobs:
ci: ci:
name: Check name: Check
@@ -20,10 +13,10 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v2
- name: Setup nodejs - name: Setup nodejs
uses: actions/setup-node@v4 uses: actions/setup-node@v2
with: with:
node-version: 'lts/*' node-version: 'lts/*'
@@ -37,12 +30,3 @@ jobs:
run: | run: |
npm run format npm run format
git diff --exit-code git diff --exit-code
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
config-file: .github/workflows/helper/codeql/js.yaml
languages: javascript
- name: Run CodeQL analysis
uses: github/codeql-action/analyze@v3

File diff suppressed because it is too large Load Diff

View File

@@ -1,115 +0,0 @@
name: Coverity Scan
on:
schedule:
- cron: '0 0 1 * *' # Monthly (1st day of month at midnight)
workflow_dispatch: # Mainly for testing. Don't forget the Coverity usage limits.
permissions: {}
jobs:
coverity_scan:
name: Scan
runs-on: ubuntu-latest
strategy:
matrix:
libt_version: ["2.0.10"]
qbt_gui: ["GUI=ON"]
qt_version: ["6.5.2"]
env:
boost_path: "${{ github.workspace }}/../boost"
coverity_path: "${{ github.workspace }}/../coverity"
libtorrent_path: "${{ github.workspace }}/../libtorrent"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install \
build-essential cmake ninja-build \
libssl-dev libxkbcommon-x11-dev libxcb-cursor-dev zlib1g-dev
- name: Install boost
env:
BOOST_MAJOR_VERSION: "1"
BOOST_MINOR_VERSION: "85"
BOOST_PATCH_VERSION: "0"
run: |
boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
set +e
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
if [ "$_exitCode" -ne "0" ]; then
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
fi
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt_version }}
archives: icu qtbase qtdeclarative qtsvg qttools
cache: true
- name: Install libtorrent
run: |
git clone \
--branch v${{ matrix.libt_version }} \
--depth 1 \
--recurse-submodules \
https://github.com/arvidn/libtorrent.git \
${{ env.libtorrent_path }}
cd ${{ env.libtorrent_path }}
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBOOST_ROOT="${{ env.boost_path }}" \
-Ddeprecated-functions=OFF
cmake --build build
sudo cmake --install build
- name: Download Coverity Build Tool
run: |
curl \
-L \
-d "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=qbittorrent%2FqBittorrent" \
-o "${{ runner.temp }}/coverity_tool.tgz" \
"https://scan.coverity.com/download/linux64"
mkdir -p ${{ env.coverity_path }}
tar \
-xf "${{ runner.temp }}/coverity_tool.tgz" \
-C "${{ env.coverity_path }}" \
--strip-components 1
- name: Build qBittorrent
run: |
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBOOST_ROOT="${{ env.boost_path }}" \
-DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }}
PATH="${{ env.coverity_path }}/bin:$PATH" \
cov-build \
--dir cov-int \
cmake --build build
- name: Submit the result to Coverity Scan
run: |
tar -caf qbittorrent.xz cov-int
curl \
--form token="${{ secrets.COVERITY_SCAN_TOKEN }}" \
--form email=sledgehammer999@qbittorrent.org \
--form file=@qbittorrent.xz \
--form version="$(git rev-parse --short HEAD)" \
--form description="master" \
https://scan.coverity.com/builds?project=qbittorrent%2FqBittorrent

74
.github/workflows/coverity-scan.yml vendored Normal file
View File

@@ -0,0 +1,74 @@
name: Coverity Scan
on:
schedule:
- cron: '0 0 1 * *' # Monthly (1st day of month at midnight)
workflow_dispatch: # Mainly for testing. Don't forget the Coverity usage limits.
jobs:
coverity_scan:
name: Scan
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install \
build-essential cmake ninja-build pkg-config \
libboost-dev libssl-dev zlib1g-dev
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: "5.15.2"
- name: Install libtorrent
run: |
git clone \
--branch "v2.0.5" \
--depth 1 \
--recurse-submodules \
https://github.com/arvidn/libtorrent.git
cd libtorrent
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-Ddeprecated-functions=OFF
cmake --build build
sudo cmake --install build
- name: Download Coverity Build Tool
run: |
wget \
-q \
https://scan.coverity.com/download/linux64 \
--post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=qbittorrent%2FqBittorrent" \
-O coverity_tool.tgz
mkdir coverity_tool
tar xzf coverity_tool.tgz --strip 1 -C coverity_tool
- name: Build qBittorrent
run: |
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DGUI=ON \
-DVERBOSE_CONFIGURE=ON
export PATH="$(pwd)/coverity_tool/bin:$PATH"
cov-build --dir cov-int cmake --build build
- name: Submit the result to Coverity Scan
run: |
tar caf qbittorrent.xz cov-int
curl \
--form token="${{ secrets.COVERITY_SCAN_TOKEN }}" \
--form email=sledgehammer999@qbittorrent.org \
--form file=@qbittorrent.xz \
--form version="$(git rev-parse --short HEAD)" \
--form description="master" \
https://scan.coverity.com/builds?project=qbittorrent%2FqBittorrent

View File

@@ -1,13 +0,0 @@
#!/bin/sh
# this file is called from AppRun so 'root_dir' will point to where AppRun is
root_dir="$(readlink -f "$(dirname "$0")")"
# Insert the default values because after the test we prepend our path
# and it will create problems with DEs (eg KDE) that don't set the variable
# and rely on the default paths
if [ -z "${XDG_DATA_DIRS}" ]; then
XDG_DATA_DIRS="/usr/local/share/:/usr/share/"
fi
export XDG_DATA_DIRS="${root_dir}/usr/share:${XDG_DATA_DIRS}"

View File

@@ -1,6 +0,0 @@
[Desktop Entry]
Name=qBittorrent
Exec=qbittorrent-nox %U
Icon=qbittorrent
Type=Application
Categories=Network

View File

@@ -1,14 +0,0 @@
name: "CodeQL config for C++"
queries:
- uses: security-and-quality
query-filters:
- exclude:
id: cpp/commented-out-code
- exclude:
id: cpp/include-non-header
- exclude:
id: cpp/loop-variable-changed
- exclude:
id: cpp/useless-expression

View File

@@ -1,11 +0,0 @@
name: "CodeQL config for Javascript"
paths-ignore:
- "**/lib/*"
queries:
- uses: security-and-quality
query-filters:
- exclude:
id: js/superfluous-trailing-arguments

View File

@@ -1,18 +0,0 @@
# https://github.com/crate-ci/typos/blob/master/docs/reference.md
# https://github.com/crate-ci/typos/blob/master/docs/design.md#identifiers-and-words
# try adding to `identifiers` list first, if doesn't work then `words` list
[default.extend-identifiers]
additionals = "additionals"
caf = "caf"
curren = "curren"
FO = "FO"
ket = "ket"
Q_INVOKABLE = "Q_INVOKABLE"
switchs = "switchs"
ths = "ths"
[default.extend-words]
BA = "BA"
helo = "helo"

View File

@@ -4,15 +4,12 @@ on:
schedule: schedule:
- cron: '0 0 * * *' - cron: '0 0 * * *'
permissions:
pull-requests: write
jobs: jobs:
stale: stale:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Mark and close stale PRs - name: Mark and close stale PRs
uses: actions/stale@v9 uses: actions/stale@v4
with: 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." 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." close-pr-message: "This PR was closed because it has been stalled for some time with no activity."

5
.gitignore vendored
View File

@@ -1,4 +1,3 @@
.vscode/
src/gui/geoip/GeoIP.dat src/gui/geoip/GeoIP.dat
src/gui/geoip/GeoIP.dat.gz src/gui/geoip/GeoIP.dat.gz
src/qbittorrent src/qbittorrent
@@ -17,7 +16,6 @@ Makefile*
*.o *.o
*.pdb *.pdb
*.exe *.exe
*.dll
# Generated MOC, resource and UI files # Generated MOC, resource and UI files
moc_*.cpp moc_*.cpp
@@ -25,7 +23,8 @@ moc_*.h
qrc_*.cpp qrc_*.cpp
ui_*.h ui_*.h
*.moc *.moc
*.qm src/lang/qbittorrent_*.qm
src/webui/www/translations/webui_*.qm
.DS_Store .DS_Store
.qmake.stash .qmake.stash
src/qbittorrent.app src/qbittorrent.app

View File

@@ -3,17 +3,13 @@ repos:
hooks: hooks:
- id: check-translation-tag - id: check-translation-tag
name: Check newline characters in <translation> tag name: Check newline characters in <translation> tag
entry: .github/workflows/helper/pre-commit/check_translation_tag.py entry: .github/workflows/check_translation_tag.py
language: script language: script
exclude: |
(?x)^(
src/lang/.*
)$
types_or: types_or:
- ts - ts
- repo: https://github.com/pre-commit/pre-commit-hooks.git - repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.5.0 rev: v4.0.1
hooks: hooks:
- id: check-json - id: check-json
name: Check JSON files name: Check JSON files
@@ -33,20 +29,17 @@ repos:
args: ["--fix=lf"] args: ["--fix=lf"]
exclude: | exclude: |
(?x)^( (?x)^(
src/webui/www/private/css/lib/.* | compile_commands.json |
src/webui/www/private/scripts/lib/.* | src/webui/www/private/scripts/lib/.*
dist/windows/license.txt |
test/testdata/crlf.txt
)$ )$
- id: end-of-file-fixer - id: end-of-file-fixer
name: Check trailing newlines name: Check trailing newlines
exclude: | exclude: |
(?x)^( (?x)^(
compile_commands.json |
configure | configure |
src/webui/www/private/css/lib/.* | src/webui/www/private/scripts/lib/.*
src/webui/www/private/scripts/lib/.* |
test/testdata/crlf.txt
)$ )$
exclude_types: exclude_types:
- svg - svg
@@ -56,54 +49,7 @@ repos:
name: Check trailing whitespaces name: Check trailing whitespaces
exclude: | exclude: |
(?x)^( (?x)^(
src/webui/www/private/css/lib/.* |
src/webui/www/private/scripts/lib/.* src/webui/www/private/scripts/lib/.*
)$ )$
exclude_types: exclude_types:
- ts - ts
- repo: https://github.com/codespell-project/codespell.git
rev: v2.2.6
hooks:
- id: codespell
name: Check spelling (codespell)
args: ["--ignore-words-list", "additionals,curren,fo,ist,ket,searchin,superseeding,te,ths"]
exclude: |
(?x)^(
.*\.desktop |
.*\.qrc |
build-aux/.* |
Changelog |
dist/windows/installer-translations/.* |
m4/.* |
src/base/3rdparty/.* |
src/searchengine/nova3/socks.py |
src/webui/www/private/scripts/lib/.*
)$
exclude_types:
- ts
- repo: https://github.com/crate-ci/typos.git
rev: v1.16.18
hooks:
- id: typos
name: Check spelling (typos)
args: ["--config", ".github/workflows/helper/pre-commit/.typos.toml"]
exclude: |
(?x)^(
.*\.asc |
.*\.desktop |
.*\.qrc |
\.pre-commit-config\.yaml |
build-aux/.* |
Changelog |
configure.* |
dist/windows/installer-translations/.* |
m4/.* |
src/base/3rdparty/.* |
src/searchengine/nova3/socks.py |
src/webui/www/private/scripts/lib/.*
)$
exclude_types:
- svg
- ts

View File

@@ -1,24 +1,27 @@
[main] [main]
host = https://www.transifex.com host = https://www.transifex.com
[o:sledgehammer999:p:qbittorrent:r:qbittorrent_v50x] [qbittorrent.qbittorrent_master]
file_filter = src/lang/qbittorrent_<lang>.ts file_filter = src/lang/qbittorrent_<lang>.ts
source_file = src/lang/qbittorrent_en.ts lang_map = pt: pt_PT
source_lang = en source_file = src/lang/qbittorrent_en.ts
type = QT source_lang = en
type = QT
minimum_perc = 23 minimum_perc = 23
lang_map = pt: pt_PT, zh: zh_CN mode = developer
[o:sledgehammer999:p:qbittorrent:r:qbittorrent_webui_v50x] [qbittorrent.qbittorrentdesktop_master]
file_filter = src/webui/www/translations/webui_<lang>.ts source_file = dist/unix/org.qbittorrent.qBittorrent.desktop
source_file = src/webui/www/translations/webui_en.ts source_lang = en
source_lang = en type = DESKTOP
type = QT
minimum_perc = 23 minimum_perc = 23
lang_map = pt: pt_PT, zh: zh_CN mode = developer
[o:sledgehammer999:p:qbittorrent:r:qbittorrentdesktop_master] [qbittorrent.qbittorrent_webui]
source_file = dist/unix/org.qbittorrent.qBittorrent.desktop file_filter = src/webui/www/translations/webui_<lang>.ts
source_lang = en lang_map = pt: pt_PT
type = DESKTOP source_file = src/webui/www/translations/webui_en.ts
source_lang = en
type = QT
minimum_perc = 23 minimum_perc = 23
mode = developer

91
AUTHORS
View File

@@ -29,66 +29,73 @@ Code from other projects:
copyright: Dan Haim <negativeiq@users.sourceforge.net> copyright: Dan Haim <negativeiq@users.sourceforge.net>
license: BSD license: BSD
* files src/webui/www/private/css/lib/vanillaSelectBox.css src/webui/www/private/scripts/lib/vanillaSelectBox.js * file src/app/stacktrace.h
copyright: Philippe Meyer <pmg.meyer@gmail.com> copyright: Timo Bingmann from http://idlebox.net/
license: MIT license: WTFPL v2.0
* file src/app/stacktrace_win.h
copyright: Quassel Project
license: GPLv2/3
Images Authors: 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) copyright: Provided by HVS <hvs linuxmail org> (raster first proposal) and Atif Afzal(@atfzl github) <atif5801@gmail.com> (vectorized and modified)
license: GPLv2+ license: GPLv2+
* files: src/qbittorrent_file.ico src/icons/fileicon.svg * files: src/qbittorrent_file.ico src/icons/fileicon.svg
copyright: 'unknown.svg' (LGPLv3+) from Oxygen Icon Theme was used as base which was slightly modified and 'qbittorrent-tray.svg' (GPLv2+) was overlaid above it. 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+ license: GPLv3+
* files: src/icons/flags/*.svg * files: src/icons/*.png
copyright: lipis/flag-icons copyright: Gnome Icon Theme
license: MIT license: GPLv2
url: https://github.com/lipis/flag-icons/ 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> copyright: Greg Houston <gregory.houston@gmail.com>
license: MIT 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> copyright: Daniel Eguren <deguren@gmail.com>
modified by: now-im <now-im.d8gcu@simplelogin.com> (@now-im)
license: LGPL license: LGPL
* folder: src/icons/ * file: src/search_engine/engines/btjunkie.png
files: application-rss+xml.svg, application-x-mswinurl.svg, connected.svg, disconnected.svg, checked-completed.svg, configure.svg, copyright: Downloaded from btjunkie.org
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: now-im <now-im.d8gcu@simplelogin.com> (@now-im) modified from La-Capitaine icon theme (https://github.com/keeferrourke/la-capitaine-icon-theme)
license: GPLv3+
* folder: src/icons/ * file: src/search_engine/engines/isohunt.png
files: application-exit.svg, collapse.svg, dialog-warning.svg, edit-find-user.svg, edit-find.svg, filter-all.svg, firewalled.svg, copyright: Downloaded from isohunt.com
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: now-im <now-im.d8gcu@simplelogin.com> (@now-im) modified from Ionicons icon theme (https://github.com/ionic-team/ionicons)
license: MIT
* folder: src/icons/ * file: src/search_engine/engines/mininova.png
files: force-recheck.svg copyright: Downloaded from mininova.org
copyright: now-im <now-im.d8gcu@simplelogin.com> (@now-im) modified from Font-Awesome icon theme (https://github.com/FortAwesome/Font-Awesome)
license: CC BY 4.0 License
* folder: src/icons/ * file: src/search_engine/engines/piratebay.png
files: downloading.svg, edit-clear.svg, error.svg, filter-active.svg, filter-inactive.svg, filter-stalled.svg, kt-set-max-download-speed.svg, copyright: Downloaded from thepiratebay.org
kt-set-max-upload-speed.svg, list-add.svg, preferences-web-browser-cookies.svg, stalledDL.svg, stalledUP.svg
copyright: now-im <now-im.d8gcu@simplelogin.com> (@now-im) * file: src/search_engine/engines/torrentreactor.png
license: BSD 2-Clause License 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: Translations authors:
* files: src/lang/*.ts * files: src/lang/*.ts

View File

@@ -1,67 +1,67 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR) # Policies <= CMP0097 default to NEW 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 project(qBittorrent
DESCRIPTION "The qBittorrent BitTorrent client" DESCRIPTION "The qBittorrent BitTorrent client"
HOMEPAGE_URL "https://www.qbittorrent.org/" HOMEPAGE_URL "https://www.qbittorrent.org/"
LANGUAGES CXX LANGUAGES CXX
) )
# 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 # version requirements - older versions may work, but you are on your own
set(minBoostVersion 1.76) set(minBoostVersion 1.65)
set(minQt6Version 6.5.0) set(minQt5Version 5.15.2)
set(minOpenSSLVersion 3.0.2) set(minQt6Version 6.2)
set(minLibtorrent1Version 1.2.19) set(minOpenSSLVersion 1.1.1)
set(minLibtorrentVersion 2.0.10) set(minLibtorrent1Version 1.2.14)
set(minLibtorrentVersion 2.0.4)
set(minZlibVersion 1.2.11) set(minZlibVersion 1.2.11)
include(GNUInstallDirs) # features (some are platform-specific)
include(CheckCXXSourceCompiles) # TODO: migrate to CheckSourceCompiles in CMake >= 3.19
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
include(FeatureSummary) include(FeatureSummary)
include(FeatureOptionsSetup) include(FeatureOptionsSetup)
feature_option(QT6 "Use Qt6" OFF)
# features, list is loosely sorted by user's interests feature_option(STACKTRACE "Enable stacktraces" ON)
feature_option(GUI "Build GUI application" ON) feature_option(GUI "Build GUI application" ON)
feature_option(WEBUI "Enable built-in HTTP server for remote control" ON) feature_option(WEBUI "Enables built-in HTTP server for headless use" ON)
feature_option(STACKTRACE "Enable stacktrace support" ON)
feature_option(TESTING "Build internal testing suite" OFF)
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) 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")
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
feature_option_dependent(DBUS feature_option_dependent(DBUS
"Enable support for notifications and power-management features via D-Bus" "Enables support for notifications and power-management features on Linux via D-Bus"
ON "GUI" OFF ON "GUI" OFF
) )
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
feature_option_dependent(SYSTEMD 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 OFF "NOT GUI" OFF
) )
endif() if (STACKTRACE)
check_cxx_source_compiles(
if (MSVC) "#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) feature_option(MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" ON)
endif() endif()
include(GNUInstallDirs)
add_subdirectory(src)
add_subdirectory(dist)
if (VERBOSE_CONFIGURE) if (VERBOSE_CONFIGURE)
feature_summary(WHAT ALL) feature_summary(WHAT ALL)
else() else()
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES) feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
endif() endif()
# go check the packages
include(CheckPackages)
# configure for specific platform
include(CommonConfig)
# Generate version header # Generate version header
configure_file("src/base/version.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/src/base/version.h" @ONLY) 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 # 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. \ 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. 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.
@@ -276,7 +275,7 @@ struct StructName {};
enum EnumName {}; enum EnumName {};
using SomeList = QList<ClassName>; typedef QList<ClassName> SomeList;
namespace NamespaceName namespace NamespaceName
{ {
@@ -318,7 +317,7 @@ The headers should be ordered alphabetically within each group. \
If there are conditionals for the same header group, then put them at the bottom of the respective group. \ If there are conditionals for the same header group, then put them at the bottom of the respective group. \
If there are conditionals that contain headers from several different header groups, then put them above the "qBittorrent's own headers" group. If there are conditionals that contain headers from several different header groups, then put them above the "qBittorrent's own headers" group.
One exception is the header containing the library version (for example, QtVersionChecks), this particular header isn't constrained by the aforementioned order. One exception is the header containing the library version (for example, QtGlobal), this particular header isn't constrained by the aforementioned order.
Example: Example:
@@ -331,7 +330,7 @@ Example:
// exceptions, headers containing version number // exceptions, headers containing version number
#include <boost/version.hpp> #include <boost/version.hpp>
#include <libtorrent/version.hpp> #include <libtorrent/version.hpp>
#include <QtVersionChecks> #include <QtGlobal>
// C++ Standard Library headers // C++ Standard Library headers
#include <cstdio> #include <cstdio>
@@ -342,7 +341,7 @@ Example:
// System headers // System headers
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <windows.h> #include <Windows.h>
#endif #endif
// Boost library headers // Boost library headers
@@ -457,8 +456,8 @@ class ExampleWidget : public QWidget
* Prefer pre-increment, pre-decrement operators * Prefer pre-increment, pre-decrement operators
```c++ ```c++
++i, --j; // yes ++i, --j; // Yes
i++, j--; // no i++, j--; // No
``` ```
* private/public/protected must not be indented * 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: * **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 # 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. 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**: 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**:
@@ -200,7 +200,7 @@ Following these guidelines helps maintainers and the community understand your s
[coding-guidelines-url]: https://github.com/qbittorrent/qBittorrent/blob/master/CODING_GUIDELINES.md [coding-guidelines-url]: https://github.com/qbittorrent/qBittorrent/blob/master/CODING_GUIDELINES.md
[coding-guidelines-git-commit-message-url]: https://github.com/qbittorrent/qBittorrent/blob/master/CODING_GUIDELINES.md#10-git-commit-message [coding-guidelines-git-commit-message-url]: https://github.com/qbittorrent/qBittorrent/blob/master/CODING_GUIDELINES.md#10-git-commit-message
[commit-message-fix-issue-example-url]: https://github.com/qbittorrent/qBittorrent/commit/c07cd440cd46345297debb47cb260f8688975f50 [commit-message-fix-issue-example-url]: https://github.com/qbittorrent/qBittorrent/commit/c07cd440cd46345297debb47cb260f8688975f50
[forum-url]: https://forum.qbittorrent.org/ [forum-url]: http://forum.qbittorrent.org/
[howto-report-bugs-url]: https://www.chiark.greenend.org.uk/~sgtatham/bugs.html [howto-report-bugs-url]: https://www.chiark.greenend.org.uk/~sgtatham/bugs.html
[how-to-translate-url]: https://github.com/qbittorrent/qBittorrent/wiki/How-to-translate-qBittorrent [how-to-translate-url]: https://github.com/qbittorrent/qBittorrent/wiki/How-to-translate-qBittorrent
[merging-vs-rebasing-url]: https://www.atlassian.com/git/tutorials/merging-vs-rebasing [merging-vs-rebasing-url]: https://www.atlassian.com/git/tutorials/merging-vs-rebasing

349
COPYING

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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