Compare commits

..

1 Commits

Author SHA1 Message Date
Christophe Dumez
22f0f20a45 Tagged rc9 release 2007-11-24 12:11:12 +00:00
20 changed files with 116 additions and 134 deletions

View File

@@ -42,12 +42,12 @@
- 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) - FEATURE: Better media file preview (player detected automatically)
- FEATURE: Greatly improved ETA calculation algorithm (use GASA)
- 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: 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: 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
- BUGFIX: Fixed a crash when filtering all the files in a torrent - BUGFIX: Fixed a crash when filtering all the files in a torrent
- BUGFIX: Reload torrent only when necessary (properties) - BUGFIX: Reload torrent only when necessary (properties)

28
TODO
View File

@@ -50,15 +50,19 @@
-> in download list -> in download list
-> in seeding list -> in seeding list
TODO: rc8->rc9 changelog:
- Check search engine cpu usage - FEATURE: Better media file preview (player detected automatically)
- BUGFIX: Remember properties window size and position
rc9->rc10 changelog: - BUGFIX: Added HTTP and SOCKS5 proxy support in downloads from urls, RSS
- FEATURE: Greatly improved ETA calculation algorithm (use GASA) - BUGFIX: Added HTTP proxy support in search engine (no SOCKS yet)
- BUGFIX: Fixed proxy host max length in preferences - BUGFIX: Do no pause torrents before saving fastresume data anymore (no longer needed)
- BUGFIX: Added a 3 minutes search engine timeout - BUGFIX: Save fast resume data regularly (every 60 seconds) to avoid downloading from scratch if qBittorrent crashes
- BUGFIX: Limit search engine plugins to 10 result pages - BUGFIX: Do not save fastresume data for checking torrents anymore
- BUGFIX: Fixed nbResults != 0 when clearing results while a search is running - BUGFIX: Saving trackers file only when necessary
- BUGFIX: Fixed possible problem when closing to systray and cancelling app exit - BUGFIX: Fixed possible segfault when unfiltering files in torrent addition dialog
- BUGFIX: Fixed preview when path contains spaces - BUGFIX: Fixed possible overflow in ETA calculation
- COSMETIC: Use more skin colors instead of hard coded ones - BUGFIX: title bar is now reset when "Display speed in title" is disabled
- BUGFIX: Fixed HTTP_PW and SOCKS5_PW in proxy combobox
- BUGFIX: Fixed proxy auth disable problem when disabling proxy
- BUGFIX: Fixed proxy layout in program preferences
- BUGFIX: Fixed everlasting libtorrent session destruction on exit

View File

@@ -392,7 +392,7 @@ void GUI::on_actionExit_triggered() {
} }
void GUI::previewFile(QString filePath) { void GUI::previewFile(QString filePath) {
QDesktopServices::openUrl(QString("file://")+filePath); QDesktopServices::openUrl(filePath);
} }
unsigned int GUI::getCurrentTabIndex() const{ unsigned int GUI::getCurrentTabIndex() const{
@@ -467,7 +467,6 @@ void GUI::closeEvent(QCloseEvent *e) {
tr("&Yes"), tr("&No"), tr("&Yes"), tr("&No"),
QString(), 0, 1)) { QString(), 0, 1)) {
e->ignore(); e->ignore();
force_exit = false;
return; return;
} }
} }
@@ -856,20 +855,10 @@ void GUI::configureSession(bool deleteOptions) {
} }
if(!proxy_str.isEmpty()) { if(!proxy_str.isEmpty()) {
// We need this for urllib in search engine plugins // We need this for urllib in search engine plugins
#ifdef Q_WS_WIN
char proxystr[512];
snprintf(proxystr, 512, "http_proxy=%s", proxy_str.toUtf8().data());
putenv(proxystr);
#else
setenv("http_proxy", proxy_str.toUtf8().data(), 1); setenv("http_proxy", proxy_str.toUtf8().data(), 1);
#endif
} }
} else { } else {
#ifdef Q_WS_WIN
putenv("http_proxy=");
#else
unsetenv("http_proxy"); unsetenv("http_proxy");
#endif
} }
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

