1
mirror of https://github.com/qbittorrent/qBittorrent synced 2025-10-16 20:32:23 +02:00

Compare commits

..

101 Commits

Author SHA1 Message Date
sledgehammer999
4eac2cab31 Bump to 3.3.10 2016-12-17 19:57:52 +02:00
sledgehammer999
87f4f57f8e Update Changelog. 2016-12-17 19:54:49 +02:00
sledgehammer999
a6e250fa43 WINDOWS: Make the updater to look for the x64 installer if running x64 version. 2016-12-17 19:48:46 +02:00
Oke Atime
b118079379 Make resume/pause menu items clickable. Closes #6040 2016-12-17 19:48:45 +02:00
Oke Atime
cb2d39f2a7 Case insensitive sort for client clumn. Closes #6054 2016-12-17 19:48:45 +02:00
sledgehammer999
4cf549ff25 Fix share ratio limiting. Broken by commit 259b5e51c4. Closes #6039 #6048. 2016-12-15 00:06:04 +02:00
sledgehammer999
b5c6342dca Bump to 3.3.9 2016-12-14 18:39:40 +02:00
sledgehammer999
46ec556921 Update Changelog. 2016-12-14 18:37:07 +02:00
sledgehammer999
33ae1a7bee Correctly migrate settings/rss/usage stats in macOS. Closes #6041. 2016-12-14 18:19:20 +02:00
sledgehammer999
87a3a67668 Fix GUI for proxy settings. Closes #6045. 2016-12-14 18:19:19 +02:00
sledgehammer999
055b1e0163 Fix slider for per torrent speed limits when no global speed limit has been set. Closes #6046. 2016-12-14 18:19:19 +02:00
sledgehammer999
2bd5ea2c68 Bump to 3.3.8 2016-12-14 02:13:13 +02:00
sledgehammer999
1479a74198 Update Changelog. 2016-12-14 02:10:00 +02:00
Eugene Shalygin
9a0d25284c Add a workaround for QTBUG-52633, qBt issue #5073
The QTBUG-52633 results in food of network interface changed events, libtorrent IP
rebind calls and flood in the qBt log. The work around is the check not only for
interface name, but for IP address on that interface before triggering the libtorrent rebind.
2016-12-14 02:04:12 +02:00
sledgehammer999
284e836992 New translations: Icelandic, Latvian, Malay, Occitan, Uzbek
Also re-run lupdate.
2016-12-13 02:11:45 +02:00
sledgehammer999
43f5b31843 Sync translations from Transifex and run lupdate. 2016-12-13 02:11:44 +02:00
sledgehammer999
cada6cfc88 Bump API_VERSION and API_VERSION_MIN to 11. 2016-12-13 02:11:43 +02:00
sledgehammer999
99f157927f Polish previous commit. 2016-12-12 21:17:18 +02:00
Yez Ezey
664664394c Change QSettings to IniFormat on macOS. Closes #5770 #5808
On macOS 10.12 Sierra, Apple changed the behaviour of CFPreferencesSetValue()
truncating data after a null character. https://bugreports.qt.io/browse/QTBUG-56344
Due to this, we have to move from native plist to IniFormat.
2016-12-12 21:17:17 +02:00
dzmat
a790901691 minimizing the number of warnings about deprecated auto_ptr 2016-12-12 21:17:17 +02:00
Chocobo1
fdc70eaa62 Change Utils::Fs::freeDiskSpaceOnPath() signature
refactor the function internals
2016-12-12 21:17:17 +02:00
Chocobo1
b05a23e1ab Remove unused variable 2016-12-12 21:17:16 +02:00
Chocobo1
9f6a0882e2 Simplify #if expression 2016-12-12 21:17:16 +02:00
Chocobo1
b351b21e55 Fix memory leak
call unicode version of the function directly
2016-12-12 21:17:16 +02:00
Chocobo1
ef22f06e92 Simplify function call 2016-12-12 21:17:16 +02:00
Chocobo1
8ea7426bc1 Replace deprecated classes 2016-12-12 21:17:15 +02:00
Chocobo1
79e7e1727f Fix unused variable warnings 2016-12-12 21:17:15 +02:00
Chocobo1
98c33dd77c Rename splitter names 2016-12-12 21:17:15 +02:00
Chocobo1
9c6504f6dd Use new key for storing RSS splitter_v value.
So that old value won't override the RSS layout.
2016-12-12 21:17:14 +02:00
Chocobo1
76c350bdcb Change RSS view layout to horizontal. Closes #5920.
Thanks Bhaalspawn for the idea.
2016-12-12 21:17:14 +02:00
sledgehammer999
106dcfd00e Decouple dependency between Session and BandwidthScheduler during Session init. Closes #6007. 2016-12-12 21:17:14 +02:00
sledgehammer999
668c8cb0e2 Fix travis osx build. 2016-12-12 21:17:14 +02:00
Chocobo1
3159bdf4dd Fix warning C4090.
different '__unaligned' qualifiers.
2016-12-12 21:17:13 +02:00
Chocobo1
97d2c0d187 Fix warning C4267.
conversion from 'size_t' to 'int', possible loss of data.
2016-12-12 21:17:13 +02:00
zywo
0041ee3636 Fix CMake compilation error. 2016-12-12 21:17:13 +02:00
Chocobo1
1ed523bec3 Shift + scroll = horizontal scroll, Closes #5980
Only for TransferListWidget, PeerListWidget
2016-12-12 21:16:39 +02:00
dzmat
b131a6e9df memleak fix 2016-12-12 21:16:39 +02:00
Chocobo1
56d9d370e9 Rename 2016-12-12 21:16:39 +02:00
Chocobo1
a6efc4d92d Fix URL 2016-12-12 21:16:38 +02:00
sledgehammer999
a77db6e822 Sync translations from Transifex and run lupdate. 2016-12-12 21:16:37 +02:00
Yez Ezey
95a558941e Fix downloadFromURL bug. Closes #5844 2016-12-12 21:16:37 +02:00
sledgehammer999
867d69d0f2 Travis: Use custom libtorrent formula and bottle for OSX.
Caches libtorrent 1.0.10 built with c++11 enabled.
2016-12-12 21:16:37 +02:00
sledgehammer999
a6d381da38 Option to disable tracker's favicon download. 2016-12-12 21:16:36 +02:00
sledgehammer999
f0eb708b07 Remove (mostly) useless log warnings about tracker's favicon. 2016-12-12 21:16:36 +02:00
Yez Ezey
1d70698bd0 add /usr/local/include due to Qt 5.7.0 bug on macOS 2016-12-12 21:16:36 +02:00
Chocobo1
79871c8e21 Update ax_boost_system.m4 to d48ec2210047bbf17702700811c3f16a5369e06c 2016-12-12 21:16:36 +02:00
Chocobo1
25d5524213 Remove redundant command 2016-12-12 21:16:35 +02:00
EdwardLinux
8d21b73434 Update portuguese.nsi 2016-12-12 21:16:35 +02:00
sledgehammer999
2ef01a314c Small travis update for OSX. 2016-12-12 21:16:35 +02:00
Yez Ezey
a8b4aca5e6 Set /usr/local/bin before default PATH on macOS. closes #5639 #5571
Since Apple made difficult for users to set PATH and /usr/bin/python
is almost unusable, I simply add /usr/local/bin before default PATH
to pick up Homebrew Python.
2016-12-12 21:16:35 +02:00
Anton Lashkov
67e7315eae Fix name of variable same as class member 2016-12-12 21:16:34 +02:00
Anton Lashkov
a25a15d1c6 Simplify if statement 2016-12-12 21:16:34 +02:00
Anton Lashkov
086588eeed Add missing else 2016-12-12 21:16:34 +02:00
Anton Lashkov
44fa308681 Fix mistake in getting value from model 2016-12-12 21:16:33 +02:00
Yez Ezey
6188287094 Add --disable-qt-dbus to configure if $host_os is macOS 2016-12-12 21:16:33 +02:00
Yez Ezey
17d10afd65 Sort torrent names case insensitively 2016-12-12 21:16:33 +02:00
Chocobo1
89bd0e4397 QJson: update to 5e3b9b84b225f4612e09ef05aa6d8c23379e4e71 2016-12-12 21:16:33 +02:00
Yez Ezey
1c1917f885 Fix extratorrent searchengine. Closes #5773
They changed to magnet link.
2016-12-12 21:16:32 +02:00
thalieht
642377bd65 Log: set embedded Tracker [OFF] msg type as info 2016-12-12 21:16:32 +02:00
Chocobo1
bb4668c071 Fix potential crash. Closes #5873. 2016-12-12 21:16:32 +02:00
Chocobo1
689316db09 Refactor 2016-12-12 21:16:32 +02:00
borouhin
ad0c008a3e Don't request client SSL certificate (closes issue #3883) 2016-12-12 21:15:51 +02:00
sledgehammer999
09e3698b37 Don't ever stop seeding forced torrents. Closes #5784. 2016-12-12 21:15:51 +02:00
sledgehammer999
6450ebfc6c Don't revert save path value in the Dialog when metadata are received. Closes #5482. 2016-12-12 21:15:51 +02:00
sledgehammer999
e9f38ebcfd Some more compiler warnings fixed. 2016-12-12 21:15:50 +02:00
sledgehammer999
4dba31f534 Fix warning due to stupid typo. 2016-12-12 21:15:50 +02:00
sledgehammer999
04c1aad0dd Delete old rss favicon before assigning new one. 2016-12-12 21:15:50 +02:00
sledgehammer999
6763f3ac33 WINDOWS: Fix python auto install, deletion of installer and use 3.5.x series for Vista+. Closes #5871. 2016-12-12 21:15:50 +02:00
sledgehammer999
afca704db0 WEBUI: Changed meaning of the value of the 'dl_limit', 'up_limit', 'alt_dl_limit' and 'alt_up_limit' tokens.
The value is expressed in bytes and not in KiB.
2016-12-12 21:15:49 +02:00
sledgehammer999
eaec8fcddd Fix setting a speed limit. 2016-12-12 21:15:49 +02:00
sledgehammer999
f86fd52d6f Add libtorrent's DHT bootstrap node to our bootstrap list. 2016-12-12 21:15:49 +02:00
sledgehammer999
f3f175570c Use the new API to add DHT bootstrap nodes for libtorrent 1.1.x and simplify the code a bit. 2016-12-12 21:15:49 +02:00
sledgehammer999
729c80f910 Use new libtorrent 1.1.2+ utility function to generate client ID instead. 2016-12-12 21:15:48 +02:00
sledgehammer999
fcaca558a0 Make sure that paths are loaded/saved using slashes as dir separators. 2016-12-12 21:15:48 +02:00
sledgehammer999
983df9113e Display message about libtorrent plugins for the correct case. 2016-12-12 21:15:48 +02:00
sledgehammer999
acf9874252 Migrate last setting related to interfaces to the new system. 2016-12-12 21:15:48 +02:00
sledgehammer999
d7cf6bb11b Fix save/load of interface address setting. 2016-12-12 21:15:47 +02:00
sledgehammer999
558ea53cc2 Use better variable names for tracker announce IP setting. 2016-12-12 21:15:47 +02:00
sledgehammer999
87a6478430 Fix values for unsetting speed limits. 2016-12-12 21:15:47 +02:00
sledgehammer999
cea673b267 Unify and simplify setting to use proxy for torrents only. 2016-12-12 21:15:46 +02:00
sledgehammer999
4a5ab93c62 Guard the flag used for deferred session configure. 2016-12-12 21:15:46 +02:00
sledgehammer999
4c86fc8973 Misc fixes. 2016-12-12 21:15:46 +02:00
sledgehammer999
1c485ffb07 Fix setting limits to unlimited. 2016-12-12 21:15:46 +02:00
sledgehammer999
f283734f13 Rename IP filtering functions and settings names. 2016-12-12 21:15:45 +02:00
sledgehammer999
dca4ff0649 Export torrents added only after the setting was enabled. 2016-12-12 21:15:45 +02:00
Vladimir Golovnev (Glassez)
1975f2269e Use new libtorrent-1.1 settings API 2016-12-12 21:15:42 +02:00
Vladimir Golovnev (Glassez)
6fac9b42da Don't use Preferences in BitTorrent::Session 2016-12-12 21:12:01 +02:00
DaRKSoM
dabae4c914 Update portugueseBR.nsi 2016-12-12 21:11:20 +02:00
Burak Yavuz
b1e9b4493d Turkish translation 2016-12-12 21:11:19 +02:00
Chocobo1
2fa207e728 The intended action is set the bit to 1, not flipping it. 2016-12-12 21:11:19 +02:00
Chocobo1
7adcd909e7 Fix crash when restoring from tray. Closes #5854. 2016-12-12 21:11:19 +02:00
ngosang
50805fc2b5 [Search engine] Remove TorrentReactor plugin 2016-12-12 21:11:19 +02:00
ngosang
3a1b7b6159 [Search engine] Update Demonoid plugin 2016-12-12 21:11:18 +02:00
sledgehammer999
498b7c2436 Properly fix the handling of default save path store/load. Bug introduced in dd34663224 2016-12-12 21:11:18 +02:00
erikssm
4f17364305 fix default save path bug 2016-12-12 21:11:18 +02:00
Yez Ezey
9ebc115719 Fix Mac OS X Build (Closes #5763)
Deleted offending code
    setUnifiedTitleAndToolBarOnMac(false);
which was a workaround to avoid bug https://bugreports.qt.io/browse/QTBUG-7305
The bug was fixed at Qt 4.6.2 https://github.com/Blizzard/qt4/blob/master/dist/changes-4.6.2
2016-12-12 21:11:17 +02:00
Yez Ezey
a6fa8c3a8e Fixed extratorrent search not working Closes #5736 #5753
The original code accumulates all the <td> texts between the description
link and the number of seeders into self.current_item["size"]:
    <td>248.72</td><td>&nbsp;MB<td> => "248.72 MB".
ExtraTorrents changed the table design, added the Added column and joined
the number and its unit:
    <td>8d</td><td>248.72&nbsp;MB</td> => "8d 248.72 MB"
This commit stores only the last <td> text in self.current_item["size"].
2016-12-12 21:11:17 +02:00
sledgehammer999
8187366c89 Use a subdomain to redirect to the actual URL for search plugins.
Will allow to move around the plugins in the git repo with the 3.4.0 release.
2016-12-12 21:11:16 +02:00
thalieht
366ad01120 fix webui port overflow 2016-12-12 21:11:16 +02:00
sledgehammer999
4da05e5914 Update UAC nsis plugin to 0.2.4c. Building the installer with nsis 3.0 (final) is possible now. Closes #5556. 2016-09-12 17:31:42 +03:00
sledgehammer999
3fb19b6a28 Fix travis again.
I wish the homebrew guys didn't break it so often and the travis guys updated their images more frequently.
2016-09-12 02:46:48 +03:00
154 changed files with 82149 additions and 39464 deletions

View File

@@ -9,8 +9,8 @@ environment:
REPO_DIR: &REPO_DIR c:\qbittorrent
CACHE_DIR: &CACHE_DIR c:\qbt_cache
QBT_VER_URL: http://builds.shiki.hu/appveyor/version
QBT_LIB_URL: http://builds.shiki.hu/appveyor/qbt_libraries.7z
QBT_VER_URL: https://builds.shiki.hu/appveyor/version
QBT_LIB_URL: https://builds.shiki.hu/appveyor/qbt_libraries.7z
# project directory
clone_folder: *REPO_DIR

View File

@@ -3,7 +3,7 @@ language: cpp
os:
- linux
- osx
osx_image: xcode7
osx_image: xcode7.3
env:
matrix:
@@ -30,7 +30,10 @@ notifications:
# container-based builds
#sudo: false
cache: ccache
cache:
ccache: true
directories:
- $HOME/hombebrew_cache
# opt-in Ubuntu Trusty
sudo: required
@@ -117,16 +120,29 @@ install:
fi
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
mkdir -p "$HOME/hombebrew_cache" ;
wget https://builds.shiki.hu/homebrew/version ;
if ! cmp --quiet "version" "$HOME/hombebrew_cache/version" ; then
echo "Cached files are different from server. Downloading new ones." ;
cp "version" $HOME/hombebrew_cache ;
cd "$HOME/hombebrew_cache" ;
wget https://builds.shiki.hu/homebrew/libtorrent-rasterbar.rb ;
wget https://builds.shiki.hu/homebrew/libtorrent-rasterbar-1.0.10.el_capitan.bottle.tar.gz ;
fi
# dependencies
brew update > /dev/null ;
brew install colormake ccache ;
brew outdated "pkg-config" || brew upgrade "pkg-config" ;
# libtorrent-rasterbar 1.0.9
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/477d5060fa093883204d70323965375353e03084/Formula/libtorrent-rasterbar.rb ;
# Copy custom libtorrent bottle to homebrew's cache so it can find and install it
# Also install our custom libtorrent formula by passing the local path to it
# These 2 files are restored from Travis' cache.
cp "$HOME/hombebrew_cache/libtorrent-rasterbar-1.0.10.el_capitan.bottle.tar.gz" "$(brew --cache)" ;
brew install "$HOME/hombebrew_cache/libtorrent-rasterbar.rb" ;
# Qt
if [ "$qt" = 4 ]; then brew install qt && ln -s /usr/local/Cellar/qt/4.8.7_2/plugins /usr/local ; fi ;
if [ "$qt" = 5 ]; then brew install qt5 && brew link --force qt5 && ln -s /usr/local/Cellar/qt5/5.6.0/plugins /usr/local ; fi ;
if [ "$qt" = 5 ]; then brew install qt5 && brew link --force qt5 && ln -s /usr/local/Cellar/qt5/5.7.0/plugins /usr/local ; fi ;
# ccache
if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then

View File

@@ -1,3 +1,52 @@
* Sat Dec 17 2016 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.3.10
- BUGFIX: Fix share ratio limiting. Broken by commit 259b5e51c49b744. Closes #6039 #6048. (sledgehammer999)
- BUGFIX: Case insensitive sort for client column. Closes #6054. (Oke Atime)
- BUGFIX: Make resume/pause menu items clickable. Closes #6040. (Oke Atime)
- WINDOWS: Make the updater to look for the x64 installer if running x64 version. (sledgehammer999)
* Wed Dec 14 2016 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.3.9
- BUGFIX: Fix slider for per torrent speed limits when no global speed limit has been set. Closes #6046. (sledgehammer999)
- BUGFIX: Fix GUI for proxy settings. Closes #6045. (sledgehammer999)
- OSX: Correctly migrate settings/rss/usage stats in macOS. Closes #6041. (sledgehammer999)
* Wed Dec 14 2016 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.3.8
- FEATURE: Start using new libtorrent 1.1.x APIs (needs at least 1.1.2). Still unofficial support. (glassez, sledgehammer999)
- FEATURE: Add a new DHT bootstrap node run by libtorrent author arvidn. (sledgehammer999)
- FEATURE: Option to disable tracker's favicon download. (sledgehammer999)
- FEATURE: Shift + scroll = horizontal scroll. Closes #5980. Only for TransferListWidget, PeerListWidget. (Chocobo1)
- BUGFIX: Actually set new path as default when checkBox is enabled in Add New Torrent dialog. (erikssm)
- BUGFIX: Properly fix the handling of default save path store/load. (sledgehammer999)
- BUGFIX: Fix crash when restoring from tray. Closes #5854. (Chocobo1)
- BUGFIX: Export torrents added only after the setting was enabled. (sledgehammer999)
- BUGFIX: Delete old rss favicon before assigning new one. (sledgehammer999)
- BUGFIX: Don't revert save path value in the Dialog when metadata are received. Closes #5482. (sledgehammer999)
- BUGFIX: Don't ever stop seeding forced torrents. Closes #5784. (sledgehammer999)
- BUGFIX: Fix potential crash in TransferList widget. Closes #5873. (Chocobo1)
- BUGFIX: Sort torrent names case insensitively. (Yez Ezey)
- BUGFIX: Fix mistake in getting values for sorting in TransferList widget. (Anton Lashkov)
- BUGFIX: Fix memory leaks. (dzmat, Chocobo1)
- WEBUI: Fix webui port overflow. (thalieht)
- WEBUI: Changed meaning of the value of the 'dl_limit', 'up_limit', 'alt_dl_limit' and 'alt_up_limit' tokens. The value is expressed in bytes and not in KiB. (sledgehammer999)
- WEBUI: Don't request client SSL certificate. Closes #3883. (borouhin)
- WEBUI: Bump API_VERSION and API_VERSION_MIN to 11.
- SEARCH: Fixed extratorrent search not working Closes #5736 #5753. (Yez Ezey)
- SEARCH: Update Demonoid plugin. (ngosang)
- SEARCH: Remove TorrentReactor plugin. (ngosang)
- SEARCH: Fix python auto install, deletion of installer and use 3.5.x series for Vista+. Closes #5871. (sledgehammer999)
- SEARCH: Set /usr/local/bin before default PATH on macOS. closes #5639 #5571. This enables finding newer python installs. (Yez Ezey)
- COSMETIC: Log: set embedded Tracker [OFF] msg type as info. (thalieht)
- COSMETIC: Remove (mostly) useless log warnings about tracker's favicon. (sledgehammer999)
- COSMETIC: Change RSS view layout to horizontal. Closes #5920. (Chocobo1)
- OSX: Fix crash on exit using Qt4. (Yez Ezey)
- OSX: Change QSettings to IniFormat on macOS. Closes #5770 #5808. (Yez Ezey)
- LINUX: Workaround a Qt5 bug which results in a flood of network interface change singals. (Eugene Shalygin)
- OTHER: Turkish translation for installer. (Burak Yavuz)
- OTHER: Update portugueseBR for installer. (DaRKSoM)
- OTHER: Update portuguese for installer. (EdwardLinux)
- OTHER: Add --disable-qt-dbus to configure if $host_os is macOS. (Yez Ezey)
- OTHER: New translations: Icelandic, Latvian, Malay, Occitan, Uzbek.
- OTHER: A whole lot of code refactoring by various people.
* Sun Sep 11 2016 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.3.7
- FEATURE: Delete torrent+files with Shift+Delete (pieniacy)
- BUGFIX: Fix 6-hour speedplot point push rate. Close #5545 (Daniel Segesdi)

View File

@@ -9,6 +9,8 @@ QMAKE_CXXFLAGS += @QBT_CONF_EXTRA_CFLAGS@
EXTERNAL_INCLUDES = @QBT_CONF_INCLUDES@
EXTERNAL_INCLUDES -= $$QMAKE_DEFAULT_INCDIRS
# added /usr/local/include due to Qt 5.7.0 bug on macOS
macx: EXTERNAL_INCLUDES += "/usr/local/include"
INCLUDEPATH += $$EXTERNAL_INCLUDES
EXTERNAL_LIBS = @LDFLAGS@ @LIBS@

13
configure vendored
View File

@@ -4257,6 +4257,17 @@ else
$as_echo "no" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OS is macOS" >&5
$as_echo_n "checking whether OS is macOS... " >&6; }
if expr "$host_os" : ".*darwin.*" > /dev/null; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
enable_qt_dbus=no
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Require 0.23 pkg-config
@@ -5090,7 +5101,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
int
main ()
{
boost::system::system_category
boost::system::error_category *a = 0;
;
return 0;
}

