You've already forked qBittorrent
							
							
				mirror of
				https://github.com/qbittorrent/qBittorrent
				synced 2025-11-02 08:10:54 +01:00 
			
		
		
		
	Compare commits
	
		
			53 Commits
		
	
	
		
			v4_5_x
			...
			release-4.
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					ede7c8acbb | ||
| 
						 | 
					9195df5179 | ||
| 
						 | 
					a3d5ea829b | ||
| 
						 | 
					c062f86bac | ||
| 
						 | 
					e5894831ec | ||
| 
						 | 
					f40e92f186 | ||
| 
						 | 
					0ab10ef2b3 | ||
| 
						 | 
					049e376953 | ||
| 
						 | 
					6dab4615aa | ||
| 
						 | 
					0b9a1dfd9d | ||
| 
						 | 
					11c45db2ec | ||
| 
						 | 
					ba147d72b9 | ||
| 
						 | 
					97ead6d7c9 | ||
| 
						 | 
					51cb3ca0c8 | ||
| 
						 | 
					c514c2b7a8 | ||
| 
						 | 
					d26e582cc1 | ||
| 
						 | 
					5d161d2477 | ||
| 
						 | 
					b9ea6a5dc5 | ||
| 
						 | 
					7b0b64a04e | ||
| 
						 | 
					4cb386af35 | ||
| 
						 | 
					14ab1b015c | ||
| 
						 | 
					0a4971c994 | ||
| 
						 | 
					a75ae21434 | ||
| 
						 | 
					01eed5dae9 | ||
| 
						 | 
					e73397c750 | ||
| 
						 | 
					869d079507 | ||
| 
						 | 
					71174edf72 | ||
| 
						 | 
					b3d46ecb78 | ||
| 
						 | 
					80035a2520 | ||
| 
						 | 
					6790335239 | ||
| 
						 | 
					48ff494dca | ||
| 
						 | 
					c5b361ce74 | ||
| 
						 | 
					397b7b9407 | ||
| 
						 | 
					6e0c1e2147 | ||
| 
						 | 
					e93c360db6 | ||
| 
						 | 
					270e2023cd | ||
| 
						 | 
					5ac858213b | ||
| 
						 | 
					f0ee6aba29 | ||
| 
						 | 
					fa418087c4 | ||
| 
						 | 
					8493e1ad64 | ||
| 
						 | 
					fe90fcef5b | ||
| 
						 | 
					210fd80167 | ||
| 
						 | 
					0a1e864f74 | ||
| 
						 | 
					7adccab687 | ||
| 
						 | 
					67e536d869 | ||
| 
						 | 
					86e8d848f6 | ||
| 
						 | 
					88114b4588 | ||
| 
						 | 
					e468f004f4 | ||
| 
						 | 
					4cfccc54ea | ||
| 
						 | 
					5ffa7e4752 | ||
| 
						 | 
					d7fd576293 | ||
| 
						 | 
					83b34053a1 | ||
| 
						 | 
					b9164adb7a | 
							
								
								
									
										18
									
								
								.github/workflows/ci_macos.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/workflows/ci_macos.yaml
									
									
									
									
										vendored
									
									
								
							@@ -17,6 +17,7 @@ jobs:
 | 
			
		||||
            qt_version: "6.2.0"
 | 
			
		||||
 | 
			
		||||
    env:
 | 
			
		||||
      boost_path: "${{ github.workspace }}/../boost"
 | 
			
		||||
      openssl_root: /usr/local/opt/openssl@1.1
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
@@ -28,13 +29,22 @@ jobs:
 | 
			
		||||
          brew update > /dev/null
 | 
			
		||||
          brew install \
 | 
			
		||||
            cmake ninja \
 | 
			
		||||
            boost openssl@1.1 zlib
 | 
			
		||||
            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.77.0/source/boost_1_77_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@v2
 | 
			
		||||
        with:
 | 
			
		||||
@@ -54,6 +64,7 @@ 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
 | 
			
		||||
@@ -68,6 +79,7 @@ jobs:
 | 
			
		||||
            -G "Ninja" \
 | 
			
		||||
            -DCMAKE_BUILD_TYPE=RelWithDebInfo \
 | 
			
		||||
            -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
 | 
			
		||||
            -DBOOST_ROOT="${{ env.boost_path }}" \
 | 
			
		||||
            -DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
 | 
			
		||||
            -DVERBOSE_CONFIGURE=ON \
 | 
			
		||||
            -D${{ matrix.qbt_gui }}
 | 
			
		||||
@@ -82,6 +94,7 @@ jobs:
 | 
			
		||||
            -G "Ninja" \
 | 
			
		||||
            -DCMAKE_BUILD_TYPE=RelWithDebInfo \
 | 
			
		||||
            -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
 | 
			
		||||
            -DBOOST_ROOT="${{ env.boost_path }}" \
 | 
			
		||||
            -DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
 | 
			
		||||
            -DQT6=ON \
 | 
			
		||||
            -DVERBOSE_CONFIGURE=ON \
 | 
			
		||||
@@ -91,7 +104,6 @@ jobs:
 | 
			
		||||
      - 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
 | 
			
		||||
@@ -100,5 +112,5 @@ jobs:
 | 
			
		||||
      - name: Upload build artifacts
 | 
			
		||||
        uses: actions/upload-artifact@v2
 | 
			
		||||
        with:
 | 
			
		||||
          name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
 | 
			
		||||
          name: build-info_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
 | 
			
		||||
          path: upload
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										32
									
								
								Changelog
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								Changelog
									
									
									
									
									
								
							@@ -1,3 +1,35 @@
 | 
			
		||||
Tue Mar 22 2022 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.4.2
 | 
			
		||||
    - FEATURE: Allow to limit max memory working set size (glassez)
 | 
			
		||||
    - BUGFIX: Fix UI crash when torrent is in a non-existent category (Kevin Cox)
 | 
			
		||||
    - BUGFIX: Correctly handle changing of global save paths (glassez)
 | 
			
		||||
    - BUGFIX: Disable performance alert (Chocobo1)
 | 
			
		||||
    - BUGFIX: Prevent loading resume data with inconsistent ID (glassez)
 | 
			
		||||
    - BUGFIX: Properly handle metadata download for an existing torrent (glassez)
 | 
			
		||||
    - BUGFIX: Prevent crash when open torrent destination folder (glassez)
 | 
			
		||||
    - WINDOWS: NSIS: Update Spanish, Spanish International and French translations(Juanjo Jiménez, RqndomHax)
 | 
			
		||||
 | 
			
		||||
Tue Feb 15 2022 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.4.1
 | 
			
		||||
    - FEATURE: Restore all torrent settings to the torrent's main context menu (thalieht)
 | 
			
		||||
    - FEATURE: Add confirmation for enabling Auto TMM from context menu (thalieht)
 | 
			
		||||
    - FEATURE: Add tooltip to Automatic Torrent Management context menu action (thalieht)
 | 
			
		||||
    - FEATURE: Add Select All/None buttons in new torrent dialog (thalieht)
 | 
			
		||||
    - BUGFIX: Keep "torrent info" alive while generate .torrent file (glassez)
 | 
			
		||||
    - BUGFIX: Correctly handle Auto TMM in Torrent Files Watcher (glassez)
 | 
			
		||||
    - BUGFIX: Correctly track the root folder name change (glassez)
 | 
			
		||||
    - BUGFIX: Various fixes to the moving torrent code (glassez)
 | 
			
		||||
    - BUGFIX: Update the torrent's download path field when changing category (thalieht)
 | 
			
		||||
    - BUGFIX: Correctly handle received metadata (glassez)
 | 
			
		||||
    - BUGFIX: Store hybrid torrents using legacy filenames (glassez)
 | 
			
		||||
    - BUGFIX: Open correct directory when clicked on Browse button (glassez)
 | 
			
		||||
    - BUGFIX: Fix crash when shutting down and clicing on system tray icon (Chocobo1)
 | 
			
		||||
    - BUGFIX: Fix "Free space on disk" in new torrent dialog (thalieht)
 | 
			
		||||
    - BUGFIX: Optimize completed files handling (Prince Gupta)
 | 
			
		||||
    - BUGFIX: Migrate proxy settings (sledgehammer999)
 | 
			
		||||
    - BUGFIX: Try to recover missing categories (glassez)
 | 
			
		||||
    - WEBUI: WebAPI: fix wrong key used for categories (Chocobo1)
 | 
			
		||||
    - WEBUI: Remove hack for outdated IE 6 browser (Chocobo1)
 | 
			
		||||
    - RSS: Correctly handle XML parsing errors (glassez)
 | 
			
		||||
 | 
			
		||||
