- Based on libtorrent v0.12 (still unreleased, use libtorrent cvs)

- Added Peer Exchange (PeX)
- Display number of complete/incomplete sources in download list for each torrent
- Updated version to v0.9.0beta1
This commit is contained in:
Christophe Dumez 2006-12-27 23:56:30 +00:00
parent b838038fe2
commit 931cfb6783
8 changed files with 31 additions and 196 deletions

View file

@ -1,12 +1,14 @@
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v0.9.0
- FEATURE: Based on libtorrent v0.12
- FEATURE: Based on Qt 4.2
- FEATURE: Brand new trayicon from Qt 4.2
- FEATURE: Support Peer Exchange (PeX)
- FEATURE: Added a menu action to visit qBittorrent website
- FEATURE: Added a menu action to report a bug in qBittorrent
- FEATURE: Use hashtables for faster lookup
- FEATURE: Improved the way parameters are passed between qBT instances (socket)
- FEATURE: User is warned when hard drive becomes full and downloads are paused
- FEATURE: Seeds / Leechers are displayed in download list as well as in torrent properties
- FEATURE: Number of complete/incomplete sources are now displayed in download list for each torrent
- BUGFIX: Fixed download from url that would fail sometimes
- BUGFIX: Save directory was reset to default when filtering files in torrent
- BUGFIX: Force a refresh of download list when the window is shown (avoid delay)

View file

@ -16,7 +16,7 @@ will install and execute qBittorrent hopefully without any problems.
Dependencies:
- Qt >= 4.2 (libqt-devel, libqtgui, libqtcore, libqtnetwork)
- rb_libtorrent by Arvid Norberg (>= v0.11 REQUIRED)
- libtorrent by Arvid Norberg (>= v0.12 REQUIRED)
-> http://libtorrent.sf.net
Be carefull: another library (the one used by rtorrent) use the same name.
These are TWO different libraries and qBittorrent will only work with the one provided

View file

