You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-10-09 18:32:15 +02:00
Compare commits
71 Commits
release-3.
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
204b02a480 | ||
![]() |
eb7a844099 | ||
![]() |
84dbb76331 | ||
![]() |
fb21944aae | ||
![]() |
14625a565d | ||
![]() |
3f875324d8 | ||
![]() |
03f2293b2a | ||
![]() |
47482586a1 | ||
![]() |
96fd1624ce | ||
![]() |
8ea2312b4f | ||
![]() |
9382de64d6 | ||
![]() |
b0e3549780 | ||
![]() |
d2abe18497 | ||
![]() |
ede004148f | ||
![]() |
91bfe3585c | ||
![]() |
f99adf8e9a | ||
![]() |
ebab7c5760 | ||
![]() |
baf5fe45b4 | ||
![]() |
54793e4195 | ||
![]() |
e8da08906c | ||
![]() |
ae7e9cd1df | ||
![]() |
7679b852b8 | ||
![]() |
eda04b3ef3 | ||
![]() |
3ef6e7bf65 | ||
![]() |
146cf9a435 | ||
![]() |
dff6b057b9 | ||
![]() |
3b7448dfc7 | ||
![]() |
4e4ac771a9 | ||
![]() |
06a376d014 | ||
![]() |
b3d2f9b701 | ||
![]() |
055a99239b | ||
![]() |
e779c9a7db | ||
![]() |
b0f7f5ae58 | ||
![]() |
512ab58832 | ||
![]() |
9ad088682c | ||
![]() |
d2fad8249c | ||
![]() |
20fb7c3adf | ||
![]() |
c4fdfec420 | ||
![]() |
a3e03e739c | ||
![]() |
9846dc0fff | ||
![]() |
1b29b148d8 | ||
![]() |
6dab35cb8e | ||
![]() |
6b2d922005 | ||
![]() |
1d92ae6382 | ||
![]() |
62f4d6386a | ||
![]() |
e74ef4c6fd | ||
![]() |
282ee0e879 | ||
![]() |
697d2ccb71 | ||
![]() |
71d163d743 | ||
![]() |
83685942de | ||
![]() |
6f34c81014 | ||
![]() |
5e826dffc8 | ||
![]() |
b4dc66020c | ||
![]() |
cb4741ed89 | ||
![]() |
4c3976e5df | ||
![]() |
fd7fb115ff | ||
![]() |
197d5b3a05 | ||
![]() |
624d6aa6a1 | ||
![]() |
28d7dc137b | ||
![]() |
351d84e2f7 | ||
![]() |
774b8f4fd6 | ||
![]() |
2fc6470696 | ||
![]() |
1038b00553 | ||
![]() |
c3b37b4f1f | ||
![]() |
41faf341cc | ||
![]() |
44e92a7f3d | ||
![]() |
599f956269 | ||
![]() |
79a9606e86 | ||
![]() |
5b576baf67 | ||
![]() |
aa3ce90478 | ||
![]() |
2c433e35b0 |
53
.travis.yml
53
.travis.yml
@@ -1,53 +0,0 @@
|
||||
language:
|
||||
- cpp
|
||||
|
||||
env:
|
||||
# use libtorrent 0.15.10
|
||||
- lt_source=from_dist gui=true
|
||||
- lt_source=from_dist gui=false
|
||||
# use libtorrent 0.16.X from RC_0_16 svn branch
|
||||
- lt_source=from_svn gui=true
|
||||
- lt_source=from_svn gui=false
|
||||
|
||||
branches:
|
||||
except:
|
||||
- search_encoding_windows
|
||||
- v2_9_x
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: change
|
||||
on_failure: change
|
||||
|
||||
before_install:
|
||||
- shopt -s expand_aliases
|
||||
- alias sudo="sudo "
|
||||
# Using nprocs/2 sometimes may fail (gcc is killed by system), just use two threads
|
||||
- alias make="colormake -j2 "
|
||||
|
||||
# Also setup a virtual display for after_success target when gui == true
|
||||
- if ! $gui; then qbtconf="$qbtconf --disable-gui"; else export "DISPLAY=:99.0" && /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 ; fi
|
||||
- ltconf=" --with-libgeoip=system"
|
||||
|
||||
- echo settings
|
||||
- echo $lt_source
|
||||
- echo $ltconf
|
||||
- echo $gui
|
||||
- echo $qbtconf
|
||||
|
||||
- sudo apt-get -qq update
|
||||
# Travis can stall during heavy load if these packages are installed in one step - split the command
|
||||
- sudo apt-get -qq install debhelper qconf colormake libssl-dev libgeoip-dev
|
||||
- sudo apt-get -qq install libboost-dev libboost-filesystem-dev libboost-system-dev
|
||||
- sudo apt-get -qq install libqt4-dev
|
||||
|
||||
install:
|
||||
- if [[ "$lt_source" == "from_dist" ]]; then sudo apt-get -qq install libtorrent-rasterbar-dev; fi
|
||||
- if [[ "$lt_source" == "from_svn" ]]; then cd .. && svn co svn://svn.code.sf.net/p/libtorrent/code/branches/RC_0_16 ./libtorrent && (cd libtorrent && ./autotool.sh && ./configure $ltconf && sudo make install) && sudo ldconfig /usr/local/lib && cd $TRAVIS_BUILD_DIR ; fi
|
||||
|
||||
script:
|
||||
- qt-qconf
|
||||
- ./configure $qbtconf && sudo make install
|
||||
|
||||
after_success:
|
||||
- if $gui ; then qbittorrent --version ; else qbittorrent-nox --version ; fi
|
15
AUTHORS
15
AUTHORS
@@ -1,7 +1,4 @@
|
||||
Current maintainer:
|
||||
* Sledgehammer999 <sledgehammer999@qbittorrent.org>
|
||||
|
||||
Original author:
|
||||
Author:
|
||||
* Christophe Dumez <chris@qbittorrent.org>
|
||||
|
||||
Contributors:
|
||||
@@ -14,7 +11,6 @@ Contributors:
|
||||
* Grigis Gaëtan <cipher16@gmail.com>
|
||||
* Christian Kandeler <zambesi@users.sourceforge.net>
|
||||
* Silvan Scherrer <silvan.scherrer@aroa.ch>
|
||||
* Nick Tiskov <daymansmail@gmail.com>
|
||||
|
||||
Code from other projects:
|
||||
* files src/qtsingleapp/* src/lineedit/*
|
||||
@@ -29,10 +25,6 @@ Code from other projects:
|
||||
copyright: Dan Haim <negativeiq@users.sourceforge.net>
|
||||
license: BSD
|
||||
|
||||
* file src/stacktrace_win.h
|
||||
copyright: Quassel Project
|
||||
license: GPLv2/3
|
||||
|
||||
Images Authors:
|
||||
* files: src/Icons/*.png
|
||||
copyright: Gnome Icon Theme
|
||||
@@ -100,9 +92,8 @@ Translations authors:
|
||||
- Georgian: Beqa Arabuli (arabulibeqa@yahoo.com)
|
||||
- German: Niels Hoffmann (zentralmaschine@users.sourceforge.net)
|
||||
- Greek: Tsvetan Bankov (emerge_life@users.sourceforge.net) and Stephanos Antaris (santaris@csd.auth.gr)
|
||||
- Hebrew: David Deutsch (d.deffo@gmail.com)
|
||||
- Hungarian: Majoros Péter (majoros.j.p@t-online.hu)
|
||||
- Italian: bovirus (bovirus@live.it) and Matteo Sechi (bu17714@gmail.com)
|
||||
- Italian: Matteo Sechi (bu17714@gmail.com)
|
||||
- Japanese: Masato Hashimoto (cabezon.hashimoto@gmail.com)
|
||||
- Korean: Jin Woo Sin (jin828sin@users.sourceforge.net)
|
||||
- Lithuanian: Naglis Jonaitis (njonaitis@gmail.com)
|
||||
@@ -116,5 +107,5 @@ Translations authors:
|
||||
- Spanish: Francisco Luque Contreras (frannoe@ya.com)
|
||||
- Swedish: Daniel Nylander (po@danielnylander.se)
|
||||
- Turkish: Hasan Yilmaz (iletisim@hedefturkce.com)
|
||||
- Ukrainian: Oleh Prypin (blaxpirit@gmail.com)
|
||||
- Ukrainian: Andrey Shpachenko (masterfix@users.sourceforge.net) and Oleh Prypin (blaxpirit@gmail.com)
|
||||
license: GPLv2
|
||||
|
158
Changelog
158
Changelog
@@ -1,125 +1,49 @@
|
||||
* Mon Jul 29 2013 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.0.11
|
||||
- FEATURE: Allow more fine tuning of upload slots. It should improve speed (sledgehammer999)
|
||||
- FEATURE: Enable edit/rename via F2 or double click in various places (Gelmir)
|
||||
- BUGFIX: Fix Spanish and Basque translations being messed up on Windows (sledgehammer999)
|
||||
- BUGFIX: Don't allow newlines in rename dialog (Gelmir)
|
||||
- BUGFIX: Treat unfinished dates as the newest ones when sorting (sledgehammer999)
|
||||
- BUGFIX: Fix text size problem on Windows with custom DPI (sledgehammer999)
|
||||
- BUGFIX: Respect UI lock when clicking on tray notification (sledgehammer999)
|
||||
- BUGFIX: Fix kickass torrents search plugin (Gelmir)
|
||||
- BUGFIX: Use system language as default language. Closes #780 (sledgehammer999)
|
||||
- BUGFIX: Move completed files to .unwanted folder when they are unselected by the user (constantined)
|
||||
- BUGFIX: Show delete action when multiple feeds are selected (Gelmir)
|
||||
- BUGFIX: Use Unicode for libtorrent alert messages (Gelmir)
|
||||
- OTHER: Update translations
|
||||
- WINDOWS: Shave off ~4MB from the binary size (sledgehammer999)
|
||||
- WINDOWS: Remove wrong dependency on msvc2008 runtime (sledgehammer999)
|
||||
- WINDOWS: Disable stacktrace when building with mingw (Gelmir)
|
||||
- WINDOWS: Updated NSIS script to include/delete .pdb file. (sledgehammer999)
|
||||
* Sat Mar 17 2012 - Christophe Dumez <chris@qbittorrent.org> - v2.9.6
|
||||
- BUGFIX: Fix download first/last pieces state reporting
|
||||
- BUGFIX: Fix name of progress column in torrent content panel
|
||||
- BUGFIX: Disable system tray icon on Mac OS X
|
||||
- BUGFIX: RSS downloader should not ignore "Do not start automatically" rule (closes #946910)
|
||||
- BUGFIX: Fix DHT port setting in Web UI (Closes #952182)
|
||||
- BUGFIX: Fix possible Web UI authentication problem when using SSL (closes #941343)
|
||||
- BUGFIX: Fix possible issues with folder removal when removing a torrent
|
||||
- I18N: Add Basque translation
|
||||
|
||||
* Tue Jul 9 2013 - Christophe Dumez <chris@qbittorrent.org> and sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.0.10
|
||||
- BUGFIX: Fix LegitTorrents search plugin
|
||||
- BUGFIX: Improve peer host name resolution (closes #360)
|
||||
- BUGFIX: Context menu fix in the Web UI
|
||||
- BUGFIX: Respect 'don't show' torrent dialog in Search (sledgehammer999)
|
||||
- BUGFIX: Torrent creator can now use files/folders from disk root (Gelmir)
|
||||
- BUGFIX: Update free disk space when changing drives in the add new torrent dialog (sledgehammer999)
|
||||
- BUGFIX: Various fixes relating to RSS drag and drop (Gelmir)
|
||||
- BUGFIX: Properly rename torrent which changes position in filter model (Gelmir)
|
||||
- BUGFIX: Actually show tray notifications when a torrent finishes downloading (sledgehammer999)
|
||||
- BUGFIX: Don't download RSS items based on rules still being edited (Gelmir)
|
||||
- COSMETIC: Native look for the search boxes (Hyperz)
|
||||
- IMPROVEMENT: Use natural sorting where possible (Gelmir and sledgehammer999)
|
||||
- LINUX: Drop Boost.Thread dependency from configure script
|
||||
- OTHER: Update translations.
|
||||
- OTHER: Drop obsolete Boost.Thread dependency from configure script on linux (Dumez)
|
||||
- LIBTORRENT: SOCKS5 fixes (0.16.10)
|
||||
- LIBTORRENT: Fix hanging issue on Windows when closing files (0.16.10)
|
||||
- LIBTORRENT: Cache can now be returned to the OS (0.16.10)
|
||||
- PERFORMANCE: Impove drawing speed of tranferlist when there are many torrents(>100) (sledgehammer999)
|
||||
- PERFORMANCE: Impove drawing speed of peers list when there are many peers (sledgehammer999)
|
||||
|
||||
* Sat Mar 16 2013 - Christophe Dumez <chris@qbittorrent.org> - v3.0.9
|
||||
- BUGFIX: Raise qBittorrent windows when another instance is launched
|
||||
- BUGFIX: Show human readable names for network interfaces in preferences (Windows)
|
||||
- BUGFIX: Fix torrent creator bug when saving non-latin path (Windows)
|
||||
- BUGFIX: Enable 'copy magnet uri' for torrents without metadata too
|
||||
- BUGFIX: Fix a few JSON parser issues (Gelmir)
|
||||
- BUGFIX: Add support for gzipped encoded HTTP responses (daimor)
|
||||
- BUGFIX: Fix possibly missing "Add torrent" icon (Driim)
|
||||
- OTHER: Add search plugin for Legit Torrents
|
||||
* Sat Feb 18 2012 - Christophe Dumez <chris@qbittorrent.org> - v2.9.5
|
||||
- BUGFIX: Fix crash when disabling then reenabling RSS
|
||||
- BUGFIX: Fix duplicate torrent detection when adding a magnet link
|
||||
- BUGFIX: Fix import of new trackers when adding a torrent with same hash (Closes #747000)
|
||||
- BUGFIX: Fix possible redownload of torrents marked as read (Closes #927495)
|
||||
- BUGFIX: Properly remove RSS feed settings/history upon feed removal
|
||||
|
||||
* Sun Jan 20 2013 - Christophe Dumez <chris@qbittorrent.org> - v3.0.8
|
||||
- BUGFIX: Fix support for --no-splash command line argument
|
||||
- BUGFIX: Fix compilation error with libtorrent v0.15
|
||||
- BUGFIX: Fix search issues with Python3
|
||||
- BUGFIX: Fix dead link about certificates in program preferences
|
||||
* Sat Feb 18 2012 - Christophe Dumez <chris@qbittorrent.org> - v2.9.4
|
||||
- BUGFIX: qBittorrent does not handle redirection to relative URLs correctly (Closes #919905)
|
||||
- BUGFIX: Cmd+M minimizes main window on Mac OS X (Closes #928216)
|
||||
- BUGFIX: Cmd+Del removes torrents on Mac OS X (Closes #928852)
|
||||
- BUGFIX: Fix potential bug when moving single file torrents to tmp folder (closes #932861)
|
||||
- BUGFIX: Fix torrent import dialog layout (Closes #930932)
|
||||
- BUGFIX: Prevent log window buffer from filling up (Closes #929673)
|
||||
- I18N: Add Belarusian translation
|
||||
|
||||
* Sat Jan 19 2013 - Christophe Dumez <chris@qbittorrent.org> - v3.0.7
|
||||
- BUGFIX: Update max write cache size to 2048MB and set it to automatic by default (closes #148)
|
||||
- BUGFIX: Add m4v to the list of previewable file extensions (closes #216)
|
||||
- BUGFIX: Fix "Couldn't set environment variable..." message on start up (closes #245)
|
||||
- BUGFIX: Use right path separator in torrent addition dialog on Windows
|
||||
- BUGFIX: Fix "Set as default save path" setting (closes #254)
|
||||
- BUGFIX: Reenable disk cache on Windows since the memory issue seems to be gone
|
||||
- BUGFIX: Fixed several search engine plugins and removed the dead ones
|
||||
- BUGFIX: Use https links in search plugins when possible
|
||||
- BUGFIX: Bump Mootools to v1.4.5 (Web UI)
|
||||
- BUGFIX: Require password to exit qBittorrent from tray icon when locked (closes #311)
|
||||
- BUGFIX: Fix possible crash in loadPeers() (closes #222)
|
||||
* Thu Dec 29 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.9.3
|
||||
- BUGFIX: Fix btdigg plugin (Python3 support + torrent name in magnet links)
|
||||
- BUGFIX: Fix banning of IPv6 peers (Closes #885021)
|
||||
- BUGFIX: Fix torrent addition dialog layout problem (Closes #84650522)
|
||||
- BUGFIX: Do not report any progress for disabled files (Closes #56731485)
|
||||
- BUGFIX: Make torrent sorting case insensitive (Closes #857154)
|
||||
- BUGFIX: Improve Web UI usability of small devices
|
||||
- BUGFIX: Program updater: More reliable version detection / comparison
|
||||
- I18N: Add Georgian translation
|
||||
|
||||
* Sun Oct 7 2012 - Christophe Dumez <chris@qbittorrent.org> - v3.0.6
|
||||
- BUGFIX: Fix unicode support for command-line arguments on Windows (closes #139)
|
||||
- BUGFIX: Do not store created torrent in memory before writing it to a file (closes #133)
|
||||
- BUGFIX: No longer fallback to ANY interface if the user-selected interface cannot be found (closes #143)
|
||||
- BUGFIX: Fix timezone parsing in RSS (closes #136)
|
||||
- BUGFIX: Fix cookie support for RSS feeds (closes #119)
|
||||
* Sat Oct 29 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.9.2
|
||||
- BUGFIX: Fix mimimum dimensions for torrent addition dialog
|
||||
- BUGFIX: Remove dependency on boost-datetime
|
||||
- BUGFIX: Remove dependency on boost-filesystem (libtorrent v0.16.x)
|
||||
|
||||
* Sun Sep 30 2012 - Christophe Dumez <chris@qbittorrent.org> - v3.0.5
|
||||
- BUGFIX: Disabling systray icon no longer disables file association settings (closes #114)
|
||||
- BUGFIX: Import new trackers from magnet link in case of duplicate torrent (closes #111)
|
||||
- BUGFIX: Fix "Skip hash check" feature in torrent import dialog (closes #128)
|
||||
- BUGFIX: Several Web UI connection fixes
|
||||
- BUGFIX: Add Basque locale to Web UI
|
||||
|
||||
* Tue Sep 18 2012 - Christophe Dumez <chris@qbittorrent.org> - v3.0.4
|
||||
- BUGFIX: Fix issue with downloads starting from scratch on startup if temporary
|
||||
directory setting is enabled.
|
||||
|
||||
* Sun Sep 16 2012 - Christophe Dumez <chris@qbittorrent.org> - v3.0.3
|
||||
- BUGFIX: Fix issue with temporary directory not being taken into consideration (closes #94)
|
||||
- BUGFIX: Address encoding issues when using search engine on Windows (closes #29)
|
||||
- BUGFIX: Bypass cache when uploading a torrent file in Web UI (closes #68)
|
||||
- BUGFIX: "Completed On" column is not updated until restart (closes #84)
|
||||
- BUGFIX: Fix possible build error on some systems
|
||||
- I18N: Add hebrew translation
|
||||
|
||||
* Sat Sep 1 2012 - Christophe Dumez <chris@qbittorrent.org> - v3.0.2
|
||||
- FEATURE: Add "clear" functionality to search field (closes #59)
|
||||
- BUGFIX: Attempt to use qBittorrent icon from theme if available (closes #49)
|
||||
- BUGFIX: Fix crash when a fastresume file is empty (closes #52)
|
||||
- BUGFIX: Fix encoding problem for detected XDG Download folder (closes #53)
|
||||
- BUGFIX: Improve performance when showing torrent content panel (Improves #24)
|
||||
- BUGFIX: Fix label-based filtering of torrents whose label contains special characters
|
||||
- BUGFIX: Fix possible crash due to labels (closes #64)
|
||||
|
||||
* Tue Aug 21 2012 - Christophe Dumez <chris@qbittorrent.org> - v3.0.1
|
||||
- BUGFIX: Fix possible crash when adding a tracker to a magnet torrent without metadata (Closes #1034254)
|
||||
- BUGFIX: Remember queue position for torrents without metadata (closes #17)
|
||||
- BUGFIX: Fix crash when using unauthorized characters in label names (closes #19)
|
||||
- BUGFIX: Fix search plugins updating (closes #25)
|
||||
- BUGFIX: Make uTP connections rate limited by default
|
||||
|
||||
* Thu Aug 09 2012 - Christophe Dumez <chris@qbittorrent.org> - v3.0.0
|
||||
- FEATURE: Brand new torrent addition dialog
|
||||
- FEATURE: Add the ability to choose the save path when using magnet links (mutoso)
|
||||
- FEATURE: Add support for adding multiple local torrents at once (Web UI)
|
||||
- COSMETIC: Improve style of left panel
|
||||
- BUGFIX: Lower panels no longer gets disabled
|
||||
- BUGFIX: Major code refactoring and various optimizations.
|
||||
- BUGFIX: No longer strip root folder from torrent files
|
||||
- OTHER: Drop support for libtorrent v0.14.x
|
||||
- OTHER: Drop support for Qt 4.5
|
||||
* Sun Oct 23 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.9.1
|
||||
- BUGFIX: Add support for speed limits scheduling (Web UI)
|
||||
- BUGFIX: Fix ratio calculation for purely seeded torrents
|
||||
- I18N: Update Russian translation
|
||||
- COSMETIC: Torrent addition dialog layout fixes
|
||||
|
||||
* Sat Oct 08 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.9.0
|
||||
- FEATURE: Add file association settings to program preferences (Windows)
|
||||
|
6
INSTALL
6
INSTALL
@@ -10,11 +10,11 @@ qBittorrent - A BitTorrent client in C++ / Qt4
|
||||
will install and execute qBittorrent hopefully without any problems.
|
||||
|
||||
Dependencies:
|
||||
- Qt >= 4.6.0 (libqtgui, libqtcore, libqtnetwork, libqtxml, libqtdbus/optional)
|
||||
- Qt >= 4.5.0 (libqtgui, libqtcore, libqtnetwork, libqtxml, libqtdbus/optional)
|
||||
|
||||
- pkg-config executable
|
||||
|
||||
- libtorrent-rasterbar by Arvid Norberg (>= 0.15.0)
|
||||
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.4 REQUIRED, compatible with v0.15.x/v0.16.x)
|
||||
-> http://www.libtorrent.net
|
||||
Be careful: another library (the one used by rTorrent) uses a similar name.
|
||||
|
||||
@@ -44,7 +44,7 @@ qBittorrent - A BitTorrent client in C++ / Qt4
|
||||
|
||||
- pkg-config executable
|
||||
|
||||
- libtorrent-rasterbar by Arvid Norberg (>= v0.15.0)
|
||||
- libtorrent-rasterbar by Arvid Norberg (>= 0.14.4 REQUIRED, >= v0.15.0 ADVISED)
|
||||
-> http://www.libtorrent.net
|
||||
Be careful: another library (the one used by rTorrent) uses a similar name.
|
||||
|
||||
|
16
README.os2
16
README.os2
@@ -27,6 +27,7 @@ First you need to create the conf.pri file in the same dir as this readme.os2 is
|
||||
the conf.pri file has the following content:
|
||||
|
||||
##### conf.pri content beginn #####
|
||||
PREFIX = .
|
||||
BINDIR = ./bin
|
||||
INCDIR = ./include
|
||||
LIBDIR = ./lib
|
||||
@@ -42,10 +43,7 @@ LIBS += -Lx:/trees/libtorrent/trunk/src/.libs \
|
||||
|
||||
Of course all the above path references have to be adjusted to your build env.
|
||||
|
||||
Now you can either do a normal build or a shadow build. A shadow build has the
|
||||
advantage that no created files are in the same dir as the sources are.
|
||||
|
||||
For a normal build do the following:
|
||||
It should now be easy to build qBittorrent:
|
||||
|
||||
Simply type:
|
||||
$ qmake
|
||||
@@ -53,16 +51,6 @@ $ qmake
|
||||
Followed by:
|
||||
$ make
|
||||
|
||||
For a shadow build do the following:
|
||||
given your sources are in x:\trees\qbittorrent\trunk create a
|
||||
x:\trees\qbittorrent\build directory
|
||||
|
||||
Now switch to the created directory and type:
|
||||
$ qmake ..\trunk
|
||||
|
||||
Followed by:
|
||||
$ make
|
||||
|
||||
If all works fine you should get a working qbittorrent executable.
|
||||
|
||||
If you have any question regarding the eCS (OS/2) port of qBittorrent you can meet me (_diver) on IRC:
|
||||
|
14
configure
vendored
14
configure
vendored
@@ -325,7 +325,7 @@ cat >$1/modules.cpp <<EOT
|
||||
#line 1 "qt4.qcm"
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: Qt >= 4.6
|
||||
name: Qt >= 4.5
|
||||
arg: enable-debug, Enable debug mode
|
||||
arg: disable-gui, Disable qBittorrent Graphical user interface for headless running
|
||||
-----END QCMOD-----
|
||||
@@ -334,8 +334,8 @@ class qc_qt4 : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_qt4(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "Qt >= 4.6"; }
|
||||
QString shortname() const { return "Qt 4.6"; }
|
||||
QString name() const { return "Qt >= 4.5"; }
|
||||
QString shortname() const { return "Qt 4.5"; }
|
||||
bool exec()
|
||||
{
|
||||
// NOX mode
|
||||
@@ -356,7 +356,7 @@ public:
|
||||
#else
|
||||
conf->addExtra("MANPREFIX = \$\$PREFIX/share");
|
||||
#endif
|
||||
return(QT_VERSION >= 0x040600);
|
||||
return(QT_VERSION >= 0x040500);
|
||||
}
|
||||
};
|
||||
#line 1 "qt-dbus.qcm"
|
||||
@@ -419,11 +419,11 @@ class qc_libtorrent_rasterbar : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "libtorrent-rasterbar >= 0.15.0"; }
|
||||
QString name() const { return "libtorrent-rasterbar >= 0.14.4"; }
|
||||
QString shortname() const { return "libtorrent-rasterbar"; }
|
||||
bool exec(){
|
||||
QStringList incs;
|
||||
QString req_ver = "0.15.0";
|
||||
QString req_ver = "0.14.4";
|
||||
QString version, libs, other;
|
||||
VersionMode mode = VersionMin;
|
||||
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
|
||||
@@ -507,7 +507,7 @@ public:
|
||||
#if LIBTORRENT_VERSION_MAJOR == 0 && LIBTORRENT_VERSION_MINOR < 16
|
||||
required_libs << "filesystem" ;
|
||||
#endif
|
||||
//required_libs << "thread";
|
||||
required_libs << "thread";
|
||||
QStringList libDirs;
|
||||
if (!s.isEmpty())
|
||||
libDirs << s;
|
||||
|
131
install.os2
131
install.os2
@@ -11,7 +11,7 @@ QBittorrent installation
|
||||
|
||||
3. INSTALLATION
|
||||
|
||||
4. BUGREPORTS
|
||||
4. CONTACT
|
||||
|
||||
5. CREDITS
|
||||
|
||||
@@ -29,70 +29,17 @@ Welcome to QBittorrent port for OS/2 and eComStation.
|
||||
2. REQUIREMENTS
|
||||
===============
|
||||
|
||||
The following requirements can be installed either by rpm or by zip files.
|
||||
* klibc 0.6.3 or later
|
||||
|
||||
RPM Installation:
|
||||
ftp://ftp.netlabs.org/pub/gcc/libc-0_6_3-csd3.wpi
|
||||
|
||||
klibc
|
||||
-----
|
||||
* openssl 1.0
|
||||
|
||||
ftp://ftp.netlabs.org/pub/unixos2/ssl10.zip
|
||||
|
||||
1. yum install libc
|
||||
* Qt4 dll
|
||||
|
||||
openssl 1.0
|
||||
-----------
|
||||
|
||||
1. yum install openssl
|
||||
|
||||
pthread
|
||||
-------
|
||||
|
||||
1. yum install pthread
|
||||
|
||||
GCC4Core
|
||||
--------
|
||||
|
||||
1. yum install libgcc
|
||||
2. yum install gcc-stack-protector
|
||||
3. yum install gcc-stdc++-shared-library
|
||||
4. yum install gcc-supc++-shared-library
|
||||
|
||||
Qt4 dll
|
||||
-------
|
||||
|
||||
1. yum install libqt4
|
||||
|
||||
|
||||
ZIP Installation:
|
||||
|
||||
klibc
|
||||
-----
|
||||
|
||||
1. Download klibc 0.6.5 or better (see http://svn.netlabs.org/libc for more information)
|
||||
2. Install the files to your libpath eg x:\ecs\dll
|
||||
|
||||
openssl 1.0
|
||||
-----------
|
||||
|
||||
1. Download the zip file from http://rpm.netlabs.org/release/00/zip
|
||||
2. Install the files to your libpath eg. x:\ecs\dll
|
||||
|
||||
pthread
|
||||
-------
|
||||
|
||||
1. Download pthread 2012-03-13 or better from http://rpm.netlabs.org/release/00/zip
|
||||
2. Install the files to your libpath eg. x:\ecs\dll
|
||||
|
||||
GCC4Core
|
||||
--------
|
||||
|
||||
1. Download GCC4Core 1.2.1 or better from http://ftp.netlabs.org/pub/gcc
|
||||
2. Install the files to your libpath eg. x:\ecs\dll
|
||||
|
||||
Qt4 dll
|
||||
-------
|
||||
|
||||
1. Download Qt4 4.7.3 or better (see http://svn.netlabs.org/qt4 for more information)
|
||||
2. Install the files according to the readme
|
||||
see http://svn.netlabs.org/qt4 for more information whats needed and where to get the latest
|
||||
|
||||
|
||||
3. INSTALLATION
|
||||
@@ -100,6 +47,30 @@ Qt4 dll
|
||||
|
||||
To install QBittorrent, do the following:
|
||||
|
||||
klibc
|
||||
-----
|
||||
|
||||
1. Download klibc 0.6.3 csd3 or later.
|
||||
2. Install the package by double-clicking on the WPI file.
|
||||
|
||||
|
||||
openssl 1.0
|
||||
-----------
|
||||
|
||||
1. Download the zip file
|
||||
2. Install the files to your libpath eg. x:\ecs\dll
|
||||
|
||||
Qt4 dll
|
||||
-------
|
||||
|
||||
1. Download the package
|
||||
2. Install the package by double-clicking on the wpi file.
|
||||
|
||||
|
||||
|
||||
QBittorrent
|
||||
-----------
|
||||
|
||||
1. Create a directory for QBittorrent.
|
||||
2. Extract the QBittorrent package to the new directory.
|
||||
3. Create a WPS object for QBittorrent.exe.
|
||||
@@ -107,13 +78,18 @@ To install QBittorrent, do the following:
|
||||
5. Happy torrenting
|
||||
|
||||
|
||||
4. BUGREPORTS
|
||||
=============
|
||||
|
||||
Please create bugreports at http://svn.netlabs.org/qtapps
|
||||
4. CONTACT
|
||||
==========
|
||||
|
||||
Please send bugreports to:
|
||||
|
||||
ecs@aroa.ch
|
||||
|
||||
Only bug reports with a reproducable bug are accepted. :-)
|
||||
|
||||
|
||||
|
||||
5. CREDITS
|
||||
==========
|
||||
|
||||
@@ -146,33 +122,6 @@ development, you can do so in one of the following ways:
|
||||
7. HISTORY
|
||||
==========
|
||||
|
||||
2012-09-19
|
||||
|
||||
* updated to 3.0.4 code level of QBittorrent
|
||||
* updated libtorrent to 0.16.3 level
|
||||
|
||||
2012-09-06
|
||||
|
||||
* updated to 3.0.2 code level of QBittorrent
|
||||
|
||||
2012-05-14
|
||||
|
||||
* updated to 2.9.8 code level of QBittorrent
|
||||
|
||||
2012-03-15
|
||||
|
||||
* updated to 2.9.5 code level of QBittorrent
|
||||
|
||||
2011-09-26
|
||||
|
||||
* updated to 2.8.5 code level of QBittorrent
|
||||
* updated to Qt 4.7.3
|
||||
|
||||
2011-06-20
|
||||
|
||||
* updated to 2.7.3 code level of QBittorrent
|
||||
* updated libtorrent to 0.15.6 level
|
||||
|
||||
2010-12-23
|
||||
|
||||
* updated to 2.5.2 code level of QBittorrent
|
||||
|
47
macxconf.pri
47
macxconf.pri
@@ -5,7 +5,6 @@ DATADIR = /usr/local/share
|
||||
# Use pkg-config to get all necessary libtorrent DEFINES
|
||||
CONFIG += link_pkgconfig
|
||||
PKGCONFIG += libtorrent-rasterbar
|
||||
DEFINES += BOOST_ASIO_DYN_LINK
|
||||
|
||||
# Special include/libs paths (macports)
|
||||
INCLUDEPATH += /usr/include/openssl /usr/include /opt/local/include/boost /opt/local/include
|
||||
@@ -16,52 +15,16 @@ LIBS += -lssl -lcrypto
|
||||
# Boost system lib
|
||||
LIBS += -lboost_system-mt
|
||||
# Boost filesystem lib (Not needed for libtorrent >= 0.16.0)
|
||||
#LIBS += -lboost_filesystem-mt
|
||||
LIBS += -lboost_filesystem-mt
|
||||
# Carbon
|
||||
LIBS += -framework Carbon -framework IOKit
|
||||
# Zlib
|
||||
LIBS += -lz
|
||||
|
||||
document_icon.path = Contents/Resources
|
||||
document_icon.files = mac/qBitTorrentDocument.icns
|
||||
document_icon.files = Icons/qBitTorrentDocument.icns
|
||||
|
||||
QMAKE_BUNDLE_DATA += document_icon
|
||||
|
||||
qt_conf.path = Contents/Resources
|
||||
qt_conf.files = mac/qt.conf
|
||||
QMAKE_BUNDLE_DATA += qt_conf
|
||||
|
||||
qt_translations.path = Contents/MacOS/translations
|
||||
qt_translations.files = qt-translations/qt_ar.qm \
|
||||
qt-translations/qt_bg.qm \
|
||||
qt-translations/qt_ca.qm \
|
||||
qt-translations/qt_cs.qm \
|
||||
qt-translations/qt_da.qm \
|
||||
qt-translations/qt_de.qm \
|
||||
qt-translations/qt_es.qm \
|
||||
qt-translations/qt_fi.qm \
|
||||
qt-translations/qt_fr.qm \
|
||||
qt-translations/qt_gl.qm \
|
||||
qt-translations/qt_he.qm \
|
||||
qt-translations/qt_hu.qm \
|
||||
qt-translations/qt_it.qm \
|
||||
qt-translations/qt_ja.qm \
|
||||
qt-translations/qt_ko.qm \
|
||||
qt-translations/qt_lt.qm \
|
||||
qt-translations/qt_nl.qm \
|
||||
qt-translations/qt_pl.qm \
|
||||
qt-translations/qt_pt.qm \
|
||||
qt-translations/qt_pt_BR.qm \
|
||||
qt-translations/qt_ru.qm \
|
||||
qt-translations/qt_sk.qm \
|
||||
qt-translations/qt_sv.qm \
|
||||
qt-translations/qt_tr.qm \
|
||||
qt-translations/qt_uk.qm \
|
||||
qt-translations/qt_zh_CN.qm \
|
||||
qt-translations/qt_zh_TW.qm
|
||||
QMAKE_BUNDLE_DATA += qt_translations
|
||||
|
||||
ICON = mac/qbittorrent_mac.icns
|
||||
QMAKE_INFO_PLIST = mac/Info.plist
|
||||
ICON = Icons/qbittorrent_mac.icns
|
||||
QMAKE_INFO_PLIST = Info.plist
|
||||
|
||||
DEFINES += WITH_GEOIP_EMBEDDED
|
||||
message("On Mac OS X, GeoIP database must be embedded.")
|
||||
|
@@ -7,13 +7,12 @@ LIBS += -ltorrent-rasterbar \
|
||||
-lboost_thread \
|
||||
-lboost_system \
|
||||
-lboost_filesystem \
|
||||
-lssl -lcrypto -lidn -lpthread -lz
|
||||
-lssl -lcrypto -lidn -lpthread
|
||||
|
||||
RC_FILE = qbittorrent_os2.rc
|
||||
|
||||
# LIBTORRENT DEFINES
|
||||
DEFINES += WITH_SHIPPED_GEOIP_H
|
||||
DEFINES += BOOST_ASIO_DYN_LINK
|
||||
|
||||
DEFINES += WITH_GEOIP_EMBEDDED
|
||||
message("On eCS(OS/2), GeoIP database must be embedded.")
|
||||
|
@@ -11,8 +11,6 @@ dist.commands += rm -fR ../$${PROJECT_NAME}-$${PROJECT_VERSION}/.git &&
|
||||
dist.commands += rm -f ../$${PROJECT_NAME}-$${PROJECT_VERSION}/.gitignore &&
|
||||
dist.commands += cd .. &&
|
||||
dist.commands += tar czf $${PROJECT_NAME}-$${PROJECT_VERSION}.tar.gz $${PROJECT_NAME}-$${PROJECT_VERSION} &&
|
||||
dist.commands += tar cf $${PROJECT_NAME}-$${PROJECT_VERSION}.tar $${PROJECT_NAME}-$${PROJECT_VERSION} &&
|
||||
dist.commands += xz -f $${PROJECT_NAME}-$${PROJECT_VERSION}.tar &&
|
||||
dist.commands += rm -fR $${PROJECT_NAME}-$${PROJECT_VERSION}
|
||||
|
||||
QMAKE_EXTRA_TARGETS += dist
|
||||
|
@@ -71,7 +71,7 @@ public:
|
||||
#if LIBTORRENT_VERSION_MAJOR == 0 && LIBTORRENT_VERSION_MINOR < 16
|
||||
required_libs << "filesystem" ;
|
||||
#endif
|
||||
//required_libs << "thread";
|
||||
required_libs << "thread";
|
||||
QStringList libDirs;
|
||||
if (!s.isEmpty())
|
||||
libDirs << s;
|
||||
|
@@ -8,11 +8,11 @@ class qc_libtorrent_rasterbar : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "libtorrent-rasterbar >= 0.15.0"; }
|
||||
QString name() const { return "libtorrent-rasterbar >= 0.14.4"; }
|
||||
QString shortname() const { return "libtorrent-rasterbar"; }
|
||||
bool exec(){
|
||||
QStringList incs;
|
||||
QString req_ver = "0.15.0";
|
||||
QString req_ver = "0.14.4";
|
||||
QString version, libs, other;
|
||||
VersionMode mode = VersionMin;
|
||||
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: Qt >= 4.6
|
||||
name: Qt >= 4.5
|
||||
arg: enable-debug, Enable debug mode
|
||||
arg: disable-gui, Disable qBittorrent Graphical user interface for headless running
|
||||
-----END QCMOD-----
|
||||
@@ -9,8 +9,8 @@ class qc_qt4 : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_qt4(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "Qt >= 4.6"; }
|
||||
QString shortname() const { return "Qt 4.6"; }
|
||||
QString name() const { return "Qt >= 4.5"; }
|
||||
QString shortname() const { return "Qt 4.5"; }
|
||||
bool exec()
|
||||
{
|
||||
// NOX mode
|
||||
@@ -31,6 +31,6 @@ public:
|
||||
#else
|
||||
conf->addExtra("MANPREFIX = $$PREFIX/share");
|
||||
#endif
|
||||
return(QT_VERSION >= 0x040600);
|
||||
return(QT_VERSION >= 0x040500);
|
||||
}
|
||||
};
|
||||
|
@@ -13,6 +13,10 @@
|
||||
<string>qBitTorrentDocument</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>BitTorrent Document</string>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/x-bittorrent</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
@@ -36,55 +40,21 @@
|
||||
<string>BitTorrent Magnet URL</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleName</key>
|
||||
<string>qBittorrent</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>qbittorrent_mac.icns</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.0.11</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>2.9.6</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>qBit</string>
|
||||
<string>????</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>qbittorrent</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.qbittorrent</string>
|
||||
<key>NSAppleScriptEnabled</key>
|
||||
<string>YES</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2006-2013 The qBittorrent project</string>
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
<string>public.item</string>
|
||||
<string>com.bittorrent.torrent</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>BitTorrent Document</string>
|
||||
<key>UTTypeIconFile</key>
|
||||
<string>qBitTorrentDocument</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.bittorrent.torrent</string>
|
||||
<key>UTTypeReferenceURL</key>
|
||||
<string>http://www.bittorrent.org/beps/bep_0000.html</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>com.apple.ostype</key>
|
||||
<string>TORR</string>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>torrent</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/x-bittorrent</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
<key>NOTE</key>
|
||||
<string>This file was generated by Qt/QMake.</string>
|
||||
</dict>
|
||||
</plist>
|
312
src/about.ui
312
src/about.ui
File diff suppressed because one or more lines are too long
@@ -45,13 +45,13 @@ class about : public QDialog, private Ui::AboutDlg{
|
||||
qDebug("Deleting about dlg");
|
||||
}
|
||||
|
||||
about(QWidget *parent): QDialog(parent) {
|
||||
about(QWidget *parent): QDialog(parent){
|
||||
setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
// Set icons
|
||||
logo->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/qbittorrent22.png")));
|
||||
//Title
|
||||
lb_name->setText(QString::fromUtf8("<b><h1>qBittorrent")+QString::fromUtf8(" "VERSION"</h1></b>"));
|
||||
lb_name->setText(QString::fromUtf8("<b><h1>")+tr("qBittorrent")+QString::fromUtf8(" "VERSION"</h1></b>"));
|
||||
// Thanks
|
||||
QString thanks_txt;
|
||||
thanks_txt += QString::fromUtf8("<p>I would first like to thank sourceforge.net for hosting qBittorrent project and for their support.</p>");
|
||||
@@ -80,9 +80,8 @@ class about : public QDialog, private Ui::AboutDlg{
|
||||
<li><u>Georgian:</u> Beqa Arabuli (arabulibeqa@yahoo.com)</li>\
|
||||
<li><u>German:</u> Niels Hoffmann (zentralmaschine@users.sourceforge.net)</li>\
|
||||
<li><u>Greek:</u> Tsvetan Bankov (emerge_life@users.sourceforge.net)</li>\
|
||||
<li><u>Hebrew:</u> David Deutsch (d.deffo@gmail.com)</li>\
|
||||
<li><u>Hungarian:</u> Majoros Péter (majoros.peterj@gmail.com)</li>\
|
||||
<li><u>Italian:</u> bovirus (bovirus@live.it) and Matteo Sechi (bu17714@gmail.com)</li>\
|
||||
<li><u>Italian:</u> Matteo Sechi (bu17714@gmail.com)</li>\
|
||||
<li><u>Japanese:</u> Masato Hashimoto (cabezon.hashimoto@gmail.com)</li>\
|
||||
<li><u>Korean:</u> Jin Woo Sin (jin828sin@users.sourceforge.net)</li>\
|
||||
<li><u>Lithuanian:</u> Naglis Jonaitis (njonaitis@gmail.com)</li>\
|
||||
@@ -93,16 +92,16 @@ class about : public QDialog, private Ui::AboutDlg{
|
||||
<li><u>Russian:</u> Nick Khazov (m2k3d0n@users.sourceforge.net) and Alexey Morsov (samurai@ricom.ru)</li>\
|
||||
<li><u>Serbian:</u> Anaximandar Milet (anaximandar@operamail.com)</li>\
|
||||
<li><u>Slovak:</u> helix84</li>\
|
||||
<li><u>Spanish:</u> Alfredo Monclús (alfrix), Francisco Luque Contreras (frannoe@ya.com)</li>\
|
||||
<li><u>Spanish:</u> Francisco Luque Contreras (frannoe@ya.com)</li>\
|
||||
<li><u>Swedish:</u> Daniel Nylander (po@danielnylander.se)</li>\
|
||||
<li><u>Turkish:</u> Hasan YILMAZ (iletisim@hedefturkce.com) and Erdem Bingöl (erdem84@gmail.com)</li>\
|
||||
<li><u>Ukrainian:</u> Oleh Prypin (blaxpirit@gmail.com)</li></ul>");
|
||||
<li><u>Ukrainian:</u> Andrey Shpachenko (masterfix@users.sourceforge.net) and Oleh Prypin (blaxpirit@gmail.com)</li></ul>");
|
||||
trans_txt += "<p>"+tr("Please contact me if you would like to translate qBittorrent into your own language.")+"</p>";
|
||||
te_translation->setHtml(trans_txt);
|
||||
// License
|
||||
te_license->append(QString::fromUtf8("<a name='top'></a>"));
|
||||
QFile licensefile(":/gpl.html");
|
||||
if (licensefile.open(QIODevice::ReadOnly|QIODevice::Text)) {
|
||||
if(licensefile.open(QIODevice::ReadOnly|QIODevice::Text)) {
|
||||
te_license->setHtml(licensefile.readAll());
|
||||
licensefile.close();
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -59,7 +59,7 @@ class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg {
|
||||
|
||||
static bool askForDeletionConfirmation(bool *delete_local_files) {
|
||||
DeletionConfirmationDlg dlg;
|
||||
if (dlg.exec() == QDialog::Accepted) {
|
||||
if(dlg.exec() == QDialog::Accepted) {
|
||||
*delete_local_files = dlg.shouldDeleteLocalFiles();
|
||||
return true;
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ DNSUpdater::DNSUpdater(QObject *parent) :
|
||||
m_ipCheckTimer.start();
|
||||
|
||||
// Check lastUpdate to avoid flooding
|
||||
if (!m_lastIPCheckTime.isValid() ||
|
||||
if(!m_lastIPCheckTime.isValid() ||
|
||||
m_lastIPCheckTime.secsTo(QDateTime::currentDateTime())*1000 > IP_CHECK_INTERVAL_MS) {
|
||||
checkPublicIP();
|
||||
}
|
||||
@@ -79,19 +79,19 @@ void DNSUpdater::checkPublicIP()
|
||||
void DNSUpdater::ipRequestFinished(QNetworkReply *reply)
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if (reply->error()) {
|
||||
if(reply->error()) {
|
||||
// Error
|
||||
qWarning() << Q_FUNC_INFO << "Error:" << reply->errorString();
|
||||
} else {
|
||||
// Parse response
|
||||
QRegExp ipregex("Current IP Address:\\s+([^<]+)</body>");
|
||||
QString ret = reply->readAll();
|
||||
if (ipregex.indexIn(ret) >= 0) {
|
||||
if(ipregex.indexIn(ret) >= 0) {
|
||||
QString ip_str = ipregex.cap(1);
|
||||
qDebug() << Q_FUNC_INFO << "Regular expression captured the following IP:" << ip_str;
|
||||
QHostAddress new_ip(ip_str);
|
||||
if (!new_ip.isNull()) {
|
||||
if (m_lastIP != new_ip) {
|
||||
if(!new_ip.isNull()) {
|
||||
if(m_lastIP != new_ip) {
|
||||
qDebug() << Q_FUNC_INFO << "The IP address changed, report the change to DynDNS...";
|
||||
qDebug() << m_lastIP.toString() << "->" << new_ip.toString();
|
||||
m_lastIP = new_ip;
|
||||
@@ -157,7 +157,7 @@ QUrl DNSUpdater::getUpdateUrl() const
|
||||
|
||||
void DNSUpdater::ipUpdateFinished(QNetworkReply *reply)
|
||||
{
|
||||
if (reply->error()) {
|
||||
if(reply->error()) {
|
||||
// Error
|
||||
qWarning() << Q_FUNC_INFO << "Error:" << reply->errorString();
|
||||
} else {
|
||||
@@ -174,11 +174,11 @@ void DNSUpdater::processIPUpdateReply(const QString &reply)
|
||||
qDebug() << Q_FUNC_INFO << reply;
|
||||
QString code = reply.split(" ").first();
|
||||
qDebug() << Q_FUNC_INFO << "Code:" << code;
|
||||
if (code == "good" || code == "nochg") {
|
||||
QBtSession::instance()->addConsoleMessage(tr("Your dynamic DNS was successfully updated."), "green");
|
||||
if(code == "good" || code == "nochg") {
|
||||
QBtSession::instance()->addConsoleMessage(tr("Your dynamic DNS was successfuly updated."), "green");
|
||||
return;
|
||||
}
|
||||
if (code == "911" || code == "dnserr") {
|
||||
if(code == "911" || code == "dnserr") {
|
||||
QBtSession::instance()->addConsoleMessage(tr("Dynamic DNS error: The service is temporarily unavailable, it will be retried in 30 minutes."),
|
||||
"red");
|
||||
m_lastIP.clear();
|
||||
@@ -188,30 +188,30 @@ void DNSUpdater::processIPUpdateReply(const QString &reply)
|
||||
// Everything bellow is an error, stop updating until the user updates something
|
||||
m_ipCheckTimer.stop();
|
||||
m_lastIP.clear();
|
||||
if (code == "nohost") {
|
||||
if(code == "nohost") {
|
||||
QBtSession::instance()->addConsoleMessage(tr("Dynamic DNS error: hostname supplied does not exist under specified account."),
|
||||
"red");
|
||||
m_state = INVALID_CREDS;
|
||||
return;
|
||||
}
|
||||
if (code == "badauth") {
|
||||
if(code == "badauth") {
|
||||
QBtSession::instance()->addConsoleMessage(tr("Dynamic DNS error: Invalid username/password."), "red");
|
||||
m_state = INVALID_CREDS;
|
||||
return;
|
||||
}
|
||||
if (code == "badagent") {
|
||||
if(code == "badagent") {
|
||||
QBtSession::instance()->addConsoleMessage(tr("Dynamic DNS error: qBittorrent was blacklisted by the service, please report a bug at http://bugs.qbittorrent.org."),
|
||||
"red");
|
||||
m_state = FATAL;
|
||||
return;
|
||||
}
|
||||
if (code == "!donator") {
|
||||
if(code == "!donator") {
|
||||
QBtSession::instance()->addConsoleMessage(tr("Dynamic DNS error: %1 was returned by the service, please report a bug at http://bugs.qbittorrent.org.").arg("!donator"),
|
||||
"red");
|
||||
m_state = FATAL;
|
||||
return;
|
||||
}
|
||||
if (code == "abuse") {
|
||||
if(code == "abuse") {
|
||||
QBtSession::instance()->addConsoleMessage(tr("Dynamic DNS error: Your username was blocked due to abuse."),
|
||||
"red");
|
||||
m_state = FATAL;
|
||||
@@ -221,18 +221,18 @@ void DNSUpdater::processIPUpdateReply(const QString &reply)
|
||||
|
||||
void DNSUpdater::updateCredentials()
|
||||
{
|
||||
if (m_state == FATAL) return;
|
||||
if(m_state == FATAL) return;
|
||||
Preferences pref;
|
||||
bool change = false;
|
||||
// Get DNS service information
|
||||
if (m_service != pref.getDynDNSService()) {
|
||||
if(m_service != pref.getDynDNSService()) {
|
||||
m_service = pref.getDynDNSService();
|
||||
change = true;
|
||||
}
|
||||
if (m_domain != pref.getDynDomainName()) {
|
||||
if(m_domain != pref.getDynDomainName()) {
|
||||
m_domain = pref.getDynDomainName();
|
||||
QRegExp domain_regex("^(?:(?!\\d|-)[a-zA-Z0-9\\-]{1,63}\\.)+[a-zA-Z]{2,}$");
|
||||
if (domain_regex.indexIn(m_domain) < 0) {
|
||||
if(domain_regex.indexIn(m_domain) < 0) {
|
||||
QBtSession::instance()->addConsoleMessage(tr("Dynamic DNS error: supplied domain name is invalid."),
|
||||
"red");
|
||||
m_lastIP.clear();
|
||||
@@ -242,9 +242,9 @@ void DNSUpdater::updateCredentials()
|
||||
}
|
||||
change = true;
|
||||
}
|
||||
if (m_username != pref.getDynDNSUsername()) {
|
||||
if(m_username != pref.getDynDNSUsername()) {
|
||||
m_username = pref.getDynDNSUsername();
|
||||
if (m_username.length() < 4) {
|
||||
if(m_username.length() < 4) {
|
||||
QBtSession::instance()->addConsoleMessage(tr("Dynamic DNS error: supplied username is too short."),
|
||||
"red");
|
||||
m_lastIP.clear();
|
||||
@@ -254,9 +254,9 @@ void DNSUpdater::updateCredentials()
|
||||
}
|
||||
change = true;
|
||||
}
|
||||
if (m_password != pref.getDynDNSPassword()) {
|
||||
if(m_password != pref.getDynDNSPassword()) {
|
||||
m_password = pref.getDynDNSPassword();
|
||||
if (m_password.length() < 4) {
|
||||
if(m_password.length() < 4) {
|
||||
QBtSession::instance()->addConsoleMessage(tr("Dynamic DNS error: supplied password is too short."),
|
||||
"red");
|
||||
m_lastIP.clear();
|
||||
@@ -267,7 +267,7 @@ void DNSUpdater::updateCredentials()
|
||||
change = true;
|
||||
}
|
||||
|
||||
if (m_state == INVALID_CREDS && change) {
|
||||
if(m_state == INVALID_CREDS && change) {
|
||||
m_state = OK; // Try again
|
||||
m_ipCheckTimer.start();
|
||||
checkPublicIP();
|
||||
|
@@ -43,38 +43,38 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
downloadFromURL(QWidget *parent): QDialog(parent) {
|
||||
downloadFromURL(QWidget *parent): QDialog(parent){
|
||||
setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
setModal(true);
|
||||
show();
|
||||
// Paste clipboard if there is an URL in it
|
||||
QString clip_txt = qApp->clipboard()->text();
|
||||
if (clip_txt.startsWith("http://", Qt::CaseInsensitive) || clip_txt.startsWith("https://", Qt::CaseInsensitive) || clip_txt.startsWith("ftp://", Qt::CaseInsensitive) || clip_txt.startsWith("magnet:", Qt::CaseInsensitive) || clip_txt.startsWith("bc://bt/", Qt::CaseInsensitive)) {
|
||||
if(clip_txt.startsWith("http://", Qt::CaseInsensitive) || clip_txt.startsWith("https://", Qt::CaseInsensitive) || clip_txt.startsWith("ftp://", Qt::CaseInsensitive) || clip_txt.startsWith("magnet:", Qt::CaseInsensitive) || clip_txt.startsWith("bc://bt/", Qt::CaseInsensitive)) {
|
||||
textUrls->setText(clip_txt);
|
||||
}
|
||||
}
|
||||
|
||||
~downloadFromURL() {}
|
||||
~downloadFromURL(){}
|
||||
|
||||
signals:
|
||||
void urlsReadyToBeDownloaded(const QStringList& torrent_urls);
|
||||
|
||||
public slots:
|
||||
void on_downloadButton_clicked() {
|
||||
void on_downloadButton_clicked(){
|
||||
QString urls = textUrls->toPlainText();
|
||||
QStringList url_list = urls.split(QString::fromUtf8("\n"));
|
||||
QString url;
|
||||
QStringList url_list_cleaned;
|
||||
foreach (url, url_list) {
|
||||
foreach(url, url_list){
|
||||
url = url.trimmed();
|
||||
if (!url.isEmpty()) {
|
||||
if (url_list_cleaned.indexOf(QRegExp(url, Qt::CaseInsensitive, QRegExp::FixedString)) < 0) {
|
||||
if(!url.isEmpty()){
|
||||
if(url_list_cleaned.indexOf(QRegExp(url, Qt::CaseInsensitive, QRegExp::FixedString)) < 0){
|
||||
url_list_cleaned << url;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!url_list_cleaned.size()) {
|
||||
if(!url_list_cleaned.size()){
|
||||
QMessageBox::critical(0, tr("No URL entered"), tr("Please type at least one URL."));
|
||||
return;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL{
|
||||
close();
|
||||
}
|
||||
|
||||
void on_cancelButton_clicked() {
|
||||
void on_cancelButton_clicked(){
|
||||
close();
|
||||
}
|
||||
};
|
||||
|
@@ -14,14 +14,31 @@
|
||||
<string>Download from urls</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="downloadURL_lbl">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<italic>false</italic>
|
||||
<bold>true</bold>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -48,7 +65,13 @@
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<pointsize>9</pointsize>
|
||||
<weight>50</weight>
|
||||
<italic>true</italic>
|
||||
<bold>false</bold>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -58,6 +81,12 @@
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkRequest>
|
||||
#include <QNetworkProxy>
|
||||
#include <QNetworkCookie>
|
||||
#include <QNetworkCookieJar>
|
||||
|
||||
#include "downloadthread.h"
|
||||
@@ -50,61 +51,11 @@ DownloadThread::DownloadThread(QObject* parent) : QObject(parent) {
|
||||
#endif
|
||||
}
|
||||
|
||||
QByteArray DownloadThread::gUncompress(Bytef *inData, size_t len) {
|
||||
if (len <= 4) {
|
||||
qWarning("gUncompress: Input data is truncated");
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QByteArray result;
|
||||
z_stream strm;
|
||||
static const int CHUNK_SIZE = 1024;
|
||||
char out[CHUNK_SIZE];
|
||||
|
||||
/* allocate inflate state */
|
||||
strm.zalloc = Z_NULL;
|
||||
strm.zfree = Z_NULL;
|
||||
strm.opaque = Z_NULL;
|
||||
strm.avail_in = len;
|
||||
strm.next_in = inData;
|
||||
|
||||
const int windowBits = 15;
|
||||
const int ENABLE_ZLIB_GZIP = 32;
|
||||
|
||||
int ret = inflateInit2(&strm, windowBits|ENABLE_ZLIB_GZIP); // gzip decoding
|
||||
if (ret != Z_OK)
|
||||
return QByteArray();
|
||||
|
||||
// run inflate()
|
||||
do {
|
||||
strm.avail_out = CHUNK_SIZE;
|
||||
strm.next_out = reinterpret_cast<unsigned char*>(out);
|
||||
|
||||
ret = inflate(&strm, Z_NO_FLUSH);
|
||||
Q_ASSERT(ret != Z_STREAM_ERROR); // state not clobbered
|
||||
|
||||
switch (ret) {
|
||||
case Z_NEED_DICT:
|
||||
case Z_DATA_ERROR:
|
||||
case Z_MEM_ERROR:
|
||||
(void) inflateEnd(&strm);
|
||||
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
result.append(out, CHUNK_SIZE - strm.avail_out);
|
||||
} while (!strm.avail_out);
|
||||
|
||||
// clean up and return
|
||||
inflateEnd(&strm);
|
||||
return result;
|
||||
}
|
||||
|
||||
void DownloadThread::processDlFinished(QNetworkReply* reply) {
|
||||
QString url = reply->url().toString();
|
||||
qDebug("Download finished: %s", qPrintable(url));
|
||||
// Check if the request was successful
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
if(reply->error() != QNetworkReply::NoError) {
|
||||
// Failure
|
||||
qDebug("Download failure (%s), reason: %s", qPrintable(url), qPrintable(errorCodeToString(reply->error())));
|
||||
emit downloadFailure(url, errorCodeToString(reply->error()));
|
||||
@@ -113,7 +64,7 @@ void DownloadThread::processDlFinished(QNetworkReply* reply) {
|
||||
}
|
||||
// Check if the server ask us to redirect somewhere lese
|
||||
const QVariant redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
|
||||
if (redirection.isValid()) {
|
||||
if(redirection.isValid()) {
|
||||
// We should redirect
|
||||
QUrl newUrl = redirection.toUrl();
|
||||
// Resolve relative urls
|
||||
@@ -122,13 +73,12 @@ void DownloadThread::processDlFinished(QNetworkReply* reply) {
|
||||
const QString newUrlString = newUrl.toString();
|
||||
qDebug("Redirecting from %s to %s", qPrintable(url), qPrintable(newUrlString));
|
||||
m_redirectMapping.insert(newUrlString, url);
|
||||
// redirecting with first cookies
|
||||
downloadUrl(newUrlString, m_networkManager.cookieJar()->cookiesForUrl(url));
|
||||
downloadUrl(newUrlString);
|
||||
reply->deleteLater();
|
||||
return;
|
||||
}
|
||||
// Checking if it was redirected, restoring initial URL
|
||||
if (m_redirectMapping.contains(url)) {
|
||||
if(m_redirectMapping.contains(url)) {
|
||||
url = m_redirectMapping.take(url);
|
||||
}
|
||||
// Success
|
||||
@@ -137,13 +87,9 @@ void DownloadThread::processDlFinished(QNetworkReply* reply) {
|
||||
if (tmpfile->open()) {
|
||||
QString filePath = tmpfile->fileName();
|
||||
qDebug("Temporary filename is: %s", qPrintable(filePath));
|
||||
if (reply->isOpen() || reply->open(QIODevice::ReadOnly)) {
|
||||
QByteArray replyData = reply->readAll();
|
||||
if (reply->rawHeader("Content-Encoding") == "gzip") {
|
||||
// uncompress gzip reply
|
||||
replyData = gUncompress(reinterpret_cast<unsigned char*>(replyData.data()), replyData.length());
|
||||
}
|
||||
tmpfile->write(replyData);
|
||||
if(reply->isOpen() || reply->open(QIODevice::ReadOnly)) {
|
||||
// TODO: Support GZIP compression
|
||||
tmpfile->write(reply->readAll());
|
||||
tmpfile->close();
|
||||
// XXX: tmpfile needs to be deleted on Windows before using the file
|
||||
// or it will complain that the file is used by another process.
|
||||
@@ -163,21 +109,39 @@ void DownloadThread::processDlFinished(QNetworkReply* reply) {
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
void DownloadThread::downloadTorrentUrl(const QString &url, const QList<QNetworkCookie>& cookies)
|
||||
{
|
||||
#ifndef DISABLE_GUI
|
||||
void DownloadThread::loadCookies(const QString &host_name, QString url) {
|
||||
const QList<QByteArray> raw_cookies = RssSettings().getHostNameCookies(host_name);
|
||||
QNetworkCookieJar *cookie_jar = m_networkManager.cookieJar();
|
||||
QList<QNetworkCookie> cookies;
|
||||
qDebug("Loading cookies for host name: %s", qPrintable(host_name));
|
||||
foreach(const QByteArray& raw_cookie, raw_cookies) {
|
||||
QList<QByteArray> cookie_parts = raw_cookie.split('=');
|
||||
if(cookie_parts.size() == 2) {
|
||||
qDebug("Loading cookie: %s", raw_cookie.constData());
|
||||
cookies << QNetworkCookie(cookie_parts.first(), cookie_parts.last());
|
||||
}
|
||||
}
|
||||
cookie_jar->setCookiesFromUrl(cookies, url);
|
||||
m_networkManager.setCookieJar(cookie_jar);
|
||||
}
|
||||
#endif
|
||||
|
||||
void DownloadThread::downloadTorrentUrl(const QString &url) {
|
||||
// Process request
|
||||
QNetworkReply *reply = downloadUrl(url, cookies);
|
||||
QNetworkReply *reply = downloadUrl(url);
|
||||
connect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(checkDownloadSize(qint64,qint64)));
|
||||
}
|
||||
|
||||
QNetworkReply* DownloadThread::downloadUrl(const QString &url, const QList<QNetworkCookie>& cookies) {
|
||||
QNetworkReply* DownloadThread::downloadUrl(const QString &url){
|
||||
// Update proxy settings
|
||||
applyProxySettings();
|
||||
// Set cookies
|
||||
if (!cookies.empty()) {
|
||||
qDebug("Setting %d cookies for url: %s", cookies.size(), qPrintable(url));
|
||||
m_networkManager.cookieJar()->setCookiesFromUrl(cookies, url);
|
||||
}
|
||||
#ifndef DISABLE_GUI
|
||||
// Load cookies
|
||||
QString host_name = QUrl::fromEncoded(url.toUtf8()).host();
|
||||
if(!host_name.isEmpty())
|
||||
loadCookies(host_name, url);
|
||||
#endif
|
||||
// Process download request
|
||||
qDebug("url is %s", qPrintable(url));
|
||||
const QUrl qurl = QUrl::fromEncoded(url.toUtf8());
|
||||
@@ -187,21 +151,19 @@ QNetworkReply* DownloadThread::downloadUrl(const QString &url, const QList<QNetw
|
||||
request.setRawHeader("User-Agent", "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5");
|
||||
qDebug("Downloading %s...", request.url().toEncoded().data());
|
||||
qDebug("%d cookies for this URL", m_networkManager.cookieJar()->cookiesForUrl(url).size());
|
||||
for (int i=0; i<m_networkManager.cookieJar()->cookiesForUrl(url).size(); ++i) {
|
||||
for(int i=0; i<m_networkManager.cookieJar()->cookiesForUrl(url).size(); ++i) {
|
||||
qDebug("%s=%s", m_networkManager.cookieJar()->cookiesForUrl(url).at(i).name().data(), m_networkManager.cookieJar()->cookiesForUrl(url).at(i).value().data());
|
||||
qDebug("Domain: %s, Path: %s", qPrintable(m_networkManager.cookieJar()->cookiesForUrl(url).at(i).domain()), qPrintable(m_networkManager.cookieJar()->cookiesForUrl(url).at(i).path()));
|
||||
}
|
||||
// accept gzip
|
||||
request.setRawHeader("Accept-Encoding", "gzip");
|
||||
return m_networkManager.get(request);
|
||||
}
|
||||
|
||||
void DownloadThread::checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal) {
|
||||
QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender());
|
||||
if (!reply) return;
|
||||
if (bytesTotal > 0) {
|
||||
if(!reply) return;
|
||||
if(bytesTotal > 0) {
|
||||
// Total number of bytes is available
|
||||
if (bytesTotal > 1048576) {
|
||||
if(bytesTotal > 1048576) {
|
||||
// More than 1MB, this is probably not a torrent file, aborting...
|
||||
reply->abort();
|
||||
reply->deleteLater();
|
||||
@@ -209,7 +171,7 @@ void DownloadThread::checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal)
|
||||
disconnect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(checkDownloadSize(qint64,qint64)));
|
||||
}
|
||||
} else {
|
||||
if (bytesReceived > 1048576) {
|
||||
if(bytesReceived > 1048576) {
|
||||
// More than 1MB, this is probably not a torrent file, aborting...
|
||||
reply->abort();
|
||||
reply->deleteLater();
|
||||
@@ -220,13 +182,13 @@ void DownloadThread::checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal)
|
||||
void DownloadThread::applyProxySettings() {
|
||||
QNetworkProxy proxy;
|
||||
const Preferences pref;
|
||||
if (pref.isProxyEnabled()) {
|
||||
if(pref.isProxyEnabled()) {
|
||||
// Proxy enabled
|
||||
proxy.setHostName(pref.getProxyIp());
|
||||
proxy.setPort(pref.getProxyPort());
|
||||
// Default proxy type is HTTP, we must change if it is SOCKS5
|
||||
const int proxy_type = pref.getProxyType();
|
||||
if (proxy_type == Proxy::SOCKS5 || proxy_type == Proxy::SOCKS5_PW) {
|
||||
if(proxy_type == Proxy::SOCKS5 || proxy_type == Proxy::SOCKS5_PW) {
|
||||
qDebug() << Q_FUNC_INFO << "using SOCKS proxy";
|
||||
proxy.setType(QNetworkProxy::Socks5Proxy);
|
||||
} else {
|
||||
@@ -234,7 +196,7 @@ void DownloadThread::applyProxySettings() {
|
||||
proxy.setType(QNetworkProxy::HttpProxy);
|
||||
}
|
||||
// Authentication?
|
||||
if (pref.isProxyAuthEnabled()) {
|
||||
if(pref.isProxyAuthEnabled()) {
|
||||
qDebug("Proxy requires authentication, authenticating");
|
||||
proxy.setUser(pref.getProxyUsername());
|
||||
proxy.setPassword(pref.getProxyPassword());
|
||||
@@ -246,7 +208,7 @@ void DownloadThread::applyProxySettings() {
|
||||
}
|
||||
|
||||
QString DownloadThread::errorCodeToString(QNetworkReply::NetworkError status) {
|
||||
switch(status) {
|
||||
switch(status){
|
||||
case QNetworkReply::HostNotFoundError:
|
||||
return tr("The remote host name was not found (invalid hostname)");
|
||||
case QNetworkReply::OperationCanceledError:
|
||||
|
@@ -32,11 +32,9 @@
|
||||
#define DOWNLOADTHREAD_H
|
||||
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkCookie>
|
||||
#include <QObject>
|
||||
#include <QHash>
|
||||
#include <QSslError>
|
||||
#include <zlib.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QNetworkAccessManager;
|
||||
@@ -47,8 +45,8 @@ class DownloadThread : public QObject {
|
||||
|
||||
public:
|
||||
DownloadThread(QObject* parent = 0);
|
||||
QNetworkReply* downloadUrl(const QString &url, const QList<QNetworkCookie>& cookies = QList<QNetworkCookie>());
|
||||
void downloadTorrentUrl(const QString &url, const QList<QNetworkCookie>& cookies = QList<QNetworkCookie>());
|
||||
QNetworkReply* downloadUrl(const QString &url);
|
||||
void downloadTorrentUrl(const QString &url);
|
||||
//void setProxy(QString IP, int port, QString username, QString password);
|
||||
|
||||
signals:
|
||||
@@ -63,9 +61,11 @@ private slots:
|
||||
#endif
|
||||
|
||||
private:
|
||||
static QByteArray gUncompress(Bytef *inData, size_t len);
|
||||
QString errorCodeToString(QNetworkReply::NetworkError status);
|
||||
void applyProxySettings();
|
||||
#ifndef DISABLE_GUI
|
||||
void loadCookies(const QString &host_name, QString url);
|
||||
#endif
|
||||
|
||||
private:
|
||||
QNetworkAccessManager m_networkManager;
|
||||
|
@@ -50,10 +50,10 @@ ExecutionLog::ExecutionLog(QWidget *parent) :
|
||||
ui->tabBan->layout()->addWidget(m_banList);
|
||||
|
||||
const QStringList log_msgs = QBtSession::instance()->getConsoleMessages();
|
||||
foreach (const QString& msg, log_msgs)
|
||||
foreach(const QString& msg, log_msgs)
|
||||
addLogMessage(msg);
|
||||
const QStringList ban_msgs = QBtSession::instance()->getPeerBanMessages();
|
||||
foreach (const QString& msg, ban_msgs)
|
||||
foreach(const QString& msg, ban_msgs)
|
||||
addBanMessage(msg);
|
||||
connect(QBtSession::instance(), SIGNAL(newConsoleMessage(QString)), SLOT(addLogMessage(QString)));
|
||||
connect(QBtSession::instance(), SIGNAL(newBanMessage(QString)), SLOT(addBanMessage(QString)));
|
||||
|
@@ -37,8 +37,8 @@ QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class ExecutionLog;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
class LogListWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class ExecutionLog : public QWidget
|
||||
{
|
||||
|
@@ -21,7 +21,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "fs_utils.h"
|
||||
#include "misc.h"
|
||||
|
||||
#ifndef CIFS_MAGIC_NUMBER
|
||||
@@ -60,11 +59,11 @@ private:
|
||||
private:
|
||||
static bool isNetworkFileSystem(QString path) {
|
||||
QString file = path;
|
||||
if (!file.endsWith(QDir::separator()))
|
||||
if(!file.endsWith(QDir::separator()))
|
||||
file += QDir::separator();
|
||||
file += ".";
|
||||
struct statfs buf;
|
||||
if (!statfs(file.toLocal8Bit().constData(), &buf)) {
|
||||
if(!statfs(file.toLocal8Bit().constData(), &buf)) {
|
||||
#ifdef Q_WS_MAC
|
||||
// XXX: should we make sure HAVE_STRUCT_FSSTAT_F_FSTYPENAME is defined?
|
||||
return (strcmp(buf.f_fstypename, "nfs") == 0 || strcmp(buf.f_fstypename, "cifs") == 0 || strcmp(buf.f_fstypename, "smbfs") == 0);
|
||||
@@ -119,23 +118,23 @@ private:
|
||||
|
||||
public:
|
||||
FileSystemWatcher(QObject *parent): QFileSystemWatcher(parent) {
|
||||
m_filters << "*.torrent" << "*.magnet";
|
||||
m_filters << "*.torrent";
|
||||
connect(this, SIGNAL(directoryChanged(QString)), this, SLOT(scanLocalFolder(QString)));
|
||||
}
|
||||
|
||||
~FileSystemWatcher() {
|
||||
#ifndef Q_WS_WIN
|
||||
if (watch_timer)
|
||||
if(watch_timer)
|
||||
delete watch_timer;
|
||||
#endif
|
||||
if (m_partialTorrentTimer)
|
||||
if(m_partialTorrentTimer)
|
||||
delete m_partialTorrentTimer;
|
||||
}
|
||||
|
||||
QStringList directories() const {
|
||||
QStringList dirs;
|
||||
#ifndef Q_WS_WIN
|
||||
if (watch_timer) {
|
||||
if(watch_timer) {
|
||||
foreach (const QDir &dir, watched_folders)
|
||||
dirs << dir.canonicalPath();
|
||||
}
|
||||
@@ -150,7 +149,7 @@ public:
|
||||
if (!dir.exists())
|
||||
return;
|
||||
// Check if the path points to a network file system or not
|
||||
if (isNetworkFileSystem(path)) {
|
||||
if(isNetworkFileSystem(path)) {
|
||||
// Network mode
|
||||
qDebug("Network folder detected: %s", qPrintable(path));
|
||||
qDebug("Using file polling mode instead of inotify...");
|
||||
@@ -195,7 +194,7 @@ protected slots:
|
||||
// Local folders scan
|
||||
addTorrentsFromDir(QDir(path), torrents);
|
||||
// Report detected torrent files
|
||||
if (!torrents.empty()) {
|
||||
if(!torrents.empty()) {
|
||||
qDebug("The following files are being reported: %s", qPrintable(torrents.join("\n")));
|
||||
emit torrentsAdded(torrents);
|
||||
}
|
||||
@@ -211,7 +210,7 @@ protected slots:
|
||||
addTorrentsFromDir(dir, torrents);
|
||||
}
|
||||
// Report detected torrent files
|
||||
if (!torrents.empty()) {
|
||||
if(!torrents.empty()) {
|
||||
qDebug("The following files are being reported: %s", qPrintable(torrents.join("\n")));
|
||||
emit torrentsAdded(torrents);
|
||||
}
|
||||
@@ -222,16 +221,16 @@ protected slots:
|
||||
QStringList no_longer_partial;
|
||||
|
||||
// Check which torrents are still partial
|
||||
foreach (const QString& torrent_path, m_partialTorrents.keys()) {
|
||||
if (!QFile::exists(torrent_path)) {
|
||||
foreach(const QString& torrent_path, m_partialTorrents.keys()) {
|
||||
if(!QFile::exists(torrent_path)) {
|
||||
m_partialTorrents.remove(torrent_path);
|
||||
continue;
|
||||
}
|
||||
if (fsutils::isValidTorrentFile(torrent_path)) {
|
||||
if(misc::isValidTorrentFile(torrent_path)) {
|
||||
no_longer_partial << torrent_path;
|
||||
m_partialTorrents.remove(torrent_path);
|
||||
} else {
|
||||
if (m_partialTorrents[torrent_path] >= MAX_PARTIAL_RETRIES) {
|
||||
if(m_partialTorrents[torrent_path] >= MAX_PARTIAL_RETRIES) {
|
||||
m_partialTorrents.remove(torrent_path);
|
||||
QFile::rename(torrent_path, torrent_path+".invalid");
|
||||
} else {
|
||||
@@ -241,7 +240,7 @@ protected slots:
|
||||
}
|
||||
|
||||
// Stop the partial timer if necessary
|
||||
if (m_partialTorrents.empty()) {
|
||||
if(m_partialTorrents.empty()) {
|
||||
m_partialTorrentTimer->stop();
|
||||
m_partialTorrentTimer->deleteLater();
|
||||
qDebug("No longer any partial torrent.");
|
||||
@@ -250,7 +249,7 @@ protected slots:
|
||||
m_partialTorrentTimer->start(WATCH_INTERVAL);
|
||||
}
|
||||
// Notify of new torrents
|
||||
if (!no_longer_partial.isEmpty())
|
||||
if(!no_longer_partial.isEmpty())
|
||||
emit torrentsAdded(no_longer_partial);
|
||||
}
|
||||
|
||||
@@ -260,7 +259,7 @@ signals:
|
||||
private:
|
||||
void startPartialTorrentTimer() {
|
||||
Q_ASSERT(!m_partialTorrents.isEmpty());
|
||||
if (!m_partialTorrentTimer) {
|
||||
if(!m_partialTorrentTimer) {
|
||||
m_partialTorrentTimer = new QTimer();
|
||||
connect(m_partialTorrentTimer, SIGNAL(timeout()), SLOT(processPartialTorrents()));
|
||||
m_partialTorrentTimer->setSingleShot(true);
|
||||
@@ -270,25 +269,19 @@ private:
|
||||
|
||||
void addTorrentsFromDir(const QDir &dir, QStringList &torrents) {
|
||||
const QStringList files = dir.entryList(m_filters, QDir::Files, QDir::Unsorted);
|
||||
foreach (const QString &file, files) {
|
||||
foreach(const QString &file, files) {
|
||||
const QString file_abspath = dir.absoluteFilePath(file);
|
||||
if (file_abspath.endsWith(".magnet")) {
|
||||
QFile f(file_abspath);
|
||||
if (f.open(QIODevice::ReadOnly)
|
||||
&& !misc::magnetUriToHash(QString::fromLocal8Bit(f.readAll())).isEmpty()) {
|
||||
torrents << file_abspath;
|
||||
}
|
||||
} else if (fsutils::isValidTorrentFile(file_abspath)) {
|
||||
if(misc::isValidTorrentFile(file_abspath)) {
|
||||
torrents << file_abspath;
|
||||
} else {
|
||||
if (!m_partialTorrents.contains(file_abspath)) {
|
||||
if(!m_partialTorrents.contains(file_abspath)) {
|
||||
qDebug("Partial torrent detected at: %s", qPrintable(file_abspath));
|
||||
qDebug("Delay the file's processing...");
|
||||
m_partialTorrents.insert(file_abspath, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!m_partialTorrents.empty())
|
||||
if(!m_partialTorrents.empty())
|
||||
startPartialTorrentTimer();
|
||||
}
|
||||
|
||||
|
503
src/fs_utils.cpp
503
src/fs_utils.cpp
File diff suppressed because it is too large
Load Diff
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt4 and libtorrent.
|
||||
* Copyright (C) 2012 Christophe Dumez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
||||
* and distribute the linked executables. You must obey the GNU General Public
|
||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
#ifndef FS_UTILS_H
|
||||
#define FS_UTILS_H
|
||||
|
||||
#include <QString>
|
||||
#include <QCoreApplication>
|
||||
|
||||
/**
|
||||
* Utility functions related to file system.
|
||||
*/
|
||||
class fsutils
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(fsutils)
|
||||
|
||||
public:
|
||||
static QString toDisplayPath(const QString& path);
|
||||
static QString fileExtension(const QString& filename);
|
||||
static QString fileName(const QString& file_path);
|
||||
static qint64 computePathSize(const QString& path);
|
||||
static bool sameFiles(const QString& path1, const QString& path2);
|
||||
static QString updateLabelInSavePath(QString defaultSavePath, QString save_path, const QString& old_label, const QString& new_label);
|
||||
static QString toValidFileSystemName(QString filename);
|
||||
static bool isValidFileSystemName(const QString& filename);
|
||||
static long long freeDiskSpaceOnPath(QString path);
|
||||
static QString branchPath(const QString& file_path, QString* removed = 0);
|
||||
static bool sameFileNames(const QString& first, const QString& second);
|
||||
static QString expandPath(const QString& path);
|
||||
static bool isValidTorrentFile(const QString& path);
|
||||
static bool smartRemoveEmptyFolderTree(const QString& dir_path);
|
||||
static bool forceRemove(const QString& file_path);
|
||||
|
||||
/* Ported from Qt4 to drop dependency on QtGui */
|
||||
static QString QDesktopServicesDataLocation();
|
||||
static QString QDesktopServicesCacheLocation();
|
||||
static QString QDesktopServicesDownloadLocation();
|
||||
/* End of Qt4 code */
|
||||
static QString searchEngineLocation();
|
||||
static QString BTBackupLocation();
|
||||
static QString cacheLocation();
|
||||
|
||||
};
|
||||
|
||||
#endif // FS_UTILS_H
|
||||
|
@@ -64,20 +64,20 @@
|
||||
#include <QFile>
|
||||
#include <QChar>
|
||||
|
||||
#include "fs_utils.h"
|
||||
#include "misc.h"
|
||||
|
||||
using namespace libtorrent;
|
||||
|
||||
QString GeoIPManager::geoipFolder(bool embedded) {
|
||||
#ifdef WITH_GEOIP_EMBEDDED
|
||||
if (embedded)
|
||||
if(embedded)
|
||||
return ":/geoip/";
|
||||
return fsutils::QDesktopServicesDataLocation()+"geoip"+QDir::separator();
|
||||
return misc::QDesktopServicesDataLocation()+"geoip"+QDir::separator();
|
||||
#else
|
||||
Q_UNUSED(embedded);
|
||||
if (QFile::exists("/usr/local/share/GeoIP/GeoIP.dat"))
|
||||
if(QFile::exists("/usr/local/share/GeoIP/GeoIP.dat"))
|
||||
return "/usr/local/share/GeoIP/";
|
||||
if (QFile::exists("/var/lib/GeoIP/GeoIP.dat"))
|
||||
if(QFile::exists("/var/lib/GeoIP/GeoIP.dat"))
|
||||
return "/var/lib/GeoIP/";
|
||||
return "/usr/share/GeoIP/";
|
||||
#endif
|
||||
@@ -89,22 +89,22 @@ QString GeoIPManager::geoipDBpath(bool embedded) {
|
||||
|
||||
#ifdef WITH_GEOIP_EMBEDDED
|
||||
void GeoIPManager::exportEmbeddedDb() {
|
||||
if (!QFile::exists(geoipDBpath(false)) || QFile(geoipDBpath(false)).size() != QFile(geoipDBpath(true)).size()) { // Export is required
|
||||
if(!QFile::exists(geoipDBpath(false)) || QFile(geoipDBpath(false)).size() != QFile(geoipDBpath(true)).size()) { // Export is required
|
||||
qDebug("A local Geoip database update is required, proceeding...");
|
||||
// Create geoip folder is necessary
|
||||
QDir gfolder(geoipFolder(false));
|
||||
if (!gfolder.exists()) {
|
||||
if (!gfolder.mkpath(geoipFolder(false))) {
|
||||
if(!gfolder.exists()) {
|
||||
if(!gfolder.mkpath(geoipFolder(false))) {
|
||||
std::cerr << "Failed to create geoip folder at " << qPrintable(geoipFolder(false)) << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Remove destination files
|
||||
if (QFile::exists(geoipDBpath(false)))
|
||||
fsutils::forceRemove(geoipDBpath(false));
|
||||
if(QFile::exists(geoipDBpath(false)))
|
||||
misc::safeRemove(geoipDBpath(false));
|
||||
// Copy from executable to hard disk
|
||||
qDebug("%s -> %s", qPrintable(geoipDBpath(true)), qPrintable(geoipDBpath(false)));
|
||||
if (!QFile::copy(geoipDBpath(true), geoipDBpath(false))) {
|
||||
if(!QFile::copy(geoipDBpath(true), geoipDBpath(false))) {
|
||||
std::cerr << "ERROR: Failed to copy geoip.dat from executable to hard disk" << std::endl;
|
||||
}
|
||||
qDebug("Local Geoip database was updated");
|
||||
@@ -116,7 +116,7 @@ void GeoIPManager::loadDatabase(session *s) {
|
||||
#ifdef WITH_GEOIP_EMBEDDED
|
||||
exportEmbeddedDb();
|
||||
#endif
|
||||
if (QFile::exists(geoipDBpath(false))) {
|
||||
if(QFile::exists(geoipDBpath(false))) {
|
||||
qDebug("Loading GeoIP database from %s...", qPrintable(geoipDBpath(false)));
|
||||
s->load_country_db(geoipDBpath(false).toLocal8Bit().constData());
|
||||
} else {
|
||||
@@ -183,9 +183,9 @@ const char * country_name[253] =
|
||||
"Saint Barthelemy","Saint Martin"};
|
||||
|
||||
QString GeoIPManager::CountryISOCodeToName(const char* iso) {
|
||||
if (iso[0] == 0) return "N/A";
|
||||
for (uint i = 0; i < num_countries; ++i) {
|
||||
if (iso[0] == country_code[i][0] && iso[1] == country_code[i][1]) {
|
||||
if(iso[0] == 0) return "N/A";
|
||||
for(uint i = 0; i < num_countries; ++i) {
|
||||
if(iso[0] == country_code[i][0] && iso[1] == country_code[i][1]) {
|
||||
return QLatin1String(country_name[i]);
|
||||
}
|
||||
}
|
||||
@@ -195,7 +195,7 @@ QString GeoIPManager::CountryISOCodeToName(const char* iso) {
|
||||
|
||||
// http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm
|
||||
QIcon GeoIPManager::CountryISOCodeToIcon(const char* iso) {
|
||||
if (iso[0] == 0 || iso[0] == '!') return QIcon();
|
||||
if(iso[0] == 0 || iso[0] == '!') return QIcon();
|
||||
const QString isoStr = QString(QByteArray(iso, 2)).toLower();
|
||||
return QIcon(":/Icons/flags/"+isoStr+".png");
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user