Thu Jan 06 2022 - sledgehammer999 <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)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								INSTALL
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								INSTALL
									
									
									
									
									
								
							@@ -11,7 +11,7 @@ qBittorrent - A BitTorrent client in C++ / Qt
 | 
			
		||||
 | 
			
		||||
  - OpenSSL >= 1.1.1
 | 
			
		||||
 | 
			
		||||
  - Qt 5.15.2 - 5.x
 | 
			
		||||
  - Qt 5.15.2 - 5.x || 6.2.0 - 6.x
 | 
			
		||||
 | 
			
		||||
  - zlib >= 1.2.11
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								configure
									
									
									
									
										vendored
									
									
								
							@@ -1,6 +1,6 @@
 | 
			
		||||
#! /bin/sh
 | 
			
		||||
# Guess values for system-dependent variables and create Makefiles.
 | 
			
		||||
# Generated by GNU Autoconf 2.71 for qbittorrent v4.4.0alpha.
 | 
			
		||||
# Generated by GNU Autoconf 2.71 for qbittorrent v4.4.2.
 | 
			
		||||
#
 | 
			
		||||
# Report bugs to <bugs.qbittorrent.org>.
 | 
			
		||||
#
 | 
			
		||||
@@ -611,8 +611,8 @@ MAKEFLAGS=
 | 
			
		||||
# Identity of this package.
 | 
			
		||||
PACKAGE_NAME='qbittorrent'
 | 
			
		||||
PACKAGE_TARNAME='qbittorrent'
 | 
			
		||||
PACKAGE_VERSION='v4.4.0alpha'
 | 
			
		||||
PACKAGE_STRING='qbittorrent v4.4.0alpha'
 | 
			
		||||
PACKAGE_VERSION='v4.4.2'
 | 
			
		||||
PACKAGE_STRING='qbittorrent v4.4.2'
 | 
			
		||||
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.4.0alpha to adapt to many kinds of systems.
 | 
			
		||||
