mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 16:37:21 -06:00
Compare commits
1 Commits
release-1.
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cce2f9f69f |
@@ -41,11 +41,9 @@
|
|||||||
- FEATURE: Added an option to automatically delete torrents when they reach a given ratio (>= 1.0)
|
- FEATURE: Added an option to automatically delete torrents when they reach a given ratio (>= 1.0)
|
||||||
- FEATURE: Added an option to display current transfer speeds in title bar
|
- FEATURE: Added an option to display current transfer speeds in title bar
|
||||||
- FEATURE: Torrent content is now displayed as a tree
|
- FEATURE: Torrent content is now displayed as a tree
|
||||||
- FEATURE: Better media file preview (player detected automatically)
|
|
||||||
- I18N: Added Hungarian translation
|
- I18N: Added Hungarian translation
|
||||||
- I18N: Added Brazilian translation
|
- I18N: Added Brazilian translation
|
||||||
- BUGFIX: Progress of paused torrents is now correct on restart
|
- BUGFIX: Progress of paused torrents is now correct on restart
|
||||||
- BUGFIX: clear the results of a search stops searching
|
|
||||||
- BUGFIX: Progress column gets sorted on restart it is was during last execution
|
- BUGFIX: Progress column gets sorted on restart it is was during last execution
|
||||||
- BUGFIX: Made ETA more reliable using stats instead of instant values
|
- BUGFIX: Made ETA more reliable using stats instead of instant values
|
||||||
- BUGFIX: Remove torrent from hard drive used to delete parent folder if empty
|
- BUGFIX: Remove torrent from hard drive used to delete parent folder if empty
|
||||||
@@ -68,8 +66,6 @@
|
|||||||
- BUGFIX: Fixed drag'n drop on non-KDE systems
|
- BUGFIX: Fixed drag'n drop on non-KDE systems
|
||||||
- BUGFIX: Removed build dependency on Python
|
- BUGFIX: Removed build dependency on Python
|
||||||
- BUGFIX: Catching DHT exception in case there is a problem
|
- BUGFIX: Catching DHT exception in case there is a problem
|
||||||
- BUGFIX: Remember properties window size and position
|
|
||||||
- BUGFIX: Improved proxy support in search engine (HTTP only)
|
|
||||||
- COSMETIC: Redesigned torrent properties a little
|
- COSMETIC: Redesigned torrent properties a little
|
||||||
- COSMETIC: Totally redesigned program preferences
|
- COSMETIC: Totally redesigned program preferences
|
||||||
- COSMETIC: Display more logs messages concerning features
|
- COSMETIC: Display more logs messages concerning features
|
||||||
|
|||||||
2
INSTALL
2
INSTALL
@@ -25,7 +25,7 @@ Dependencies:
|
|||||||
|
|
||||||
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
|
- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization
|
||||||
|
|
||||||
- libcurl
|
- libcommoncpp2
|
||||||
|
|
||||||
- python >= 2.3 (needed by search engine)
|
- python >= 2.3 (needed by search engine)
|
||||||
|
|
||||||
|
|||||||
31
TODO
31
TODO
@@ -8,9 +8,11 @@
|
|||||||
- Skins support? (contact Mateusz)
|
- Skins support? (contact Mateusz)
|
||||||
|
|
||||||
// Harder
|
// Harder
|
||||||
|
- Display a progress bar that really represents the pieces we have (like in eMule)
|
||||||
- Torrent scheduler ala µtorrent/Bitcomet
|
- Torrent scheduler ala µtorrent/Bitcomet
|
||||||
|
|
||||||
// Waiting for libtorrent
|
// Waiting for libtorrent
|
||||||
|
- File selection in a torrent in compact mode
|
||||||
- Allow to prioritize torrents (may code this in qBittorrent?)
|
- Allow to prioritize torrents (may code this in qBittorrent?)
|
||||||
|
|
||||||
// Unsure
|
// Unsure
|
||||||
@@ -50,19 +52,16 @@
|
|||||||
-> in download list
|
-> in download list
|
||||||
-> in seeding list
|
-> in seeding list
|
||||||
|
|
||||||
rc8->rc9 changelog:
|
// in v1.0.0 - FEATURE FREEZE
|
||||||
- FEATURE: Better media file preview (player detected automatically)
|
- Fix all (or almost all) opened bugs in bug tracker
|
||||||
- BUGFIX: Remember properties window size and position
|
- Recheck doc
|
||||||
- BUGFIX: Added HTTP and SOCKS5 proxy support in downloads from urls, RSS
|
- Translations update (IN PROGRESS)
|
||||||
- BUGFIX: Added HTTP proxy support in search engine (no SOCKS yet)
|
|
||||||
- BUGFIX: Do no pause torrents before saving fastresume data anymore (no longer needed)
|
rc6->rc7 changelog:
|
||||||
- BUGFIX: Save fast resume data regularly (every 60 seconds) to avoid downloading from scratch if qBittorrent crashes
|
- BUGFIX: Catching DHT exception in case there is a problem
|
||||||
- BUGFIX: Do not save fastresume data for checking torrents anymore
|
- BUGFIX: Removed build dependency on Python
|
||||||
- BUGFIX: Saving trackers file only when necessary
|
- BUGFIX: Fixed a bug in children update when changing files priorities
|
||||||
- BUGFIX: Fixed possible segfault when unfiltering files in torrent addition dialog
|
- BUGFIX: Pause/Start All now affect all tabs, not only the current one
|
||||||
- BUGFIX: Fixed possible overflow in ETA calculation
|
- BUGFIX: Don't reload all torrents everytime settings are saved
|
||||||
- BUGFIX: title bar is now reset when "Display speed in title" is disabled
|
- BUGFIX: Don't reload seeding torrents anymore (no point)
|
||||||
- BUGFIX: Fixed HTTP_PW and SOCKS5_PW in proxy combobox
|
- I18N: Updated Turkish translation
|
||||||
- BUGFIX: Fixed proxy auth disable problem when disabling proxy
|
|
||||||
- BUGFIX: Fixed proxy layout in program preferences
|
|
||||||
- BUGFIX: Fixed everlasting libtorrent session destruction on exit
|
|
||||||
78
configure
vendored
78
configure
vendored
@@ -22,8 +22,8 @@ Dependency options:
|
|||||||
--with-libtorrent-lib=[path] Path to libtorrent library files
|
--with-libtorrent-lib=[path] Path to libtorrent library files
|
||||||
--with-libtorrent-static-lib=[path] Path to libtorrent .a file
|
--with-libtorrent-static-lib=[path] Path to libtorrent .a file
|
||||||
--with-libboost-inc=[path] Path to libboost include files
|
--with-libboost-inc=[path] Path to libboost include files
|
||||||
--with-libcurl-inc=[path] Path to libcurl include files
|
--with-libcommoncpp2-inc=[path] Path to libcommoncpp2 include files
|
||||||
--with-libcurl-lib=[path] Path to libcurl library files
|
--with-libcommoncpp2-lib=[path] Path to libcommoncpp2 library files
|
||||||
--disable-libmagick Disable use of libmagick
|
--disable-libmagick Disable use of libmagick
|
||||||
--with-libmagick-inc=[path] Path to libmagick++ include files
|
--with-libmagick-inc=[path] Path to libmagick++ include files
|
||||||
--with-libmagick-lib=[path] Path to libmagick++ library files
|
--with-libmagick-lib=[path] Path to libmagick++ library files
|
||||||
@@ -166,13 +166,13 @@ while [ $# -gt 0 ]; do
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--with-libcurl-inc=*)
|
--with-libcommoncpp2-inc=*)
|
||||||
QC_WITH_LIBCURL_INC=$optarg
|
QC_WITH_LIBCOMMONCPP2_INC=$optarg
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--with-libcurl-lib=*)
|
--with-libcommoncpp2-lib=*)
|
||||||
QC_WITH_LIBCURL_LIB=$optarg
|
QC_WITH_LIBCOMMONCPP2_LIB=$optarg
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -231,8 +231,8 @@ echo QC_WITH_LIBTORRENT_INC=$QC_WITH_LIBTORRENT_INC
|
|||||||
echo QC_WITH_LIBTORRENT_LIB=$QC_WITH_LIBTORRENT_LIB
|
echo QC_WITH_LIBTORRENT_LIB=$QC_WITH_LIBTORRENT_LIB
|
||||||
echo QC_WITH_LIBTORRENT_STATIC_LIB=$QC_WITH_LIBTORRENT_STATIC_LIB
|
echo QC_WITH_LIBTORRENT_STATIC_LIB=$QC_WITH_LIBTORRENT_STATIC_LIB
|
||||||
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
|
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
|
||||||
echo QC_WITH_LIBCURL_INC=$QC_WITH_LIBCURL_INC
|
echo QC_WITH_LIBCOMMONCPP2_INC=$QC_WITH_LIBCOMMONCPP2_INC
|
||||||
echo QC_WITH_LIBCURL_LIB=$QC_WITH_LIBCURL_LIB
|
echo QC_WITH_LIBCOMMONCPP2_LIB=$QC_WITH_LIBCOMMONCPP2_LIB
|
||||||
echo QC_DISABLE_libmagick=$QC_DISABLE_libmagick
|
echo QC_DISABLE_libmagick=$QC_DISABLE_libmagick
|
||||||
echo QC_WITH_LIBMAGICK_INC=$QC_WITH_LIBMAGICK_INC
|
echo QC_WITH_LIBMAGICK_INC=$QC_WITH_LIBMAGICK_INC
|
||||||
echo QC_WITH_LIBMAGICK_LIB=$QC_WITH_LIBMAGICK_LIB
|
echo QC_WITH_LIBMAGICK_LIB=$QC_WITH_LIBMAGICK_LIB
|
||||||
@@ -425,6 +425,16 @@ public:
|
|||||||
if(!found) return false;
|
if(!found) return false;
|
||||||
conf->addLib(QString("-L") + s);
|
conf->addLib(QString("-L") + s);
|
||||||
}
|
}
|
||||||
|
// BUGFIX for Fedora (doesn't support pkg-config?)
|
||||||
|
QFile issue_file("/etc/issue");
|
||||||
|
if(issue_file.open(QIODevice::ReadOnly | QIODevice::Text)){
|
||||||
|
QString content = issue_file.readAll();
|
||||||
|
issue_file.close();
|
||||||
|
if(content.indexOf("Fedora") != -1){
|
||||||
|
qWarning("Fedora detected. WORKAROUND for Fedora pkg-config problem enabled");
|
||||||
|
conf->addLib("-lssl -lcrypto -lboost_date_time -lboost_filesystem -lboost_thread -lz -ltorrent");
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -485,25 +495,25 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#line 1 "libcurl.qcm"
|
#line 1 "libcommoncpp2.qcm"
|
||||||
/*
|
/*
|
||||||
-----BEGIN QCMOD-----
|
-----BEGIN QCMOD-----
|
||||||
name: libcommoncpp2
|
name: libcommoncpp2
|
||||||
arg: with-libcurl-inc=[path], Path to libcurl include files
|
arg: with-libcommoncpp2-inc=[path], Path to libcommoncpp2 include files
|
||||||
arg: with-libcurl-lib=[path], Path to libcurl library files
|
arg: with-libcommoncpp2-lib=[path], Path to libcommoncpp2 library files
|
||||||
-----END QCMOD-----
|
-----END QCMOD-----
|
||||||
*/
|
*/
|
||||||
class qc_libcurl : public ConfObj
|
class qc_libcommoncpp2 : public ConfObj
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
qc_libcurl(Conf *c) : ConfObj(c) {}
|
qc_libcommoncpp2(Conf *c) : ConfObj(c) {}
|
||||||
QString name() const { return "libcurl"; }
|
QString name() const { return "GNU Common C++ library (libcommoncpp2)"; }
|
||||||
QString shortname() const { return "libcurl"; }
|
QString shortname() const { return "libcommoncpp2"; }
|
||||||
bool exec(){
|
bool exec(){
|
||||||
QString s;
|
QString s;
|
||||||
s = conf->getenv("QC_WITH_LIBCURL_INC");
|
s = conf->getenv("QC_WITH_LIBCOMMONCPP2_INC");
|
||||||
if(!s.isEmpty()) {
|
if(!s.isEmpty()) {
|
||||||
if(!conf->checkHeader(s, "curl/curl.h")) {
|
if(!conf->checkHeader(s, "cc++/url.h")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
@@ -512,7 +522,7 @@ public:
|
|||||||
sl << "/usr/local/include";
|
sl << "/usr/local/include";
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach(s, sl){
|
foreach(s, sl){
|
||||||
if(conf->checkHeader(s, "curl/curl.h")){
|
if(conf->checkHeader(s, "cc++/url.h")){
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -523,10 +533,12 @@ public:
|
|||||||
}
|
}
|
||||||
conf->addIncludePath(s);
|
conf->addIncludePath(s);
|
||||||
|
|
||||||
s = conf->getenv("QC_WITH_LIBCURL_LIB");
|
s = conf->getenv("QC_WITH_LIBCOMMONCPP2_LIB");
|
||||||
if(!s.isEmpty()) {
|
if(!s.isEmpty()) {
|
||||||
if(!QFile::exists(s+QString("/libcurl.so")))
|
if(!QFile::exists(s+QString("/libccext2.so")))
|
||||||
return false;
|
return false;
|
||||||
|
if(!QFile::exists(s+QString("/libccgnu2.so")))
|
||||||
|
return false;
|
||||||
conf->addLib(QString("-L") + s);
|
conf->addLib(QString("-L") + s);
|
||||||
}else{
|
}else{
|
||||||
QStringList sl;
|
QStringList sl;
|
||||||
@@ -536,14 +548,26 @@ public:
|
|||||||
sl << "/usr/local/lib64/";
|
sl << "/usr/local/lib64/";
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach(s, sl){
|
foreach(s, sl){
|
||||||
if(QFile::exists(s+QString("libcurl.so"))){
|
if(QFile::exists(s+QString("libccext2.so"))){
|
||||||
found = true;
|
if(QFile::exists(s+QString("libccgnu2.so"))){
|
||||||
break;
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!found) return false;
|
if(!found) return false;
|
||||||
conf->addLib(QString("-L") + s);
|
conf->addLib(QString("-L") + s);
|
||||||
}
|
}
|
||||||
|
// BUGFIX for Fedora (doesn't support pkg-config?)
|
||||||
|
QFile issue_file("/etc/issue");
|
||||||
|
if(issue_file.open(QIODevice::ReadOnly | QIODevice::Text)){
|
||||||
|
QString content = issue_file.readAll();
|
||||||
|
issue_file.close();
|
||||||
|
if(content.indexOf("Fedora") != -1){
|
||||||
|
qWarning("Fedora detected. WORKAROUND for Fedora pkg-config problem enabled");
|
||||||
|
conf->addLib("-pthread -lccext2 -lz -lccgnu2 -ldl -lrt");
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -711,7 +735,7 @@ cat >$1/modules_new.cpp <<EOT
|
|||||||
o = new qc_libboost(conf);
|
o = new qc_libboost(conf);
|
||||||
o->required = true;
|
o->required = true;
|
||||||
o->disabled = false;
|
o->disabled = false;
|
||||||
o = new qc_libcurl(conf);
|
o = new qc_libcommoncpp2(conf);
|
||||||
o->required = true;
|
o->required = true;
|
||||||
o->disabled = false;
|
o->disabled = false;
|
||||||
o = new qc_libmagick(conf);
|
o = new qc_libmagick(conf);
|
||||||
@@ -1669,8 +1693,8 @@ export QC_WITH_LIBTORRENT_INC
|
|||||||
export QC_WITH_LIBTORRENT_LIB
|
export QC_WITH_LIBTORRENT_LIB
|
||||||
export QC_WITH_LIBTORRENT_STATIC_LIB
|
export QC_WITH_LIBTORRENT_STATIC_LIB
|
||||||
export QC_WITH_LIBBOOST_INC
|
export QC_WITH_LIBBOOST_INC
|
||||||
export QC_WITH_LIBCURL_INC
|
export QC_WITH_LIBCOMMONCPP2_INC
|
||||||
export QC_WITH_LIBCURL_LIB
|
export QC_WITH_LIBCOMMONCPP2_LIB
|
||||||
export QC_DISABLE_libmagick
|
export QC_DISABLE_libmagick
|
||||||
export QC_WITH_LIBMAGICK_INC
|
export QC_WITH_LIBMAGICK_INC
|
||||||
export QC_WITH_LIBMAGICK_LIB
|
export QC_WITH_LIBMAGICK_LIB
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<dep type='libboost'>
|
<dep type='libboost'>
|
||||||
<required/>
|
<required/>
|
||||||
</dep>
|
</dep>
|
||||||
<dep type='libcurl'>
|
<dep type='libcommoncpp2'>
|
||||||
<required/>
|
<required/>
|
||||||
</dep>
|
</dep>
|
||||||
<dep type='libmagick'/>
|
<dep type='libmagick'/>
|
||||||
|
|||||||
@@ -60,6 +60,16 @@ public:
|
|||||||
if(!found) return false;
|
if(!found) return false;
|
||||||
conf->addLib(QString("-L") + s);
|
conf->addLib(QString("-L") + s);
|
||||||
}
|
}
|
||||||
|
// BUGFIX for Fedora (doesn't support pkg-config?)
|
||||||
|
QFile issue_file("/etc/issue");
|
||||||
|
if(issue_file.open(QIODevice::ReadOnly | QIODevice::Text)){
|
||||||
|
QString content = issue_file.readAll();
|
||||||
|
issue_file.close();
|
||||||
|
if(content.indexOf("Fedora") != -1){
|
||||||
|
qWarning("Fedora detected. WORKAROUND for Fedora pkg-config problem enabled");
|
||||||
|
conf->addLib("-pthread -lccext2 -lz -lccgnu2 -ldl -lrt");
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
-----BEGIN QCMOD-----
|
|
||||||
name: libcommoncpp2
|
|
||||||
arg: with-libcurl-inc=[path], Path to libcurl include files
|
|
||||||
arg: with-libcurl-lib=[path], Path to libcurl library files
|
|
||||||
-----END QCMOD-----
|
|
||||||
*/
|
|
||||||
class qc_libcurl : public ConfObj
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
qc_libcurl(Conf *c) : ConfObj(c) {}
|
|
||||||
QString name() const { return "libcurl"; }
|
|
||||||
QString shortname() const { return "libcurl"; }
|
|
||||||
bool exec(){
|
|
||||||
QString s;
|
|
||||||
s = conf->getenv("QC_WITH_LIBCURL_INC");
|
|
||||||
if(!s.isEmpty()) {
|
|
||||||
if(!conf->checkHeader(s, "curl/curl.h")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
QStringList sl;
|
|
||||||
sl << "/usr/include";
|
|
||||||
sl << "/usr/local/include";
|
|
||||||
bool found = false;
|
|
||||||
foreach(s, sl){
|
|
||||||
if(conf->checkHeader(s, "curl/curl.h")){
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!found) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
conf->addIncludePath(s);
|
|
||||||
|
|
||||||
s = conf->getenv("QC_WITH_LIBCURL_LIB");
|
|
||||||
if(!s.isEmpty()) {
|
|
||||||
if(!QFile::exists(s+QString("/libcurl.so")))
|
|
||||||
return false;
|
|
||||||
conf->addLib(QString("-L") + s);
|
|
||||||
}else{
|
|
||||||
QStringList sl;
|
|
||||||
sl << "/usr/lib/";
|
|
||||||
sl << "/usr/lib64/";
|
|
||||||
sl << "/usr/local/lib/";
|
|
||||||
sl << "/usr/local/lib64/";
|
|
||||||
bool found = false;
|
|
||||||
foreach(s, sl){
|
|
||||||
if(QFile::exists(s+QString("libcurl.so"))){
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!found) return false;
|
|
||||||
conf->addLib(QString("-L") + s);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -65,6 +65,16 @@ public:
|
|||||||
if(!found) return false;
|
if(!found) return false;
|
||||||
conf->addLib(QString("-L") + s);
|
conf->addLib(QString("-L") + s);
|
||||||
}
|
}
|
||||||
|
// BUGFIX for Fedora (doesn't support pkg-config?)
|
||||||
|
QFile issue_file("/etc/issue");
|
||||||
|
if(issue_file.open(QIODevice::ReadOnly | QIODevice::Text)){
|
||||||
|
QString content = issue_file.readAll();
|
||||||
|
issue_file.close();
|
||||||
|
if(content.indexOf("Fedora") != -1){
|
||||||
|
qWarning("Fedora detected. WORKAROUND for Fedora pkg-config problem enabled");
|
||||||
|
conf->addLib("-lssl -lcrypto -lboost_date_time -lboost_filesystem -lboost_thread -lz -ltorrent");
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -313,6 +313,8 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){
|
|||||||
QModelIndex index;
|
QModelIndex index;
|
||||||
// Enable/disable pause/start action given the DL state
|
// Enable/disable pause/start action given the DL state
|
||||||
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
QModelIndexList selectedIndexes = finishedList->selectionModel()->selectedIndexes();
|
||||||
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
|
QString previewProgram = settings.value("Preferences/general/MediaPlayer", QString()).toString();
|
||||||
bool has_pause = false, has_start = false, has_preview = false;
|
bool has_pause = false, has_start = false, has_preview = false;
|
||||||
foreach(index, selectedIndexes) {
|
foreach(index, selectedIndexes) {
|
||||||
if(index.column() == F_NAME) {
|
if(index.column() == F_NAME) {
|
||||||
@@ -332,7 +334,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){
|
|||||||
has_pause = true;
|
has_pause = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(BTSession->isFilePreviewPossible(hash) && !has_preview) {
|
if(!previewProgram.isEmpty() && BTSession->isFilePreviewPossible(hash) && !has_preview) {
|
||||||
myFinishedListMenu.addAction(actionPreview_file);
|
myFinishedListMenu.addAction(actionPreview_file);
|
||||||
has_preview = true;
|
has_preview = true;
|
||||||
}
|
}
|
||||||
|
|||||||
54
src/GUI.cpp
54
src/GUI.cpp
@@ -45,7 +45,6 @@
|
|||||||
#include "options_imp.h"
|
#include "options_imp.h"
|
||||||
#include "previewSelect.h"
|
#include "previewSelect.h"
|
||||||
#include "allocationDlg.h"
|
#include "allocationDlg.h"
|
||||||
#include "stdlib.h"
|
|
||||||
|
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
@@ -160,6 +159,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||||||
checkConnect = new QTimer(this);
|
checkConnect = new QTimer(this);
|
||||||
connect(checkConnect, SIGNAL(timeout()), this, SLOT(checkConnectionStatus()));
|
connect(checkConnect, SIGNAL(timeout()), this, SLOT(checkConnectionStatus()));
|
||||||
checkConnect->start(5000);
|
checkConnect->start(5000);
|
||||||
|
previewProcess = new QProcess(this);
|
||||||
|
connect(previewProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(cleanTempPreviewFile(int, QProcess::ExitStatus)));
|
||||||
// Accept drag 'n drops
|
// Accept drag 'n drops
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
show();
|
show();
|
||||||
@@ -181,6 +182,9 @@ GUI::~GUI() {
|
|||||||
delete myTrayIconMenu;
|
delete myTrayIconMenu;
|
||||||
}
|
}
|
||||||
delete tcpServer;
|
delete tcpServer;
|
||||||
|
previewProcess->kill();
|
||||||
|
previewProcess->waitForFinished();
|
||||||
|
delete previewProcess;
|
||||||
delete connecStatusLblIcon;
|
delete connecStatusLblIcon;
|
||||||
delete tabs;
|
delete tabs;
|
||||||
// Keyboard shortcuts
|
// Keyboard shortcuts
|
||||||
@@ -384,6 +388,12 @@ void GUI::on_actionPreview_file_triggered() {
|
|||||||
new previewSelect(this, h);
|
new previewSelect(this, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GUI::cleanTempPreviewFile(int, QProcess::ExitStatus) const {
|
||||||
|
if(!QFile::remove(QDir::tempPath()+QDir::separator()+QString::fromUtf8("qBT_preview.tmp"))) {
|
||||||
|
std::cerr << "Couldn't remove temporary file: " << (QDir::tempPath()+QDir::separator()+QString::fromUtf8("qBT_preview.tmp")).toUtf8().data() << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Necessary if we want to close the window
|
// Necessary if we want to close the window
|
||||||
// in one time if "close to systray" is enabled
|
// in one time if "close to systray" is enabled
|
||||||
void GUI::on_actionExit_triggered() {
|
void GUI::on_actionExit_triggered() {
|
||||||
@@ -392,7 +402,21 @@ void GUI::on_actionExit_triggered() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GUI::previewFile(QString filePath) {
|
void GUI::previewFile(QString filePath) {
|
||||||
QDesktopServices::openUrl(filePath);
|
// Check if there is already one preview running
|
||||||
|
if(previewProcess->state() == QProcess::NotRunning) {
|
||||||
|
// First copy temporarily (XXX: is it necessary?)
|
||||||
|
QString tmpPath = QDir::tempPath()+QDir::separator()+QString::fromUtf8("qBT_preview.tmp");
|
||||||
|
QFile::remove(tmpPath);
|
||||||
|
QFile::copy(filePath, tmpPath);
|
||||||
|
// Launch program preview
|
||||||
|
QStringList params;
|
||||||
|
params << tmpPath;
|
||||||
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
|
QString previewProgram = settings.value(QString::fromUtf8("Preferences/General/MediaPlayer"), QString()).toString();
|
||||||
|
previewProcess->start(previewProgram, params, QIODevice::ReadOnly);
|
||||||
|
}else{
|
||||||
|
QMessageBox::critical(0, tr("Preview process already running"), tr("There is already another preview process running.\nPlease close the other one first."));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int GUI::getCurrentTabIndex() const{
|
unsigned int GUI::getCurrentTabIndex() const{
|
||||||
@@ -764,12 +788,7 @@ void GUI::processDownloadedFiles(QString path, QString url) {
|
|||||||
void GUI::configureSession(bool deleteOptions) {
|
void GUI::configureSession(bool deleteOptions) {
|
||||||
qDebug("Configuring session");
|
qDebug("Configuring session");
|
||||||
// General
|
// General
|
||||||
bool new_displaySpeedInTitle = options->speedInTitleBar();
|
displaySpeedInTitle = options->speedInTitleBar();
|
||||||
if(!new_displaySpeedInTitle && new_displaySpeedInTitle != displaySpeedInTitle) {
|
|
||||||
// Reset title
|
|
||||||
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION)));
|
|
||||||
}
|
|
||||||
displaySpeedInTitle = new_displaySpeedInTitle;
|
|
||||||
unsigned int new_refreshInterval = options->getRefreshInterval();
|
unsigned int new_refreshInterval = options->getRefreshInterval();
|
||||||
if(refreshInterval != new_refreshInterval) {
|
if(refreshInterval != new_refreshInterval) {
|
||||||
refreshInterval = new_refreshInterval;
|
refreshInterval = new_refreshInterval;
|
||||||
@@ -830,21 +849,12 @@ void GUI::configureSession(bool deleteOptions) {
|
|||||||
// * Proxy settings
|
// * Proxy settings
|
||||||
proxy_settings proxySettings;
|
proxy_settings proxySettings;
|
||||||
if(options->isProxyEnabled()) {
|
if(options->isProxyEnabled()) {
|
||||||
proxySettings.hostname = options->getProxyIp().toStdString();
|
|
||||||
proxySettings.port = options->getProxyPort();
|
|
||||||
if(options->isProxyAuthEnabled()) {
|
|
||||||
proxySettings.username = options->getProxyUsername().toStdString();
|
|
||||||
proxySettings.password = options->getProxyPassword().toStdString();
|
|
||||||
}
|
|
||||||
QString proxy_str;
|
|
||||||
switch(options->getProxyType()) {
|
switch(options->getProxyType()) {
|
||||||
case HTTP:
|
case HTTP:
|
||||||
proxySettings.type = proxy_settings::http;
|
proxySettings.type = proxy_settings::http;
|
||||||
proxy_str = misc::toQString("http://")+options->getProxyIp()+":"+misc::toQString(proxySettings.port);
|
|
||||||
break;
|
break;
|
||||||
case HTTP_PW:
|
case HTTP_PW:
|
||||||
proxySettings.type = proxy_settings::http_pw;
|
proxySettings.type = proxy_settings::http_pw;
|
||||||
proxy_str = misc::toQString("http://")+options->getProxyUsername()+":"+options->getProxyPassword()+"@"+options->getProxyIp()+":"+misc::toQString(proxySettings.port);
|
|
||||||
break;
|
break;
|
||||||
case SOCKS5:
|
case SOCKS5:
|
||||||
proxySettings.type = proxy_settings::socks5;
|
proxySettings.type = proxy_settings::socks5;
|
||||||
@@ -853,12 +863,12 @@ void GUI::configureSession(bool deleteOptions) {
|
|||||||
proxySettings.type = proxy_settings::socks5_pw;
|
proxySettings.type = proxy_settings::socks5_pw;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(!proxy_str.isEmpty()) {
|
proxySettings.hostname = options->getProxyIp().toStdString();
|
||||||
// We need this for urllib in search engine plugins
|
proxySettings.port = options->getProxyPort();
|
||||||
setenv("http_proxy", proxy_str.toUtf8().data(), 1);
|
if(options->isProxyAuthEnabled()) {
|
||||||
|
proxySettings.username = options->getProxyUsername().toStdString();
|
||||||
|
proxySettings.password = options->getProxyPassword().toStdString();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
unsetenv("http_proxy");
|
|
||||||
}
|
}
|
||||||
BTSession->setProxySettings(proxySettings, options->useProxyForTrackers(), options->useProxyForPeers(), options->useProxyForWebseeds(), options->useProxyForDHT());
|
BTSession->setProxySettings(proxySettings, options->useProxyForTrackers(), options->useProxyForPeers(), options->useProxyForWebseeds(), options->useProxyForDHT());
|
||||||
// * Session settings
|
// * Session settings
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||||||
QShortcut *switchDownShortcut;
|
QShortcut *switchDownShortcut;
|
||||||
QShortcut *switchUpShortcut;
|
QShortcut *switchUpShortcut;
|
||||||
QShortcut *switchRSSShortcut;
|
QShortcut *switchRSSShortcut;
|
||||||
|
// Preview
|
||||||
|
QProcess *previewProcess;
|
||||||
// Search
|
// Search
|
||||||
SearchEngine *searchEngine;
|
SearchEngine *searchEngine;
|
||||||
// RSS
|
// RSS
|
||||||
@@ -96,6 +98,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||||||
void togglePausedState(QString hash);
|
void togglePausedState(QString hash);
|
||||||
void on_actionPreview_file_triggered();
|
void on_actionPreview_file_triggered();
|
||||||
void previewFile(QString filePath);
|
void previewFile(QString filePath);
|
||||||
|
void cleanTempPreviewFile(int, QProcess::ExitStatus) const;
|
||||||
void balloonClicked();
|
void balloonClicked();
|
||||||
void writeSettings();
|
void writeSettings();
|
||||||
void readSettings();
|
void readSettings();
|
||||||
|
|||||||
@@ -181,8 +181,6 @@ class PropListDelegate: public QItemDelegate {
|
|||||||
// } else {
|
// } else {
|
||||||
model->setData(index, QVariant(HIGH));
|
model->setData(index, QVariant(HIGH));
|
||||||
model->setData(index, QVariant(NORMAL));
|
model->setData(index, QVariant(NORMAL));
|
||||||
if(filteredFilesChanged != 0)
|
|
||||||
*filteredFilesChanged = true;
|
|
||||||
// }
|
// }
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
#define MAX_TRACKER_ERRORS 2
|
#define MAX_TRACKER_ERRORS 2
|
||||||
|
|
||||||
// Main constructor
|
// Main constructor
|
||||||
bittorrent::bittorrent() : timerScan(0), DHTEnabled(false), preAllocateAll(false), addInPause(false), maxConnecsPerTorrent(500), maxUploadsPerTorrent(4), max_ratio(-1), UPnPEnabled(false), NATPMPEnabled(false), LSDEnabled(false) {
|
bittorrent::bittorrent() : timerScan(0), DHTEnabled(false), preAllocateAll(false), addInPause(false), maxConnecsPerTorrent(500), maxUploadsPerTorrent(4), max_ratio(-1) {
|
||||||
// To avoid some exceptions
|
// To avoid some exceptions
|
||||||
fs::path::default_name_check(fs::no_check);
|
fs::path::default_name_check(fs::no_check);
|
||||||
// Creating bittorrent session
|
// Creating bittorrent session
|
||||||
@@ -58,9 +58,6 @@ bittorrent::bittorrent() : timerScan(0), DHTEnabled(false), preAllocateAll(false
|
|||||||
ETARefresher = new QTimer();
|
ETARefresher = new QTimer();
|
||||||
connect(ETARefresher, SIGNAL(timeout()), this, SLOT(updateETAs()));
|
connect(ETARefresher, SIGNAL(timeout()), this, SLOT(updateETAs()));
|
||||||
ETARefresher->start(ETA_REFRESH_INTERVAL);
|
ETARefresher->start(ETA_REFRESH_INTERVAL);
|
||||||
fastResumeSaver = new QTimer();
|
|
||||||
connect(fastResumeSaver, SIGNAL(timeout()), this, SLOT(saveFastResumeAndRatioData()));
|
|
||||||
fastResumeSaver->start(60000);
|
|
||||||
// To download from urls
|
// To download from urls
|
||||||
downloader = new downloadThread(this);
|
downloader = new downloadThread(this);
|
||||||
connect(downloader, SIGNAL(downloadFinished(QString, QString)), this, SLOT(processDownloadedFile(QString, QString)));
|
connect(downloader, SIGNAL(downloadFinished(QString, QString)), this, SLOT(processDownloadedFile(QString, QString)));
|
||||||
@@ -76,7 +73,6 @@ bittorrent::~bittorrent() {
|
|||||||
disableDirectoryScanning();
|
disableDirectoryScanning();
|
||||||
// Delete our objects
|
// Delete our objects
|
||||||
delete deleter;
|
delete deleter;
|
||||||
delete fastResumeSaver;
|
|
||||||
delete timerAlerts;
|
delete timerAlerts;
|
||||||
delete ETARefresher;
|
delete ETARefresher;
|
||||||
delete downloader;
|
delete downloader;
|
||||||
@@ -97,7 +93,7 @@ void bittorrent::preAllocateAllFiles(bool b) {
|
|||||||
qDebug("/!\\ Error: Invalid handle");
|
qDebug("/!\\ Error: Invalid handle");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
reloadTorrent(h, b);
|
pauseAndReloadTorrent(h, b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,16 +162,8 @@ void bittorrent::updateETAs() {
|
|||||||
foreach(val, listEtas) {
|
foreach(val, listEtas) {
|
||||||
moy += (qlonglong)((double)val/(double)nbETAs);
|
moy += (qlonglong)((double)val/(double)nbETAs);
|
||||||
}
|
}
|
||||||
if(moy < 0) {
|
Q_ASSERT(moy >= 0);
|
||||||
if(ETAstats.contains(hash)) {
|
ETAs[hash] = moy;
|
||||||
ETAstats.remove(hash);
|
|
||||||
}
|
|
||||||
if(ETAs.contains(hash)) {
|
|
||||||
ETAs.remove(hash);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ETAs[hash] = moy;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// Speed is too low, we don't want an overflow.
|
// Speed is too low, we don't want an overflow.
|
||||||
if(ETAstats.contains(hash)) {
|
if(ETAstats.contains(hash)) {
|
||||||
@@ -245,6 +233,10 @@ void bittorrent::deleteTorrent(QString hash, bool permanent) {
|
|||||||
ETAs.remove(hash);
|
ETAs.remove(hash);
|
||||||
// Remove tracker errors
|
// Remove tracker errors
|
||||||
trackersErrors.remove(hash);
|
trackersErrors.remove(hash);
|
||||||
|
// Remove from reloadingTorrents if reloading
|
||||||
|
if(reloadingTorrents.contains(hash)) {
|
||||||
|
reloadingTorrents.remove(hash);
|
||||||
|
}
|
||||||
// Remove it from ratio table
|
// Remove it from ratio table
|
||||||
ratioData.remove(hash);
|
ratioData.remove(hash);
|
||||||
int index = finishedTorrents.indexOf(hash);
|
int index = finishedTorrents.indexOf(hash);
|
||||||
@@ -310,8 +302,6 @@ void bittorrent::setFinishedTorrent(QString hash) {
|
|||||||
// Remove it from ETAs hash tables
|
// Remove it from ETAs hash tables
|
||||||
ETAstats.remove(hash);
|
ETAstats.remove(hash);
|
||||||
ETAs.remove(hash);
|
ETAs.remove(hash);
|
||||||
// Save fast resume data
|
|
||||||
saveFastResumeAndRatioData(hash);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pause a running torrent
|
// Pause a running torrent
|
||||||
@@ -321,8 +311,6 @@ bool bittorrent::pauseTorrent(QString hash) {
|
|||||||
if(h.is_valid() && !h.is_paused()) {
|
if(h.is_valid() && !h.is_paused()) {
|
||||||
h.pause();
|
h.pause();
|
||||||
change = true;
|
change = true;
|
||||||
// Save fast resume data
|
|
||||||
saveFastResumeAndRatioData(hash);
|
|
||||||
qDebug("Torrent paused successfully");
|
qDebug("Torrent paused successfully");
|
||||||
}else{
|
}else{
|
||||||
if(!h.is_valid()) {
|
if(!h.is_valid()) {
|
||||||
@@ -631,49 +619,25 @@ bool bittorrent::isDHTEnabled() const{
|
|||||||
|
|
||||||
void bittorrent::enableUPnP(bool b) {
|
void bittorrent::enableUPnP(bool b) {
|
||||||
if(b) {
|
if(b) {
|
||||||
if(!UPnPEnabled) {
|
s->start_upnp();
|
||||||
qDebug("Enabling UPnP");
|
|
||||||
s->start_upnp();
|
|
||||||
UPnPEnabled = true;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if(UPnPEnabled) {
|
s->stop_upnp();
|
||||||
qDebug("Disabling UPnP");
|
|
||||||
s->stop_upnp();
|
|
||||||
UPnPEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void bittorrent::enableNATPMP(bool b) {
|
void bittorrent::enableNATPMP(bool b) {
|
||||||
if(b) {
|
if(b) {
|
||||||
if(!NATPMPEnabled) {
|
s->start_natpmp();
|
||||||
qDebug("Enabling NAT-PMP");
|
|
||||||
s->start_natpmp();
|
|
||||||
NATPMPEnabled = true;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if(NATPMPEnabled) {
|
s->stop_natpmp();
|
||||||
qDebug("Disabling NAT-PMP");
|
|
||||||
s->stop_natpmp();
|
|
||||||
NATPMPEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void bittorrent::enableLSD(bool b) {
|
void bittorrent::enableLSD(bool b) {
|
||||||
if(b) {
|
if(b) {
|
||||||
if(!LSDEnabled) {
|
s->start_lsd();
|
||||||
qDebug("Enabling LSD");
|
|
||||||
s->start_lsd();
|
|
||||||
LSDEnabled = true;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if(LSDEnabled) {
|
s->stop_lsd();
|
||||||
qDebug("Disabling LSD");
|
|
||||||
s->stop_lsd();
|
|
||||||
LSDEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -744,7 +708,6 @@ void bittorrent::loadTorrentSpeedLimits(QString hash) {
|
|||||||
// Read pieces priorities from .priorities file
|
// Read pieces priorities from .priorities file
|
||||||
// and ask QTorrentHandle to consider them
|
// and ask QTorrentHandle to consider them
|
||||||
void bittorrent::loadFilesPriorities(QTorrentHandle &h) {
|
void bittorrent::loadFilesPriorities(QTorrentHandle &h) {
|
||||||
qDebug("Applying pieces priorities");
|
|
||||||
if(!h.is_valid()) {
|
if(!h.is_valid()) {
|
||||||
qDebug("/!\\ Error: Invalid handle");
|
qDebug("/!\\ Error: Invalid handle");
|
||||||
return;
|
return;
|
||||||
@@ -859,26 +822,10 @@ void bittorrent::saveDownloadUploadForTorrent(QString hash) {
|
|||||||
ratio_file.close();
|
ratio_file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only save fast resume data for unfinished and unpaused torrents (Optimization)
|
// Save fastresume data for all torrents
|
||||||
// Called periodically and on exit
|
// and remove them from the session
|
||||||
void bittorrent::saveFastResumeAndRatioData() {
|
void bittorrent::saveFastResumeAndRatioData() {
|
||||||
QString hash;
|
qDebug("Saving fast resume and ratio data");
|
||||||
QStringList hashes = getUnfinishedTorrents();
|
|
||||||
foreach(hash, hashes) {
|
|
||||||
QTorrentHandle h = getTorrentHandle(hash);
|
|
||||||
if(!h.is_valid()) {
|
|
||||||
qDebug("/!\\ Error: Invalid handle");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if(h.is_paused()) {
|
|
||||||
// Do not need to save fast resume data for paused torrents
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
saveFastResumeAndRatioData(hash);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void bittorrent::saveFastResumeAndRatioData(QString hash) {
|
|
||||||
QString file;
|
QString file;
|
||||||
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
|
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
|
||||||
// Checking if torrentBackup Dir exists
|
// Checking if torrentBackup Dir exists
|
||||||
@@ -886,26 +833,54 @@ void bittorrent::saveFastResumeAndRatioData(QString hash) {
|
|||||||
if(! torrentBackup.exists()) {
|
if(! torrentBackup.exists()) {
|
||||||
torrentBackup.mkpath(torrentBackup.path());
|
torrentBackup.mkpath(torrentBackup.path());
|
||||||
}
|
}
|
||||||
// Extracting resume data
|
// Pause torrents
|
||||||
QTorrentHandle h = getTorrentHandle(hash);
|
std::vector<torrent_handle> handles = s->get_torrents();
|
||||||
if(!h.is_valid()) {
|
for(unsigned int i=0; i<handles.size(); ++i) {
|
||||||
qDebug("/!\\ Error: Invalid handle");
|
QTorrentHandle h = handles[i];
|
||||||
return;
|
if(!h.is_valid()) {
|
||||||
}
|
qDebug("/!\\ Error: Invalid handle");
|
||||||
if (h.has_metadata() && h.state() != torrent_status::checking_files && h.state() != torrent_status::queued_for_checking) {
|
continue;
|
||||||
if(QFile::exists(torrentBackup.path()+QDir::separator()+hash+".torrent")) {
|
}
|
||||||
// Remove old .fastresume data in case it exists
|
// Pause download (needed before fast resume writing)
|
||||||
QFile::remove(torrentBackup.path()+QDir::separator()+hash + ".fastresume");
|
if(!h.is_paused()){
|
||||||
// Write fast resume data
|
waitingForPause << h.hash();
|
||||||
entry resumeData = h.write_resume_data();
|
h.pause();
|
||||||
file = hash + ".fastresume";
|
|
||||||
boost::filesystem::ofstream out(fs::path(torrentBackup.path().toUtf8().data()) / file.toUtf8().data(), std::ios_base::binary);
|
|
||||||
out.unsetf(std::ios_base::skipws);
|
|
||||||
bencode(std::ostream_iterator<char>(out), resumeData);
|
|
||||||
}
|
}
|
||||||
// Save ratio data
|
|
||||||
saveDownloadUploadForTorrent(hash);
|
|
||||||
}
|
}
|
||||||
|
// Write fast resume data
|
||||||
|
for(unsigned int i=0; i<handles.size(); ++i) {
|
||||||
|
QTorrentHandle h = handles[i];
|
||||||
|
if(!h.is_valid()) {
|
||||||
|
qDebug("/!\\ Error: Invalid handle");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
QString hash = h.hash();
|
||||||
|
while(waitingForPause.contains(hash)) {
|
||||||
|
//qDebug("Sleeping while waiting that %s is paused", misc::toString(h.info_hash()).c_str());
|
||||||
|
SleeperThread::msleep(300);
|
||||||
|
readAlerts();
|
||||||
|
}
|
||||||
|
// Extracting resume data
|
||||||
|
if (h.has_metadata()) {
|
||||||
|
if(QFile::exists(torrentBackup.path()+QDir::separator()+hash+".torrent")) {
|
||||||
|
// Remove old .fastresume data in case it exists
|
||||||
|
QFile::remove(torrentBackup.path()+QDir::separator()+hash + ".fastresume");
|
||||||
|
// Write fast resume data
|
||||||
|
entry resumeData = h.write_resume_data();
|
||||||
|
file = hash + ".fastresume";
|
||||||
|
boost::filesystem::ofstream out(fs::path(torrentBackup.path().toUtf8().data()) / file.toUtf8().data(), std::ios_base::binary);
|
||||||
|
out.unsetf(std::ios_base::skipws);
|
||||||
|
bencode(std::ostream_iterator<char>(out), resumeData);
|
||||||
|
}
|
||||||
|
// Save ratio data
|
||||||
|
saveDownloadUploadForTorrent(hash);
|
||||||
|
// Save trackers
|
||||||
|
saveTrackerFile(hash);
|
||||||
|
}
|
||||||
|
// Remove torrent
|
||||||
|
s->remove_torrent(h.get_torrent_handle());
|
||||||
|
}
|
||||||
|
qDebug("Fast resume and ratio data saved");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bittorrent::isFilePreviewPossible(QString hash) const{
|
bool bittorrent::isFilePreviewPossible(QString hash) const{
|
||||||
@@ -1048,7 +1023,6 @@ bool bittorrent::loadTrackerFile(QString hash) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void bittorrent::saveTrackerFile(QString hash) {
|
void bittorrent::saveTrackerFile(QString hash) {
|
||||||
qDebug("Saving tracker file for %s", hash.toUtf8().data());
|
|
||||||
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
|
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
|
||||||
QFile tracker_file(torrentBackup.path()+QDir::separator()+ hash + ".trackers");
|
QFile tracker_file(torrentBackup.path()+QDir::separator()+ hash + ".trackers");
|
||||||
if(tracker_file.exists()) {
|
if(tracker_file.exists()) {
|
||||||
@@ -1151,6 +1125,21 @@ void bittorrent::readAlerts() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (torrent_paused_alert* p = dynamic_cast<torrent_paused_alert*>(a.get())) {
|
||||||
|
QTorrentHandle h(p->handle);
|
||||||
|
if(h.is_valid()){
|
||||||
|
QString hash = h.hash();
|
||||||
|
qDebug("Received torrent_paused_alert for %s", hash.toUtf8().data());
|
||||||
|
int index = waitingForPause.indexOf(hash);
|
||||||
|
if(index != -1){
|
||||||
|
waitingForPause.removeAt(index);
|
||||||
|
}
|
||||||
|
if(reloadingTorrents.contains(hash)) {
|
||||||
|
reloadTorrent(h, reloadingTorrents.value(hash));
|
||||||
|
reloadingTorrents.remove(hash);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (peer_blocked_alert* p = dynamic_cast<peer_blocked_alert*>(a.get())) {
|
else if (peer_blocked_alert* p = dynamic_cast<peer_blocked_alert*>(a.get())) {
|
||||||
emit peerBlocked(QString::fromUtf8(p->ip.to_string().c_str()));
|
emit peerBlocked(QString::fromUtf8(p->ip.to_string().c_str()));
|
||||||
}
|
}
|
||||||
@@ -1191,6 +1180,22 @@ QStringList bittorrent::getTorrentsToPauseAfterChecking() const{
|
|||||||
return torrentsToPauseAfterChecking;
|
return torrentsToPauseAfterChecking;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Function to reload the torrent async after the torrent is actually
|
||||||
|
// paused so that we can get fastresume data
|
||||||
|
void bittorrent::pauseAndReloadTorrent(QTorrentHandle h, bool full_alloc) {
|
||||||
|
if(!h.is_valid()) {
|
||||||
|
std::cerr << "/!\\ Error: Invalid handle\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// ask to pause the torrent (async)
|
||||||
|
h.pause();
|
||||||
|
QString hash = h.hash();
|
||||||
|
// Add it to reloadingTorrents has table so that we now we
|
||||||
|
// we should reload the torrent once we receive the
|
||||||
|
// torrent_paused_alert. pause() is async now...
|
||||||
|
reloadingTorrents[hash] = full_alloc;
|
||||||
|
}
|
||||||
|
|
||||||
// Reload a torrent with full allocation mode
|
// Reload a torrent with full allocation mode
|
||||||
void bittorrent::reloadTorrent(const QTorrentHandle &h, bool full_alloc) {
|
void bittorrent::reloadTorrent(const QTorrentHandle &h, bool full_alloc) {
|
||||||
qDebug("** Reloading a torrent");
|
qDebug("** Reloading a torrent");
|
||||||
|
|||||||
@@ -44,17 +44,18 @@ class bittorrent : public QObject{
|
|||||||
QString scan_dir;
|
QString scan_dir;
|
||||||
QTimer *timerScan;
|
QTimer *timerScan;
|
||||||
QTimer *timerAlerts;
|
QTimer *timerAlerts;
|
||||||
QTimer *fastResumeSaver;
|
|
||||||
bool DHTEnabled;
|
bool DHTEnabled;
|
||||||
downloadThread *downloader;
|
downloadThread *downloader;
|
||||||
QString defaultSavePath;
|
QString defaultSavePath;
|
||||||
QStringList torrentsToPauseAfterChecking;
|
QStringList torrentsToPauseAfterChecking;
|
||||||
|
QHash<QString, bool> reloadingTorrents;
|
||||||
QHash<QString, QList<qlonglong> > ETAstats;
|
QHash<QString, QList<qlonglong> > ETAstats;
|
||||||
QHash<QString, qlonglong> ETAs;
|
QHash<QString, qlonglong> ETAs;
|
||||||
QHash<QString, QPair<size_type,size_type> > ratioData;
|
QHash<QString, QPair<size_type,size_type> > ratioData;
|
||||||
QTimer *ETARefresher;
|
QTimer *ETARefresher;
|
||||||
QHash<QString, QList<QPair<QString, QString> > > trackersErrors;
|
QHash<QString, QList<QPair<QString, QString> > > trackersErrors;
|
||||||
deleteThread *deleter;
|
deleteThread *deleter;
|
||||||
|
QStringList waitingForPause;
|
||||||
QStringList finishedTorrents;
|
QStringList finishedTorrents;
|
||||||
QStringList unfinishedTorrents;
|
QStringList unfinishedTorrents;
|
||||||
bool preAllocateAll;
|
bool preAllocateAll;
|
||||||
@@ -62,9 +63,6 @@ class bittorrent : public QObject{
|
|||||||
int maxConnecsPerTorrent;
|
int maxConnecsPerTorrent;
|
||||||
int maxUploadsPerTorrent;
|
int maxUploadsPerTorrent;
|
||||||
float max_ratio;
|
float max_ratio;
|
||||||
bool UPnPEnabled;
|
|
||||||
bool NATPMPEnabled;
|
|
||||||
bool LSDEnabled;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString getSavePath(QString hash);
|
QString getSavePath(QString hash);
|
||||||
@@ -101,7 +99,6 @@ class bittorrent : public QObject{
|
|||||||
void saveDHTEntry();
|
void saveDHTEntry();
|
||||||
void preAllocateAllFiles(bool b);
|
void preAllocateAllFiles(bool b);
|
||||||
void saveFastResumeAndRatioData();
|
void saveFastResumeAndRatioData();
|
||||||
void saveFastResumeAndRatioData(QString hash);
|
|
||||||
void enableDirectoryScanning(QString scan_dir);
|
void enableDirectoryScanning(QString scan_dir);
|
||||||
void disableDirectoryScanning();
|
void disableDirectoryScanning();
|
||||||
void enablePeerExchange();
|
void enablePeerExchange();
|
||||||
@@ -139,7 +136,6 @@ class bittorrent : public QObject{
|
|||||||
void enableNATPMP(bool b);
|
void enableNATPMP(bool b);
|
||||||
void enableLSD(bool b);
|
void enableLSD(bool b);
|
||||||
bool enableDHT(bool b);
|
bool enableDHT(bool b);
|
||||||
void reloadTorrent(const QTorrentHandle &h, bool full_alloc);
|
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void scanDirectory();
|
void scanDirectory();
|
||||||
@@ -147,6 +143,8 @@ class bittorrent : public QObject{
|
|||||||
void processDownloadedFile(QString, QString);
|
void processDownloadedFile(QString, QString);
|
||||||
bool loadTrackerFile(QString hash);
|
bool loadTrackerFile(QString hash);
|
||||||
void saveTrackerFile(QString hash);
|
void saveTrackerFile(QString hash);
|
||||||
|
void pauseAndReloadTorrent(QTorrentHandle h, bool full_alloc);
|
||||||
|
void reloadTorrent(const QTorrentHandle &h, bool full_alloc); // This is protected now, call pauseAndReloadTorrent() instead
|
||||||
void deleteBigRatios();
|
void deleteBigRatios();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|||||||
@@ -21,48 +21,43 @@
|
|||||||
|
|
||||||
#include "downloadThread.h"
|
#include "downloadThread.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <QSettings>
|
#include <cc++/common.h>
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
// http://curl.rtin.bz/libcurl/c/libcurl-errors.html
|
QString subDownloadThread::errorCodeToString(int status) {
|
||||||
QString subDownloadThread::errorCodeToString(CURLcode status) {
|
|
||||||
switch(status){
|
switch(status){
|
||||||
case CURLE_FTP_CANT_GET_HOST:
|
case 1://ost::URLStream::errUnreachable:
|
||||||
case CURLE_COULDNT_RESOLVE_HOST:
|
|
||||||
return tr("Host is unreachable");
|
return tr("Host is unreachable");
|
||||||
case CURLE_READ_ERROR:
|
case 2://ost::URLStream::errMissing:
|
||||||
case CURLE_FILE_COULDNT_READ_FILE:
|
|
||||||
return tr("File was not found (404)");
|
return tr("File was not found (404)");
|
||||||
case CURLE_FTP_ACCESS_DENIED:
|
case 3://ost::URLStream::errDenied:
|
||||||
case CURLE_LOGIN_DENIED:
|
|
||||||
case CURLE_FTP_USER_PASSWORD_INCORRECT:
|
|
||||||
return tr("Connection was denied");
|
return tr("Connection was denied");
|
||||||
case CURLE_URL_MALFORMAT:
|
case 4://ost::URLStream::errInvalid:
|
||||||
return tr("Url is invalid");
|
return tr("Url is invalid");
|
||||||
case CURLE_COULDNT_RESOLVE_PROXY:
|
case 5://ost::URLStream::errForbidden:
|
||||||
return tr("Could not resolve proxy");
|
return tr("Connection forbidden (403)");
|
||||||
//case 5:
|
case 6://ost::URLStream::errUnauthorized:
|
||||||
// return tr("Connection forbidden (403)");
|
return tr("Connection was not authorized (401)");
|
||||||
//case 6:
|
case 7://ost::URLStream::errRelocated:
|
||||||
// return tr("Connection was not authorized (401)");
|
return tr("Content has moved (301)");
|
||||||
//case 7:
|
case 8://ost::URLStream::errFailure:
|
||||||
// return tr("Content has moved (301)");
|
|
||||||
case CURLE_COULDNT_CONNECT:
|
|
||||||
return tr("Connection failure");
|
return tr("Connection failure");
|
||||||
case CURLE_OPERATION_TIMEOUTED:
|
case 9://ost::URLStream::errTimeout:
|
||||||
return tr("Connection was timed out");
|
return tr("Connection was timed out");
|
||||||
case CURLE_INTERFACE_FAILED:
|
case 10://ost::URLStream::errInterface:
|
||||||
return tr("Incorrect network interface");
|
return tr("Incorrect network interface");
|
||||||
default:
|
default:
|
||||||
return tr("Unknown error");
|
return tr("Unknown error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
subDownloadThread::subDownloadThread(QObject *parent, QString url) : QThread(parent), url(url), abort(false){}
|
subDownloadThread::subDownloadThread(QObject *parent, QString url) : QThread(parent), url(url), abort(false){
|
||||||
|
url_stream = new ost::URLStream();
|
||||||
|
}
|
||||||
|
|
||||||
subDownloadThread::~subDownloadThread(){
|
subDownloadThread::~subDownloadThread(){
|
||||||
abort = true;
|
abort = true;
|
||||||
wait();
|
wait();
|
||||||
|
delete url_stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
void subDownloadThread::run(){
|
void subDownloadThread::run(){
|
||||||
@@ -73,57 +68,38 @@ void subDownloadThread::run(){
|
|||||||
filePath = tmpfile->fileName();
|
filePath = tmpfile->fileName();
|
||||||
}
|
}
|
||||||
delete tmpfile;
|
delete tmpfile;
|
||||||
FILE *f = fopen(filePath.toUtf8().data(), "w");
|
QFile dest_file(filePath);
|
||||||
if(!f) {
|
if(!dest_file.open(QIODevice::WriteOnly | QIODevice::Text)){
|
||||||
std::cerr << "couldn't open destination file" << "\n";
|
std::cerr << "Error: could't create temporary file: " << (const char*)filePath.toUtf8() << '\n';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CURL *curl;
|
ost::URLStream::Error status = url_stream->get((const char*)url.toUtf8());
|
||||||
CURLcode res;
|
if(status){
|
||||||
curl = curl_easy_init();
|
// Failure
|
||||||
if(curl) {
|
QString error_msg = errorCodeToString((int)status);
|
||||||
std::string c_url = url.toUtf8().data();
|
qDebug("Download failed for %s, reason: %s", (const char*)url.toUtf8(), (const char*)error_msg.toUtf8());
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, c_url.c_str());
|
url_stream->close();
|
||||||
// SSL support
|
emit downloadFailureST(this, url, error_msg);
|
||||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
|
return;
|
||||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
|
|
||||||
// PROXY SUPPORT
|
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
|
||||||
int intValue = settings.value(QString::fromUtf8("Preferences/Connection/ProxyType"), 0).toInt();
|
|
||||||
if(intValue > 0) {
|
|
||||||
// Proxy enabled
|
|
||||||
QString IP = settings.value(QString::fromUtf8("Preferences/Connection/Proxy/IP"), "0.0.0.0").toString();
|
|
||||||
QString port = settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Port"), 8080).toString();
|
|
||||||
qDebug("Using proxy: %s", (IP+QString(":")+port).toUtf8().data());
|
|
||||||
curl_easy_setopt(curl, CURLOPT_PROXYPORT, (IP+QString(":")+port).toUtf8().data());
|
|
||||||
// Default proxy type is HTTP, we must change if it is SOCKS5
|
|
||||||
if(intValue%2==0) {
|
|
||||||
qDebug("Proxy is SOCKS5, not HTTP");
|
|
||||||
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
|
|
||||||
}
|
|
||||||
// Authentication?
|
|
||||||
if(intValue > 2) {
|
|
||||||
qDebug("Proxy requires authentication, authenticating");
|
|
||||||
QString username = settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Username"), QString()).toString();
|
|
||||||
QString password = settings.value(QString::fromUtf8("Preferences/Connection/Proxy/Password"), QString()).toString();
|
|
||||||
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, (username+QString(":")+password).toUtf8().data());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// TODO: define CURLOPT_WRITEFUNCTION or it will crash on windows
|
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
|
|
||||||
qDebug("Downloading %s", url.toUtf8().data());
|
|
||||||
res = curl_easy_perform(curl);
|
|
||||||
/* always cleanup */
|
|
||||||
curl_easy_cleanup(curl);
|
|
||||||
fclose(f);
|
|
||||||
if(res) {
|
|
||||||
emit downloadFailureST(this, url, errorCodeToString(res));
|
|
||||||
} else {
|
|
||||||
emit downloadFinishedST(this, url, filePath);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
std::cerr << "Could not initialize CURL" << "\n";
|
|
||||||
}
|
}
|
||||||
|
qDebug("Downloading %s...", (const char*)url.toUtf8());
|
||||||
|
char cbuf[1024];
|
||||||
|
int len;
|
||||||
|
while(!url_stream->eof()) {
|
||||||
|
url_stream->read(cbuf, sizeof(cbuf));
|
||||||
|
len = url_stream->gcount();
|
||||||
|
if(len > 0)
|
||||||
|
dest_file.write(cbuf, len);
|
||||||
|
if(abort){
|
||||||
|
dest_file.close();
|
||||||
|
url_stream->close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dest_file.close();
|
||||||
|
url_stream->close();
|
||||||
|
emit downloadFinishedST(this, url, filePath);
|
||||||
|
qDebug("download completed here: %s", (const char*)filePath.toUtf8());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Download Thread **/
|
/** Download Thread **/
|
||||||
|
|||||||
@@ -29,18 +29,22 @@
|
|||||||
#include <QMutexLocker>
|
#include <QMutexLocker>
|
||||||
#include <QWaitCondition>
|
#include <QWaitCondition>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <curl/curl.h>
|
|
||||||
|
namespace ost {
|
||||||
|
class URLStream;
|
||||||
|
}
|
||||||
|
|
||||||
class subDownloadThread : public QThread {
|
class subDownloadThread : public QThread {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
QString url;
|
QString url;
|
||||||
|
ost::URLStream *url_stream;
|
||||||
bool abort;
|
bool abort;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
subDownloadThread(QObject *parent, QString url);
|
subDownloadThread(QObject *parent, QString url);
|
||||||
~subDownloadThread();
|
~subDownloadThread();
|
||||||
QString errorCodeToString(CURLcode status);
|
QString errorCodeToString(int status);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// For subthreads
|
// For subthreads
|
||||||
@@ -72,13 +76,13 @@ class downloadThread : public QThread {
|
|||||||
~downloadThread();
|
~downloadThread();
|
||||||
|
|
||||||
void downloadUrl(QString url);
|
void downloadUrl(QString url);
|
||||||
void setProxy(QString IP, int port, QString username, QString password);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void run();
|
void run();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void propagateDownloadedFile(subDownloadThread* st, QString url, QString path);
|
void propagateDownloadedFile(subDownloadThread* st, QString url, QString path);
|
||||||
|
|
||||||
void propagateDownloadFailure(subDownloadThread* st, QString url, QString reason);
|
void propagateDownloadFailure(subDownloadThread* st, QString url, QString reason);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ void DownloadingTorrents::setInfoBar(QString info, QColor color) {
|
|||||||
infoBar->clear();
|
infoBar->clear();
|
||||||
nbLines = 1;
|
nbLines = 1;
|
||||||
}
|
}
|
||||||
|
qDebug("Color is %s", color.name().toUtf8().data());
|
||||||
infoBar->append(QString::fromUtf8("<font color='grey'>")+ QTime::currentTime().toString(QString::fromUtf8("hh:mm:ss")) + QString::fromUtf8("</font> - <font color='") + color.name() +QString::fromUtf8("'><i>") + info + QString::fromUtf8("</i></font>"));
|
infoBar->append(QString::fromUtf8("<font color='grey'>")+ QTime::currentTime().toString(QString::fromUtf8("hh:mm:ss")) + QString::fromUtf8("</font> - <font color='") + color.name() +QString::fromUtf8("'><i>") + info + QString::fromUtf8("</i></font>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,6 +246,8 @@ void DownloadingTorrents::displayDLListMenu(const QPoint& pos) {
|
|||||||
QModelIndex index;
|
QModelIndex index;
|
||||||
// Enable/disable pause/start action given the DL state
|
// Enable/disable pause/start action given the DL state
|
||||||
QModelIndexList selectedIndexes = downloadList->selectionModel()->selectedIndexes();
|
QModelIndexList selectedIndexes = downloadList->selectionModel()->selectedIndexes();
|
||||||
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
||||||
|
QString previewProgram = settings.value(QString::fromUtf8("Preferences/general/MediaPlayer"), QString()).toString();
|
||||||
bool has_pause = false, has_start = false, has_preview = false;
|
bool has_pause = false, has_start = false, has_preview = false;
|
||||||
foreach(index, selectedIndexes) {
|
foreach(index, selectedIndexes) {
|
||||||
if(index.column() == NAME) {
|
if(index.column() == NAME) {
|
||||||
@@ -264,7 +267,7 @@ void DownloadingTorrents::displayDLListMenu(const QPoint& pos) {
|
|||||||
has_pause = true;
|
has_pause = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(BTSession->isFilePreviewPossible(hash) && !has_preview) {
|
if(!previewProgram.isEmpty() && BTSession->isFilePreviewPossible(hash) && !has_preview) {
|
||||||
myDLLlistMenu.addAction(actionPreview_file);
|
myDLLlistMenu.addAction(actionPreview_file);
|
||||||
has_preview = true;
|
has_preview = true;
|
||||||
}
|
}
|
||||||
|
|||||||
175
src/options.ui
175
src/options.ui
@@ -306,6 +306,51 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="previewBox" >
|
||||||
|
<property name="title" >
|
||||||
|
<string>Preview program</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" >
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_preview" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Media player:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="textMediaPlayer" />
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="browsePreviewButton" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
@@ -947,72 +992,70 @@
|
|||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>Affected connections</string>
|
<string>Affected connections</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" >
|
<widget class="QCheckBox" name="checkProxyTrackers" >
|
||||||
<item>
|
<property name="geometry" >
|
||||||
<widget class="QCheckBox" name="checkProxyTrackers" >
|
<rect>
|
||||||
<property name="sizePolicy" >
|
<x>10</x>
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
<y>20</y>
|
||||||
<horstretch>0</horstretch>
|
<width>341</width>
|
||||||
<verstretch>0</verstretch>
|
<height>22</height>
|
||||||
</sizepolicy>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Use proxy for connections to trackers</string>
|
<string>Use proxy for connections to trackers</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked" >
|
<property name="checked" >
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
<widget class="QCheckBox" name="checkProxyPeers" >
|
||||||
<item>
|
<property name="geometry" >
|
||||||
<widget class="QCheckBox" name="checkProxyPeers" >
|
<rect>
|
||||||
<property name="sizePolicy" >
|
<x>10</x>
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
<y>40</y>
|
||||||
<horstretch>0</horstretch>
|
<width>341</width>
|
||||||
<verstretch>0</verstretch>
|
<height>22</height>
|
||||||
</sizepolicy>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Use proxy for connections to regular peers</string>
|
<string>Use proxy for connections to regular peers</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked" >
|
<property name="checked" >
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
<widget class="QCheckBox" name="checkProxyWebseeds" >
|
||||||
<item>
|
<property name="geometry" >
|
||||||
<widget class="QCheckBox" name="checkProxyDHT" >
|
<rect>
|
||||||
<property name="sizePolicy" >
|
<x>10</x>
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
<y>60</y>
|
||||||
<horstretch>0</horstretch>
|
<width>341</width>
|
||||||
<verstretch>0</verstretch>
|
<height>22</height>
|
||||||
</sizepolicy>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Use proxy for DHT messages</string>
|
<string>Use proxy for connections to web seeds</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked" >
|
<property name="checked" >
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
<widget class="QCheckBox" name="checkProxyDHT" >
|
||||||
<item>
|
<property name="geometry" >
|
||||||
<widget class="QCheckBox" name="checkProxyWebseeds" >
|
<rect>
|
||||||
<property name="sizePolicy" >
|
<x>10</x>
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
<y>80</y>
|
||||||
<horstretch>0</horstretch>
|
<width>341</width>
|
||||||
<verstretch>0</verstretch>
|
<height>22</height>
|
||||||
</sizepolicy>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Use proxy for connections to web seeds</string>
|
<string>Use proxy for DHT messages</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked" >
|
<property name="checked" >
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
|||||||
connect(checkCloseToSystray, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
connect(checkCloseToSystray, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
||||||
connect(checkMinimizeToSysTray, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
connect(checkMinimizeToSysTray, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
||||||
connect(checkSystrayBalloons, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
connect(checkSystrayBalloons, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
||||||
|
connect(textMediaPlayer, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
|
||||||
// Downloads tab
|
// Downloads tab
|
||||||
connect(textSavePath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
|
connect(textSavePath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
|
||||||
connect(checkPreallocateAll, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
connect(checkPreallocateAll, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
|
||||||
@@ -261,6 +262,7 @@ void options_imp::saveOptions(){
|
|||||||
settings.setValue(QString::fromUtf8("CloseToTray"), closeToTray());
|
settings.setValue(QString::fromUtf8("CloseToTray"), closeToTray());
|
||||||
settings.setValue(QString::fromUtf8("MinimizeToTray"), minimizeToTray());
|
settings.setValue(QString::fromUtf8("MinimizeToTray"), minimizeToTray());
|
||||||
settings.setValue(QString::fromUtf8("NotificationBaloons"), OSDEnabled());
|
settings.setValue(QString::fromUtf8("NotificationBaloons"), OSDEnabled());
|
||||||
|
settings.setValue(QString::fromUtf8("MediaPlayer"), getPreviewProgram());
|
||||||
// End General preferences
|
// End General preferences
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
// Downloads preferences
|
// Downloads preferences
|
||||||
@@ -404,6 +406,7 @@ void options_imp::loadOptions(){
|
|||||||
checkMinimizeToSysTray->setChecked(settings.value(QString::fromUtf8("MinimizeToTray"), false).toBool());
|
checkMinimizeToSysTray->setChecked(settings.value(QString::fromUtf8("MinimizeToTray"), false).toBool());
|
||||||
checkSystrayBalloons->setChecked(settings.value(QString::fromUtf8("NotificationBaloons"), true).toBool());
|
checkSystrayBalloons->setChecked(settings.value(QString::fromUtf8("NotificationBaloons"), true).toBool());
|
||||||
}
|
}
|
||||||
|
textMediaPlayer->setText(settings.value(QString::fromUtf8("MediaPlayer"), QString()).toString());
|
||||||
// End General preferences
|
// End General preferences
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
// Downloads preferences
|
// Downloads preferences
|
||||||
@@ -460,15 +463,7 @@ void options_imp::loadOptions(){
|
|||||||
spinUploadLimit->setEnabled(false);
|
spinUploadLimit->setEnabled(false);
|
||||||
}
|
}
|
||||||
intValue = settings.value(QString::fromUtf8("ProxyType"), 0).toInt();
|
intValue = settings.value(QString::fromUtf8("ProxyType"), 0).toInt();
|
||||||
if(intValue <= 0) {
|
if(intValue < 0) intValue = 0;
|
||||||
intValue = 0;
|
|
||||||
} else {
|
|
||||||
if(intValue%2 == 0) {
|
|
||||||
intValue = 2;
|
|
||||||
}else {
|
|
||||||
intValue = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
comboProxyType->setCurrentIndex(intValue);
|
comboProxyType->setCurrentIndex(intValue);
|
||||||
enableProxy(intValue);
|
enableProxy(intValue);
|
||||||
if(isProxyEnabled()) {
|
if(isProxyEnabled()) {
|
||||||
@@ -588,6 +583,12 @@ int options_imp::getEncryptionSetting() const{
|
|||||||
return comboEncryption->currentIndex();
|
return comboEncryption->currentIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString options_imp::getPreviewProgram() const{
|
||||||
|
QString preview_txt = textMediaPlayer->text();
|
||||||
|
preview_txt = preview_txt.trimmed();
|
||||||
|
return preview_txt;
|
||||||
|
}
|
||||||
|
|
||||||
bool options_imp::minimizeToTray() const{
|
bool options_imp::minimizeToTray() const{
|
||||||
if(checkNoSystray->isChecked()) return false;
|
if(checkNoSystray->isChecked()) return false;
|
||||||
return checkMinimizeToSysTray->isChecked();
|
return checkMinimizeToSysTray->isChecked();
|
||||||
@@ -871,7 +872,6 @@ void options_imp::enableProxy(int index){
|
|||||||
textProxyIP->setEnabled(false);
|
textProxyIP->setEnabled(false);
|
||||||
lblProxyPort->setEnabled(false);
|
lblProxyPort->setEnabled(false);
|
||||||
spinProxyPort->setEnabled(false);
|
spinProxyPort->setEnabled(false);
|
||||||
checkProxyAuth->setChecked(false);
|
|
||||||
checkProxyAuth->setEnabled(false);
|
checkProxyAuth->setEnabled(false);
|
||||||
ProxyConnecsBox->setEnabled(false);
|
ProxyConnecsBox->setEnabled(false);
|
||||||
}
|
}
|
||||||
@@ -996,6 +996,13 @@ void options_imp::on_browseFilterButton_clicked() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void options_imp::on_browsePreviewButton_clicked() {
|
||||||
|
QString program_txt = QFileDialog::getOpenFileName(this, tr("Choose your favourite preview program"), QDir::homePath());
|
||||||
|
if(!program_txt.isNull()){
|
||||||
|
textMediaPlayer->setText(program_txt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Display dialog to choose save dir
|
// Display dialog to choose save dir
|
||||||
void options_imp::on_browseSaveDirButton_clicked(){
|
void options_imp::on_browseSaveDirButton_clicked(){
|
||||||
QString dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath());
|
QString dir = QFileDialog::getExistingDirectory(this, tr("Choose a save directory"), QDir::homePath());
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class options_imp : public QDialog, private Ui::Dialog{
|
|||||||
bool minimizeToTray() const;
|
bool minimizeToTray() const;
|
||||||
bool closeToTray() const;
|
bool closeToTray() const;
|
||||||
bool OSDEnabled() const;
|
bool OSDEnabled() const;
|
||||||
|
QString getPreviewProgram() const;
|
||||||
// Downloads
|
// Downloads
|
||||||
QString getSavePath() const;
|
QString getSavePath() const;
|
||||||
bool preAllocateAllFiles() const;
|
bool preAllocateAllFiles() const;
|
||||||
@@ -118,6 +119,7 @@ class options_imp : public QDialog, private Ui::Dialog{
|
|||||||
void on_addFilterRangeButton_clicked();
|
void on_addFilterRangeButton_clicked();
|
||||||
void on_delFilterRangeButton_clicked();
|
void on_delFilterRangeButton_clicked();
|
||||||
void on_browseScanDirButton_clicked();
|
void on_browseScanDirButton_clicked();
|
||||||
|
void on_browsePreviewButton_clicked();
|
||||||
void on_browseFilterButton_clicked();
|
void on_browseFilterButton_clicked();
|
||||||
void on_browseSaveDirButton_clicked();
|
void on_browseSaveDirButton_clicked();
|
||||||
void processFilterFile(QString filePath=QString());
|
void processFilterFile(QString filePath=QString());
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>594</width>
|
<width>538</width>
|
||||||
<height>567</height>
|
<height>567</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
#include <QSettings>
|
|
||||||
#include <QDesktopWidget>
|
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
properties::properties(QWidget *parent, bittorrent *BTSession, QTorrentHandle &h): QDialog(parent), h(h), BTSession(BTSession), changedFilteredfiles(false), hash(h.hash()) {
|
properties::properties(QWidget *parent, bittorrent *BTSession, QTorrentHandle &h): QDialog(parent), h(h), BTSession(BTSession), changedFilteredfiles(false), hash(h.hash()) {
|
||||||
@@ -120,7 +118,6 @@ properties::properties(QWidget *parent, bittorrent *BTSession, QTorrentHandle &h
|
|||||||
updateInfosTimer = new QTimer(this);
|
updateInfosTimer = new QTimer(this);
|
||||||
connect(updateInfosTimer, SIGNAL(timeout()), this, SLOT(updateInfos()));
|
connect(updateInfosTimer, SIGNAL(timeout()), this, SLOT(updateInfos()));
|
||||||
updateInfosTimer->start(3000);
|
updateInfosTimer->start(3000);
|
||||||
loadSettings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
properties::~properties(){
|
properties::~properties(){
|
||||||
@@ -158,36 +155,6 @@ void properties::addFilesToTree(file *root, QStandardItem *parent) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void properties::writeSettings() {
|
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
|
||||||
settings.beginGroup(QString::fromUtf8("PropWindow"));
|
|
||||||
settings.setValue(QString::fromUtf8("size"), size());
|
|
||||||
settings.setValue(QString::fromUtf8("pos"), pos());
|
|
||||||
settings.endGroup();
|
|
||||||
}
|
|
||||||
|
|
||||||
void properties::loadSettings() {
|
|
||||||
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
|
|
||||||
resize(settings.value(QString::fromUtf8("PropWindow/size"), size()).toSize());
|
|
||||||
move(settings.value(QString::fromUtf8("PropWindow/pos"), screenCenter()).toPoint());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Center window
|
|
||||||
QPoint properties::screenCenter() const{
|
|
||||||
int scrn = 0;
|
|
||||||
QWidget *w = this->topLevelWidget();
|
|
||||||
|
|
||||||
if(w)
|
|
||||||
scrn = QApplication::desktop()->screenNumber(w);
|
|
||||||
else if(QApplication::desktop()->isVirtualDesktop())
|
|
||||||
scrn = QApplication::desktop()->screenNumber(QCursor::pos());
|
|
||||||
else
|
|
||||||
scrn = QApplication::desktop()->screenNumber(this);
|
|
||||||
|
|
||||||
QRect desk(QApplication::desktop()->availableGeometry(scrn));
|
|
||||||
return QPoint((desk.width() - this->frameGeometry().width()) / 2, (desk.height() - this->frameGeometry().height()) / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// priority is the new priority of given item
|
// priority is the new priority of given item
|
||||||
void properties::updateParentsPriority(QStandardItem *item, int priority) {
|
void properties::updateParentsPriority(QStandardItem *item, int priority) {
|
||||||
QStandardItem *parent = item->parent();
|
QStandardItem *parent = item->parent();
|
||||||
@@ -337,7 +304,6 @@ bool properties::allFiltered() const {
|
|||||||
|
|
||||||
|
|
||||||
void properties::getPriorities(QStandardItem *parent, int *priorities) {
|
void properties::getPriorities(QStandardItem *parent, int *priorities) {
|
||||||
qDebug("In getPriorities");
|
|
||||||
unsigned int nbRows = parent->rowCount();
|
unsigned int nbRows = parent->rowCount();
|
||||||
for(unsigned int i=0; i<nbRows; ++i){
|
for(unsigned int i=0; i<nbRows; ++i){
|
||||||
QStandardItem *item = parent->child(i, INDEX);
|
QStandardItem *item = parent->child(i, INDEX);
|
||||||
@@ -347,7 +313,6 @@ void properties::getPriorities(QStandardItem *parent, int *priorities) {
|
|||||||
} else {
|
} else {
|
||||||
item = parent->child(i, PRIORITY);
|
item = parent->child(i, PRIORITY);
|
||||||
priorities[index] = item->text().toInt();
|
priorities[index] = item->text().toInt();
|
||||||
qDebug("File at index %d has priority %d", index, priorities[index]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -489,7 +454,6 @@ void properties::askForTracker(){
|
|||||||
h.force_reannounce();
|
h.force_reannounce();
|
||||||
// Reload Trackers
|
// Reload Trackers
|
||||||
loadTrackers();
|
loadTrackers();
|
||||||
emit trackersChanged(h.hash());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void properties::deleteSelectedUrlSeeds(){
|
void properties::deleteSelectedUrlSeeds(){
|
||||||
@@ -538,7 +502,6 @@ void properties::deleteSelectedTrackers(){
|
|||||||
h.force_reannounce();
|
h.force_reannounce();
|
||||||
// Reload Trackers
|
// Reload Trackers
|
||||||
loadTrackers();
|
loadTrackers();
|
||||||
emit trackersChanged(h.hash());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void properties::riseSelectedTracker(){
|
void properties::riseSelectedTracker(){
|
||||||
@@ -572,7 +535,6 @@ void properties::riseSelectedTracker(){
|
|||||||
// Reload Trackers
|
// Reload Trackers
|
||||||
loadTrackers();
|
loadTrackers();
|
||||||
trackersURLS->item(i-1)->setSelected(true);
|
trackersURLS->item(i-1)->setSelected(true);
|
||||||
emit trackersChanged(h.hash());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -607,7 +569,6 @@ void properties::lowerSelectedTracker(){
|
|||||||
// Reload Trackers
|
// Reload Trackers
|
||||||
loadTrackers();
|
loadTrackers();
|
||||||
trackersURLS->item(i+1)->setSelected(true);
|
trackersURLS->item(i+1)->setSelected(true);
|
||||||
emit trackersChanged(h.hash());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,13 +74,10 @@ class properties : public QDialog, private Ui::properties{
|
|||||||
void updateParentsPriority(QStandardItem *item, int priority);
|
void updateParentsPriority(QStandardItem *item, int priority);
|
||||||
void updatePriorities(QStandardItem *item);
|
void updatePriorities(QStandardItem *item);
|
||||||
void getPriorities(QStandardItem *parent, int *priorities);
|
void getPriorities(QStandardItem *parent, int *priorities);
|
||||||
void writeSettings();
|
|
||||||
void loadSettings();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void filteredFilesChanged(QString hash);
|
void filteredFilesChanged(QString hash);
|
||||||
void fileSizeChanged(QString hash);
|
void fileSizeChanged(QString hash);
|
||||||
void trackersChanged(QString hash);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
@@ -89,9 +86,6 @@ class properties : public QDialog, private Ui::properties{
|
|||||||
bool allFiltered() const;
|
bool allFiltered() const;
|
||||||
bool savePiecesPriorities();
|
bool savePiecesPriorities();
|
||||||
int* loadPiecesPriorities();
|
int* loadPiecesPriorities();
|
||||||
|
|
||||||
protected:
|
|
||||||
QPoint screenCenter() const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -452,19 +452,12 @@ void SearchEngine::on_stop_search_button_clicked(){
|
|||||||
|
|
||||||
// Clear search results list
|
// Clear search results list
|
||||||
void SearchEngine::on_clear_button_clicked(){
|
void SearchEngine::on_clear_button_clicked(){
|
||||||
// Kill process
|
|
||||||
searchProcess->terminate();
|
|
||||||
search_stopped = true;
|
|
||||||
|
|
||||||
searchResultsUrls.clear();
|
searchResultsUrls.clear();
|
||||||
SearchListModel->removeRows(0, SearchListModel->rowCount());
|
SearchListModel->removeRows(0, SearchListModel->rowCount());
|
||||||
// Disable clear & download buttons
|
// Disable clear & download buttons
|
||||||
clear_button->setEnabled(false);
|
clear_button->setEnabled(false);
|
||||||
download_button->setEnabled(false);
|
download_button->setEnabled(false);
|
||||||
results_lbl->setText(tr("Results")+" <i>(0)</i>:");
|
results_lbl->setText(tr("Results")+" <i>(0)</i>:");
|
||||||
// focus on search pattern
|
|
||||||
search_pattern->clear();
|
|
||||||
search_pattern->setFocus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchEngine::on_clearPatternButton_clicked() {
|
void SearchEngine::on_clearPatternButton_clicked() {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ TARGET = qbittorrent
|
|||||||
CONFIG += qt thread x11 network
|
CONFIG += qt thread x11 network
|
||||||
|
|
||||||
# Update this VERSION for each release
|
# Update this VERSION for each release
|
||||||
DEFINES += VERSION=\\\"v1.0.0rc9\\\"
|
DEFINES += VERSION=\\\"v1.0.0rc7\\\"
|
||||||
DEFINES += VERSION_MAJOR=1
|
DEFINES += VERSION_MAJOR=1
|
||||||
DEFINES += VERSION_MINOR=0
|
DEFINES += VERSION_MINOR=0
|
||||||
DEFINES += VERSION_BUGFIX=0
|
DEFINES += VERSION_BUGFIX=0
|
||||||
@@ -53,7 +53,7 @@ DEFINES += NDEBUG
|
|||||||
menuicon.path = $$PREFIX/share/applications/
|
menuicon.path = $$PREFIX/share/applications/
|
||||||
INSTALLS += menuicon
|
INSTALLS += menuicon
|
||||||
icon16.files = menuicons/16x16/apps/qbittorrent.png
|
icon16.files = menuicons/16x16/apps/qbittorrent.png
|
||||||
icon16.path = $$PREFIX/share/icons/hicolor/16x16/apps/
|
icon16.path = $$PREFIX/share/icons/hicolor/22x22/apps/
|
||||||
icon22.files = menuicons/22x22/apps/qbittorrent.png
|
icon22.files = menuicons/22x22/apps/qbittorrent.png
|
||||||
icon22.path = $$PREFIX/share/icons/hicolor/22x22/apps/
|
icon22.path = $$PREFIX/share/icons/hicolor/22x22/apps/
|
||||||
icon24.files = menuicons/24x24/apps/qbittorrent.png
|
icon24.files = menuicons/24x24/apps/qbittorrent.png
|
||||||
@@ -81,7 +81,7 @@ QMAKE_CXXFLAGS_RELEASE += -fwrapv -O2
|
|||||||
QMAKE_CXXFLAGS_DEBUG += -fwrapv -O1
|
QMAKE_CXXFLAGS_DEBUG += -fwrapv -O1
|
||||||
|
|
||||||
CONFIG += link_pkgconfig
|
CONFIG += link_pkgconfig
|
||||||
PKGCONFIG += "libtorrent libcurl"
|
PKGCONFIG += libtorrent libccext2 libccgnu2
|
||||||
|
|
||||||
!contains(DEFINES, HAVE_MAGICK){
|
!contains(DEFINES, HAVE_MAGICK){
|
||||||
message(ImageMagick disabled)
|
message(ImageMagick disabled)
|
||||||
|
|||||||
Reference in New Issue
Block a user