1
mirror of https://github.com/qbittorrent/qBittorrent synced 2025-10-14 11:52:15 +02:00

Compare commits

..

39 Commits

Author SHA1 Message Date
Christophe Dumez
445d000a87 - Removed rc2 from version 2009-08-13 03:54:35 +00:00
Christophe Dumez
3bf89e17e5 - Tagged v1.4.0 release 2009-08-13 03:51:59 +00:00
Christophe Dumez
a038616fe5 - Updated Changelog 2009-08-13 03:48:53 +00:00
Christophe Dumez
81e5c295b6 - Updated German translation 2009-08-13 01:29:57 +00:00
Christophe Dumez
08d079a563 - Updated Swedish, Bulgarian and Greek translations 2009-08-11 01:16:27 +00:00
Christophe Dumez
454c8dc2bc - Fix compilation with Qt 4.3 (closes #410138) 2009-08-07 10:26:02 +00:00
Christophe Dumez
337fc72ee6 - Updated Changelog 2009-08-06 14:19:49 +00:00
Christophe Dumez
b1e9c1ccf5 - Updated preference text since we are spoofing µtorrent now instead of Azureus 2009-08-06 13:14:50 +00:00
Christophe Dumez
64806cb199 - Torrent is moved to temp dir on startup if it is supposed to be complete but data could not be found 2009-08-06 08:58:49 +00:00
Christophe Dumez
8e8e7cd3e7 - Fixed finished torrents returning to download dir on restart when temp dir feature is enabled 2009-08-06 08:48:04 +00:00
Christophe Dumez
27a18e01e2 - Updated Hungarian translation 2009-08-06 04:01:31 +00:00
Christophe Dumez
fc9e7d74a3 - Bump to rc2 2009-08-02 06:36:13 +00:00
Christophe Dumez
037a1875f9 - Use findPkg (pkg-config) to find libtorrent-rasterbar and detected if version is sufficient
- Cleaned up libMagick compilation flags detection
- Minor fixes to About dialog
- Updated language files
- Fixed French translation
2009-08-02 06:33:43 +00:00
Christophe Dumez
66baa4d3dc - Fixed torrent name parsing in Mininova search plugin due to Web site changes (Thanks Lucas Moauro for the patch) 2009-08-02 01:42:38 +00:00
Christophe Dumez
9e522a8a6c - Updated language files 2009-08-02 01:19:02 +00:00
Christophe Dumez
cfa4edd140 - Updated Korean and Italian translations
- Fixes to about dialog
2009-08-02 01:08:14 +00:00
Christophe Dumez
9e9134cd44 - Polished Finnish translation 2009-07-27 07:59:48 +00:00
Christophe Dumez
83a798b07e - Updated Portuguese and Brazilian translations 2009-07-27 01:57:40 +00:00
Christophe Dumez
baee85684c - Updated romanian translation 2009-07-25 16:14:53 +00:00
Christophe Dumez
88afb0f0e7 - Updated Chinese Translation 2009-07-25 13:32:08 +00:00
Christophe Dumez
6f212f18f5 - Updated Russian translation 2009-07-25 12:07:13 +00:00
Christophe Dumez
f04e600340 - Updated Turkish translation 2009-07-25 08:46:07 +00:00
Christophe Dumez
5140886567 - Updated slovak translation 2009-07-24 13:24:10 +00:00
Christophe Dumez
0aa59694fd - Updated Czech translation 2009-07-24 11:29:45 +00:00
Christophe Dumez
66d31b5ca1 - Updated Finnish translation 2009-07-24 11:16:41 +00:00
Christophe Dumez
47135932a4 - Updated Finnish translation 2009-07-24 09:16:26 +00:00
Christophe Dumez
40d0e44f15 - Bump to rc1 2009-07-24 08:32:51 +00:00
Christophe Dumez
16c30a2f10 - Updated language files 2009-07-24 08:16:40 +00:00
Christophe Dumez
7f2639fcbd - Remember visual indexes of columns in transfer lists 2009-07-24 05:53:35 +00:00
Christophe Dumez
8ad987a672 - Save properties window size, position, columns width and restore them
- Set a minimum default width for NAME column in properties
2009-07-24 03:35:55 +00:00
Christophe Dumez
b24194068a - Fixed possible overflow in progress calculation in arborescence.h 2009-07-24 03:00:11 +00:00
Christophe Dumez
f4e9b00ce3 - Fixed a small typo 2009-07-24 02:40:36 +00:00
Christophe Dumez
5c0a24d58b - Fixed "infos" -> "info" typo in torrent properties
- Updated language files
- Updated French translation
2009-07-23 14:15:27 +00:00
Christophe Dumez
c4aa23c86b - Fixed torrent creation (closes #402025) 2009-07-23 09:11:05 +00:00
Christophe Dumez
96911a2c48 - Fixed broken icon for Website link 2009-07-15 11:13:52 +00:00
Christophe Dumez
85abb80f43 - Updated TODO 2009-07-15 11:02:56 +00:00
Christophe Dumez
2372f434cf Fixed a small bug in new DHT port setting code 2009-07-14 08:06:55 +00:00
Christophe Dumez
ee6bc3c2e9 - FEATURE: Allow to set a different port for DHT (UDP) than the one used for
Bittorrent
2009-07-14 07:50:00 +00:00
Christophe Dumez
b6c6637c3b Made IP filter more robust 2009-07-14 06:49:16 +00:00
76 changed files with 5662 additions and 11610 deletions

View File

@@ -1,15 +1,25 @@
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.4.0
* Thu Aug 13 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.4.0
- FEATURE: Display swarm information in lists
- FEATURE: Allow to define temporary download folder
- FEATURE: Display total amount of uploaded data in finished list
- FEATURE: Resizing a column in a search results tab affects all tabs
- FEATURE: Search results tab columns are now remembered upon startup
- FEATURE: Added right click menu in search engine to clear completion history
- FEATURE: Allow to set a different port for DHT (UDP) than the one used for Bittorrent
- FEATURE: Updated spoofing code to avoid trackers ban
- BUGFIX: Provide more helpful explanation when an I/O error occured
- BUGFIX: Stop enforcing UTF-8 and use system locale instead
- COSMETIC: Redesigned program preferences
- COSMETIC: Updated icons set
* Fri Jul 24 2009 - Christophe DUMEZ <chris@qbittorrent.org> - 1.3.5
- BUGFIX: Made IP filter parser more robust
- BUGFIX: Fixed torrent creation tool
- BUGFIX: Fixed possible overflow in progress calculation in arborescence.h
- BUGFIX: Save properties window size, position, columns width and restore them
- BUGFIX: Set a minimum default width for NAME column in properties
- BUGFIX: Remember visual indexes of columns in transfer lists
* Sun Jul 12 2009 - Christophe DUMEZ <chris@qbittorrent.org> - v1.3.4
- BUGFIX: Fixed IP filter file parsing on 64bits
- BUGFIX: Suppressed QLayout: Attempting to add QLayout "" to properties "properties" warning message when opening a properties dialog

25
TODO
View File

@@ -1,27 +1,2 @@
See https://blueprints.launchpad.net/qbittorrent/
// TODO in v1.4.0
- Display peers information (disabled as a default)
- Automatically move torrent to another directory on completion (disabled as a default)
- Rework program preferences (make easier)
- Provide better errors messages to make debugging easier
// translations done in v1.3.0
- Romanian
- Russian
- Hungarian
- German
- Chinese (traditional)
- Chinese (simplified)
- Italian
- Swedish
- Turkish
- French
- Slovak
- Czech
- Korean
- Portuguese
- Brazilian
- Greek
- Bulgarian
- Finnish

109
configure vendored
View File

@@ -18,17 +18,12 @@ Main options:
--help This help text.
Dependency options:
--with-libtorrent-inc=[path] Path to libtorrent-rasterbar include
files
--with-libtorrent-lib=[path] Path to libtorrent-rasterbar library
files
--with-libtorrent-static-lib=[path] Path to libtorrent-rasterbar .a file
--with-libboost-inc=[path] Path to libboost include files
--with-libcurl-inc=[path] Path to libcurl include files
--with-libcurl-lib=[path] Path to libcurl library files
--disable-libzzip Disable use of libzzip
--with-libzzip-inc=[path] Path to libzzip++ include files
--with-libzzip-lib=[path] Path to libzzip++ library files
--with-libboost-inc=[path] Path to libboost include files
--with-libcurl-inc=[path] Path to libcurl include files
--with-libcurl-lib=[path] Path to libcurl library files
--disable-libzzip Disable use of libzzip
--with-libzzip-inc=[path] Path to libzzip++ include files
--with-libzzip-lib=[path] Path to libzzip++ library files
EOT
}
@@ -145,21 +140,6 @@ while [ $# -gt 0 ]; do
shift
;;
--with-libtorrent-inc=*)
QC_WITH_LIBTORRENT_INC=$optarg
shift
;;
--with-libtorrent-lib=*)
QC_WITH_LIBTORRENT_LIB=$optarg
shift
;;
--with-libtorrent-static-lib=*)
QC_WITH_LIBTORRENT_STATIC_LIB=$optarg
shift
;;
--with-libboost-inc=*)
QC_WITH_LIBBOOST_INC=$optarg
shift
@@ -211,9 +191,6 @@ echo PREFIX=$PREFIX
echo BINDIR=$BINDIR
echo DATADIR=$DATADIR
echo EX_QTDIR=$EX_QTDIR
echo QC_WITH_LIBTORRENT_INC=$QC_WITH_LIBTORRENT_INC
echo QC_WITH_LIBTORRENT_LIB=$QC_WITH_LIBTORRENT_LIB
echo QC_WITH_LIBTORRENT_STATIC_LIB=$QC_WITH_LIBTORRENT_STATIC_LIB
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
echo QC_WITH_LIBCURL_INC=$QC_WITH_LIBCURL_INC
echo QC_WITH_LIBCURL_LIB=$QC_WITH_LIBCURL_LIB
@@ -346,70 +323,29 @@ public:
/*
-----BEGIN QCMOD-----
name: libtorrent-rasterbar
arg: with-libtorrent-inc=[path], Path to libtorrent-rasterbar include files
arg: with-libtorrent-lib=[path], Path to libtorrent-rasterbar library files
arg: with-libtorrent-static-lib=[path], Path to libtorrent-rasterbar .a file
-----END QCMOD-----
*/
// see Conf::findPkgConfig
class qc_libtorrent_rasterbar : public ConfObj
{
public:
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
QString name() const { return "libtorrent-rasterbar >= 0.14"; }
QString name() const { return "libtorrent-rasterbar >= 0.14.0 (>= 0.14.4 advised)"; }
QString shortname() const { return "libtorrent-rasterbar"; }
bool exec(){
QString s;
s = conf->getenv("QC_WITH_LIBTORRENT_INC");
if(!s.isEmpty()) {
if(!conf->checkHeader(s, "libtorrent/magnet_uri.hpp")) {
return false;
}
}else{
QStringList sl;
sl << "/usr/include";
sl << "/usr/local/include";
bool found = false;
foreach(s, sl){
if(conf->checkHeader(s, "libtorrent/magnet_uri.hpp")){
found = true;
break;
}
}
if(!found) {
return false;
}
}
conf->addIncludePath(s);
conf->addIncludePath(s+QDir::separator()+"libtorrent");
s = conf->getenv("QC_WITH_LIBTORRENT_STATIC_LIB");
if(!s.isEmpty() && QFile::exists(s) && s.endsWith(".a")){
conf->addLib(s);
return true;
}
s = conf->getenv("QC_WITH_LIBTORRENT_LIB");
if(!s.isEmpty()) {
if(!conf->checkLibrary(s, "torrent-rasterbar")) {
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(conf->checkLibrary(s, "torrent-rasterbar")){
found = true;
break;
}
}
if(!found) return false;
conf->addLib(QString("-L") + s);
}
QStringList incs;
QString req_ver = "0.14.0";
QString adv_ver = "0.14.4";
QString version, libs, other;
VersionMode mode = VersionMin;
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
return false;
for(int n = 0; n < incs.count(); ++n)
conf->addIncludePath(incs[n]);
if(!libs.isEmpty())
conf->addLib(libs);
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
printf("\nWarning: libtorrent-rasterbar v%s was detected. Although it will compile and run, you will probably experience some bugs. Please consider updating to v%s!\n", version.toUtf8().data(), adv_ver.toUtf8().data());
return true;
}
};
@@ -1567,9 +1503,6 @@ export PREFIX
export BINDIR
export DATADIR
export EX_QTDIR
export QC_WITH_LIBTORRENT_INC
export QC_WITH_LIBTORRENT_LIB
export QC_WITH_LIBTORRENT_STATIC_LIB
export QC_WITH_LIBBOOST_INC
export QC_WITH_LIBCURL_INC
export QC_WITH_LIBCURL_LIB