View File

@@ -38,6 +38,8 @@
#include <libtorrent/torrent_info.hpp> #include <libtorrent/torrent_info.hpp>
#include <boost/filesystem/exception.hpp> #include <boost/filesystem/exception.hpp>
#define ETAS_MAX_VALUES 3
#define ETA_REFRESH_INTERVAL 10000
#define MAX_TRACKER_ERRORS 2 #define MAX_TRACKER_ERRORS 2
// Main constructor // Main constructor
@@ -53,6 +55,9 @@ bittorrent::bittorrent() : timerScan(0), DHTEnabled(false), preAllocateAll(false
timerAlerts = new QTimer(); timerAlerts = new QTimer();
connect(timerAlerts, SIGNAL(timeout()), this, SLOT(readAlerts())); connect(timerAlerts, SIGNAL(timeout()), this, SLOT(readAlerts()));
timerAlerts->start(3000); timerAlerts->start(3000);
ETARefresher = new QTimer();
connect(ETARefresher, SIGNAL(timeout()), this, SLOT(updateETAs()));
ETARefresher->start(ETA_REFRESH_INTERVAL);
fastResumeSaver = new QTimer(); fastResumeSaver = new QTimer();
connect(fastResumeSaver, SIGNAL(timeout()), this, SLOT(saveFastResumeAndRatioData())); connect(fastResumeSaver, SIGNAL(timeout()), this, SLOT(saveFastResumeAndRatioData()));
fastResumeSaver->start(60000); fastResumeSaver->start(60000);
@@ -62,7 +67,6 @@ bittorrent::bittorrent() : timerScan(0), DHTEnabled(false), preAllocateAll(false
connect(downloader, SIGNAL(downloadFailure(QString, QString)), this, SLOT(handleDownloadFailure(QString, QString))); connect(downloader, SIGNAL(downloadFailure(QString, QString)), this, SLOT(handleDownloadFailure(QString, QString)));
// File deleter (thread) // File deleter (thread)
deleter = new deleteThread(this); deleter = new deleteThread(this);
BigRatioTimer = 0;
qDebug("* BTSession constructed"); qDebug("* BTSession constructed");
} }
@@ -74,8 +78,7 @@ bittorrent::~bittorrent() {
delete deleter; delete deleter;
delete fastResumeSaver; delete fastResumeSaver;
delete timerAlerts; delete timerAlerts;
if(BigRatioTimer != 0) delete ETARefresher;
delete BigRatioTimer;
delete downloader; delete downloader;
// Delete BT session // Delete BT session
delete s; delete s;
@@ -140,34 +143,57 @@ void bittorrent::startTorrentsInPause(bool b) {
addInPause = b; addInPause = b;
} }
// Calculate the ETA using GASA void bittorrent::updateETAs() {
// GASA: global Average Speed Algorithm QString hash;
qlonglong bittorrent::getETA(QString hash) const { foreach(hash, unfinishedTorrents) {
QTorrentHandle h = getTorrentHandle(hash); QTorrentHandle h = getTorrentHandle(hash);
if(!h.is_valid()) return -1; if(h.is_valid()) {
switch(h.state()) { if(h.is_paused()) continue;
case torrent_status::downloading: QString hash = h.hash();
case torrent_status::connecting_to_tracker: { QList<qlonglong> listEtas = ETAstats.value(hash, QList<qlonglong>());
if(!TorrentsStartTime.contains(hash)) return -1; // XXX: We can still get an overflow if remaining file size is approximately
int timeElapsed = TorrentsStartTime.value(hash).secsTo(QDateTime::currentDateTime()); // 8.38*10^5 TiB (let's assume this can't happen)
double avg_speed; if(h.download_payload_rate() > 0.1) {
if(timeElapsed) { if(listEtas.size() == ETAS_MAX_VALUES) {
size_type data_origin = TorrentsStartData.value(hash, 0); listEtas.removeFirst();
avg_speed = (double)(h.total_payload_download()-data_origin) / (double)timeElapsed; }
listEtas << (qlonglong)((h.actual_size()-h.total_wanted_done())/(double)h.download_payload_rate());
ETAstats[hash] = listEtas;
qlonglong moy = 0;
qlonglong val;
unsigned int nbETAs = listEtas.size();
Q_ASSERT(nbETAs);
foreach(val, listEtas) {
moy += (qlonglong)((double)val/(double)nbETAs);
}
if(moy < 0) {
if(ETAstats.contains(hash)) {
ETAstats.remove(hash);
}
if(ETAs.contains(hash)) {
ETAs.remove(hash);
}
} else {
ETAs[hash] = moy;
}
} else { } else {
return -1; // Speed is too low, we don't want an overflow.
if(ETAstats.contains(hash)) {
ETAstats.remove(hash);
}
if(ETAs.contains(hash)) {
ETAs.remove(hash);
}
} }
if(avg_speed) {
return (qlonglong) floor((double) (h.actual_size() - h.total_wanted_done()) / avg_speed);
} else {
return -1;
}
} }
default:
return -1;
} }
// Delete big ratios
if(max_ratio != -1)
deleteBigRatios();
}
long bittorrent::getETA(QString hash) const{
return ETAs.value(hash, -1);
} }
// Return the torrent handle, given its hash // Return the torrent handle, given its hash
@@ -214,9 +240,9 @@ void bittorrent::deleteTorrent(QString hash, bool permanent) {
foreach(file, files) { foreach(file, files) {
torrentBackup.remove(file); torrentBackup.remove(file);
} }
// Remove it from TorrentsStartTime hash table // Remove it from ETAs hash tables
TorrentsStartTime.remove(hash); ETAstats.remove(hash);
TorrentsStartData.remove(hash); ETAs.remove(hash);
// Remove tracker errors // Remove tracker errors
trackersErrors.remove(hash); trackersErrors.remove(hash);
// Remove it from ratio table // Remove it from ratio table
@@ -264,9 +290,6 @@ void bittorrent::setUnfinishedTorrent(QString hash) {
} }
if(!unfinishedTorrents.contains(hash)) { if(!unfinishedTorrents.contains(hash)) {
unfinishedTorrents << hash; unfinishedTorrents << hash;
QTorrentHandle h = getTorrentHandle(hash);
TorrentsStartData[hash] = h.total_payload_download();
TorrentsStartTime[hash] = QDateTime::currentDateTime();
} }
} }
@@ -284,9 +307,9 @@ void bittorrent::setFinishedTorrent(QString hash) {
if(index != -1) { if(index != -1) {
unfinishedTorrents.removeAt(index); unfinishedTorrents.removeAt(index);
} }
// Remove it from TorrentsStartTime hash table // Remove it from ETAs hash tables
TorrentsStartTime.remove(hash); ETAstats.remove(hash);
TorrentsStartData.remove(hash); ETAs.remove(hash);
// Save fast resume data // Save fast resume data
saveFastResumeAndRatioData(hash); saveFastResumeAndRatioData(hash);
} }
@@ -314,9 +337,9 @@ bool bittorrent::pauseTorrent(QString hash) {
paused_file.open(QIODevice::WriteOnly | QIODevice::Text); paused_file.open(QIODevice::WriteOnly | QIODevice::Text);
paused_file.close(); paused_file.close();
} }
// Remove it from TorrentsStartTime hash table // Remove it from ETAs hash tables
TorrentsStartTime.remove(hash); ETAstats.remove(hash);
TorrentsStartData.remove(hash); ETAs.remove(hash);
return change; return change;
} }
@@ -325,9 +348,6 @@ bool bittorrent::resumeTorrent(QString hash) {
bool success = false; bool success = false;
QTorrentHandle h = getTorrentHandle(hash); QTorrentHandle h = getTorrentHandle(hash);
if(h.is_valid() && h.is_paused()) { if(h.is_valid() && h.is_paused()) {
// Save Addition DateTime
TorrentsStartData[hash] = h.total_payload_download();
TorrentsStartTime[hash] = QDateTime::currentDateTime();
h.resume(); h.resume();
success = true; success = true;
} }
@@ -998,22 +1018,9 @@ void bittorrent::setGlobalRatio(float ratio) {
// be automatically deleted // be automatically deleted
void bittorrent::setDeleteRatio(float ratio) { void bittorrent::setDeleteRatio(float ratio) {
if(ratio != -1 && ratio < 1.) ratio = 1.; if(ratio != -1 && ratio < 1.) ratio = 1.;
if(max_ratio == -1 && ratio != -1) { max_ratio = ratio;
Q_ASSERT(!BigRatioTimer); qDebug("* Set deleteRatio to %.1f", max_ratio);
BigRatioTimer = new QTimer(this); deleteBigRatios();
connect(BigRatioTimer, SIGNAL(timeout()), this, SLOT(deleteBigRatios()));
BigRatioTimer->start(5000);
} else {
if(max_ratio != -1 && ratio == -1) {
delete BigRatioTimer;
BigRatioTimer = 0;
}
}
if(max_ratio != ratio) {
max_ratio = ratio;
qDebug("* Set deleteRatio to %.1f", max_ratio);
deleteBigRatios();
}
} }
bool bittorrent::loadTrackerFile(QString hash) { bool bittorrent::loadTrackerFile(QString hash) {
@@ -1168,10 +1175,6 @@ void bittorrent::readAlerts() {
// Pause torrent // Pause torrent
pauseTorrent(hash); pauseTorrent(hash);
qDebug("%s was paused after checking", hash.toUtf8().data()); qDebug("%s was paused after checking", hash.toUtf8().data());
} else {
// Save Addition DateTime
TorrentsStartTime[hash] = QDateTime::currentDateTime();
TorrentsStartData[hash] = h.total_payload_download();
} }
emit torrentFinishedChecking(hash); emit torrentFinishedChecking(hash);
} }

View File

@@ -25,7 +25,6 @@
#include <QList> #include <QList>
#include <QPair> #include <QPair>
#include <QStringList> #include <QStringList>
#include <QDateTime>
#include <libtorrent/session.hpp> #include <libtorrent/session.hpp>
#include <libtorrent/ip_filter.hpp> #include <libtorrent/ip_filter.hpp>
@@ -46,14 +45,14 @@ class bittorrent : public QObject{
QTimer *timerScan; QTimer *timerScan;
QTimer *timerAlerts; QTimer *timerAlerts;
QTimer *fastResumeSaver; QTimer *fastResumeSaver;
QTimer *BigRatioTimer;
bool DHTEnabled; bool DHTEnabled;
downloadThread *downloader; downloadThread *downloader;
QString defaultSavePath; QString defaultSavePath;
QStringList torrentsToPauseAfterChecking; QStringList torrentsToPauseAfterChecking;
QHash<QString, QDateTime> TorrentsStartTime; QHash<QString, QList<qlonglong> > ETAstats;
QHash<QString, size_type> TorrentsStartData; QHash<QString, qlonglong> ETAs;
QHash<QString, QPair<size_type,size_type> > ratioData; QHash<QString, QPair<size_type,size_type> > ratioData;
QTimer *ETARefresher;
QHash<QString, QList<QPair<QString, QString> > > trackersErrors; QHash<QString, QList<QPair<QString, QString> > > trackersErrors;
deleteThread *deleter; deleteThread *deleter;
QStringList finishedTorrents; QStringList finishedTorrents;
@@ -83,7 +82,7 @@ class bittorrent : public QObject{
session_status getSessionStatus() const; session_status getSessionStatus() const;
int getListenPort() const; int getListenPort() const;
QStringList getTorrentsToPauseAfterChecking() const; QStringList getTorrentsToPauseAfterChecking() const;
qlonglong getETA(QString hash) const; long getETA(QString hash) const;
float getRealRatio(QString hash) const; float getRealRatio(QString hash) const;
session* getSession() const; session* getSession() const;
QList<QPair<QString, QString> > getTrackersErrors(QString hash) const; QList<QPair<QString, QString> > getTrackersErrors(QString hash) const;
@@ -109,6 +108,7 @@ class bittorrent : public QObject{
void enableIPFilter(ip_filter filter); void enableIPFilter(ip_filter filter);
void disableIPFilter(); void disableIPFilter();
void resumeUnfinishedTorrents(); void resumeUnfinishedTorrents();
void updateETAs();
void saveTorrentSpeedLimits(QString hash); void saveTorrentSpeedLimits(QString hash);
void loadTorrentSpeedLimits(QString hash); void loadTorrentSpeedLimits(QString hash);
void saveDownloadUploadForTorrent(QString hash); void saveDownloadUploadForTorrent(QString hash);

View File

@@ -109,8 +109,7 @@ void subDownloadThread::run(){
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, (username+QString(":")+password).toUtf8().data()); curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, (username+QString(":")+password).toUtf8().data());
} }
} }
// We have to define CURLOPT_WRITEFUNCTION or it will crash on windows // TODO: define CURLOPT_WRITEFUNCTION or it will crash on windows
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, f); curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
qDebug("Downloading %s", url.toUtf8().data()); qDebug("Downloading %s", url.toUtf8().data());
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@@ -414,7 +414,7 @@ void DownloadingTorrents::updateDlList() {
}else{ }else{
DLListModel->setData(DLListModel->index(row, NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/stalled.png"))), Qt::DecorationRole); DLListModel->setData(DLListModel->index(row, NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/stalled.png"))), Qt::DecorationRole);
DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1)); DLListModel->setData(DLListModel->index(row, ETA), QVariant((qlonglong)-1));
setRowColor(row, QApplication::palette().color(QPalette::WindowText)); setRowColor(row, QPalette::WindowText);
} }
DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)h.progress())); DLListModel->setData(DLListModel->index(row, PROGRESS), QVariant((double)h.progress()));
DLListModel->setData(DLListModel->index(row, DLSPEED), QVariant((double)h.download_payload_rate())); DLListModel->setData(DLListModel->index(row, DLSPEED), QVariant((double)h.download_payload_rate()));