View File

@@ -67,6 +67,12 @@ AS_IF([expr "$host_os" : ".*freebsd.*" > /dev/null],
LIBS="-lexecinfo $LIBS"],
[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([whether OS is macOS])
AS_IF([expr "$host_os" : ".*darwin.*" > /dev/null],
[AC_MSG_RESULT([yes])
enable_qt_dbus=no],
[AC_MSG_RESULT([no])])
# Require 0.23 pkg-config
PKG_PROG_PKG_CONFIG([0.23])
AS_IF([test "x$PKG_CONFIG" = "x"],

2
dist/mac/Info.plist vendored
View File

@@ -45,7 +45,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.3.7</string>
<string>3.3.10</string>
<key>CFBundleSignature</key>
<string>qBit</string>
<key>CFBundleExecutable</key>

View File

@@ -1,12 +1,12 @@
TRANSLATORS:
1. Use an editor that has NSIS syntax highlighting(eg Notepad++/Geany). This will
1. Use an editor that has NSIS syntax highlighting(eg Notepad++/Geany). This will
make your life easier.
2. Open the relevant .nsi file that exists in the folder named
2. Open the relevant .nsi file that exists in the folder named
"installer-translations"
3. Lines starting with ";" are considered comments. These include the
3. Lines starting with ";" are considered comments. These include the
english message to help you with the translation.
4. Edit only the part inside the quotation marks(""). Unless you know
4. Edit only the part inside the quotation marks(""). Unless you know
what you are doing.
5. Save the files with utf8 encoding and BOM.
6. Submit your changes: 1) as a pull request to the official git repo or
@@ -16,17 +16,13 @@ TRANSLATORS:
PACKAGERS:
You will need NSIS and upx to make the installer. You need a unicode version of NSIS.
I tested with NSIS 3.0a0.
I tested with NSIS 3.0 (final).
1. Open the options.nsi file in an editor and change line that contains
"!define PROG_VERSION "3.0.3"" to the version of qbittorrent you just built.
2. Extract the plugins found in the folder "nsis plugins" into your
"!define PROG_VERSION "3.0.3"" to the version of qbittorrent you just built.
2. Extract the plugins found in the folder "nsis plugins" into your
NSIS's unicode Plugin directory(usually C:\Program Files\NSIS\Plugins\x86-unicode).
Only the *.dll files are needed. Don't use the .dll from UAC.zip, use the one from "UAC Unicode.zip".
NOTE: To build the unicode version of UAC with MSVC2008 you need:
a) the sources from UAC.zip
b) apply the util.cpp.diff from "UAC Unicode.zip" to util.cpp
c) in a msvc command prompt issue: cl.exe /O1s /GS- /GR- /EHs-c- /Zl /LD /DUNICODE RunAs.cpp uac.cpp util.cpp /link kernel32.lib user32.lib shell32.lib advapi32.lib ole32.lib /DLL /MANIFEST:NO /OUT:uac.dll
Only the *.dll files are needed. Use the unicode version of the dlls.
3. The script you need to compile is "qbittorrent.nsi". It includes all other necessary scripts.
4. The script expects the following file tree:
@@ -53,10 +49,11 @@ qbittorrent.exe
qbittorrent.nsi
qt.conf
translations.nsi
UAC.nsh
uninstaller.nsi
5. "license.txt" is a text file that contains the text rendered
5. "license.txt" is a text file that contains the text rendered
from src\gui\gpl.html or the text contained in COPYING
6. "qbittorrent.exe" is the compiled binary file.
@@ -64,7 +61,7 @@ SCRIPT HACKERS:
If you add any new LangString variable to the scripts you NEED to provide
"translations" of it to all the .nsi files inside "installer-translations.
You can always leave the english string but you have to use all the LANG_<lang name>
for the given variable. Otherwise, if the user chooses a language that you
haven't provided a LANG_<lang name> for your variable then your string will be empty.
You can always leave the english string but you have to use all the LANG_<lang name>
for the given variable. Otherwise, if the user chooses a language that you
haven't provided a LANG_<lang name> for your variable then your string will be empty.
Don't worry though, NSIS throws warnings for this when compiling the scripts.

