diff options
author | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2017-03-20 18:17:36 +0000 |
---|---|---|
committer | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2017-03-20 18:17:36 +0000 |
commit | 0bc83f30f7308ded02fae2c54b573557e89cb1ab (patch) | |
tree | 08088d28840eb2a5680ee4eac1e1a739b427ca90 /net-p2p/qbittorrent/files | |
parent | c59be11b14ca6474fb78dd171a5f99dc3eff2cea (diff) | |
download | ports-0bc83f30f7308ded02fae2c54b573557e89cb1ab.tar.gz ports-0bc83f30f7308ded02fae2c54b573557e89cb1ab.zip |
- Update to 3.3.11
- While here, fix LICENSE and add LICENSE_FILE
PR: 217550
Submitted by: rezny@freebsd.org
Approved by: maintainer timeout (yuri@rawbw.com, 2 weeks)
Notes
Notes:
svn path=/head/; revision=436556
Diffstat (limited to 'net-p2p/qbittorrent/files')
3 files changed, 55 insertions, 67 deletions
diff --git a/net-p2p/qbittorrent/files/patch-src_base_bittorrent_session.cpp b/net-p2p/qbittorrent/files/patch-src_base_bittorrent_session.cpp deleted file mode 100644 index 91ef012887e1..000000000000 --- a/net-p2p/qbittorrent/files/patch-src_base_bittorrent_session.cpp +++ /dev/null @@ -1,64 +0,0 @@ -Revert the following commit until libtorrent 1.1.2 is released: - -From 729c80f9104a3d01ec724351bd6910b4b8d14c6c Mon Sep 17 00:00:00 2001 -From: sledgehammer999 <hammered999@gmail.com> -Date: Mon, 31 Oct 2016 02:31:56 +0200 -Subject: [PATCH] Use new libtorrent 1.1.2+ utility function to generate client - ID instead. - ---- src/base/bittorrent/session.cpp.orig 2016-12-17 18:02:06 UTC -+++ src/base/bittorrent/session.cpp -@@ -45,6 +45,7 @@ - #include <QTimer> - - #include <cstdlib> -+#include <sstream> - #include <queue> - #include <vector> - -@@ -194,6 +195,36 @@ namespace - - template <typename T> - LowerLimited<T> lowerLimited(T limit, T ret) { return LowerLimited<T>(limit, ret); } -+ -+#if LIBTORRENT_VERSION_NUM >= 10100 -+ std::string makeFingerprint(const char* peerId, int major, int minor, int revision, int tag) -+ { -+ Q_ASSERT(peerId); -+ Q_ASSERT(major >= 0); -+ Q_ASSERT(minor >= 0); -+ Q_ASSERT(revision >= 0); -+ Q_ASSERT(tag >= 0); -+ Q_ASSERT(std::strlen(peerId) == 2); -+ -+ auto versionToChar = [](int v) -> char -+ { -+ if (v >= 0 && v < 10) return static_cast<char>('0' + v); -+ if (v >= 10) return static_cast<char>('A' + (v - 10)); -+ Q_ASSERT(false); -+ return '0'; -+ }; -+ -+ std::ostringstream buf; -+ buf << '-' -+ << peerId -+ << versionToChar(major) -+ << versionToChar(minor) -+ << versionToChar(revision) -+ << versionToChar(tag) -+ << '-'; -+ return buf.str(); -+ } -+#endif - } - - // Session -@@ -334,7 +365,7 @@ Session::Session(QObject *parent) - dispatchAlerts(alertPtr.release()); - }); - #else -- std::string peerId = libt::generate_fingerprint(PEER_ID, VERSION_MAJOR, VERSION_MINOR, VERSION_BUGFIX, VERSION_BUILD); -+ std::string peerId = makeFingerprint(PEER_ID, VERSION_MAJOR, VERSION_MINOR, VERSION_BUGFIX, VERSION_BUILD); - libt::settings_pack pack; - pack.set_int(libt::settings_pack::alert_mask, alertMask); - pack.set_str(libt::settings_pack::peer_fingerprint, peerId); diff --git a/net-p2p/qbittorrent/files/patch-src_base_http_server.cpp b/net-p2p/qbittorrent/files/patch-src_base_http_server.cpp new file mode 100644 index 000000000000..287e8b4d18a7 --- /dev/null +++ b/net-p2p/qbittorrent/files/patch-src_base_http_server.cpp @@ -0,0 +1,25 @@ +# Missing header; upstream patch shuffles them a bit +# +--- src/base/http/server.cpp.orig 2017-03-03 23:20:21 UTC ++++ src/base/http/server.cpp +@@ -28,14 +28,18 @@ + * exception statement from your version. + */ + ++#include "server.h" ++ ++#include <QNetworkProxy> ++#include <QStringList> ++ + #ifndef QT_NO_OPENSSL + #include <QSslSocket> + #else + #include <QTcpSocket> + #endif +-#include <QNetworkProxy> ++ + #include "connection.h" +-#include "server.h" + + using namespace Http; + diff --git a/net-p2p/qbittorrent/files/patch-src_base_utils_string.cpp b/net-p2p/qbittorrent/files/patch-src_base_utils_string.cpp index f03a2a6041dd..f401c5bf742b 100644 --- a/net-p2p/qbittorrent/files/patch-src_base_utils_string.cpp +++ b/net-p2p/qbittorrent/files/patch-src_base_utils_string.cpp @@ -1,6 +1,8 @@ -Avoid use of thread local storage on versions prior to which it was supported. - ---- src/base/utils/string.cpp.orig 2016-12-17 18:02:06 UTC +# Avoid use of thread local storage on versions prior to which it was supported. +# +# Qt::escape is part of QtGui, upstream patch replaces it for webui +# +--- src/base/utils/string.cpp.orig 2017-03-03 23:20:21 UTC +++ src/base/utils/string.cpp @@ -37,7 +37,7 @@ #ifdef QBT_USES_QT5 @@ -31,3 +33,28 @@ Avoid use of thread local storage on versions prior to which it was supported. static QThreadStorage<NaturalCompare> nCmp; if (!nCmp.hasLocalData()) nCmp.setLocalData(NaturalCompare(false)); return (nCmp.localData())(left, right); +@@ -217,6 +219,23 @@ QString Utils::String::toHtmlEscaped(con + #ifdef QBT_USES_QT5 + return str.toHtmlEscaped(); + #else +- return Qt::escape(str); ++ // code from Qt ++ QString rich; ++ const int len = str.length(); ++ rich.reserve(int(len * 1.1)); ++ for (int i = 0; i < len; ++i) { ++ if (str.at(i) == QLatin1Char('<')) ++ rich += QLatin1String("<"); ++ else if (str.at(i) == QLatin1Char('>')) ++ rich += QLatin1String(">"); ++ else if (str.at(i) == QLatin1Char('&')) ++ rich += QLatin1String("&"); ++ else if (str.at(i) == QLatin1Char('"')) ++ rich += QLatin1String("""); ++ else ++ rich += str.at(i); ++ } ++ rich.squeeze(); ++ return rich; + #endif + } |