View File

@@ -64,14 +64,11 @@ public:
return false;
}
conf->addLib(QString("-L") + s);
QProcess magickConfig;
QString out = "";
QStringList params;
params << "--libs";
magickConfig.start("Magick++-config", params, QIODevice::ReadOnly);
magickConfig.waitForStarted();
magickConfig.waitForFinished();
QByteArray result = magickConfig.readAll();
result = result.replace("\n", "");
params << "--libs";
qconf->doCommand("Magick++-config", params, &out);
out = out.replace("\n", "");
conf->addLib(result.data());
conf->addDefine("HAVE_MAGICK");
return true;

View File

@@ -1,9 +1,6 @@
/*
-----BEGIN QCMOD-----
name: libtorrent-rasterbar
arg: with-libtorrent-inc=[path], Path to libtorrent-rasterbar include files
arg: with-libtorrent-lib=[path], Path to libtorrent-rasterbar library files
arg: with-libtorrent-static-lib=[path], Path to libtorrent-rasterbar .a file
-----END QCMOD-----
*/
// see Conf::findPkgConfig
@@ -11,61 +8,22 @@ class qc_libtorrent_rasterbar : public ConfObj
{
public:
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
QString name() const { return "libtorrent-rasterbar >= 0.14"; }
QString name() const { return "libtorrent-rasterbar >= 0.14.0 (>= 0.14.4 advised)"; }
QString shortname() const { return "libtorrent-rasterbar"; }
bool exec(){
QString s;
s = conf->getenv("QC_WITH_LIBTORRENT_INC");
if(!s.isEmpty()) {
if(!conf->checkHeader(s, "libtorrent/magnet_uri.hpp")) {
return false;
}
}else{
QStringList sl;
sl << "/usr/include";
sl << "/usr/local/include";
bool found = false;
foreach(s, sl){
if(conf->checkHeader(s, "libtorrent/magnet_uri.hpp")){
found = true;
break;
}
}
if(!found) {
return false;
}
}
conf->addIncludePath(s);
conf->addIncludePath(s+QDir::separator()+"libtorrent");
s = conf->getenv("QC_WITH_LIBTORRENT_STATIC_LIB");
if(!s.isEmpty() && QFile::exists(s) && s.endsWith(".a")){
conf->addLib(s);
return true;
}
s = conf->getenv("QC_WITH_LIBTORRENT_LIB");
if(!s.isEmpty()) {
if(!conf->checkLibrary(s, "torrent-rasterbar")) {
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(conf->checkLibrary(s, "torrent-rasterbar")){
found = true;
break;
}
}
if(!found) return false;
conf->addLib(QString("-L") + s);
}
QStringList incs;
QString req_ver = "0.14.0";
QString adv_ver = "0.14.4";
QString version, libs, other;
VersionMode mode = VersionMin;
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
return false;
for(int n = 0; n < incs.count(); ++n)
conf->addIncludePath(incs[n]);
if(!libs.isEmpty())
conf->addLib(libs);
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
printf("\nWarning: libtorrent-rasterbar v%s was detected. Although it will compile and run, you will probably experience some bugs. Please consider updating to v%s!\n", version.toUtf8().data(), adv_ver.toUtf8().data());
return true;
}
};