@ -7,7 +7,7 @@ class qc_libtorrent : public ConfObj
{
public:
qc_libtorrent(Conf *c) : ConfObj(c) {}
QString name() const { return "libtorrent >= 0.11"; }
QString name() const { return "libtorrent >= 0.12"; }
QString shortname() const { return "libtorrent"; }
bool exec(){
QString s;
@ -15,8 +15,8 @@ public:
sl += "/usr/include";
sl += "/usr/local/include";
sl += "/sw/include";
if(!conf->findHeader("libtorrent/kademlia/node.hpp", sl, &s)) {
qWarning("libtorrent v0.11 includes not found!\nYou can download it at http://www.libtorrent.net");
if(!conf->findHeader("libtorrent/extensions/ut_pex.hpp", sl, &s)) {
qWarning("libtorrent v0.12 includes not found!\nYou can download it at http://www.libtorrent.net");
return false;
}
conf->addIncludePath(s);

View file

@ -40,6 +40,9 @@
#include <boost/filesystem/exception.hpp>
#include <curl/curl.h>
#include <libtorrent/extensions/metadata_transfer.hpp>
#include <libtorrent/extensions/ut_pex.hpp>
#include "GUI.h"
#include "misc.h"
#include "createtorrent_imp.h"
@ -127,7 +130,8 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent){
DHTEnabled = false;
// Configure BT session according to options
configureSession();
s->disable_extensions();
s->add_extension(&create_metadata_plugin);
s->add_extension(&create_ut_pex_plugin);
// download thread
downloader = new downloadThread(this);
connect(downloader, SIGNAL(downloadFinished(QString, QString, int, QString)), this, SLOT(processDownloadedFile(QString, QString, int, QString)));
@ -523,14 +527,9 @@ void GUI::updateDlList(bool force){
DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)torrentStatus.upload_payload_rate));
break;
default:
DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant(QString(misc::toString(torrentStatus.num_complete, true).c_str())+"/"+QString(misc::toString(torrentStatus.num_incomplete, true).c_str())));
DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1));
}
if(torrentStatus.num_complete == -1 && torrentStatus.num_incomplete == -1){
DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant(tr("Unknown")));
}else{
DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant(QString(misc::toString(torrentStatus.num_complete, true).c_str())+"/"+QString(misc::toString(torrentStatus.num_incomplete, true).c_str())));
}
DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant(QString(misc::toString(torrentStatus.num_seeds, true).c_str())+"/"+QString(misc::toString(torrentStatus.num_peers - torrentStatus.num_seeds, true).c_str())));
}
}catch(invalid_handle e){
continue;
@ -1296,7 +1295,7 @@ void GUI::addTorrent(const QString& path, bool fromScanDir, const QString& from_
DLListModel->setData(DLListModel->index(row, SIZE), QVariant((qlonglong)t.total_size()));
DLListModel->setData(DLListModel->index(row, DLSPEED), QVariant((double)0.));
DLListModel->setData(DLListModel->index(row, UPSPEED), QVariant((double)0.));
DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant(tr("Unknown")));
DLListModel->setData(DLListModel->index(row, SEEDSLEECH), QVariant("0/0"));
DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1));
// Pause torrent if it was paused last time
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+QString(t.name().c_str())+".paused")){

View file

@ -23,7 +23,7 @@
#define ABOUT_H
#include "ui_about.h"
#define VERSION "v0.9.0alpha1"
#define VERSION "v0.9.0beta1"
class about : public QDialog, private Ui::AboutDlg{
Q_OBJECT

View file

@ -26,12 +26,13 @@
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/fstream.hpp>
#include "libtorrent/entry.hpp"
#include "libtorrent/bencode.hpp"
#include "libtorrent/torrent_info.hpp"
#include "libtorrent/file.hpp"
#include "libtorrent/storage.hpp"
#include "libtorrent/hasher.hpp"
#include <libtorrent/entry.hpp>
#include <libtorrent/bencode.hpp>
#include <libtorrent/torrent_info.hpp>
#include <libtorrent/file.hpp>
#include <libtorrent/storage.hpp>
#include <libtorrent/hasher.hpp>
#include <libtorrent/file_pool.hpp>
#include "createtorrent_imp.h"
@ -105,7 +106,8 @@ void createtorrent::on_createButton_clicked(){
add_files(t, full_path.branch_path(), full_path.leaf());
t.set_piece_size(piece_size);
storage st(t, full_path.branch_path());
file_pool fp;
storage st(t, full_path.branch_path(), fp);
QStringList trackers = txt_announce->toPlainText().split('\n');
for(int i=0; i<trackers.size(); ++i){
t.add_tracker((const char*)trackers.at(i).toUtf8());

View file

@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>538</width>
<height>585</height>
<height>567</height>
</rect>
</property>
<property name="windowTitle" >
@ -77,137 +77,6 @@
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="font" >
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="text" >
<string>Download state:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="dlState" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>111</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="lbl_seeds" >
<property name="font" >
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="text" >
<string>Seeders:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="nbSeeds" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_leechers" >
<property name="font" >
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="text" >
<string>Leechers:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="nbLeechers" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
@ -218,6 +87,12 @@
</property>
<item>
<widget class="QLabel" name="savePath_lbl" >
<property name="font" >
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text" >
<string>Save path:</string>
</property>

View file

@ -46,32 +46,6 @@ properties::properties(QWidget *parent, torrent_handle h, QStringList trackerErr
torrent_status torrentStatus = h.status();
torrent_info torrentInfo = h.get_torrent_info();
fileName->setText(torrentInfo.name().c_str());
torrent_status::state_t state = torrentStatus.state;
switch(state){
case torrent_status::finished:
dlState->setText(tr("Finished"));
break;
case torrent_status::queued_for_checking:
dlState->setText(tr("Queued for checking"));
break;
case torrent_status::checking_files:
dlState->setText(tr("Checking files"));
break;
case torrent_status::connecting_to_tracker:
dlState->setText(tr("Connecting to tracker"));
break;
case torrent_status::downloading_metadata:
dlState->setText(tr("Downloading Metadata"));
break;
case torrent_status::downloading:
dlState->setText(tr("Downloading"));
break;
case torrent_status::seeding:
dlState->setText(tr("Seeding"));
break;
case torrent_status::allocating:
dlState->setText(tr("Allocating"));
}
QString tracker = QString(torrentStatus.current_tracker.c_str()).trimmed();
if(!tracker.isEmpty()){
trackerURL->setText(tracker);
@ -98,23 +72,6 @@ properties::properties(QWidget *parent, torrent_handle h, QStringList trackerErr
snprintf(tmp, MAX_CHAR_TMP, "%.1f", ratio);
shareRatio->setText(tmp);
}
float complete, partial;
QString completeStr, partialStr;
complete = torrentStatus.num_complete;
if(complete == -1){
completeStr = tr("Unknown");
}else{
completeStr = QString(misc::toString(complete).c_str());
}
partial = torrentStatus.num_incomplete;
if(partial == -1){
partialStr = tr("Unknown");
}else{
partialStr = QString(misc::toString(partial).c_str());
}
nbSeeds->setText(completeStr);
nbLeechers->setText(partialStr);
// Tracker Errors
for(int i=0; i < trackerErrors.size(); ++i){
this->trackerErrors->append(trackerErrors.at(i));