View File

@@ -82,7 +82,7 @@ class DownloadingTorrents : public QWidget, public Ui::downloading{
public slots: public slots:
void updateDlList(); void updateDlList();
void setInfoBar(QString info, QColor color=QApplication::palette().color(QPalette::WindowText)); void setInfoBar(QString info, QColor color=QPalette::WindowText);
void pauseTorrent(QString hash); void pauseTorrent(QString hash);
void resumeTorrent(QString hash); void resumeTorrent(QString hash);
void updateRatio(); void updateRatio();

View File

@@ -298,7 +298,7 @@ class misc : public QObject{
// Take a number of seconds and return an user-friendly // Take a number of seconds and return an user-friendly
// time duration like "1d 2h 10m". // time duration like "1d 2h 10m".
static QString userFriendlyDuration(qlonglong seconds) { static QString userFriendlyDuration(const long int seconds) {
if(seconds < 0) { if(seconds < 0) {
return tr("Unknown"); return tr("Unknown");
} }

View File

@@ -794,10 +794,10 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="text" > <property name="text" >
<string/> <string>0.0.0.0</string>
</property> </property>
<property name="maxLength" > <property name="maxLength" >
<number>75</number> <number>15</number>
</property> </property>
<property name="echoMode" > <property name="echoMode" >
<enum>QLineEdit::Normal</enum> <enum>QLineEdit::Normal</enum>

View File

@@ -42,7 +42,7 @@ class QGnomeLookStyle : public QCleanlooksStyle {
vertical = (pb2->orientation == Qt::Vertical); vertical = (pb2->orientation == Qt::Vertical);
} }
if (!vertical) { if (!vertical) {
QPalette::ColorRole textRole = QPalette::WindowText;/* QPalette::ColorRole textRole = QPalette::Dark;/*
if ((pb->textAlignment & Qt::AlignCenter) && pb->textVisible if ((pb->textAlignment & Qt::AlignCenter) && pb->textVisible
&& ((qint64(pb->progress) - qint64(pb->minimum)) * 2 >= (qint64(pb->maximum) - qint64(pb->minimum)))) { && ((qint64(pb->progress) - qint64(pb->minimum)) * 2 >= (qint64(pb->maximum) - qint64(pb->minimum)))) {
textRole = QPalette::HighlightedText; textRole = QPalette::HighlightedText;

View File

@@ -28,7 +28,6 @@
#include <QTemporaryFile> #include <QTemporaryFile>
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include <iostream> #include <iostream>
#include <QTimer>
#include "SearchListDelegate.h" #include "SearchListDelegate.h"
#include "searchEngine.h" #include "searchEngine.h"
@@ -80,9 +79,6 @@ SearchEngine::SearchEngine(bittorrent *BTSession, QSystemTrayIcon *myTrayIcon, b
connect(searchProcess, SIGNAL(started()), this, SLOT(searchStarted())); connect(searchProcess, SIGNAL(started()), this, SLOT(searchStarted()));
connect(searchProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readSearchOutput())); connect(searchProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readSearchOutput()));
connect(searchProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(searchFinished(int,QProcess::ExitStatus))); connect(searchProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(searchFinished(int,QProcess::ExitStatus)));
searchTimeout = new QTimer(this);
searchTimeout->setSingleShot(true);
connect(searchTimeout, SIGNAL(timeout()), this, SLOT(on_stop_search_button_clicked()));
// Check last enabled search engines // Check last enabled search engines
loadEngineSettings(); loadEngineSettings();
// Update nova.py search plugin if necessary // Update nova.py search plugin if necessary
@@ -96,7 +92,6 @@ SearchEngine::~SearchEngine(){
saveColWidthSearchList(); saveColWidthSearchList();
searchProcess->kill(); searchProcess->kill();
searchProcess->waitForFinished(); searchProcess->waitForFinished();
delete searchTimeout;
delete searchProcess; delete searchProcess;
delete searchCompleter; delete searchCompleter;
delete SearchListModel; delete SearchListModel;
@@ -250,9 +245,6 @@ void SearchEngine::on_search_button_clicked(){
searchProcess->kill(); searchProcess->kill();
searchProcess->waitForFinished(); searchProcess->waitForFinished();
} }
if(searchTimeout->isActive()) {
searchTimeout->stop();
}
QString pattern = search_pattern->text().trimmed(); QString pattern = search_pattern->text().trimmed();
// No search pattern entered // No search pattern entered
if(pattern.isEmpty()){ if(pattern.isEmpty()){
@@ -287,7 +279,6 @@ void SearchEngine::on_search_button_clicked(){
results_lbl->setText(tr("Results")+" <i>(0)</i>:"); results_lbl->setText(tr("Results")+" <i>(0)</i>:");
// Launch search // Launch search
searchProcess->start(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py", params, QIODevice::ReadOnly); searchProcess->start(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py", params, QIODevice::ReadOnly);
searchTimeout->start(180000); // 3min
} }
void SearchEngine::searchStarted(){ void SearchEngine::searchStarted(){
@@ -457,7 +448,6 @@ void SearchEngine::on_stop_search_button_clicked(){
// Kill process // Kill process
searchProcess->terminate(); searchProcess->terminate();
search_stopped = true; search_stopped = true;
searchTimeout->stop();
} }
// Clear search results list // Clear search results list
@@ -465,13 +455,12 @@ void SearchEngine::on_clear_button_clicked(){
// Kill process // Kill process
searchProcess->terminate(); searchProcess->terminate();
search_stopped = true; search_stopped = true;
searchTimeout->stop();
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);
nb_search_results = 0;
results_lbl->setText(tr("Results")+" <i>(0)</i>:"); results_lbl->setText(tr("Results")+" <i>(0)</i>:");
// focus on search pattern // focus on search pattern
search_pattern->clear(); search_pattern->clear();

View File

@@ -33,7 +33,6 @@ class SearchListDelegate;
class bittorrent; class bittorrent;
class QSystemTrayIcon; class QSystemTrayIcon;
class downloadThread; class downloadThread;
class QTimer;
class SearchEngine : public QWidget, public Ui::search_engine{ class SearchEngine : public QWidget, public Ui::search_engine{
Q_OBJECT Q_OBJECT
@@ -55,7 +54,6 @@ class SearchEngine : public QWidget, public Ui::search_engine{
bool systrayIntegration; bool systrayIntegration;
downloadThread *downloader; downloadThread *downloader;
QStringList enabled_engines; QStringList enabled_engines;
QTimer *searchTimeout;
public: public:
SearchEngine(bittorrent *BTSession, QSystemTrayIcon *myTrayIcon, bool systrayIntegration); SearchEngine(bittorrent *BTSession, QSystemTrayIcon *myTrayIcon, bool systrayIntegration);

View File

@@ -1,4 +1,4 @@
#VERSION: 1.11 #VERSION: 1.10
#AUTHORS: Fabien Devaux (fab@gnux.info) #AUTHORS: Fabien Devaux (fab@gnux.info)
from novaprinter import prettyPrinter from novaprinter import prettyPrinter
import urllib import urllib
@@ -10,7 +10,7 @@ class btjunkie(object):
def search(self, what): def search(self, what):
i = 1 i = 1
while True and i<11: while True:
res = 0 res = 0
dat = urllib.urlopen(self.url+'/search?q=%s&o=52&p=%d'%(what,i)).read().decode('utf8', 'replace') dat = urllib.urlopen(self.url+'/search?q=%s&o=52&p=%d'%(what,i)).read().decode('utf8', 'replace')
# I know it's not very readable, but the SGML parser feels in pain # I know it's not very readable, but the SGML parser feels in pain
@@ -32,4 +32,4 @@ class btjunkie(object):
res = res + 1 res = res + 1
if res == 0: if res == 0:
break break
i = i + 1 i = i + 1

View File

@@ -1,4 +1,4 @@
#VERSION: 1.01 #VERSION: 1.00
#AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net) #AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net)
from novaprinter import prettyPrinter from novaprinter import prettyPrinter
import sgmllib import sgmllib
@@ -67,7 +67,7 @@ class isohunt(object):
def search(self, what): def search(self, what):
i = 1 i = 1
while True and i<11: while True:
results = [] results = []
parser = self.SimpleSGMLParser(results, self.url) parser = self.SimpleSGMLParser(results, self.url)
dat = urllib.urlopen(self.url+'/torrents.php?ihq=%s&ihp=%s'%(what,i)).read().decode('utf-8', 'replace') dat = urllib.urlopen(self.url+'/torrents.php?ihq=%s&ihp=%s'%(what,i)).read().decode('utf-8', 'replace')
@@ -75,4 +75,4 @@ class isohunt(object):
parser.close() parser.close()
if len(results) <= 0: if len(results) <= 0:
break break
i += 1 i += 1

View File

@@ -1,4 +1,4 @@
#VERSION: 1.12 #VERSION: 1.11
#AUTHORS: Fabien Devaux (fab@gnux.info) #AUTHORS: Fabien Devaux (fab@gnux.info)
from novaprinter import prettyPrinter from novaprinter import prettyPrinter
import urllib import urllib
@@ -29,7 +29,7 @@ class mininova(object):
else: else:
return ''.join([ get_text(n) for n in txt.childNodes]) return ''.join([ get_text(n) for n in txt.childNodes])
page = 1 page = 1
while True and page<11: while True:
res = 0 res = 0
dat = urllib.urlopen(self.url+'/search/%s/seeds/%d'%(what, page)).read().decode('utf-8', 'replace') dat = urllib.urlopen(self.url+'/search/%s/seeds/%d'%(what, page)).read().decode('utf-8', 'replace')
dat = re.sub("<a href=\"http://www.boardreader.com/index.php.*\"", "<a href=\"plop\"", dat) dat = re.sub("<a href=\"http://www.boardreader.com/index.php.*\"", "<a href=\"plop\"", dat)

View File

@@ -1,4 +1,4 @@
#VERSION: 1.01 #VERSION: 1.00
#AUTHORS: Fabien Devaux (fab@gnux.info) #AUTHORS: Fabien Devaux (fab@gnux.info)
from novaprinter import prettyPrinter from novaprinter import prettyPrinter
import sgmllib import sgmllib
@@ -68,7 +68,7 @@ class piratebay(object):
ret = [] ret = []
i = 0 i = 0
order = 'se' order = 'se'
while True and i<11: while True:
results = [] results = []
parser = self.SimpleSGMLParser(results, self.url) parser = self.SimpleSGMLParser(results, self.url)
dat = urllib.urlopen(self.url+'/search/%s/%u/0/0' % (what, i)).read() dat = urllib.urlopen(self.url+'/search/%s/%u/0/0' % (what, i)).read()
@@ -76,4 +76,4 @@ class piratebay(object):
parser.close() parser.close()
if len(results) <= 0: if len(results) <= 0:
break break
i += 1 i += 1

View File

@@ -1,4 +1,4 @@
#VERSION: 1.01 #VERSION: 1.00
#AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net) #AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net)
from novaprinter import prettyPrinter from novaprinter import prettyPrinter
import sgmllib import sgmllib
@@ -67,7 +67,7 @@ class torrentreactor(object):
def search(self, what): def search(self, what):
i = 0 i = 0
while True and i<11: while True:
results = [] results = []
parser = self.SimpleSGMLParser(results, self.url) parser = self.SimpleSGMLParser(results, self.url)
dat = urllib.urlopen(self.url+'/search.php?search=&words=%s&cid=&sid=&type=2&orderby=a.seeds&asc=0&skip=%s'%(what,(i*35))).read().decode('utf-8', 'replace') dat = urllib.urlopen(self.url+'/search.php?search=&words=%s&cid=&sid=&type=2&orderby=a.seeds&asc=0&skip=%s'%(what,(i*35))).read().decode('utf-8', 'replace')
@@ -75,4 +75,4 @@ class torrentreactor(object):
parser.close() parser.close()
if len(results) <= 0: if len(results) <= 0:
break break
i += 1 i += 1

View File

@@ -1,5 +1,5 @@
isohunt: 1.01 isohunt: 1.00
torrentreactor: 1.01 torrentreactor: 1.00
btjunkie: 1.11 btjunkie: 1.10
mininova: 1.12 mininova: 1.11
piratebay: 1.01 piratebay: 1.00

View File

@@ -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.0rc10\\\" DEFINES += VERSION=\\\"v1.0.0rc9\\\"
DEFINES += VERSION_MAJOR=1 DEFINES += VERSION_MAJOR=1
DEFINES += VERSION_MINOR=0 DEFINES += VERSION_MINOR=0
DEFINES += VERSION_BUGFIX=0 DEFINES += VERSION_BUGFIX=0