View File

@@ -182,6 +182,23 @@ bool FinishedTorrents::loadColWidthFinishedList(){
finishedList->header()->resizeSection(i, width_list.at(i).toInt());
}
loadLastSortedColumn();
QVariantList visualIndexes = settings.value(QString::fromUtf8("FinishedListVisualIndexes"), QVariantList()).toList();
if(visualIndexes.size() != finishedListModel->columnCount()-1) {
qDebug("Corrupted values for download list columns sizes");
return false;
}
bool change = false;
do {
change = false;
for(int i=0;i<visualIndexes.size(); ++i) {
int new_visual_index = visualIndexes.at(finishedList->header()->logicalIndex(i)).toInt();
if(i != new_visual_index) {
qDebug("Moving column from %d to %d", finishedList->header()->logicalIndex(i), new_visual_index);
finishedList->header()->moveSection(i, new_visual_index);
change = true;
}
}
}while(change);
qDebug("Finished list columns width loaded");
return true;
}
@@ -229,6 +246,11 @@ void FinishedTorrents::saveColWidthFinishedList() const{
}
}
settings.setValue("FinishedListColsWidth", new_width_list.join(" "));
QVariantList visualIndexes;
for(int i=0; i<nbColumns; ++i) {
visualIndexes.append(finishedList->header()->visualIndex(i));
}
settings.setValue(QString::fromUtf8("FinishedListVisualIndexes"), visualIndexes);
qDebug("Finished list columns width saved");
}

