You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-10-21 13:52:16 +02:00
Compare commits
53 Commits
release-4.
...
release-4.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2c65b79640 | ||
![]() |
1ef504631d | ||
![]() |
5468f10184 | ||
![]() |
5e249c4898 | ||
![]() |
c67d863c93 | ||
![]() |
6e375a38ef | ||
![]() |
0f6768f6ad | ||
![]() |
bdeb662cb0 | ||
![]() |
b9b06d5384 | ||
![]() |
6a174b594b | ||
![]() |
f7cd5ac7c7 | ||
![]() |
50f676c305 | ||
![]() |
7103ae73cd | ||
![]() |
7d4b8b010f | ||
![]() |
09bf033226 | ||
![]() |
4e62608802 | ||
![]() |
37b29bf91a | ||
![]() |
d67037136b | ||
![]() |
73292137b7 | ||
![]() |
56f7a4e803 | ||
![]() |
1cea6a25af | ||
![]() |
ebc704ef14 | ||
![]() |
a2a1a78f44 | ||
![]() |
3a54d574b0 | ||
![]() |
d0be71c225 | ||
![]() |
7c04b4acd8 | ||
![]() |
eda3747c08 | ||
![]() |
7d23ea1f80 | ||
![]() |
698ee94d0b | ||
![]() |
65d1b588d9 | ||
![]() |
eea693979a | ||
![]() |
654bf85a71 | ||
![]() |
8706a7c973 | ||
![]() |
439a2ef597 | ||
![]() |
c5a7aa7668 | ||
![]() |
e5bf83a594 | ||
![]() |
2a3e64933b | ||
![]() |
35f8af32a3 | ||
![]() |
37354a9e29 | ||
![]() |
7cb14e2a5b | ||
![]() |
4aae7266a5 | ||
![]() |
075245c915 | ||
![]() |
476707cc80 | ||
![]() |
7b0b5e3d7f | ||
![]() |
4142722303 | ||
![]() |
8ebb11f981 | ||
![]() |
80016db781 | ||
![]() |
a9f43bd5d2 | ||
![]() |
2f0c3f047a | ||
![]() |
f40a36ecb3 | ||
![]() |
a1ee1c0448 | ||
![]() |
939f83bdd5 | ||
![]() |
e98a887286 |
16
.travis.yml
16
.travis.yml
@@ -55,14 +55,13 @@ addons:
|
||||
apt:
|
||||
sources:
|
||||
# sources list: https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json
|
||||
- sourceline: 'ppa:qbittorrent-team/qbittorrent-stable'
|
||||
- sourceline: 'ppa:qbittorrent-team/qbt-libtorrent-travisci'
|
||||
- sourceline: 'ppa:beineri/opt-qt59-xenial'
|
||||
packages:
|
||||
# packages list: https://github.com/travis-ci/apt-package-safelist/blob/master/ubuntu-trusty
|
||||
- [autoconf, automake, colormake]
|
||||
- [libboost-dev, libboost-system-dev]
|
||||
- libssl-dev
|
||||
- libtorrent-rasterbar-dev
|
||||
- [qt59base, qt59svg, qt59tools]
|
||||
- zlib1g-dev
|
||||
# required for Qt 5.9 from 'beineri' PPA
|
||||
@@ -132,7 +131,7 @@ install:
|
||||
ccache -V && ccache --show-stats && ccache --zero-stats
|
||||
fi
|
||||
- |
|
||||
if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
if [ "$libt_branch" = "RC_1_1" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
wget https://builds.shiki.hu/travis/deb/version
|
||||
if ! cmp --quiet "version" "$HOME/travis/deb/version" ; then
|
||||
echo "Cached files are different from server. Downloading new ones."
|
||||
@@ -141,11 +140,16 @@ install:
|
||||
mkdir "$HOME/travis/deb"
|
||||
cp "version" $HOME/travis/deb
|
||||
cd "$HOME/travis/deb"
|
||||
wget https://builds.shiki.hu/travis/deb/libtorrent-rasterbar-dev_1.2.x_amd64.deb
|
||||
wget https://builds.shiki.hu/travis/deb/libtorrent-rasterbar10_1.2.x_amd64.deb
|
||||
wget https://builds.shiki.hu/travis/deb/libtorrent-rasterbar-dev_1.1.x_amd64.deb
|
||||
wget https://builds.shiki.hu/travis/deb/libtorrent-rasterbar9_1.1.x_amd64.deb
|
||||
fi
|
||||
|
||||
sudo dpkg -i "$HOME/travis/deb/libtorrent-rasterbar-dev_1.2.x_amd64.deb" "$HOME/travis/deb/libtorrent-rasterbar10_1.2.x_amd64.deb"
|
||||
sudo dpkg -i "$HOME/travis/deb/libtorrent-rasterbar-dev_1.1.x_amd64.deb" "$HOME/travis/deb/libtorrent-rasterbar9_1.1.x_amd64.deb"
|
||||
fi
|
||||
- |
|
||||
if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
# Will install latest 1.2.x daily build from the PPA
|
||||
sudo apt-get -y install libtorrent-rasterbar-dev
|
||||
fi
|
||||
- |
|
||||
if [ "$libt_branch" = "RC_1_1" ] && [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
|
27
Changelog
27
Changelog
@@ -1,3 +1,30 @@
|
||||
Sat Apr 25 2020 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.2.5
|
||||
- BUGFIX: Fix crash when torrent is deleted on limit reached (glassez)
|
||||
- BUGFIX: Register datatype properly (Chocobo1)
|
||||
- WEBUI: Add ability to send custom HTTP headers (Chocobo1)
|
||||
- WEBUI: Expand RSS related API (Sepro)
|
||||
- WINDOWS: Installer: Update german translation (schnurlos)
|
||||
|
||||
Wed Apr 22 2020 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.2.4
|
||||
- BUGFIX: Fix sub-sorting of Transfer list (glassez)
|
||||
- BUGFIX: Fix wrong logic that disables "prevent sleeping" timer (Chocobo1)
|
||||
- BUGFIX: Set disk cache size for older libtorrent versions (NotTsunami)
|
||||
- BUGFIX: Sort locale language list (Chocobo1)
|
||||
- BUGFIX: Remove white outline around mascot.png (adem)
|
||||
- BUGFIX: Various fixes in configuring the chosen network interface and not leaking the IP (Raif Atef, an0n666)
|
||||
- BUGFIX: Save "resume data" when torrent storage is moved (glassez)
|
||||
- BUGFIX: Avoid holding encoded resume data in memory (Chocobo1)
|
||||
- BUGFIX: Fix date format for "Last seen complete" (Chocobo1)
|
||||
- BUGFIX: Remove deprecated strict super seeding mode from advanced settings (an0n666)
|
||||
- BUGFIX: Change default stop_tracker_timeout settings (an0n666)
|
||||
- BUGFIX: Convert the Log widget to use custom View/Model (jagannatharjun)
|
||||
- BUGFIX: Change default upload slot choking limits (an0n666)
|
||||
- BUGFIX: Don't uncheck Authentication checkbox when changing proxy type (thalieht)
|
||||
- BUGFIX: Reduce ambiguity for selecting tray icons (Chocobo1)
|
||||
- WEBUI: Fix unable to add multiple peers in WebUI (Sepro)
|
||||
- WEBUI: Fix UPnP lease duration get/set (NotTsunami)
|
||||
- SEARCH: Detect python3 executable on Windows (József Sallai)
|
||||
|
||||
Wed Apr 01 2020 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.2.3
|
||||
- FEATURE: Add logging for SOCKS5 proxy errors (Chocobo1)
|
||||
- FEATURE: Add UPnP lease duration advanced option (NotTsunami)
|
||||
|
24
configure
vendored
24
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for qbittorrent v4.2.3.
|
||||
# Generated by GNU Autoconf 2.69 for qbittorrent v4.2.5.
|
||||
#
|
||||
# Report bugs to <bugs.qbittorrent.org>.
|
||||
#
|
||||
@@ -580,8 +580,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='qbittorrent'
|
||||
PACKAGE_TARNAME='qbittorrent'
|
||||
PACKAGE_VERSION='v4.2.3'
|
||||
PACKAGE_STRING='qbittorrent v4.2.3'
|
||||
PACKAGE_VERSION='v4.2.5'
|
||||
PACKAGE_STRING='qbittorrent v4.2.5'
|
||||
PACKAGE_BUGREPORT='bugs.qbittorrent.org'
|
||||
PACKAGE_URL='https://www.qbittorrent.org/'
|
||||
|
||||
@@ -1302,7 +1302,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures qbittorrent v4.2.3 to adapt to many kinds of systems.
|
||||
\`configure' configures qbittorrent v4.2.5 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1373,7 +1373,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of qbittorrent v4.2.3:";;
|
||||
short | recursive ) echo "Configuration of qbittorrent v4.2.5:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1509,7 +1509,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
qbittorrent configure v4.2.3
|
||||
qbittorrent configure v4.2.5
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 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.2.3, which was
|
||||
It was created by qbittorrent $as_me v4.2.5, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -3826,7 +3826,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='qbittorrent'
|
||||
VERSION='v4.2.3'
|
||||
VERSION='v4.2.5'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -6343,7 +6343,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.2.3, which was
|
||||
This file was extended by qbittorrent $as_me v4.2.5, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -6401,7 +6401,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
qbittorrent config.status v4.2.3
|
||||
qbittorrent config.status v4.2.5
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
@@ -7659,7 +7659,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.2.3, which was
|
||||
This file was extended by qbittorrent $as_me v4.2.5, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -7717,7 +7717,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
qbittorrent config.status v4.2.3
|
||||
qbittorrent config.status v4.2.5
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
AC_INIT([qbittorrent], [v4.2.3], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
|
||||
AC_INIT([qbittorrent], [v4.2.5], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_PROG_CC
|
||||
|
10
dist/mac/Info.plist
vendored
10
dist/mac/Info.plist
vendored
@@ -55,7 +55,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>4.2.3</string>
|
||||
<string>4.2.5</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>@EXECUTABLE@</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@@ -88,13 +88,17 @@
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>com.apple.ostype</key>
|
||||
<string>TORR</string>
|
||||
<array>
|
||||
<string>TORR</string>
|
||||
</array>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>torrent</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/x-bittorrent</string>
|
||||
<array>
|
||||
<string>application/x-bittorrent</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
|
@@ -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.2.3" date="2020-04-01"/>
|
||||
<release version="4.2.5" date="2020-04-25"/>
|
||||
</releases>
|
||||
</component>
|
||||
|
@@ -15,7 +15,7 @@ LangString inst_magnet ${LANG_GERMAN} "Öffne Magnet-Links mit qBittorrent"
|
||||
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
|
||||
LangString inst_firewall ${LANG_GERMAN} "Regel in der Windows Firewall hinzufügen"
|
||||
;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_GERMAN} "Disable Windows path length limit (260 character MAX_PATH limitation, requires Windows 10 1607 or later)"
|
||||
LangString inst_pathlimit ${LANG_GERMAN} "Deaktiviere die Windows-Pfadlängenbeschränkung (260 Zeichen Beschränkung von MAX_PATH - erfordert Windows 10 1607 oder höher)"
|
||||
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
|
||||
LangString inst_firewallinfo ${LANG_GERMAN} "Füge Regel in der Windows Firewall hinzu"
|
||||
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
|
||||
|
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.2.3"
|
||||
!define PROG_VERSION "4.2.5"
|
||||
|
||||
!define MUI_FINISHPAGE_RUN
|
||||
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun
|
||||
|
@@ -61,6 +61,7 @@
|
||||
#endif // Q_OS_MACOS
|
||||
#endif
|
||||
|
||||
#include "base/bittorrent/infohash.h"
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
#include "base/exceptions.h"
|
||||
@@ -133,6 +134,7 @@ Application::Application(int &argc, char **argv)
|
||||
, m_commandLineArgs(parseCommandLine(this->arguments()))
|
||||
{
|
||||
qRegisterMetaType<Log::Msg>("Log::Msg");
|
||||
qRegisterMetaType<Log::Peer>("Log::Peer");
|
||||
|
||||
setApplicationName("qBittorrent");
|
||||
setOrganizationDomain("qbittorrent.org");
|
||||
|
@@ -68,7 +68,7 @@ namespace RSS
|
||||
class AutoDownloader;
|
||||
}
|
||||
|
||||
class Application : public BaseApplication
|
||||
class Application final : public BaseApplication
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(Application)
|
||||
|
@@ -77,7 +77,7 @@
|
||||
|
||||
namespace QtLP_Private
|
||||
{
|
||||
class QtLockedFile : public QFile
|
||||
class QtLockedFile final : public QFile
|
||||
{
|
||||
public:
|
||||
enum LockMode
|
||||
|
@@ -22,6 +22,7 @@ bittorrent/session.h
|
||||
bittorrent/sessionstatus.h
|
||||
bittorrent/torrentcreatorthread.h
|
||||
bittorrent/torrenthandle.h
|
||||
bittorrent/torrenthandleimpl.h
|
||||
bittorrent/torrentinfo.h
|
||||
bittorrent/tracker.h
|
||||
bittorrent/trackerentry.h
|
||||
@@ -58,6 +59,7 @@ utils/bytearray.h
|
||||
utils/foreignapps.h
|
||||
utils/fs.h
|
||||
utils/gzip.h
|
||||
utils/io.h
|
||||
utils/misc.h
|
||||
utils/net.h
|
||||
utils/password.h
|
||||
@@ -99,6 +101,7 @@ bittorrent/private/statistics.cpp
|
||||
bittorrent/session.cpp
|
||||
bittorrent/torrentcreatorthread.cpp
|
||||
bittorrent/torrenthandle.cpp
|
||||
bittorrent/torrenthandleimpl.cpp
|
||||
bittorrent/torrentinfo.cpp
|
||||
bittorrent/tracker.cpp
|
||||
bittorrent/trackerentry.cpp
|
||||
@@ -133,6 +136,7 @@ utils/bytearray.cpp
|
||||
utils/foreignapps.cpp
|
||||
utils/fs.cpp
|
||||
utils/gzip.cpp
|
||||
utils/io.cpp
|
||||
utils/misc.cpp
|
||||
utils/net.cpp
|
||||
utils/password.cpp
|
||||
|
@@ -21,6 +21,7 @@ HEADERS += \
|
||||
$$PWD/bittorrent/sessionstatus.h \
|
||||
$$PWD/bittorrent/torrentcreatorthread.h \
|
||||
$$PWD/bittorrent/torrenthandle.h \
|
||||
$$PWD/bittorrent/torrenthandleimpl.h \
|
||||
$$PWD/bittorrent/torrentinfo.h \
|
||||
$$PWD/bittorrent/tracker.h \
|
||||
$$PWD/bittorrent/trackerentry.h \
|
||||
@@ -73,6 +74,7 @@ HEADERS += \
|
||||
$$PWD/utils/foreignapps.h \
|
||||
$$PWD/utils/fs.h \
|
||||
$$PWD/utils/gzip.h \
|
||||
$$PWD/utils/io.h \
|
||||
$$PWD/utils/misc.h \
|
||||
$$PWD/utils/net.h \
|
||||
$$PWD/utils/password.h \
|
||||
@@ -98,6 +100,7 @@ SOURCES += \
|
||||
$$PWD/bittorrent/session.cpp \
|
||||
$$PWD/bittorrent/torrentcreatorthread.cpp \
|
||||
$$PWD/bittorrent/torrenthandle.cpp \
|
||||
$$PWD/bittorrent/torrenthandleimpl.cpp \
|
||||
$$PWD/bittorrent/torrentinfo.cpp \
|
||||
$$PWD/bittorrent/tracker.cpp \
|
||||
$$PWD/bittorrent/trackerentry.cpp \
|
||||
@@ -143,6 +146,7 @@ SOURCES += \
|
||||
$$PWD/utils/foreignapps.cpp \
|
||||
$$PWD/utils/fs.cpp \
|
||||
$$PWD/utils/gzip.cpp \
|
||||
$$PWD/utils/io.cpp \
|
||||
$$PWD/utils/misc.cpp \
|
||||
$$PWD/utils/net.cpp \
|
||||
$$PWD/utils/password.cpp \
|
||||
|
@@ -28,6 +28,8 @@
|
||||
|
||||
#include "peerinfo.h"
|
||||
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
#include <QBitArray>
|
||||
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
|
@@ -35,7 +35,7 @@
|
||||
|
||||
class QDataStream;
|
||||
|
||||
class FilterParserThread : public QThread
|
||||
class FilterParserThread final : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include <libtorrent/extensions.hpp>
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
class NativeSessionExtension : public lt::plugin
|
||||
class NativeSessionExtension final : public lt::plugin
|
||||
{
|
||||
#if (LIBTORRENT_VERSION_NUM >= 10200)
|
||||
lt::feature_flags_t implemented_features() override;
|
||||
|
@@ -47,7 +47,7 @@ namespace
|
||||
#if (LIBTORRENT_VERSION_NUM < 10200)
|
||||
return torrentStatus.auto_managed;
|
||||
#else
|
||||
return bool {torrentStatus.flags & lt::torrent_flags::auto_managed};
|
||||
return static_cast<bool>(torrentStatus.flags & lt::torrent_flags::auto_managed);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#include <libtorrent/torrent_handle.hpp>
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
class NativeTorrentExtension : public lt::torrent_plugin
|
||||
class NativeTorrentExtension final : public lt::torrent_plugin
|
||||
{
|
||||
public:
|
||||
explicit NativeTorrentExtension(const lt::torrent_handle &torrentHandle);
|
||||
|
@@ -44,7 +44,7 @@ using LTPortMapping = int;
|
||||
using LTPortMapping = lt::port_mapping_t;
|
||||
#endif
|
||||
|
||||
class PortForwarderImpl : public Net::PortForwarder
|
||||
class PortForwarderImpl final : public Net::PortForwarder
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(PortForwarderImpl)
|
||||
|
@@ -28,11 +28,15 @@
|
||||
|
||||
#include "resumedatasavingmanager.h"
|
||||
|
||||
#include <libtorrent/bencode.hpp>
|
||||
#include <libtorrent/entry.hpp>
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QSaveFile>
|
||||
|
||||
#include "base/logger.h"
|
||||
#include "base/utils/fs.h"
|
||||
#include "base/utils/io.h"
|
||||
|
||||
ResumeDataSavingManager::ResumeDataSavingManager(const QString &resumeFolderPath)
|
||||
: m_resumeDataDir(resumeFolderPath)
|
||||
@@ -44,12 +48,27 @@ void ResumeDataSavingManager::save(const QString &filename, const QByteArray &da
|
||||
const QString filepath = m_resumeDataDir.absoluteFilePath(filename);
|
||||
|
||||
QSaveFile file {filepath};
|
||||
if (file.open(QIODevice::WriteOnly)) {
|
||||
file.write(data);
|
||||
if (!file.commit()) {
|
||||
Logger::instance()->addMessage(QString("Couldn't save data in '%1'. Error: %2")
|
||||
.arg(filepath, file.errorString()), Log::WARNING);
|
||||
}
|
||||
if (!file.open(QIODevice::WriteOnly) || (file.write(data) != data.size()) || !file.commit()) {
|
||||
LogMsg(tr("Couldn't save data to '%1'. Error: %2")
|
||||
.arg(filepath, file.errorString()), Log::CRITICAL);
|
||||
}
|
||||
}
|
||||
|
||||
void ResumeDataSavingManager::save(const QString &filename, const std::shared_ptr<lt::entry> &data) const
|
||||
{
|
||||
const QString filepath = m_resumeDataDir.absoluteFilePath(filename);
|
||||
|
||||
QSaveFile file {filepath};
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
LogMsg(tr("Couldn't save data to '%1'. Error: %2")
|
||||
.arg(filepath, file.errorString()), Log::CRITICAL);
|
||||
return;
|
||||
}
|
||||
|
||||
lt::bencode(Utils::IO::FileDeviceOutputIterator {file}, *data);
|
||||
if ((file.error() != QFileDevice::NoError) || !file.commit()) {
|
||||
LogMsg(tr("Couldn't save data to '%1'. Error: %2")
|
||||
.arg(filepath, file.errorString()), Log::CRITICAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -28,6 +28,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <libtorrent/fwd.hpp>
|
||||
|
||||
#include <QDir>
|
||||
#include <QObject>
|
||||
|
||||
@@ -43,8 +47,9 @@ public:
|
||||
|
||||
public slots:
|
||||
void save(const QString &filename, const QByteArray &data) const;
|
||||
void save(const QString &filename, const std::shared_ptr<lt::entry> &data) const;
|
||||
void remove(const QString &filename) const;
|
||||
|
||||
private:
|
||||
QDir m_resumeDataDir;
|
||||
const QDir m_resumeDataDir;
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,7 @@
|
||||
#ifndef BITTORRENT_SESSION_H
|
||||
#define BITTORRENT_SESSION_H
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <libtorrent/fwd.hpp>
|
||||
@@ -92,6 +93,7 @@ namespace BitTorrent
|
||||
class InfoHash;
|
||||
class MagnetUri;
|
||||
class TorrentHandle;
|
||||
class TorrentHandleImpl;
|
||||
class Tracker;
|
||||
class TrackerEntry;
|
||||
struct CreateTorrentParams;
|
||||
@@ -377,8 +379,6 @@ namespace BitTorrent
|
||||
void setAnnounceIP(const QString &ip);
|
||||
int stopTrackerTimeout() const;
|
||||
void setStopTrackerTimeout(int value);
|
||||
bool isSuperSeedingEnabled() const;
|
||||
void setSuperSeedingEnabled(bool enabled);
|
||||
int maxConnections() const;
|
||||
void setMaxConnections(int max);
|
||||
int maxConnectionsPerTorrent() const;
|
||||
@@ -412,7 +412,7 @@ namespace BitTorrent
|
||||
|
||||
void startUpTorrents();
|
||||
TorrentHandle *findTorrent(const InfoHash &hash) const;
|
||||
QHash<InfoHash, TorrentHandle *> torrents() const;
|
||||
QVector<TorrentHandle *> torrents() const;
|
||||
bool hasActiveTorrents() const;
|
||||
bool hasUnfinishedTorrents() const;
|
||||
bool hasRunningSeed() const;
|
||||
@@ -441,31 +441,31 @@ namespace BitTorrent
|
||||
void bottomTorrentsQueuePos(const QVector<InfoHash> &hashes);
|
||||
|
||||
// TorrentHandle interface
|
||||
void handleTorrentSaveResumeDataRequested(const TorrentHandle *torrent);
|
||||
void handleTorrentShareLimitChanged(TorrentHandle *const torrent);
|
||||
void handleTorrentNameChanged(TorrentHandle *const torrent);
|
||||
void handleTorrentSavePathChanged(TorrentHandle *const torrent);
|
||||
void handleTorrentCategoryChanged(TorrentHandle *const torrent, const QString &oldCategory);
|
||||
void handleTorrentTagAdded(TorrentHandle *const torrent, const QString &tag);
|
||||
void handleTorrentTagRemoved(TorrentHandle *const torrent, const QString &tag);
|
||||
void handleTorrentSavingModeChanged(TorrentHandle *const torrent);
|
||||
void handleTorrentMetadataReceived(TorrentHandle *const torrent);
|
||||
void handleTorrentPaused(TorrentHandle *const torrent);
|
||||
void handleTorrentResumed(TorrentHandle *const torrent);
|
||||
void handleTorrentChecked(TorrentHandle *const torrent);
|
||||
void handleTorrentFinished(TorrentHandle *const torrent);
|
||||
void handleTorrentTrackersAdded(TorrentHandle *const torrent, const QVector<TrackerEntry> &newTrackers);
|
||||
void handleTorrentTrackersRemoved(TorrentHandle *const torrent, const QVector<TrackerEntry> &deletedTrackers);
|
||||
void handleTorrentTrackersChanged(TorrentHandle *const torrent);
|
||||
void handleTorrentUrlSeedsAdded(TorrentHandle *const torrent, const QVector<QUrl> &newUrlSeeds);
|
||||
void handleTorrentUrlSeedsRemoved(TorrentHandle *const torrent, const QVector<QUrl> &urlSeeds);
|
||||
void handleTorrentResumeDataReady(TorrentHandle *const torrent, const lt::entry &data);
|
||||
void handleTorrentResumeDataFailed(TorrentHandle *const torrent);
|
||||
void handleTorrentTrackerReply(TorrentHandle *const torrent, const QString &trackerUrl);
|
||||
void handleTorrentTrackerWarning(TorrentHandle *const torrent, const QString &trackerUrl);
|
||||
void handleTorrentTrackerError(TorrentHandle *const torrent, const QString &trackerUrl);
|
||||
void handleTorrentSaveResumeDataRequested(const TorrentHandleImpl *torrent);
|
||||
void handleTorrentShareLimitChanged(TorrentHandleImpl *const torrent);
|
||||
void handleTorrentNameChanged(TorrentHandleImpl *const torrent);
|
||||
void handleTorrentSavePathChanged(TorrentHandleImpl *const torrent);
|
||||
void handleTorrentCategoryChanged(TorrentHandleImpl *const torrent, const QString &oldCategory);
|
||||
void handleTorrentTagAdded(TorrentHandleImpl *const torrent, const QString &tag);
|
||||
void handleTorrentTagRemoved(TorrentHandleImpl *const torrent, const QString &tag);
|
||||
void handleTorrentSavingModeChanged(TorrentHandleImpl *const torrent);
|
||||
void handleTorrentMetadataReceived(TorrentHandleImpl *const torrent);
|
||||
void handleTorrentPaused(TorrentHandleImpl *const torrent);
|
||||
void handleTorrentResumed(TorrentHandleImpl *const torrent);
|
||||
void handleTorrentChecked(TorrentHandleImpl *const torrent);
|
||||
void handleTorrentFinished(TorrentHandleImpl *const torrent);
|
||||
void handleTorrentTrackersAdded(TorrentHandleImpl *const torrent, const QVector<TrackerEntry> &newTrackers);
|
||||
void handleTorrentTrackersRemoved(TorrentHandleImpl *const torrent, const QVector<TrackerEntry> &deletedTrackers);
|
||||
void handleTorrentTrackersChanged(TorrentHandleImpl *const torrent);
|
||||
void handleTorrentUrlSeedsAdded(TorrentHandleImpl *const torrent, const QVector<QUrl> &newUrlSeeds);
|
||||
void handleTorrentUrlSeedsRemoved(TorrentHandleImpl *const torrent, const QVector<QUrl> &urlSeeds);
|
||||
void handleTorrentResumeDataReady(TorrentHandleImpl *const torrent, const std::shared_ptr<lt::entry> &data);
|
||||
void handleTorrentResumeDataFailed(TorrentHandleImpl *const torrent);
|
||||
void handleTorrentTrackerReply(TorrentHandleImpl *const torrent, const QString &trackerUrl);
|
||||
void handleTorrentTrackerWarning(TorrentHandleImpl *const torrent, const QString &trackerUrl);
|
||||
void handleTorrentTrackerError(TorrentHandleImpl *const torrent, const QString &trackerUrl);
|
||||
|
||||
bool addMoveTorrentStorageJob(TorrentHandle *torrent, const QString &newPath, MoveStorageMode mode);
|
||||
bool addMoveTorrentStorageJob(TorrentHandleImpl *torrent, const QString &newPath, MoveStorageMode mode);
|
||||
|
||||
signals:
|
||||
void addTorrentFailed(const QString &error);
|
||||
@@ -522,7 +522,7 @@ namespace BitTorrent
|
||||
private:
|
||||
struct MoveStorageJob
|
||||
{
|
||||
TorrentHandle *torrent;
|
||||
TorrentHandleImpl *torrent;
|
||||
QString path;
|
||||
MoveStorageMode mode;
|
||||
};
|
||||
@@ -572,7 +572,7 @@ namespace BitTorrent
|
||||
bool findIncompleteFiles(TorrentInfo &torrentInfo, QString &savePath) const;
|
||||
|
||||
void updateSeedingLimitTimer();
|
||||
void exportTorrentFile(TorrentHandle *const torrent, TorrentExportFolder folder = TorrentExportFolder::Regular);
|
||||
void exportTorrentFile(const TorrentHandle *torrent, TorrentExportFolder folder = TorrentExportFolder::Regular);
|
||||
|
||||
void handleAlert(const lt::alert *a);
|
||||
void dispatchTorrentAlert(const lt::alert *a);
|
||||
@@ -657,7 +657,6 @@ namespace BitTorrent
|
||||
CachedSettingValue<bool> m_includeOverheadInLimits;
|
||||
CachedSettingValue<QString> m_announceIP;
|
||||
CachedSettingValue<int> m_stopTrackerTimeout;
|
||||
CachedSettingValue<bool> m_isSuperSeedingEnabled;
|
||||
CachedSettingValue<int> m_maxConnections;
|
||||
CachedSettingValue<int> m_maxUploads;
|
||||
CachedSettingValue<int> m_maxConnectionsPerTorrent;
|
||||
@@ -735,7 +734,7 @@ namespace BitTorrent
|
||||
ResumeDataSavingManager *m_resumeDataSavingManager = nullptr;
|
||||
|
||||
QHash<InfoHash, TorrentInfo> m_loadedMetadata;
|
||||
QHash<InfoHash, TorrentHandle *> m_torrents;
|
||||
QHash<InfoHash, TorrentHandleImpl *> m_torrents;
|
||||
QHash<InfoHash, CreateTorrentParams> m_addingTorrents;
|
||||
QHash<QString, AddTorrentParams> m_downloadedTorrents;
|
||||
QHash<InfoHash, RemovingTorrentData> m_removingTorrents;
|
||||
@@ -760,4 +759,9 @@ namespace BitTorrent
|
||||
};
|
||||
}
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
|
||||
Q_DECLARE_METATYPE(std::shared_ptr<lt::entry>)
|
||||
const int sharedPtrLtEntryTypeID = qRegisterMetaType<std::shared_ptr<lt::entry>>();
|
||||
#endif
|
||||
|
||||
#endif // BITTORRENT_SESSION_H
|
||||
|
@@ -41,8 +41,10 @@
|
||||
#include <QFileInfo>
|
||||
#include <QHash>
|
||||
|
||||
#include "base/exceptions.h"
|
||||
#include "base/global.h"
|
||||
#include "base/utils/fs.h"
|
||||
#include "base/utils/io.h"
|
||||
#include "base/utils/string.h"
|
||||
#include "private/ltunderlyingtype.h"
|
||||
|
||||
@@ -162,7 +164,7 @@ void TorrentCreatorThread::run()
|
||||
lt::set_piece_hashes(newTorrent, Utils::Fs::toNativePath(parentPath).toStdString()
|
||||
, [this, &newTorrent](const LTPieceIndex n)
|
||||
{
|
||||
sendProgressSignal(LTUnderlyingType<LTPieceIndex> {n}, newTorrent.num_pieces());
|
||||
sendProgressSignal(static_cast<LTUnderlyingType<LTPieceIndex>>(n), newTorrent.num_pieces());
|
||||
});
|
||||
// Set qBittorrent as creator and add user comment to
|
||||
// torrent_info structure
|
||||
@@ -182,19 +184,19 @@ void TorrentCreatorThread::run()
|
||||
if (isInterruptionRequested()) return;
|
||||
|
||||
// create the torrent
|
||||
std::ofstream outfile(
|
||||
#ifdef _MSC_VER
|
||||
Utils::Fs::toNativePath(m_params.savePath).toStdWString().c_str()
|
||||
#else
|
||||
Utils::Fs::toNativePath(m_params.savePath).toUtf8().constData()
|
||||
#endif
|
||||
, (std::ios_base::out | std::ios_base::binary | std::ios_base::trunc));
|
||||
if (outfile.fail())
|
||||
throw std::runtime_error(tr("create new torrent file failed").toStdString());
|
||||
QFile outfile {m_params.savePath};
|
||||
if (!outfile.open(QIODevice::WriteOnly)) {
|
||||
throw RuntimeError {tr("Create new torrent file failed. Reason: %1")
|
||||
.arg(outfile.errorString())};
|
||||
}
|
||||
|
||||
if (isInterruptionRequested()) return;
|
||||
|
||||
lt::bencode(std::ostream_iterator<char>(outfile), entry);
|
||||
lt::bencode(Utils::IO::FileDeviceOutputIterator {outfile}, entry);
|
||||
if (outfile.error() != QFileDevice::NoError) {
|
||||
throw RuntimeError {tr("Create new torrent file failed. Reason: %1")
|
||||
.arg(outfile.errorString())};
|
||||
}
|
||||
outfile.close();
|
||||
|
||||
emit updateProgress(100);
|
||||
|
@@ -48,7 +48,7 @@ namespace BitTorrent
|
||||
QStringList urlSeeds;
|
||||
};
|
||||
|
||||
class TorrentCreatorThread : public QThread
|
||||
class TorrentCreatorThread final : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2142
src/base/bittorrent/torrenthandleimpl.cpp
Normal file
2142
src/base/bittorrent/torrenthandleimpl.cpp
Normal file
File diff suppressed because it is too large
Load Diff
338
src/base/bittorrent/torrenthandleimpl.h
Normal file
338
src/base/bittorrent/torrenthandleimpl.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -47,6 +47,7 @@
|
||||
#include "base/exceptions.h"
|
||||
#include "base/global.h"
|
||||
#include "base/utils/fs.h"
|
||||
#include "base/utils/io.h"
|
||||
#include "base/utils/misc.h"
|
||||
#include "infohash.h"
|
||||
#include "trackerentry.h"
|
||||
@@ -166,12 +167,12 @@ void TorrentInfo::saveToFile(const QString &path) const
|
||||
#endif
|
||||
const lt::entry torrentEntry = torrentCreator.generate();
|
||||
|
||||
QByteArray out;
|
||||
out.reserve(1024 * 1024); // most torrent file sizes are under 1 MB
|
||||
lt::bencode(std::back_inserter(out), torrentEntry);
|
||||
QFile torrentFile {path};
|
||||
if (!torrentFile.open(QIODevice::WriteOnly))
|
||||
throw RuntimeError {torrentFile.errorString()};
|
||||
|
||||
QFile torrentFile{path};
|
||||
if (!torrentFile.open(QIODevice::WriteOnly) || (torrentFile.write(out) != out.size()))
|
||||
lt::bencode(Utils::IO::FileDeviceOutputIterator {torrentFile}, torrentEntry);
|
||||
if (torrentFile.error() != QFileDevice::NoError)
|
||||
throw RuntimeError {torrentFile.errorString()};
|
||||
}
|
||||
|
||||
|
@@ -70,7 +70,7 @@ namespace BitTorrent
|
||||
// *Basic* Bittorrent tracker implementation
|
||||
// [BEP-3] The BitTorrent Protocol Specification
|
||||
// also see: https://wiki.theory.org/index.php/BitTorrentSpecification#Tracker_HTTP.2FHTTPS_Protocol
|
||||
class Tracker : public QObject, public Http::IRequestHandler, private Http::ResponseBuilder
|
||||
class Tracker final : public QObject, public Http::IRequestHandler, private Http::ResponseBuilder
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(Tracker)
|
||||
|
@@ -41,7 +41,7 @@ namespace Http
|
||||
class IRequestHandler;
|
||||
class Connection;
|
||||
|
||||
class Server : public QTcpServer
|
||||
class Server final : public QTcpServer
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(Server)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user