View File

@@ -228,6 +228,8 @@ pop $_LOGICLIB_TEMP
!undef _UAC_ParseDefineFlags_orin_this
!ifdef _UAC_ParseDefineFlags_orin_f1
!undef _UAC_ParseDefineFlags_orin_f1
!endif
!ifdef _UAC_ParseDefineFlags_orin_f2
!undef _UAC_ParseDefineFlags_orin_f2
!endif
!macroend

View File

@@ -17,7 +17,7 @@ LangString inst_firewallinfo ${LANG_PORTUGUESE} "Adicionando regra à firewall d
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_PORTUGUESE} "O qBittorrent está a ser executado. Feche a aplicação antes de instalar esta versão."
;LangString inst_uninstall_question ${LANG_ENGLISH} "A previous installation was detected. It will be uninstalled without deleting user settings."
LangString inst_uninstall_question ${LANG_PORTUGUESE} "A previous installation was detected. It will be uninstalled without deleting user settings."
LangString inst_uninstall_question ${LANG_PORTUGUESE} "Uma antiga instalação foi encontrada.Essa mesma será desinstalada sem apagar as definições do usuário."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_PORTUGUESE} "A desinstalar versão anterior."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."

View File

@@ -17,7 +17,7 @@ LangString inst_firewallinfo ${LANG_PORTUGUESEBR} "Adicionando regra no firewall
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_PORTUGUESEBR} "qBittorrent está rodando. Por favor feche a aplicação antes de instalar."
;LangString inst_uninstall_question ${LANG_ENGLISH} "A previous installation was detected. It will be uninstalled without deleting user settings."
LangString inst_uninstall_question ${LANG_PORTUGUESEBR} "A previous installation was detected. It will be uninstalled without deleting user settings."
LangString inst_uninstall_question ${LANG_PORTUGUESEBR} "Uma instalação anterior foi detectada. Ela será desistalada sem deletar as configurações de usuário."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_PORTUGUESEBR} "Desinstalando versão anterior."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."