View File

@@ -105,7 +105,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
actionDownload_from_URL->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/url.png")));
actionOptions->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/settings.png")));
actionAbout->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/info.png")));
actionWebsite->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/qbittorrent32.png")));
actionWebsite->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
actionBugReport->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/bug.png")));
actionStart->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/play.png")));
actionPause->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/pause.png")));
@@ -745,8 +745,7 @@ void GUI::dropEvent(QDropEvent *event) {
if(event->mimeData()->hasUrls()) {
QList<QUrl> urls = event->mimeData()->urls();
foreach(const QUrl &url, urls) {
QString tmp = url.toString();
tmp.trimmed();
QString tmp = url.toString().trimmed();
if(!tmp.isEmpty())
files << url.toString();
}
@@ -990,7 +989,7 @@ void GUI::configureSession(bool deleteOptions) {
BTSession->setListeningPortsRange(options->getPorts());
unsigned short new_listenPort = BTSession->getListenPort();
if(new_listenPort != old_listenPort) {
BTSession->addConsoleMessage(tr("qBittorrent is bind to port: %1", "e.g: qBittorrent is bind to port: 1666").arg( misc::toQString(new_listenPort)));
BTSession->addConsoleMessage(tr("qBittorrent is bound to port: TCP/%1", "e.g: qBittorrent is bound to port: 6881").arg( misc::toQString(new_listenPort)));
}
// * Global download limit
QPair<int, int> limits = options->getGlobalBandwidthLimits();
@@ -1079,9 +1078,12 @@ void GUI::configureSession(bool deleteOptions) {
// * DHT
if(options->isDHTEnabled()) {
// Set DHT Port
BTSession->setDHTPort(new_listenPort);
BTSession->setDHTPort(options->getDHTPort());
if(BTSession->enableDHT(true)) {
BTSession->addConsoleMessage(tr("DHT support [ON], port: %1").arg(new_listenPort), QString::fromUtf8("blue"));
int dht_port = new_listenPort;
if(options->getDHTPort())
dht_port = options->getDHTPort();
BTSession->addConsoleMessage(tr("DHT support [ON], port: UDP/%1").arg(dht_port), QString::fromUtf8("blue"));
} else {
BTSession->addConsoleMessage(tr("DHT support [OFF]"), QString::fromUtf8("red"));
}

File diff suppressed because one or more lines are too long

View File

@@ -91,7 +91,19 @@ class about : public QDialog, private Ui::AboutDlg{
te_translation->scrollToAnchor(QString::fromUtf8("top"));
// License
te_license->append(QString::fromUtf8("<a name='top'></a>"));
te_license->append(QString::fromUtf8("<center><b>GNU GENERAL PUBLIC LICENSE</b></center><br>\
te_license->append(QString::fromUtf8("qBittorrent is licensed under the GNU General Public License version 2 with the\
addition of the following special exception:\
<br><br>\
<i>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.</i>\
<br><br>\
<center><b>GNU GENERAL PUBLIC LICENSE</b></center><br>\
<center>Version 2, June 1991</center><br>\
Copyright (C) 1989, 1991 Free Software Foundation, Inc.<br>\
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA<br>\

View File

@@ -51,6 +51,8 @@ class torrent_file {
torrent_file(torrent_file *parent, QString path, bool dir, size_type size=0, int index=-1, float progress=0., int priority=1): parent(parent), is_dir(dir), size(size), progress(progress), priority(priority), index(index){
qDebug("created a file with index %d", index);
rel_path = QDir::cleanPath(path);
Q_ASSERT(progress >= 0.);
Q_ASSERT(progress <= 1.);
if(parent) {
parent->updateProgress();
parent->updatePriority(priority);
@@ -75,8 +77,8 @@ class torrent_file {
progress = 0.;
return;
}
float wanted = 0.;
float done = 0.;
double wanted = 0.;
double done = 0.;
foreach(const torrent_file *child, children) {
wanted += child->getSize();
done += child->getSize()*child->getProgress();
@@ -205,13 +207,13 @@ class arborescence {
} else {
// XXX: Will crash if there is no file in torrent
qDebug("one file in the torrent, setting it as root with index 0");
root = new torrent_file(0, misc::toQString(t.name()), false, fi->size, 0, ((float)fp[0])/t.file_at(0).size, prioritiesTab[0]);
root = new torrent_file(0, misc::toQString(t.name()), false, fi->size, 0, ((double)fp[0])/t.file_at(0).size, prioritiesTab[0]);
return;
}
int i = 0;
while(fi != t.end_files()) {
QString path = QDir::cleanPath(misc::toQString(fi->path.string()));
addFile(path, fi->size, i, ((float)fp[i])/t.file_at(i).size, prioritiesTab[i]);
addFile(path, fi->size, i, ((double)fp[i])/t.file_at(i).size, prioritiesTab[i]);
fi++;
++i;
}

View File

@@ -62,7 +62,7 @@ bittorrent::bittorrent() : DHTEnabled(false), preAllocateAll(false), addInPause(
// Check if we should spoof azureus
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
if(settings.value(QString::fromUtf8("AzureusSpoof"), false).toBool()) {
s = new session(fingerprint("AZ", 3, 0, 5, 2), 0);
s = new session(fingerprint("UT", 1, 8, 3, 0), 0);
} else {
s = new session(fingerprint("qB", VERSION_MAJOR, VERSION_MINOR, VERSION_BUGFIX, 0), 0);
}
@@ -450,7 +450,7 @@ QTorrentHandle bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
savepath_file.write(savePath.toLocal8Bit());
savepath_file.close();
}
if(defaultTempPath.isEmpty()) {
if(defaultTempPath.isEmpty() || QFile::exists(misc::qBittorrentPath()+QString::fromUtf8("BT_backup")+QDir::separator()+hash+QString::fromUtf8(".finished"))) {
p.save_path = savePath.toLocal8Bit().data();
} else {
p.save_path = defaultTempPath.toLocal8Bit().data();
@@ -1072,9 +1072,9 @@ void bittorrent::saveTrackerFile(QString hash) {
tracker_file.close();
}
// Set DHT port (>= 1000)
// Set DHT port (>= 1000 or 0 if same as BT)
void bittorrent::setDHTPort(int dht_port) {
if(dht_port >= 1000) {
if(dht_port == 0 or dht_port >= 1000) {
struct dht_settings DHTSettings;
DHTSettings.service_port = dht_port;
s->set_dht_settings(DHTSettings);
@@ -1255,6 +1255,15 @@ void bittorrent::readAlerts() {
if(h.is_valid()){
QString hash = h.hash();
qDebug("%s have just finished checking", hash.toLocal8Bit().data());
// Move to temp directory if necessary
if(!h.is_seed() && !defaultTempPath.isEmpty()) {
// Check if directory is different
QDir current_dir(h.save_path());
QDir save_dir(getSavePath(h.hash()));
if(current_dir == save_dir) {
h.move_storage(defaultTempPath);
}
}
emit torrentFinishedChecking(h);
}
}

View File

@@ -184,7 +184,6 @@ void createtorrent::on_createButton_clicked(){
void createtorrent::handleCreationFailure(QString msg) {
QMessageBox::information(0, tr("Torrent creation"), tr("Torrent creation was unsuccessful, reason: %1").arg(msg));
hide();
}
void createtorrent::handleCreationSuccess(QString path, const char* branch_path) {
@@ -205,7 +204,7 @@ void createtorrent::handleCreationSuccess(QString path, const char* branch_path)
emit torrent_to_seed(path);
}
QMessageBox::information(0, tr("Torrent creation"), tr("Torrent was created successfully:")+" "+path);
hide();
close();
}
void createtorrent::updateProgressBar(int progress) {
@@ -228,8 +227,12 @@ void torrentCreatorThread::create(QString _input_path, QString _save_path, QStri
start();
}
void sendProgressUpdateSignal(int i, int num, QDialog *parent){
((createtorrent*)parent)->updateProgressBar((int)(i*100./(float)num));
void sendProgressUpdateSignal(int i, int num, torrentCreatorThread *parent){
parent->sendProgressSignal((int)(i*100./(float)num));
}
void torrentCreatorThread::sendProgressSignal(int progress) {
emit updateProgress(progress);
}
void torrentCreatorThread::run() {
@@ -254,15 +257,13 @@ void torrentCreatorThread::run() {
}
if(abort) return;
// calculate the hash for all pieces
set_piece_hashes(t, full_path.branch_path(), boost::bind<void>(&sendProgressUpdateSignal, _1, t.num_pieces(), parent));
set_piece_hashes(t, full_path.branch_path(), boost::bind<void>(&sendProgressUpdateSignal, _1, t.num_pieces(), this));
// Set qBittorrent as creator and add user comment to
// torrent_info structure
t.set_creator(creator_str);
t.set_comment((const char*)comment.toLocal8Bit());
// Is private ?
if(is_private){
t.set_priv(true);
}
t.set_priv(is_private);
if(abort) return;
// create the torrent and print it to out
ofstream out(complete(path((const char*)save_path.toLocal8Bit())), std::ios_base::binary);

View File

@@ -57,6 +57,7 @@ class torrentCreatorThread : public QThread {
wait();
}
void create(QString _input_path, QString _save_path, QStringList _trackers, QStringList _url_seeds, QString _comment, bool _is_private, int _piece_size);
void sendProgressSignal(int progress);
protected:
void run();
@@ -64,6 +65,8 @@ class torrentCreatorThread : public QThread {
signals:
void creationFailure(QString msg);
void creationSuccess(QString path, const char* branch_path);
signals:
void updateProgress(int progress);
};

View File

@@ -738,6 +738,11 @@ void DownloadingTorrents::saveColWidthDLList() const{
}
}
settings.setValue(QString::fromUtf8("DownloadListColsWidth"), new_width_list.join(QString::fromUtf8(" ")));
QVariantList visualIndexes;
for(int i=0; i<nbColumns; ++i) {
visualIndexes.append(downloadList->header()->visualIndex(i));
}
settings.setValue(QString::fromUtf8("DownloadListVisualIndexes"), visualIndexes);
qDebug("Download list columns width saved");
}
@@ -758,6 +763,23 @@ bool DownloadingTorrents::loadColWidthDLList() {
for(unsigned int i=0; i<listSize; ++i) {
downloadList->header()->resizeSection(i, width_list.at(i).toInt());
}
QVariantList visualIndexes = settings.value(QString::fromUtf8("DownloadListVisualIndexes"), QVariantList()).toList();
if(visualIndexes.size() != DLListModel->columnCount()-1) {
qDebug("Corrupted values for download list columns sizes");
return false;
}
bool change = false;
do {
change = false;
for(int i=0;i<visualIndexes.size(); ++i) {
int new_visual_index = visualIndexes.at(downloadList->header()->logicalIndex(i)).toInt();
if(i != new_visual_index) {
qDebug("Moving column from %d to %d", downloadList->header()->logicalIndex(i), new_visual_index);
downloadList->header()->moveSection(i, new_visual_index);
change = true;
}
}
}while(change);
qDebug("Download list columns width loaded");
return true;
}

View File

@@ -191,8 +191,12 @@ class FilterParserThread : public QThread {
if(IPv4) {
//IPv4 addresses
IP = strStartIP.split('.');
if(IP.size() != 4)
throw exception();
address_v4 start((IP.at(0).toUInt() << 24) + (IP.at(1).toUInt() << 16) + (IP.at(2).toUInt() << 8) + IP.at(3).toUInt());
IP = strEndIP.split('.');
if(IP.size() != 4)
throw exception();
address_v4 last((IP.at(0).toUInt() << 24) + (IP.at(1).toUInt() << 16) + (IP.at(2).toUInt() << 8) + IP.at(3).toUInt());
// Apply to bittorrent session
filter.add_rule(start, last, ip_filter::blocked);

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

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