\`configure' configures qbittorrent v4.4.2 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.4.0alpha:";;
 | 
			
		||||
     short | recursive ) echo "Configuration of qbittorrent v4.4.2:";;
 | 
			
		||||
   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.4.0alpha
 | 
			
		||||
qbittorrent configure v4.4.2
 | 
			
		||||
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.4.0alpha, which was
 | 
			
		||||
It was created by qbittorrent $as_me v4.4.2, 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.4.0alpha'
 | 
			
		||||
 VERSION='v4.4.2'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
 | 
			
		||||
@@ -7254,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.4.0alpha, which was
 | 
			
		||||
This file was extended by qbittorrent $as_me v4.4.2, which was
 | 
			
		||||
generated by GNU Autoconf 2.71.  Invocation command line was
 | 
			
		||||
 | 
			
		||||
  CONFIG_FILES    = $CONFIG_FILES
 | 
			
		||||
@@ -7314,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.4.0alpha
 | 
			
		||||
qbittorrent config.status v4.4.2
 | 
			
		||||
configured by $0, generated by GNU Autoconf 2.71,
 | 
			
		||||
  with options \\"\$ac_cs_config\\"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
 | 
			
		||||
AC_INIT([qbittorrent], [v4.4.0alpha], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
 | 
			
		||||
AC_INIT([qbittorrent], [v4.4.2], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
 | 
			
		||||
AC_CONFIG_AUX_DIR([build-aux])
 | 
			
		||||
AC_CONFIG_MACRO_DIR([m4])
 | 
			
		||||
: ${CFLAGS=""}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/mac/Info.plist
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/mac/Info.plist
									
									
									
									
										vendored
									
									
								
							@@ -55,7 +55,7 @@
 | 
			
		||||
	<key>CFBundlePackageType</key>
 | 
			
		||||
	<string>APPL</string>
 | 
			
		||||
	<key>CFBundleShortVersionString</key>
 | 
			
		||||
	<string>4.4.0</string>
 | 
			
		||||
	<string>4.4.2</string>
 | 
			
		||||
	<key>CFBundleExecutable</key>
 | 
			
		||||
	<string>${EXECUTABLE_NAME}</string>
 | 
			
		||||
	<key>CFBundleIdentifier</key>
 | 
			
		||||
 
 | 
			
		||||
@@ -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.4.0" date="2020-10-18"/>
 | 
			
		||||
    <release version="4.4.2" date="2022-03-22"/>
 | 
			
		||||
  </releases>
 | 
			
		||||
</component>
 | 
			
		||||
 
 | 
			
		||||
@@ -106,7 +106,7 @@ Name[ja]=qBittorrent
 | 
			
		||||
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
 | 
			
		||||
@@ -115,6 +115,8 @@ 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
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										36
									
								
								dist/windows/installer-translations/french.nsi
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										36
									
								
								dist/windows/installer-translations/french.nsi
									
									
									
									
										vendored
									
									
								
							@@ -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 Raccourci Bureau"
 | 
			
		||||
LangString inst_dekstop ${LANG_FRENCH} "Créer un Raccourci sur le Bureau"
 | 
			
		||||
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
 | 
			
		||||
LangString inst_startmenu ${LANG_FRENCH} "Créer Raccourci dans le Menu Démarrer"
 | 
			
		||||
LangString inst_startmenu ${LANG_FRENCH} "Créer un Raccourci dans le Menu Démarrer"
 | 
			
		||||
;LangString inst_startup ${LANG_ENGLISH} "Start qBittorrent on Windows start up"
 | 
			
		||||
LangString inst_startup ${LANG_FRENCH} "Démarrez qBittorrent au démarrage de Windows"
 | 
			
		||||
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
 | 
			
		||||
LangString inst_torrent ${LANG_FRENCH} "Ouvrir fichiers .torrent avec qBittorrent"
 | 
			
		||||
LangString inst_torrent ${LANG_FRENCH} "Ouvrir les fichiers .torrent avec qBittorrent"
 | 
			
		||||
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
 | 
			
		||||
LangString inst_magnet ${LANG_FRENCH} "Ouvrir liens magnet avec qBittorrent"
 | 
			
		||||
LangString inst_magnet ${LANG_FRENCH} "Ouvrir les liens magnet avec qBittorrent"
 | 
			
		||||
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
 | 
			
		||||
LangString inst_firewall ${LANG_FRENCH} "Ajouter règle Pare-Feu Windows"
 | 
			
		||||
LangString inst_firewall ${LANG_FRENCH} "Ajouter une règle au Pare-Feu 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_FRENCH} "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_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
 | 
			
		||||
LangString inst_firewallinfo ${LANG_FRENCH} "Ajout règle Pare-Feu Windows"
 | 
			
		||||
LangString inst_firewallinfo ${LANG_FRENCH} "Ajout d'une règle au Pare-Feu de 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 sans supprimer 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 en conservant les réglages utilisateur."
 | 
			
		||||
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
 | 
			
		||||
LangString inst_unist ${LANG_FRENCH} "Désinstallation de la version précédente."
 | 
			
		||||
LangString inst_unist ${LANG_FRENCH} "Désinstallation de la version antérieure."
 | 
			
		||||
;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} "Uninstall qBittorrent"
 | 
			
		||||
LangString inst_uninstall_link_description ${LANG_FRENCH} "Désinstaller qBittorrent"
 | 
			
		||||
 | 
			
		||||
;------------------------------------
 | 
			
		||||
;Uninstaller strings
 | 
			
		||||
 | 
			
		||||
;LangString remove_files ${LANG_ENGLISH} "Remove files"
 | 
			
		||||
LangString remove_files ${LANG_FRENCH} "Supprimer fichiers"
 | 
			
		||||
LangString remove_files ${LANG_FRENCH} "Supprimer les fichiers"
 | 
			
		||||
;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts"
 | 
			
		||||
LangString remove_shortcuts ${LANG_FRENCH} "Supprimer raccourcis"
 | 
			
		||||
LangString remove_shortcuts ${LANG_FRENCH} "Supprimer les raccourcis"
 | 
			
		||||
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
 | 
			
		||||
LangString remove_associations ${LANG_FRENCH} "Supprimer associations de fichiers"
 | 
			
		||||
LangString remove_associations ${LANG_FRENCH} "Supprimer les associations de fichiers"
 | 
			
		||||
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
 | 
			
		||||
LangString remove_registry ${LANG_FRENCH} "Supprimer clés de registre"
 | 
			
		||||
LangString remove_registry ${LANG_FRENCH} "Supprimer les clés de registre"
 | 
			
		||||
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
 | 
			
		||||
LangString remove_conf ${LANG_FRENCH} "Supprimer fichiers de configuration"
 | 
			
		||||
LangString remove_conf ${LANG_FRENCH} "Supprimer les fichiers de configuration"
 | 
			
		||||
;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule"
 | 
			
		||||
LangString remove_firewall ${LANG_FRENCH} "Supprimer règle Pare-Feu Windows"
 | 
			
		||||
LangString remove_firewall ${LANG_FRENCH} "Supprimer la règle du Pare-Feu de Windows"
 | 
			
		||||
;LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule"
 | 
			
		||||
LangString remove_firewallinfo ${LANG_FRENCH} "Suppression règle Pare-Feu Windows"
 | 
			
		||||
LangString remove_firewallinfo ${LANG_FRENCH} "Suppression de la règle du Pare-Feu de Windows"
 | 
			
		||||
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
 | 
			
		||||
LangString remove_cache ${LANG_FRENCH} "Supprimer torrents et données cachées"
 | 
			
		||||
LangString remove_cache ${LANG_FRENCH} "Supprimer les 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:"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								dist/windows/installer-translations/spanish.nsi
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								dist/windows/installer-translations/spanish.nsi
									
									
									
									
										vendored
									
									
								
							@@ -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} "Inicie qBittorrent en el inicio de Windows"
 | 
			
		||||
LangString inst_startup ${LANG_SPANISH} "Iniciar 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} "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_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} "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_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
 | 
			
		||||
LangString inst_uninstall_link_description ${LANG_SPANISH} "Uninstall qBittorrent"
 | 
			
		||||
LangString inst_uninstall_link_description ${LANG_SPANISH} "Desinstalar 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"
 | 
			
		||||
LangString remove_associations ${LANG_SPANISH} "Deshacer asociaciones de archivos"
 | 
			
		||||
;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"
 | 
			
		||||
 
 | 
			
		||||
@@ -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} "Inicie qBittorrent en el inicio de Windows"
 | 
			
		||||
LangString inst_startup ${LANG_SPANISHINTERNATIONAL} "Iniciar 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} "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_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} "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_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
 | 
			
		||||
LangString inst_uninstall_link_description ${LANG_SPANISHINTERNATIONAL} "Uninstall qBittorrent"
 | 
			
		||||
LangString inst_uninstall_link_description ${LANG_SPANISHINTERNATIONAL} "Desinstalar 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"
 | 
			
		||||
LangString remove_associations ${LANG_SPANISHINTERNATIONAL} "Deshacer asociaciones de archivos"
 | 
			
		||||
;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"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								dist/windows/options.nsi
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/windows/options.nsi
									
									
									
									
										vendored
									
									
								
							@@ -28,7 +28,7 @@ XPStyle on
 | 
			
		||||
!define CSIDL_LOCALAPPDATA '0x1C' ;Local Application Data path
 | 
			
		||||
 | 
			
		||||
; Program specific
 | 
			
		||||
!define PROG_VERSION "4.4.0"
 | 
			
		||||
!define PROG_VERSION "4.4.2"
 | 
			
		||||
 | 
			
		||||
!define MUI_FINISHPAGE_RUN
 | 
			
		||||
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun
 | 
			
		||||
 
 | 
			
		||||
@@ -65,6 +65,7 @@
 | 
			
		||||
#include "base/bittorrent/session.h"
 | 
			
		||||
#include "base/bittorrent/torrent.h"
 | 
			
		||||
#include "base/exceptions.h"
 | 
			
		||||
#include "base/global.h"
 | 
			
		||||
#include "base/iconprovider.h"
 | 
			
		||||
#include "base/logger.h"
 | 
			
		||||
#include "base/net/downloadmanager.h"
 | 
			
		||||
@@ -121,6 +122,9 @@ Application::Application(int &argc, char **argv)
 | 
			
		||||
    , m_running(false)
 | 
			
		||||
    , m_shutdownAct(ShutdownDialogAction::Exit)
 | 
			
		||||
    , m_commandLineArgs(parseCommandLine(this->arguments()))
 | 
			
		||||
#ifdef Q_OS_WIN
 | 
			
		||||
    , m_storeMemoryWorkingSetLimit(SETTINGS_KEY("MemoryWorkingSetLimit"))
 | 
			
		||||
#endif
 | 
			
		||||
    , m_storeFileLoggerEnabled(FILELOGGER_SETTINGS_KEY("Enabled"))
 | 
			
		||||
    , m_storeFileLoggerBackup(FILELOGGER_SETTINGS_KEY("Backup"))
 | 
			
		||||
    , m_storeFileLoggerDeleteOld(FILELOGGER_SETTINGS_KEY("DeleteOld"))
 | 
			
		||||
@@ -204,6 +208,22 @@ const QBtCommandLineParameters &Application::commandLineArgs() const
 | 
			
		||||
    return m_commandLineArgs;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef Q_OS_WIN
 | 
			
		||||
int Application::memoryWorkingSetLimit() const
 | 
			
		||||
{
 | 
			
		||||
    return m_storeMemoryWorkingSetLimit.get(512);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Application::setMemoryWorkingSetLimit(const int size)
 | 
			
		||||
{
 | 
			
		||||
    if (size == memoryWorkingSetLimit())
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    m_storeMemoryWorkingSetLimit = size;
 | 
			
		||||
    applyMemoryWorkingSetLimit();
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
bool Application::isFileLoggerEnabled() const
 | 
			
		||||
{
 | 
			
		||||
    return m_storeFileLoggerEnabled.get(true);
 | 
			
		||||
@@ -602,6 +622,10 @@ void Application::processParams(const QStringList ¶ms)
 | 
			
		||||
 | 
			
		||||
int Application::exec(const QStringList ¶ms)
 | 
			
		||||
{
 | 
			
		||||
#ifdef Q_OS_WIN
 | 
			
		||||
    applyMemoryWorkingSetLimit();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    Net::ProxyConfigurationManager::initInstance();
 | 
			
		||||
    Net::DownloadManager::initInstance();
 | 
			
		||||
    IconProvider::initInstance();
 | 
			
		||||
@@ -650,8 +674,8 @@ int Application::exec(const QStringList ¶ms)
 | 
			
		||||
    const auto scheme = QString::fromLatin1(pref->isWebUiHttpsEnabled() ? "https" : "http");
 | 
			
		||||
    const auto url = QString::fromLatin1("%1://localhost:%2\n").arg(scheme, QString::number(pref->getWebUiPort()));
 | 
			
		||||
    const QString mesg = QString::fromLatin1("\n******** %1 ********\n").arg(tr("Information"))
 | 
			
		||||
        + tr("To control qBittorrent, access the WebUI at: %1\n").arg(url);
 | 
			
		||||
    printf("%s", qUtf8Printable(mesg));
 | 
			
		||||
        + tr("To control qBittorrent, access the WebUI at: %1").arg(url);
 | 
			
		||||
    printf("%s\n", qUtf8Printable(mesg));
 | 
			
		||||
 | 
			
		||||
    if (pref->getWebUIPassword() == "ARQ77eY1NUZaQsuDHbIMCA==:0WMRkYTUWVT9wVvdDtHAjU9b3b7uB8NR1Gur2hmQCvCDpm39Q+PsJRJPaCU51dEiz+dTzh8qbPsL8WkFljQYFQ==")
 | 
			
		||||
    {
 | 
			
		||||
@@ -771,6 +795,29 @@ void Application::shutdownCleanup(QSessionManager &manager)
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef Q_OS_WIN
 | 
			
		||||
void Application::applyMemoryWorkingSetLimit()
 | 
			
		||||
{
 | 
			
		||||
    const SIZE_T UNIT_SIZE = 1024 * 1024; // MiB
 | 
			
		||||
    const SIZE_T maxSize = memoryWorkingSetLimit() * UNIT_SIZE;
 | 
			
		||||
    const SIZE_T minSize = std::min<SIZE_T>((64 * UNIT_SIZE), (maxSize / 2));
 | 
			
		||||
    if (!::SetProcessWorkingSetSizeEx(::GetCurrentProcess(), minSize, maxSize, QUOTA_LIMITS_HARDWS_MAX_ENABLE))
 | 
			
		||||
    {
 | 
			
		||||
        const DWORD errorCode = ::GetLastError();
 | 
			
		||||
        QString message;
 | 
			
		||||
        LPVOID lpMsgBuf = nullptr;
 | 
			
		||||
        if (::FormatMessageW((FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS)
 | 
			
		||||
                         , nullptr, errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast<LPWSTR>(&lpMsgBuf), 0, nullptr))
 | 
			
		||||
        {
 | 
			
		||||
            message = QString::fromWCharArray(reinterpret_cast<LPWSTR>(lpMsgBuf)).trimmed();
 | 
			
		||||
            ::LocalFree(lpMsgBuf);
 | 
			
		||||
        }
 | 
			
		||||
        LogMsg(tr("Failed to set physical memory (RAM) usage limit. Error code: %1. Error message: \"%2\"")
 | 
			
		||||
               .arg(QString::number(errorCode), message), Log::WARNING);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void Application::cleanup()
 | 
			
		||||
{
 | 
			
		||||
    // cleanup() can be called multiple times during shutdown. We only need it once.
 | 
			
		||||
 
 | 
			
		||||
@@ -88,6 +88,11 @@ public:
 | 
			
		||||
 | 
			
		||||
    const QBtCommandLineParameters &commandLineArgs() const;
 | 
			
		||||
 | 
			
		||||
#ifdef Q_OS_WIN
 | 
			
		||||
    int memoryWorkingSetLimit() const;
 | 
			
		||||
    void setMemoryWorkingSetLimit(int size);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    // FileLogger properties
 | 
			
		||||
    bool isFileLoggerEnabled() const;
 | 
			
		||||
    void setFileLoggerEnabled(bool value);
 | 
			
		||||
@@ -121,6 +126,9 @@ private slots:
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
#ifdef Q_OS_WIN
 | 
			
		||||
    void applyMemoryWorkingSetLimit();
 | 
			
		||||
#endif
 | 
			
		||||
    void initializeTranslation();
 | 
			
		||||
    void processParams(const QStringList ¶ms);
 | 
			
		||||
    void runExternalProgram(const BitTorrent::Torrent *torrent) const;
 | 
			
		||||
@@ -146,6 +154,9 @@ private:
 | 
			
		||||
    QTranslator m_translator;
 | 
			
		||||
    QStringList m_paramsQueue;
 | 
			
		||||
 | 
			
		||||
#ifdef Q_OS_WIN
 | 
			
		||||
    SettingValue<int> m_storeMemoryWorkingSetLimit;
 | 
			
		||||
#endif
 | 
			
		||||
    SettingValue<bool> m_storeFileLoggerEnabled;
 | 
			
		||||
    SettingValue<bool> m_storeFileLoggerBackup;
 | 
			
		||||
    SettingValue<bool> m_storeFileLoggerDeleteOld;
 | 
			
		||||
 
 | 
			
		||||
@@ -32,6 +32,7 @@
 | 
			
		||||
 | 
			
		||||
#include "base/bittorrent/torrentcontentlayout.h"
 | 
			
		||||
#include "base/logger.h"
 | 
			
		||||
#include "base/net/proxyconfigurationmanager.h"
 | 
			
		||||
#include "base/preferences.h"
 | 
			
		||||
#include "base/profile.h"
 | 
			
		||||
#include "base/settingsstorage.h"
 | 
			
		||||
@@ -42,7 +43,7 @@
 | 
			
		||||
 | 
			
		||||
namespace
 | 
			
		||||
{
 | 
			
		||||
    const int MIGRATION_VERSION = 2;
 | 
			
		||||
    const int MIGRATION_VERSION = 3;
 | 
			
		||||
    const char MIGRATION_VERSION_KEY[] = "Meta/MigrationVersion";
 | 
			
		||||
 | 
			
		||||
    void exportWebUIHttpsFiles()
 | 
			
		||||
@@ -326,6 +327,46 @@ namespace
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void migrateProxySettingsEnum()
 | 
			
		||||
    {
 | 
			
		||||
        auto *settingsStorage = SettingsStorage::instance();
 | 
			
		||||
        const auto key = QString::fromLatin1("Network/Proxy/Type");
 | 
			
		||||
        const auto value = settingsStorage->loadValue<QString>(key);
 | 
			
		||||
 | 
			
		||||
        bool ok = false;
 | 
			
		||||
        const auto number = value.toInt(&ok);
 | 
			
		||||
 | 
			
		||||
        if (ok)
 | 
			
		||||
        {
 | 
			
		||||
            switch (number)
 | 
			
		||||
            {
 | 
			
		||||
            case 0:
 | 
			
		||||
                settingsStorage->storeValue(key, Net::ProxyType::None);
 | 
			
		||||
                break;
 | 
			
		||||
            case 1:
 | 
			
		||||
                settingsStorage->storeValue(key, Net::ProxyType::HTTP);
 | 
			
		||||
                break;
 | 
			
		||||
            case 2:
 | 
			
		||||
                settingsStorage->storeValue(key, Net::ProxyType::SOCKS5);
 | 
			
		||||
                break;
 | 
			
		||||
            case 3:
 | 
			
		||||
                settingsStorage->storeValue(key, Net::ProxyType::HTTP_PW);
 | 
			
		||||
                break;
 | 
			
		||||
            case 4:
 | 
			
		||||
                settingsStorage->storeValue(key, Net::ProxyType::SOCKS5_PW);
 | 
			
		||||
                break;
 | 
			
		||||
            case 5:
 | 
			
		||||
                settingsStorage->storeValue(key, Net::ProxyType::SOCKS4);
 | 
			
		||||
                break;
 | 
			
		||||
            default:
 | 
			
		||||
                LogMsg(QObject::tr("Invalid value found in configuration file, reverting it to default. Key: \"%1\". Invalid value: \"%2\".")
 | 
			
		||||
                           .arg(key, QString::number(number)), Log::WARNING);
 | 
			
		||||
                settingsStorage->removeValue(key);
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool upgrade(const bool /*ask*/)
 | 
			
		||||
@@ -343,9 +384,13 @@ bool upgrade(const bool /*ask*/)
 | 
			
		||||
            upgradeDNSServiceSettings();
 | 
			
		||||
            upgradeTrayIconStyleSettings();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (version < 2)
 | 
			
		||||
            migrateSettingKeys();
 | 
			
		||||
 | 
			
		||||
        if (version < 3)
 | 
			
		||||
            migrateProxySettingsEnum();
 | 
			
		||||
 | 
			
		||||
        version = MIGRATION_VERSION;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -325,9 +325,6 @@ std::optional<BitTorrent::LoadTorrentParams> BitTorrent::DBResumeDataStorage::lo
 | 
			
		||||
    lt::error_code ec;
 | 
			
		||||
    const lt::bdecode_node root = lt::bdecode(allData, ec);
 | 
			
		||||
 | 
			
		||||
    resumeData.downloadPath = Profile::instance()->fromPortablePath(
 | 
			
		||||
                Utils::Fs::toUniformPath(fromLTString(root.dict_find_string_value("qBt-downloadPath"))));
 | 
			
		||||
 | 
			
		||||
    lt::add_torrent_params &p = resumeData.ltAddTorrentParams;
 | 
			
		||||
 | 
			
		||||
    p = lt::read_resume_data(root, ec);
 | 
			
		||||
 
 | 
			
		||||
@@ -36,6 +36,13 @@ BitTorrent::InfoHash::InfoHash(const WrappedType &nativeHash)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef QBT_USES_LIBTORRENT2
 | 
			
		||||
BitTorrent::InfoHash::InfoHash(const SHA1Hash &v1, const SHA256Hash &v2)
 | 
			
		||||
    : InfoHash {WrappedType(v1, v2)}
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
bool BitTorrent::InfoHash::isValid() const
 | 
			
		||||
{
 | 
			
		||||
    return m_valid;
 | 
			
		||||
 
 | 
			
		||||
@@ -65,6 +65,9 @@ namespace BitTorrent
 | 
			
		||||
 | 
			
		||||
        InfoHash() = default;
 | 
			
		||||
        InfoHash(const WrappedType &nativeHash);
 | 
			
		||||
#ifdef QBT_USES_LIBTORRENT2
 | 
			
		||||
        InfoHash(const SHA1Hash &v1, const SHA256Hash &v2);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
        bool isValid() const;
 | 
			
		||||
        SHA1Hash v1() const;
 | 
			
		||||
@@ -85,3 +88,6 @@ namespace BitTorrent
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Q_DECLARE_METATYPE(BitTorrent::TorrentID)
 | 
			
		||||
// We can declare it as Q_MOVABLE_TYPE to improve performance
 | 
			
		||||
// since base type uses QSharedDataPointer as the only member
 | 
			
		||||
Q_DECLARE_TYPEINFO(BitTorrent::TorrentID, Q_MOVABLE_TYPE);
 | 
			
		||||
 
 | 
			
		||||
@@ -41,6 +41,7 @@ namespace
 | 
			
		||||
NativeTorrentExtension::NativeTorrentExtension(const lt::torrent_handle &torrentHandle)
 | 
			
		||||
    : m_torrentHandle {torrentHandle}
 | 
			
		||||
{
 | 
			
		||||
    on_state(m_torrentHandle.status({}).state);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool NativeTorrentExtension::on_pause()
 | 
			
		||||
@@ -56,7 +57,10 @@ bool NativeTorrentExtension::on_pause()
 | 
			
		||||
void NativeTorrentExtension::on_state(const lt::torrent_status::state_t state)
 | 
			
		||||
{
 | 
			
		||||
    if (m_state == lt::torrent_status::downloading_metadata)
 | 
			
		||||
        m_torrentHandle.set_flags(lt::torrent_flags::stop_when_ready);
 | 
			
		||||
    {
 | 
			
		||||
        m_torrentHandle.unset_flags(lt::torrent_flags::auto_managed);
 | 
			
		||||
        m_torrentHandle.pause();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    m_state = state;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -236,6 +236,14 @@ namespace
 | 
			
		||||
        status.pieces = params.have_pieces;
 | 
			
		||||
        status.verified_pieces = params.verified_pieces;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    template <typename Vector>
 | 
			
		||||
    Vector resized(const Vector &inVector, const typename Vector::size_type size, const typename Vector::value_type &defaultValue)
 | 
			
		||||
    {
 | 
			
		||||
        Vector outVector = inVector;
 | 
			
		||||
        outVector.resize(size, defaultValue);
 | 
			
		||||
        return outVector;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TorrentImpl
 | 
			
		||||
@@ -273,13 +281,16 @@ TorrentImpl::TorrentImpl(Session *session, lt::session *nativeSession
 | 
			
		||||
        m_torrentInfo = TorrentInfo(*m_ltAddTorrentParams.ti);
 | 
			
		||||
 | 
			
		||||
        Q_ASSERT(m_filePaths.isEmpty());
 | 
			
		||||
        Q_ASSERT(m_indexMap.isEmpty());
 | 
			
		||||
        const int filesCount = m_torrentInfo.filesCount();
 | 
			
		||||
        m_filePaths.reserve(filesCount);
 | 
			
		||||
        m_indexMap.reserve(filesCount);
 | 
			
		||||
        const std::shared_ptr<const lt::torrent_info> currentInfo = m_nativeHandle.torrent_file();
 | 
			
		||||
        const lt::file_storage &fileStorage = currentInfo->files();
 | 
			
		||||
        for (int i = 0; i < filesCount; ++i)
 | 
			
		||||
        {
 | 
			
		||||
            const lt::file_index_t nativeIndex = m_torrentInfo.nativeIndexes().at(i);
 | 
			
		||||
            m_indexMap[nativeIndex] = i;
 | 
			
		||||
            const QString filePath = Utils::Fs::toUniformPath(QString::fromStdString(fileStorage.file_path(nativeIndex)));
 | 
			
		||||
            m_filePaths.append(filePath);
 | 
			
		||||
        }
 | 
			
		||||
@@ -412,7 +423,7 @@ void TorrentImpl::setSavePath(const QString &path)
 | 
			
		||||
    m_session->handleTorrentNeedSaveResumeData(this);
 | 
			
		||||
 | 
			
		||||
    const bool isFinished = isSeed() || m_hasSeedStatus;
 | 
			
		||||
    if (isFinished)
 | 
			
		||||
    if (isFinished || downloadPath().isEmpty())
 | 
			
		||||
        moveStorage(savePath(), MoveStorageMode::KeepExistingFiles);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -444,7 +455,7 @@ QString TorrentImpl::rootPath() const
 | 
			
		||||
    if (!hasMetadata())
 | 
			
		||||
        return {};
 | 
			
		||||
 | 
			
		||||
    const QString relativeRootPath = m_torrentInfo.rootFolder();
 | 
			
		||||
    const QString relativeRootPath = Utils::Fs::findRootFolder(filePaths());
 | 
			
		||||
    if (relativeRootPath.isEmpty())
 | 
			
		||||
        return {};
 | 
			
		||||
 | 
			
		||||
@@ -1500,6 +1511,8 @@ void TorrentImpl::fileSearchFinished(const QString &savePath, const QStringList
 | 
			
		||||
 | 
			
		||||
void TorrentImpl::endReceivedMetadataHandling(const QString &savePath, const QStringList &fileNames)
 | 
			
		||||
{
 | 
			
		||||
    Q_ASSERT(m_filePaths.isEmpty());
 | 
			
		||||
 | 
			
		||||
    lt::add_torrent_params &p = m_ltAddTorrentParams;
 | 
			
		||||
 | 
			
		||||
    const std::shared_ptr<lt::torrent_info> metadata = std::const_pointer_cast<lt::torrent_info>(m_nativeHandle.torrent_file());
 | 
			
		||||
@@ -1507,13 +1520,14 @@ void TorrentImpl::endReceivedMetadataHandling(const QString &savePath, const QSt
 | 
			
		||||
    m_filePaths = fileNames;
 | 
			
		||||
    const auto nativeIndexes = m_torrentInfo.nativeIndexes();
 | 
			
		||||
    for (int i = 0; i < fileNames.size(); ++i)
 | 
			
		||||
        p.renamed_files[nativeIndexes[i]] = fileNames[i].toStdString();
 | 
			
		||||
    {
 | 
			
		||||
        const auto nativeIndex = nativeIndexes.at(i);
 | 
			
		||||
        p.renamed_files[nativeIndex] = fileNames[i].toStdString();
 | 
			
		||||
    }
 | 
			
		||||
    p.save_path = Utils::Fs::toNativePath(savePath).toStdString();
 | 
			
		||||
    p.ti = metadata;
 | 
			
		||||
 | 
			
		||||
    const int internalFilesCount = p.ti->files().num_files(); // including .pad files
 | 
			
		||||
    // Use qBittorrent default priority rather than libtorrent's (4)
 | 
			
		||||
    p.file_priorities = std::vector(internalFilesCount, LT::toNative(DownloadPriority::Normal));
 | 
			
		||||
    p.file_priorities = resized(p.file_priorities, metadata->files().num_files()
 | 
			
		||||
                                , LT::toNative(p.file_priorities.empty() ? DownloadPriority::Normal : DownloadPriority::Ignored));
 | 
			
		||||
 | 
			
		||||
    reload();
 | 
			
		||||
 | 
			
		||||
@@ -1555,7 +1569,8 @@ void TorrentImpl::reload()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    m_nativeHandle = m_nativeSession->add_torrent(p);
 | 
			
		||||
    m_nativeHandle.queue_position_set(queuePos);
 | 
			
		||||
    if (queuePos >= lt::queue_position_t {})
 | 
			
		||||
        m_nativeHandle.queue_position_set(queuePos);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TorrentImpl::pause()
 | 
			
		||||
@@ -1635,11 +1650,6 @@ void TorrentImpl::handleStateUpdate(const lt::torrent_status &nativeStatus)
 | 
			
		||||
    updateStatus(nativeStatus);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TorrentImpl::handleDownloadPathChanged()
 | 
			
		||||
{
 | 
			
		||||
    adjustStorageLocation();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TorrentImpl::handleMoveStorageJobFinished(const bool hasOutstandingJob)
 | 
			
		||||
{
 | 
			
		||||
    m_session->handleTorrentNeedSaveResumeData(this);
 | 
			
		||||
@@ -1775,6 +1785,8 @@ void TorrentImpl::handleSaveResumeDataAlert(const lt::save_resume_data_alert *p)
 | 
			
		||||
{
 | 
			
		||||
    if (m_maintenanceJob == MaintenanceJob::HandleMetadata)
 | 
			
		||||
    {
 | 
			
		||||
        Q_ASSERT(m_indexMap.isEmpty());
 | 
			
		||||
 | 
			
		||||
        m_ltAddTorrentParams = p->params;
 | 
			
		||||
 | 
			
		||||
        m_ltAddTorrentParams.have_pieces.clear();
 | 
			
		||||
@@ -1784,6 +1796,19 @@ void TorrentImpl::handleSaveResumeDataAlert(const lt::save_resume_data_alert *p)
 | 
			
		||||
 | 
			
		||||
        QStringList filePaths = metadata.filePaths();
 | 
			
		||||
        applyContentLayout(filePaths, m_contentLayout);
 | 
			
		||||
 | 
			
		||||
        const auto nativeIndexes = metadata.nativeIndexes();
 | 
			
		||||
        const auto &renamedFiles = m_ltAddTorrentParams.renamed_files;
 | 
			
		||||
        m_indexMap.reserve(filePaths.size());
 | 
			
		||||
        for (int i = 0; i < filePaths.size(); ++i)
 | 
			
		||||
        {
 | 
			
		||||
            const auto nativeIndex = nativeIndexes.at(i);
 | 
			
		||||
            m_indexMap[nativeIndex] = i;
 | 
			
		||||
 | 
			
		||||
            if (const auto it = renamedFiles.find(nativeIndex); it != renamedFiles.cend())
 | 
			
		||||
                filePaths[i] = QString::fromStdString(it->second);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        m_session->findIncompleteFiles(metadata, savePath(), downloadPath(), filePaths);
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
@@ -1862,7 +1887,7 @@ void TorrentImpl::handleFastResumeRejectedAlert(const lt::fastresume_rejected_al
 | 
			
		||||
 | 
			
		||||
void TorrentImpl::handleFileRenamedAlert(const lt::file_renamed_alert *p)
 | 
			
		||||
{
 | 
			
		||||
    const int fileIndex = m_torrentInfo.nativeIndexes().indexOf(p->index);
 | 
			
		||||
    const int fileIndex = m_indexMap.value(p->index, -1);
 | 
			
		||||
    Q_ASSERT(fileIndex >= 0);
 | 
			
		||||
 | 
			
		||||
    // Remove empty leftover folders
 | 
			
		||||
@@ -1892,9 +1917,10 @@ void TorrentImpl::handleFileRenamedAlert(const lt::file_renamed_alert *p)
 | 
			
		||||
        ++pathIdx;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    QDir storageDir {actualStorageLocation()};
 | 
			
		||||
    for (int i = (oldPathParts.size() - 1); i >= pathIdx; --i)
 | 
			
		||||
    {
 | 
			
		||||
        QDir().rmdir(savePath() + Utils::String::join(oldPathParts, QString::fromLatin1("/")));
 | 
			
		||||
        storageDir.rmdir(Utils::String::join(oldPathParts, QString::fromLatin1("/")));
 | 
			
		||||
        oldPathParts.removeLast();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -1907,7 +1933,7 @@ void TorrentImpl::handleFileRenamedAlert(const lt::file_renamed_alert *p)
 | 
			
		||||
 | 
			
		||||
void TorrentImpl::handleFileRenameFailedAlert(const lt::file_rename_failed_alert *p)
 | 
			
		||||
{
 | 
			
		||||
    const int fileIndex = m_torrentInfo.nativeIndexes().indexOf(p->index);
 | 
			
		||||
    const int fileIndex = m_indexMap.value(p->index, -1);
 | 
			
		||||
    Q_ASSERT(fileIndex >= 0);
 | 
			
		||||
 | 
			
		||||
    LogMsg(tr("File rename failed. Torrent: \"%1\", file: \"%2\", reason: \"%3\"")
 | 
			
		||||
@@ -1922,12 +1948,14 @@ void TorrentImpl::handleFileRenameFailedAlert(const lt::file_rename_failed_alert
 | 
			
		||||
 | 
			
		||||
void TorrentImpl::handleFileCompletedAlert(const lt::file_completed_alert *p)
 | 
			
		||||
{
 | 
			
		||||
    const int fileIndex = m_torrentInfo.nativeIndexes().indexOf(p->index);
 | 
			
		||||
    Q_ASSERT(fileIndex >= 0);
 | 
			
		||||
    if (m_maintenanceJob == MaintenanceJob::HandleMetadata)
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    qDebug("A file completed download in torrent \"%s\"", qUtf8Printable(name()));
 | 
			
		||||
    if (m_session->isAppendExtensionEnabled())
 | 
			
		||||
    {
 | 
			
		||||
        const int fileIndex = m_indexMap.value(p->index, -1);
 | 
			
		||||
        Q_ASSERT(fileIndex >= 0);
 | 
			
		||||
 | 
			
		||||
        QString name = filePath(fileIndex);
 | 
			
		||||
        if (name.endsWith(QB_EXT))
 | 
			
		||||
        {
 | 
			
		||||
@@ -1961,12 +1989,6 @@ void TorrentImpl::handleMetadataReceivedAlert(const lt::metadata_received_alert
 | 
			
		||||
    m_session->handleTorrentNeedSaveResumeData(this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TorrentImpl::handlePerformanceAlert(const lt::performance_alert *p) const
 | 
			
		||||
{
 | 
			
		||||
    LogMsg((tr("Performance alert: ") + QString::fromStdString(p->message()))
 | 
			
		||||
           , Log::INFO);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TorrentImpl::handleCategoryOptionsChanged()
 | 
			
		||||
{
 | 
			
		||||
    if (m_useAutoTMM)
 | 
			
		||||
@@ -2034,9 +2056,6 @@ void TorrentImpl::handleAlert(const lt::alert *a)
 | 
			
		||||
    case lt::torrent_checked_alert::alert_type:
 | 
			
		||||
        handleTorrentCheckedAlert(static_cast<const lt::torrent_checked_alert*>(a));
 | 
			
		||||
        break;
 | 
			
		||||
    case lt::performance_alert::alert_type:
 | 
			
		||||
        handlePerformanceAlert(static_cast<const lt::performance_alert*>(a));
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -2081,7 +2100,8 @@ void TorrentImpl::adjustStorageLocation()
 | 
			
		||||
    const bool isFinished = isSeed() || m_hasSeedStatus;
 | 
			
		||||
    const QDir targetDir {((isFinished || downloadPath.isEmpty()) ? savePath() : downloadPath)};
 | 
			
		||||
 | 
			
		||||
    moveStorage(targetDir.absolutePath(), MoveStorageMode::Overwrite);
 | 
			
		||||
    if ((targetDir != QDir(actualStorageLocation())) || isMoveInProgress())
 | 
			
		||||
        moveStorage(targetDir.absolutePath(), MoveStorageMode::Overwrite);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lt::torrent_handle TorrentImpl::nativeHandle() const
 | 
			
		||||
 
 | 
			
		||||
@@ -232,7 +232,6 @@ namespace BitTorrent
 | 
			
		||||
 | 
			
		||||
        void handleAlert(const lt::alert *a);
 | 
			
		||||
        void handleStateUpdate(const lt::torrent_status &nativeStatus);
 | 
			
		||||
        void handleDownloadPathChanged();
 | 
			
		||||
        void handleCategoryOptionsChanged();
 | 
			
		||||
        void handleAppendExtensionToggled();
 | 
			
		||||
        void saveResumeData();
 | 
			
		||||
@@ -255,7 +254,6 @@ namespace BitTorrent
 | 
			
		||||
        void handleFileRenamedAlert(const lt::file_renamed_alert *p);
 | 
			
		||||
        void handleFileRenameFailedAlert(const lt::file_rename_failed_alert *p);
 | 
			
		||||
        void handleMetadataReceivedAlert(const lt::metadata_received_alert *p);
 | 
			
		||||
        void handlePerformanceAlert(const lt::performance_alert *p) const;
 | 
			
		||||
        void handleSaveResumeDataAlert(const lt::save_resume_data_alert *p);
 | 
			
		||||
        void handleSaveResumeDataFailedAlert(const lt::save_resume_data_failed_alert *p);
 | 
			
		||||
        void handleTorrentCheckedAlert(const lt::torrent_checked_alert *p);
 | 
			
		||||
@@ -286,6 +284,7 @@ namespace BitTorrent
 | 
			
		||||
        TorrentState m_state = TorrentState::Unknown;
 | 
			
		||||
        TorrentInfo m_torrentInfo;
 | 
			
		||||
        QStringList m_filePaths;
 | 
			
		||||
        QHash<lt::file_index_t, int> m_indexMap;
 | 
			
		||||
        SpeedMonitor m_speedMonitor;
 | 
			
		||||
 | 
			
		||||
        InfoHash m_infoHash;
 | 
			
		||||
 
 | 
			
		||||
@@ -140,7 +140,7 @@ nonstd::expected<void, QString> TorrentInfo::saveToFile(const QString &path) con
 | 
			
		||||
 | 
			
		||||
    try
 | 
			
		||||
    {
 | 
			
		||||
        const auto torrentCreator = lt::create_torrent(*nativeInfo());
 | 
			
		||||
        const auto torrentCreator = lt::create_torrent(*m_nativeInfo);
 | 
			
		||||
        const lt::entry torrentEntry = torrentCreator.generate();
 | 
			
		||||
        const nonstd::expected<void, QString> result = Utils::IO::saveToFile(path, torrentEntry);
 | 
			
		||||
        if (!result)
 | 
			
		||||
@@ -409,19 +409,6 @@ int TorrentInfo::fileIndex(const QString &fileName) const
 | 
			
		||||
    return -1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QString TorrentInfo::rootFolder() const
 | 
			
		||||
{
 | 
			
		||||
    if (!isValid())
 | 
			
		||||
        return {};
 | 
			
		||||
 | 
			
		||||
    return Utils::Fs::findRootFolder(filePaths());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool TorrentInfo::hasRootFolder() const
 | 
			
		||||
{
 | 
			
		||||
    return !rootFolder().isEmpty();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TorrentContentLayout TorrentInfo::contentLayout() const
 | 
			
		||||
{
 | 
			
		||||
    if (!isValid())
 | 
			
		||||
 
 | 
			
		||||
@@ -92,9 +92,6 @@ namespace BitTorrent
 | 
			
		||||
        PieceRange filePieces(const QString &file) const;
 | 
			
		||||
        PieceRange filePieces(int fileIndex) const;
 | 
			
		||||
 | 
			
		||||
        QString rootFolder() const;
 | 
			
		||||
        bool hasRootFolder() const;
 | 
			
		||||
 | 
			
		||||
        std::shared_ptr<lt::torrent_info> nativeInfo() const;
 | 
			
		||||
        QVector<lt::file_index_t> nativeIndexes() const;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -591,16 +591,16 @@ void Parser::parse_impl(const QByteArray &feedData)
 | 
			
		||||
        xml.skipCurrentElement();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!foundChannel)
 | 
			
		||||
    {
 | 
			
		||||
        m_result.error = tr("Invalid RSS feed.");
 | 
			
		||||
    }
 | 
			
		||||
    else if (xml.hasError())
 | 
			
		||||
    if (xml.hasError())
 | 
			
		||||
    {
 | 
			
		||||
        m_result.error = tr("%1 (line: %2, column: %3, offset: %4).")
 | 
			
		||||
                .arg(xml.errorString()).arg(xml.lineNumber())
 | 
			
		||||
                .arg(xml.columnNumber()).arg(xml.characterOffset());
 | 
			
		||||
    }
 | 
			
		||||
    else if (!foundChannel)
 | 
			
		||||
    {
 | 
			
		||||
        m_result.error = tr("Invalid RSS feed.");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    emit finished(m_result);
 | 
			
		||||
    m_result.articles.clear(); // clear articles only
 | 
			
		||||
 
 | 
			
		||||
@@ -511,7 +511,8 @@ void TorrentFilesWatcher::Worker::processFolder(const QString &path, const QStri
 | 
			
		||||
        if (path != watchedFolderPath)
 | 
			
		||||
        {
 | 
			
		||||
            const QString subdirPath = watchedDir.relativeFilePath(path);
 | 
			
		||||
            if (addTorrentParams.useAutoTMM)
 | 
			
		||||
            const bool useAutoTMM = addTorrentParams.useAutoTMM.value_or(!BitTorrent::Session::instance()->isAutoTMMDisabledByDefault());
 | 
			
		||||
            if (useAutoTMM)
 | 
			
		||||
            {
 | 
			
		||||
                addTorrentParams.category = addTorrentParams.category.isEmpty()
 | 
			
		||||
                        ? subdirPath : (addTorrentParams.category + QLatin1Char('/') + subdirPath);
 | 
			
		||||
@@ -590,7 +591,8 @@ void TorrentFilesWatcher::Worker::processFailedTorrents()
 | 
			
		||||
                if (exactDirPath != dir.path())
 | 
			
		||||
                {
 | 
			
		||||
                    const QString subdirPath = dir.relativeFilePath(exactDirPath);
 | 
			
		||||
                    if (addTorrentParams.useAutoTMM)
 | 
			
		||||
                    const bool useAutoTMM = addTorrentParams.useAutoTMM.value_or(!BitTorrent::Session::instance()->isAutoTMMDisabledByDefault());
 | 
			
		||||
                    if (useAutoTMM)
 | 
			
		||||
                    {
 | 
			
		||||
                        addTorrentParams.category = addTorrentParams.category.isEmpty()
 | 
			
		||||
                                ? subdirPath : (addTorrentParams.category + QLatin1Char('/') + subdirPath);
 | 
			
		||||
 
 | 
			
		||||
@@ -30,9 +30,9 @@
 | 
			
		||||
 | 
			
		||||
#define QBT_VERSION_MAJOR 4
 | 
			
		||||
#define QBT_VERSION_MINOR 4
 | 
			
		||||
#define QBT_VERSION_BUGFIX 0
 | 
			
		||||
#define QBT_VERSION_BUGFIX 2
 | 
			
		||||
#define QBT_VERSION_BUILD 0
 | 
			
		||||
#define QBT_VERSION_STATUS "rc1"  // Should be empty for stable releases!
 | 
			
		||||
#define QBT_VERSION_STATUS ""  // Should be empty for stable releases!
 | 
			
		||||
 | 
			
		||||
#define QBT__STRINGIFY(x) #x
 | 
			
		||||
#define QBT_STRINGIFY(x) QBT__STRINGIFY(x)
 | 
			
		||||
 
 | 
			
		||||
@@ -200,7 +200,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
 | 
			
		||||
 | 
			
		||||
    m_ui->startTorrentCheckBox->setChecked(!m_torrentParams.addPaused.value_or(session->isAddTorrentPaused()));
 | 
			
		||||
 | 
			
		||||
    m_ui->comboTTM->blockSignals(true); // the TreeView size isn't correct if the slot does it job at this point
 | 
			
		||||
    m_ui->comboTTM->blockSignals(true); // the TreeView size isn't correct if the slot does its job at this point
 | 
			
		||||
    m_ui->comboTTM->setCurrentIndex(session->isAutoTMMDisabledByDefault() ? 0 : 1);
 | 
			
		||||
    m_ui->comboTTM->blockSignals(false);
 | 
			
		||||
 | 
			
		||||
@@ -874,6 +874,8 @@ void AddNewTorrentDialog::setupTreeview()
 | 
			
		||||
        connect(m_ui->contentTreeView, &QAbstractItemView::clicked, m_ui->contentTreeView
 | 
			
		||||
                , qOverload<const QModelIndex &>(&QAbstractItemView::edit));
 | 
			
		||||
        connect(m_ui->contentTreeView, &QWidget::customContextMenuRequested, this, &AddNewTorrentDialog::displayContentTreeMenu);
 | 
			
		||||
        connect(m_ui->buttonSelectAll, &QPushButton::clicked, m_contentModel, &TorrentContentFilterModel::selectAll);
 | 
			
		||||
        connect(m_ui->buttonSelectNone, &QPushButton::clicked, m_contentModel, &TorrentContentFilterModel::selectNone);
 | 
			
		||||
 | 
			
		||||
        const auto contentLayout = ((m_ui->contentLayoutComboBox->currentIndex() == 0)
 | 
			
		||||
                                    ? BitTorrent::detectContentLayout(m_torrentInfo.filePaths())
 | 
			
		||||
@@ -964,9 +966,9 @@ void AddNewTorrentDialog::TMMChanged(int index)
 | 
			
		||||
 | 
			
		||||
        m_ui->groupBoxDownloadPath->blockSignals(true);
 | 
			
		||||
        m_ui->groupBoxDownloadPath->setChecked(!downloadPath.isEmpty());
 | 
			
		||||
 | 
			
		||||
        updateDiskSpaceLabel();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    updateDiskSpaceLabel();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void AddNewTorrentDialog::doNotDeleteTorrentClicked(bool checked)
 | 
			
		||||
 
 | 
			
		||||
@@ -392,22 +392,59 @@
 | 
			
		||||
       </item>
 | 
			
		||||
      </layout>
 | 
			
		||||
     </widget>
 | 
			
		||||
     <widget class="TorrentContentTreeView" name="contentTreeView">
 | 
			
		||||
      <property name="sizePolicy">
 | 
			
		||||
       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
 | 
			
		||||
        <horstretch>1</horstretch>
 | 
			
		||||
        <verstretch>0</verstretch>
 | 
			
		||||
       </sizepolicy>
 | 
			
		||||
      </property>
 | 
			
		||||
      <property name="contextMenuPolicy">
 | 
			
		||||
       <enum>Qt::CustomContextMenu</enum>
 | 
			
		||||
      </property>
 | 
			
		||||
      <property name="selectionMode">
 | 
			
		||||
       <enum>QAbstractItemView::ExtendedSelection</enum>
 | 
			
		||||
      </property>
 | 
			
		||||
      <property name="sortingEnabled">
 | 
			
		||||
       <bool>true</bool>
 | 
			
		||||
      </property>
 | 
			
		||||
     <widget class="QWidget" name="layoutWidget">
 | 
			
		||||
      <layout class="QVBoxLayout" name="verticalLayout_5">
 | 
			
		||||
       <item>
 | 
			
		||||
        <layout class="QHBoxLayout" name="contentFilterLayout">
 | 
			
		||||
         <item>
 | 
			
		||||
          <widget class="QPushButton" name="buttonSelectAll">
 | 
			
		||||
           <property name="text">
 | 
			
		||||
            <string>Select All</string>
 | 
			
		||||
           </property>
 | 
			
		||||
          </widget>
 | 
			
		||||
         </item>
 | 
			
		||||
         <item>
 | 
			
		||||
          <widget class="QPushButton" name="buttonSelectNone">
 | 
			
		||||
           <property name="text">
 | 
			
		||||
            <string>Select None</string>
 | 
			
		||||
           </property>
 | 
			
		||||
          </widget>
 | 
			
		||||
         </item>
 | 
			
		||||
         <item>
 | 
			
		||||
          <spacer name="horizontalSpacer_6">
 | 
			
		||||
           <property name="orientation">
 | 
			
		||||
            <enum>Qt::Horizontal</enum>
 | 
			
		||||
           </property>
 | 
			
		||||
           <property name="sizeHint" stdset="0">
 | 
			
		||||
            <size>
 | 
			
		||||
             <width>168</width>
 | 
			
		||||
             <height>20</height>
 | 
			
		||||
            </size>
 | 
			
		||||
           </property>
 | 
			
		||||
          </spacer>
 | 
			
		||||
         </item>
 | 
			
		||||
        </layout>
 | 
			
		||||
       </item>
 | 
			
		||||
       <item>
 | 
			
		||||
        <widget class="TorrentContentTreeView" name="contentTreeView">
 | 
			
		||||
         <property name="sizePolicy">
 | 
			
		||||
          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
 | 
			
		||||
           <horstretch>1</horstretch>
 | 
			
		||||
           <verstretch>0</verstretch>
 | 
			
		||||
          </sizepolicy>
 | 
			
		||||
         </property>
 | 
			
		||||
         <property name="contextMenuPolicy">
 | 
			
		||||
          <enum>Qt::CustomContextMenu</enum>
 | 
			
		||||
         </property>
 | 
			
		||||
         <property name="selectionMode">
 | 
			
		||||
          <enum>QAbstractItemView::ExtendedSelection</enum>
 | 
			
		||||
         </property>
 | 
			
		||||
         <property name="sortingEnabled">
 | 
			
		||||
          <bool>true</bool>
 | 
			
		||||
         </property>
 | 
			
		||||
        </widget>
 | 
			
		||||
       </item>
 | 
			
		||||
      </layout>
 | 
			
		||||
     </widget>
 | 
			
		||||
    </widget>
 | 
			
		||||
   </item>
 | 
			
		||||
 
 | 
			
		||||
@@ -64,6 +64,7 @@ namespace
 | 
			
		||||
        RESUME_DATA_STORAGE,
 | 
			
		||||
#if defined(Q_OS_WIN)
 | 
			
		||||
        OS_MEMORY_PRIORITY,
 | 
			
		||||
        MEMORY_WORKING_SET_LIMIT,
 | 
			
		||||
#endif
 | 
			
		||||
        // network interface
 | 
			
		||||
        NETWORK_IFACE,
 | 
			
		||||
@@ -196,6 +197,8 @@ void AdvancedSettings::saveAdvancedSettings()
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
    session->setOSMemoryPriority(prio);
 | 
			
		||||
 | 
			
		||||
    static_cast<Application *>(QCoreApplication::instance())->setMemoryWorkingSetLimit(m_spinBoxMemoryWorkingSetLimit.value());
 | 
			
		||||
#endif
 | 
			
		||||
    // Async IO threads
 | 
			
		||||
    session->setAsyncIOThreads(m_spinBoxAsyncIOThreads.value());
 | 
			
		||||
@@ -436,6 +439,15 @@ void AdvancedSettings::loadAdvancedSettings()
 | 
			
		||||
    addRow(OS_MEMORY_PRIORITY, (tr("Process memory priority (Windows >= 8 only)")
 | 
			
		||||
        + ' ' + makeLink("https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-memory_priority_information", "(?)"))
 | 
			
		||||
        , &m_comboBoxOSMemoryPriority);
 | 
			
		||||
 | 
			
		||||
    m_spinBoxMemoryWorkingSetLimit.setMinimum(1);
 | 
			
		||||
    m_spinBoxMemoryWorkingSetLimit.setMaximum(std::numeric_limits<int>::max());
 | 
			
		||||
    m_spinBoxMemoryWorkingSetLimit.setSuffix(tr(" MiB"));
 | 
			
		||||
    m_spinBoxMemoryWorkingSetLimit.setValue(static_cast<Application *>(QCoreApplication::instance())->memoryWorkingSetLimit());
 | 
			
		||||
 | 
			
		||||
    addRow(MEMORY_WORKING_SET_LIMIT, (tr("Physical memory (RAM) usage limit")
 | 
			
		||||
        + ' ' + makeLink("https://wikipedia.org/wiki/Working_set", "(?)"))
 | 
			
		||||
        , &m_spinBoxMemoryWorkingSetLimit);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    // Async IO threads
 | 
			
		||||
 
 | 
			
		||||
@@ -82,6 +82,7 @@ private:
 | 
			
		||||
    // OS dependent settings
 | 
			
		||||
#if defined(Q_OS_WIN)
 | 
			
		||||
    QComboBox m_comboBoxOSMemoryPriority;
 | 
			
		||||
    QSpinBox m_spinBoxMemoryWorkingSetLimit;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef Q_OS_MACOS
 | 
			
		||||
 
 | 
			
		||||
@@ -111,8 +111,12 @@ FileSystemPathEdit::FileSystemPathEditPrivate::FileSystemPathEditPrivate(
 | 
			
		||||
void FileSystemPathEdit::FileSystemPathEditPrivate::browseActionTriggered()
 | 
			
		||||
{
 | 
			
		||||
    Q_Q(FileSystemPathEdit);
 | 
			
		||||
 | 
			
		||||
    const QFileInfo fileInfo {q->selectedPath()};
 | 
			
		||||
    const QString directory = (m_mode == FileSystemPathEdit::Mode::DirectoryOpen) || (m_mode == FileSystemPathEdit::Mode::DirectorySave)
 | 
			
		||||
            ? fileInfo.absoluteFilePath()
 | 
			
		||||
            : fileInfo.absolutePath();
 | 
			
		||||
    QString filter = q->fileNameFilter();
 | 
			
		||||
    QString directory = q->currentDirectory().isEmpty() ? QDir::homePath() : q->currentDirectory();
 | 
			
		||||
 | 
			
		||||
    QString selectedPath;
 | 
			
		||||
    switch (m_mode)
 | 
			
		||||
@@ -308,11 +312,6 @@ void FileSystemPathEdit::setDialogCaption(const QString &caption)
 | 
			
		||||
    d->m_dialogCaption = caption;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QString FileSystemPathEdit::currentDirectory() const
 | 
			
		||||
{
 | 
			
		||||
    return QFileInfo(selectedPath()).absoluteDir().absolutePath();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QWidget *FileSystemPathEdit::editWidgetImpl() const
 | 
			
		||||
{
 | 
			
		||||
    Q_D(const FileSystemPathEdit);
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user