View File

@@ -1,51 +1,51 @@
;Installer strings
;LangString inst_qbt_req ${LANG_ENGLISH} "qBittorrent (required)"
LangString inst_qbt_req ${LANG_TURKISH} "qBittorrent (required)"
LangString inst_qbt_req ${LANG_TURKISH} "qBittorrent (zorunlu)"
;LangString inst_dekstop ${LANG_ENGLISH} "Create Desktop Shortcut"
LangString inst_dekstop ${LANG_TURKISH} "Create Desktop Shortcut"
LangString inst_dekstop ${LANG_TURKISH} "Masaüstü Kısayolu oluştur"
;LangString inst_startmenu ${LANG_ENGLISH} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_TURKISH} "Create Start Menu Shortcut"
LangString inst_startmenu ${LANG_TURKISH} "Başlangıç Menüsü Kısayolu oluştur"
;LangString inst_torrent ${LANG_ENGLISH} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_TURKISH} "Open .torrent files with qBittorrent"
LangString inst_torrent ${LANG_TURKISH} ".torrent dosyalarını qBittorrent ile aç"
;LangString inst_magnet ${LANG_ENGLISH} "Open magnet links with qBittorrent"
LangString inst_magnet ${LANG_TURKISH} "Open magnet links with qBittorrent"
LangString inst_magnet ${LANG_TURKISH} "Magnet bağlantılarını qBittorrent ile aç"
;LangString inst_firewall ${LANG_ENGLISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_TURKISH} "Add Windows Firewall rule"
LangString inst_firewall ${LANG_TURKISH} "Windows Güvenlik Duvarı kuralı ekle"
;LangString inst_firewallinfo ${LANG_ENGLISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_TURKISH} "Adding Windows Firewall rule"
LangString inst_firewallinfo ${LANG_TURKISH} "Windows Güvenlik Duvarı kuralı ekleniyor"
;LangString inst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_TURKISH} "qBittorrent is running. Please close the application before installing."
LangString inst_warning ${LANG_TURKISH} "qBittorrent çalışıyor. Lütfen yüklemeden önce uygulamayı kapatın."
;LangString inst_uninstall_question ${LANG_ENGLISH} "A previous installation was detected. It will be uninstalled without deleting user settings."
LangString inst_uninstall_question ${LANG_TURKISH} "A previous installation was detected. It will be uninstalled without deleting user settings."
LangString inst_uninstall_question ${LANG_TURKISH} "Önceki bir kurulum algılandı. Kullanıcı ayarları silinmeden kaldırılacaktır."
;LangString inst_unist ${LANG_ENGLISH} "Uninstalling previous version."
LangString inst_unist ${LANG_TURKISH} "Uninstalling previous version."
LangString inst_unist ${LANG_TURKISH} "Önceki sürüm kaldırılıyor."
;LangString launch_qbt ${LANG_ENGLISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_TURKISH} "Launch qBittorrent."
LangString launch_qbt ${LANG_TURKISH} "qBittorrent'i çalıştır."
;------------------------------------
;Uninstaller strings
;LangString remove_files ${LANG_ENGLISH} "Remove files"
LangString remove_files ${LANG_TURKISH} "Remove files"
LangString remove_files ${LANG_TURKISH} "Dosyaları kaldır"
;LangString remove_shortcuts ${LANG_ENGLISH} "Remove shortcuts"
LangString remove_shortcuts ${LANG_TURKISH} "Remove shortcuts"
LangString remove_shortcuts ${LANG_TURKISH} "Kısayolları kaldır"
;LangString remove_associations ${LANG_ENGLISH} "Remove file associations"
LangString remove_associations ${LANG_TURKISH} "Remove file associations"
LangString remove_associations ${LANG_TURKISH} "Dosya ilişkilendirmelerini kaldır"
;LangString remove_registry ${LANG_ENGLISH} "Remove registry keys"
LangString remove_registry ${LANG_TURKISH} "Remove registry keys"
LangString remove_registry ${LANG_TURKISH} "Kayıt defteri anahtarlarını kaldır"
;LangString remove_conf ${LANG_ENGLISH} "Remove configuration files"
LangString remove_conf ${LANG_TURKISH} "Remove configuration files"
LangString remove_conf ${LANG_TURKISH} "Yapılandırma dosyalarını kaldır"
;LangString remove_firewall ${LANG_ENGLISH} "Remove Windows Firewall rule"
LangString remove_firewall ${LANG_TURKISH} "Remove Windows Firewall rule"
LangString remove_firewall ${LANG_TURKISH} "Windows Güvenlik Duvarı kuralını kaldır"
;LangString remove_firewallinfo ${LANG_ENGLISH} "Removing Windows Firewall rule"
LangString remove_firewallinfo ${LANG_TURKISH} "Removing Windows Firewall rule"
LangString remove_firewallinfo ${LANG_TURKISH} "Windows Güvenlik Duvarı kuralı kaldırılıyor"
;LangString remove_cache ${LANG_ENGLISH} "Remove torrents and cached data"
LangString remove_cache ${LANG_TURKISH} "Remove torrents and cached data"
LangString remove_cache ${LANG_TURKISH} "Torrentleri ve önbelleklenen verileri kaldır"
;LangString uninst_warning ${LANG_ENGLISH} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_TURKISH} "qBittorrent is running. Please close the application before uninstalling."
LangString uninst_warning ${LANG_TURKISH} "qBittorrent çalışıyor. Lütfen kaldırmadan önce uygulamayı kapatın."
;LangString uninst_tor_warn ${LANG_ENGLISH} "Not removing .torrent association. It is associated with:"
LangString uninst_tor_warn ${LANG_TURKISH} "Not removing .torrent association. It is associated with:"
LangString uninst_tor_warn ${LANG_TURKISH} ".torrent ilişkilendirmesi kaldırılmıyor. Şununla ilişkilendirildi:"
;LangString uninst_mag_warn ${LANG_ENGLISH} "Not removing magnet association. It is associated with:"
LangString uninst_mag_warn ${LANG_TURKISH} "Not removing magnet association. It is associated with:"
LangString uninst_mag_warn ${LANG_TURKISH} "Magnet ilişkilendirmesi kaldırılmıyor. Şununla ilişkilendirildi:"

