Skip to content

Commit

Permalink
Merge branch 'v4_2_x' of https://github.com/qbittorrent/qBittorrent i…
Browse files Browse the repository at this point in the history
…nto v4_2_x
  • Loading branch information
c0re100 committed Apr 22, 2020
2 parents 38b8453 + 50f676c commit 2f9b278
Show file tree
Hide file tree
Showing 225 changed files with 32,083 additions and 28,163 deletions.
20 changes: 20 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
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)
Expand Down
24 changes: 12 additions & 12 deletions configure
Original file line number Diff line number Diff line change
@@ -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.4.
#
# Report bugs to <bugs.qbittorrent.org>.
#
Expand Down Expand Up @@ -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.4'
PACKAGE_STRING='qbittorrent v4.2.4'
PACKAGE_BUGREPORT='bugs.qbittorrent.org'
PACKAGE_URL='https://www.qbittorrent.org/'

Expand Down Expand Up @@ -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.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -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.4:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -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.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -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.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -3826,7 +3826,7 @@ fi

# Define the identity of the package.
PACKAGE='qbittorrent'
VERSION='v4.2.3'
VERSION='v4.2.4'


cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -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.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -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.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down Expand Up @@ -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.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -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.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([qbittorrent], [v4.2.3], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
AC_INIT([qbittorrent], [v4.2.4], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CC
Expand Down
10 changes: 7 additions & 3 deletions dist/mac/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.2.3</string>
<string>4.2.4</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion dist/unix/org.qbittorrent.qBittorrent.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.4" date="2020-04-20"/>
</releases>
</component>
2 changes: 1 addition & 1 deletion dist/windows/options.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ XPStyle on
!define CSIDL_LOCALAPPDATA '0x1C' ;Local Application Data path

; Program specific
!define PROG_VERSION "4.2.3.10"
!define PROG_VERSION "4.2.4.10"

!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun
Expand Down
2 changes: 2 additions & 0 deletions src/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/app/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace RSS
class AutoDownloader;
}

class Application : public BaseApplication
class Application final : public BaseApplication
{
Q_OBJECT
Q_DISABLE_COPY(Application)
Expand Down
2 changes: 1 addition & 1 deletion src/app/qtlocalpeer/qtlockedfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

namespace QtLP_Private
{
class QtLockedFile : public QFile
class QtLockedFile final : public QFile
{
public:
enum LockMode
Expand Down
4 changes: 4 additions & 0 deletions src/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/base/base.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down
2 changes: 2 additions & 0 deletions src/base/bittorrent/peerinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

#include "peerinfo.h"

#include <libtorrent/version.hpp>

#include <QBitArray>

#include "base/bittorrent/torrenthandle.h"
Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/private/filterparserthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

class QDataStream;

class FilterParserThread : public QThread
class FilterParserThread final : public QThread
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/private/nativesessionextension.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/private/nativetorrentextension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/private/nativetorrentextension.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/private/portforwarderimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
31 changes: 25 additions & 6 deletions src/base/bittorrent/private/resumedatasavingmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
}

Expand Down
7 changes: 6 additions & 1 deletion src/base/bittorrent/private/resumedatasavingmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

#pragma once

#include <memory>

#include <libtorrent/fwd.hpp>

#include <QDir>
#include <QObject>

Expand All @@ -43,8 +47,9 @@ class ResumeDataSavingManager : public QObject

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;
};
Loading

0 comments on commit 2f9b278

Please sign in to comment.