Binary file not shown.

Binary file not shown.

View File

@@ -19,7 +19,7 @@ XPStyle on
!define CSIDL_APPDATA '0x1A' ;Application Data path
!define CSIDL_LOCALAPPDATA '0x1C' ;Local Application Data path
!define PROG_VERSION "3.3.7"
!define PROG_VERSION "3.3.10"
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun
!define MUI_FINISHPAGE_RUN_TEXT $(launch_qbt)

View File

@@ -31,7 +31,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 17
#serial 18
AC_DEFUN([AX_BOOST_SYSTEM],
[
@@ -68,9 +68,10 @@ AC_DEFUN([AX_BOOST_SYSTEM],
ax_cv_boost_system,
[AC_LANG_PUSH([C++])
CXXFLAGS_SAVE=$CXXFLAGS
CXXFLAGS=
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]],
[[boost::system::system_category]])],
[[boost::system::error_category *a = 0;]])],
ax_cv_boost_system=yes, ax_cv_boost_system=no)
CXXFLAGS=$CXXFLAGS_SAVE
AC_LANG_POP([C++])

View File

@@ -70,6 +70,7 @@
#include "base/net/smtp.h"
#include "base/net/downloadmanager.h"
#include "base/net/geoipmanager.h"
#include "base/net/proxyconfigurationmanager.h"
#include "base/bittorrent/session.h"
#include "base/bittorrent/torrenthandle.h"
@@ -263,7 +264,7 @@ void Application::runExternalProgram(BitTorrent::TorrentHandle *const torrent) c
#elif defined(Q_OS_WIN) // test cmd: `echo "%F" > "c:\ab ba.txt"`
program.prepend(QLatin1String("\"")).append(QLatin1String("\""));
program.prepend(Utils::Misc::windowsSystemPath() + QLatin1String("\\cmd.exe /C "));
const uint cmdMaxLength = 32768; // max length (incl. terminate char) for `lpCommandLine` in `CreateProcessW()`
const int cmdMaxLength = 32768; // max length (incl. terminate char) for `lpCommandLine` in `CreateProcessW()`
if ((program.size() + 1) > cmdMaxLength) {
logger->addMessage(tr("Torrent: %1, run external program command too long (length > %2), execution failed.").arg(torrent->name()).arg(cmdMaxLength), Log::CRITICAL);
return;
@@ -395,6 +396,7 @@ void Application::processParams(const QStringList &params)
int Application::exec(const QStringList &params)
{
Net::ProxyConfigurationManager::initInstance();
Net::DownloadManager::initInstance();
#ifdef DISABLE_GUI
IconProvider::initInstance();
@@ -621,6 +623,7 @@ void Application::cleanup()
Net::GeoIPManager::freeInstance();
#endif
Net::DownloadManager::freeInstance();
Net::ProxyConfigurationManager::freeInstance();
Preferences::freeInstance();
SettingsStorage::freeInstance();
delete m_fileLogger;

View File

@@ -135,6 +135,12 @@ int main(int argc, char *argv[])
// We must save it here because QApplication constructor may change it
bool isOneArg = (argc == 2);
#ifdef Q_OS_MAC
// On macOS 10.12 Sierra, Apple changed the behaviour of CFPreferencesSetValue() https://bugreports.qt.io/browse/QTBUG-56344
// Due to this, we have to move from native plist to IniFormat
macMigratePlists();
#endif
// Create Application
QString appId = QLatin1String("qBittorrent-") + Utils::Misc::getUserIDString();
QScopedPointer<Application> app(new Application(appId, argc, argv));
@@ -230,6 +236,17 @@ int main(int argc, char *argv[])
qputenv("QT_BEARER_POLL_TIMEOUT", QByteArray::number(-1));
#endif
#if defined(Q_OS_MAC)
{
// Since Apple made difficult for users to set PATH, we set here for convenience.
// Users are supposed to install Homebrew Python for search function.
// For more info see issue #5571.
QByteArray path = "/usr/local/bin:";
path += qgetenv("PATH");
qputenv("PATH", path.constData());
}
#endif
#ifndef DISABLE_GUI
if (!upgrade()) return EXIT_FAILURE;
#else

View File

@@ -29,24 +29,31 @@
#ifndef UPGRADE_H
#define UPGRADE_H
#include <libtorrent/lazy_entry.hpp>
#include <libtorrent/entry.hpp>
#include <libtorrent/version.hpp>
#if LIBTORRENT_VERSION_NUM >= 10100
#include <libtorrent/bdecode.hpp>
#endif
#include <libtorrent/bencode.hpp>
#include <libtorrent/entry.hpp>
#if LIBTORRENT_VERSION_NUM < 10100
#include <libtorrent/lazy_entry.hpp>
#endif
#include <QString>
#include <QDir>
#include <QFile>
#include <QRegExp>
#ifndef DISABLE_GUI
#include <QMessageBox>
#endif
#include <QRegExp>
#include <QString>
#include "base/logger.h"
#include "base/utils/fs.h"
#include "base/utils/misc.h"
#include "base/utils/string.h"
#include "base/qinisettings.h"
#include "base/preferences.h"
#include "base/qinisettings.h"
bool userAcceptsUpgrade()
{
@@ -86,10 +93,16 @@ bool upgradeResumeFile(const QString &filepath, const QVariantHash &oldTorrent =
QByteArray data = file1.readAll();
file1.close();
libtorrent::lazy_entry fastOld;
libtorrent::error_code ec;
libtorrent::lazy_bdecode(data.constData(), data.constData() + data.size(), fastOld, ec);
if (ec || (fastOld.type() != libtorrent::lazy_entry::dict_t)) return false;
#if LIBTORRENT_VERSION_NUM < 10100
libtorrent::lazy_entry fastOld;
libtorrent::lazy_bdecode(data.constData(), data.constData() + data.size(), fastOld, ec);
if (ec || (fastOld.type() != libtorrent::lazy_entry::dict_t)) return false;
#else
libtorrent::bdecode_node fastOld;
libtorrent::bdecode(data.constData(), data.constData() + data.size(), fastOld, ec);
if (ec || (fastOld.type() != libtorrent::bdecode_node::dict_t)) return false;
#endif
libtorrent::entry fastNew;
fastNew = fastOld;
@@ -143,7 +156,12 @@ bool upgrade(bool ask = true)
upgradeResumeFile(backupFolderDir.absoluteFilePath(backupFile));
// ****************************************************************************************
#ifdef Q_OS_MAC
// native .plist
QSettings *oldResumeSettings = new QSettings("qBittorrent", "qBittorrent-resume");
#else
QIniSettings *oldResumeSettings = new QIniSettings("qBittorrent", "qBittorrent-resume");
#endif
QString oldResumeFilename = oldResumeSettings->fileName();
QVariantHash oldResumeData = oldResumeSettings->value("torrents").toHash();
delete oldResumeSettings;
@@ -210,4 +228,34 @@ bool upgrade(bool ask = true)
return true;
}
#ifdef Q_OS_MAC
void migratePlistToIni(const QString &application)
{
QIniSettings iniFile("qBittorrent", application);
if (!iniFile.allKeys().isEmpty()) return; // We copy the contents of plist, only if inifile does not exist(is empty).
QSettings *plistFile = new QSettings("qBittorrent", application);
plistFile->setFallbacksEnabled(false);
const QStringList plist = plistFile->allKeys();
if (!plist.isEmpty()) {
foreach (const QString &key, plist)
iniFile.setValue(key, plistFile->value(key));
plistFile->clear();
}
QString plistPath = plistFile->fileName();
delete plistFile;
Utils::Fs::forceRemove(plistPath);
}
void macMigratePlists()
{
migratePlistToIni("qBittorrent-data");
migratePlistToIni("qBittorrent-rss");
migratePlistToIni("qBittorrent");
}
#endif // Q_OS_MAC
#endif // UPGRADE_H

View File

@@ -30,6 +30,7 @@ net/downloadmanager.h
net/geoipmanager.h
net/portforwarder.h
net/private/geoipdatabase.h
net/proxyconfigurationmanager.h
net/reverseresolution.h
net/smtp.h
rss/private/rssparser.h
@@ -88,6 +89,7 @@ net/downloadmanager.cpp
net/geoipmanager.cpp
net/portforwarder.cpp
net/private/geoipdatabase.cpp
net/proxyconfigurationmanager.cpp
net/reverseresolution.cpp
net/smtp.cpp
rss/private/rssparser.cpp

View File

@@ -5,6 +5,7 @@ HEADERS += \
$$PWD/qinisettings.h \
$$PWD/logger.h \
$$PWD/settingsstorage.h \
$$PWD/settingvalue.h \
$$PWD/preferences.h \
$$PWD/indexrange.h \
$$PWD/iconprovider.h \
@@ -20,6 +21,7 @@ HEADERS += \
$$PWD/net/downloadhandler.h \
$$PWD/net/geoipmanager.h \
$$PWD/net/portforwarder.h \
$$PWD/net/proxyconfigurationmanager.h \
$$PWD/net/reverseresolution.h \
$$PWD/net/smtp.h \
$$PWD/net/private/geoipdatabase.h \
@@ -74,6 +76,7 @@ SOURCES += \
$$PWD/net/downloadhandler.cpp \
$$PWD/net/geoipmanager.cpp \
$$PWD/net/portforwarder.cpp \
$$PWD/net/proxyconfigurationmanager.cpp \
$$PWD/net/reverseresolution.cpp \
$$PWD/net/smtp.cpp \
$$PWD/net/private/geoipdatabase.cpp \

View File

@@ -31,13 +31,13 @@
#include <QTime>
#include <QDateTime>
#include "base/bittorrent/session.h"
#include "base/preferences.h"
#include "bandwidthscheduler.h"
BandwidthScheduler::BandwidthScheduler(QObject *parent)
: QTimer(parent)
{
Q_ASSERT(Preferences::instance()->isSchedulerEnabled());
// Single shot, we call start() again manually
setSingleShot(true);
// Connect Signals/Slots
@@ -47,8 +47,7 @@ BandwidthScheduler::BandwidthScheduler(QObject *parent)
void BandwidthScheduler::start()
{
const Preferences* const pref = Preferences::instance();
Q_ASSERT(pref->isSchedulerEnabled());
bool alt_bw_enabled = pref->isAltBandwidthEnabled();
bool alt_bw_enabled = BitTorrent::Session::instance()->isAltGlobalSpeedLimitEnabled();
QTime start = pref->getSchedulerStartTime();
QTime end = pref->getSchedulerEndTime();

View File

@@ -55,10 +55,10 @@ FilterParserThread::~FilterParserThread()
}
// Parser for eMule ip filter in DAT format
int FilterParserThread::parseDATFilterFile(QString m_filePath, libt::ip_filter &filter)
int FilterParserThread::parseDATFilterFile(QString filePath, libt::ip_filter &filter)
{
int ruleCount = 0;
QFile file(m_filePath);
QFile file(filePath);
if (!file.exists()) return ruleCount;
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
@@ -149,10 +149,10 @@ int FilterParserThread::parseDATFilterFile(QString m_filePath, libt::ip_filter &
}
// Parser for PeerGuardian ip filter in p2p format
int FilterParserThread::parseP2PFilterFile(QString m_filePath, libt::ip_filter &filter)
int FilterParserThread::parseP2PFilterFile(QString filePath, libt::ip_filter &filter)
{
int ruleCount = 0;
QFile file(m_filePath);
QFile file(filePath);
if (!file.exists()) return ruleCount;
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
@@ -257,10 +257,10 @@ int FilterParserThread::getlineInStream(QDataStream &stream, std::string &name,
}
// Parser for PeerGuardian ip filter in p2p format
int FilterParserThread::parseP2BFilterFile(QString m_filePath, libt::ip_filter &filter)
int FilterParserThread::parseP2BFilterFile(QString filePath, libt::ip_filter &filter)
{
int ruleCount = 0;
QFile file(m_filePath);
QFile file(filePath);
if (!file.exists()) return ruleCount;
if (!file.open(QIODevice::ReadOnly)) {
@@ -369,7 +369,7 @@ int FilterParserThread::parseP2BFilterFile(QString m_filePath, libt::ip_filter &
// * eMule IP list (DAT): http://wiki.phoenixlabs.org/wiki/DAT_Format
// * PeerGuardian Text (P2P): http://wiki.phoenixlabs.org/wiki/P2P_Format
// * PeerGuardian Binary (P2B): http://wiki.phoenixlabs.org/wiki/P2B_Format
void FilterParserThread::processFilterFile(QString _filePath)
void FilterParserThread::processFilterFile(QString filePath)
{
if (isRunning()) {
// Already parsing a filter, m_abort first
@@ -378,27 +378,11 @@ void FilterParserThread::processFilterFile(QString _filePath)
}
m_abort = false;
m_filePath = _filePath;
m_filePath = filePath;
// Run it
start();
}
void FilterParserThread::processFilterList(libt::session *s, const QStringList &IPs)
{
// First, import current filter
libt::ip_filter filter = s->get_ip_filter();
foreach (const QString &ip, IPs) {
qDebug("Manual ban of peer %s", ip.toLocal8Bit().constData());
boost::system::error_code ec;
libt::address addr = libt::address::from_string(ip.toLocal8Bit().constData(), ec);
Q_ASSERT(!ec);
if (!ec)
filter.add_rule(addr, addr, libt::ip_filter::blocked);
}
s->set_ip_filter(filter);
}
QString FilterParserThread::cleanupIPAddress(QString _ip)
{
_ip = _ip.trimmed();

View File

@@ -54,8 +54,7 @@ public:
int parseP2PFilterFile(QString filePath, libtorrent::ip_filter &filter);
int getlineInStream(QDataStream &stream, std::string &name, char delim);
int parseP2BFilterFile(QString filePath, libtorrent::ip_filter &filter);
void processFilterFile(QString _filePath);
static void processFilterList(libtorrent::session *s, const QStringList &IPs);
void processFilterFile(QString filePath);
signals:
void IPFilterParsed(int ruleCount);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -752,7 +752,7 @@ void TorrentHandle::updateState()
m_state = isSeed() ? TorrentState::PausedUploading : TorrentState::PausedDownloading;
}
else {
if (m_session->isQueueingEnabled() && isQueued() && !isChecking()) {
if (m_session->isQueueingSystemEnabled() && isQueued() && !isChecking()) {
m_state = isSeed() ? TorrentState::QueuedUploading : TorrentState::QueuedDownloading;
}
else {

View File

@@ -239,7 +239,7 @@ QVector<int> TorrentInfo::fileIndicesForPiece(int pieceIndex) const
std::vector<libt::file_slice> files(
nativeInfo()->map_block(pieceIndex, 0, nativeInfo()->piece_size(pieceIndex)));
QVector<int> res;
res.reserve(files.size());
res.reserve(int(files.size()));
std::transform(files.begin(), files.end(), std::back_inserter(res),
[](const libt::file_slice &s) { return s.file_index; });

View File

@@ -91,6 +91,7 @@ void Server::incomingConnection(int socketDescriptor)
#else
static_cast<QSslSocket*>(serverSocket)->setLocalCertificate(m_certificates.first());
#endif
static_cast<QSslSocket*>(serverSocket)->setPeerVerifyMode(QSslSocket::VerifyNone);
static_cast<QSslSocket*>(serverSocket)->startServerEncryption();
}
#endif

View File

@@ -27,20 +27,21 @@
* exception statement from your version.
*/
#include "downloadmanager.h"
#include <QDateTime>
#include <QNetworkRequest>
#include <QNetworkProxy>
#include <QNetworkCookieJar>
#include <QNetworkReply>
#include <QDebug>
#include <QNetworkCookie>
#include <QNetworkCookieJar>
#include <QNetworkProxy>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QSslError>
#include <QUrl>
#include <QDebug>
#include "base/preferences.h"
#include "downloadhandler.h"
#include "downloadmanager.h"
#include "proxyconfigurationmanager.h"
// Spoof Firefox 38 user agent to avoid web server banning
const char DEFAULT_USER_AGENT[] = "Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Firefox/38.0";
@@ -208,16 +209,16 @@ bool DownloadManager::deleteCookie(const QNetworkCookie &cookie)
void DownloadManager::applyProxySettings()
{
auto proxyManager = ProxyConfigurationManager::instance();
ProxyConfiguration proxyConfig = proxyManager->proxyConfiguration();
QNetworkProxy proxy;
const Preferences* const pref = Preferences::instance();
if (pref->isProxyEnabled() && !pref->isProxyOnlyForTorrents()) {
if (!proxyManager->isProxyOnlyForTorrents() && (proxyConfig.type != ProxyType::None)) {
// Proxy enabled
proxy.setHostName(pref->getProxyIp());
proxy.setPort(pref->getProxyPort());
proxy.setHostName(proxyConfig.ip);
proxy.setPort(proxyConfig.port);
// Default proxy type is HTTP, we must change if it is SOCKS5
const int proxyType = pref->getProxyType();
if ((proxyType == Proxy::SOCKS5) || (proxyType == Proxy::SOCKS5_PW)) {
if ((proxyConfig.type == ProxyType::SOCKS5) || (proxyConfig.type == ProxyType::SOCKS5_PW)) {
qDebug() << Q_FUNC_INFO << "using SOCKS proxy";
proxy.setType(QNetworkProxy::Socks5Proxy);
}
@@ -226,10 +227,10 @@ void DownloadManager::applyProxySettings()
proxy.setType(QNetworkProxy::HttpProxy);
}
// Authentication?
if (pref->isProxyAuthEnabled()) {
if (proxyManager->isAuthenticationRequired()) {
qDebug("Proxy requires authentication, authenticating");
proxy.setUser(pref->getProxyUsername());
proxy.setPassword(pref->getProxyPassword());
proxy.setUser(proxyConfig.username);
proxy.setPassword(proxyConfig.password);
}
}
else {

View File

@@ -45,7 +45,6 @@
static const char DATABASE_URL[] = "https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz";
static const char GEOIP_FOLDER[] = "GeoIP";
static const char GEOIP_FILENAME[] = "GeoLite2-Country.mmdb";
static const int CACHE_SIZE = 1000;
static const int UPDATE_INTERVAL = 30; // Days between database updates
using namespace Net;

View File

@@ -26,13 +26,17 @@
* exception statement from your version.
*/
#include "portforwarder.h"
#include <QDebug>
#include <libtorrent/session.hpp>
#include <libtorrent/version.hpp>
#include "base/logger.h"
#include "base/preferences.h"
#include "portforwarder.h"
#include "base/settingsstorage.h"
static const QString KEY_ENABLED = QLatin1String("Network/PortForwardingEnabled");
namespace libt = libtorrent;
using namespace Net;
@@ -42,8 +46,8 @@ PortForwarder::PortForwarder(libtorrent::session *provider, QObject *parent)
, m_active(false)
, m_provider(provider)
{
configure();
connect(Preferences::instance(), SIGNAL(changed()), SLOT(configure()));
if (SettingsStorage::instance()->loadValue(KEY_ENABLED, true).toBool())
start();
}
PortForwarder::~PortForwarder()
@@ -70,7 +74,24 @@ PortForwarder *PortForwarder::instance()
return m_instance;
}
void PortForwarder::addPort(qint16 port)
bool PortForwarder::isEnabled() const
{
return m_active;
}
void PortForwarder::setEnabled(bool enabled)
{
if (m_active != enabled) {
if (enabled)
start();
else
stop();
SettingsStorage::instance()->storeValue(KEY_ENABLED, enabled);
}
}
void PortForwarder::addPort(quint16 port)
{
if (!m_mappedPorts.contains(port)) {
m_mappedPorts.insert(port, 0);
@@ -79,7 +100,7 @@ void PortForwarder::addPort(qint16 port)
}
}
void PortForwarder::deletePort(qint16 port)
void PortForwarder::deletePort(quint16 port)
{
if (m_mappedPorts.contains(port)) {
if (m_active)
@@ -88,23 +109,19 @@ void PortForwarder::deletePort(qint16 port)
}
}
void PortForwarder::configure()
{
bool enable = Preferences::instance()->isUPnPEnabled();
if (m_active != enable) {
if (enable)
start();
else
stop();
}
}
void PortForwarder::start()
{
qDebug("Enabling UPnP / NAT-PMP");
#if LIBTORRENT_VERSION_NUM < 10100
m_provider->start_upnp();
m_provider->start_natpmp();
foreach (qint16 port, m_mappedPorts.keys())
#else
libt::settings_pack settingsPack = m_provider->get_settings();
settingsPack.set_bool(libt::settings_pack::enable_upnp, true);
settingsPack.set_bool(libt::settings_pack::enable_natpmp, true);
m_provider->apply_settings(settingsPack);
#endif
foreach (quint16 port, m_mappedPorts.keys())
m_mappedPorts[port] = m_provider->add_port_mapping(libt::session::tcp, port, port);
m_active = true;
Logger::instance()->addMessage(tr("UPnP / NAT-PMP support [ON]"), Log::INFO);
@@ -113,8 +130,15 @@ void PortForwarder::start()
void PortForwarder::stop()
{
qDebug("Disabling UPnP / NAT-PMP");
#if LIBTORRENT_VERSION_NUM < 10100
m_provider->stop_upnp();
m_provider->stop_natpmp();
#else
libt::settings_pack settingsPack = m_provider->get_settings();
settingsPack.set_bool(libt::settings_pack::enable_upnp, false);
settingsPack.set_bool(libt::settings_pack::enable_natpmp, false);
m_provider->apply_settings(settingsPack);
#endif
m_active = false;
Logger::instance()->addMessage(tr("UPnP / NAT-PMP support [OFF]"), Log::INFO);
}

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