Compare commits

...

18 Commits

Author SHA1 Message Date
Christophe Dumez
603b14dd4c - Tagged rc11 release 2007-12-30 18:19:01 +00:00
Christophe Dumez
faa33b0d7e - Removed debug mode 2007-12-28 10:00:28 +00:00
Christophe Dumez
8fdf3d520c - Fixed btjunkie search engine 2007-12-28 09:58:14 +00:00
Christophe Dumez
b238a4ed69 - Fixed eol problems on Windows 2007-12-12 22:01:49 +00:00
Christophe Dumez
ba53bdc708 should fix eol problems on windows 2007-12-12 21:47:31 +00:00
Christophe Dumez
f2a65e07b5 - Fix for windows 2007-12-12 18:21:08 +00:00
Christophe Dumez
62afd4f98b - Forgot to call one script with python executable 2007-12-12 17:55:56 +00:00
Christophe Dumez
6c11fd5a0d - Call python script with python executable (fix for windows) 2007-12-12 17:15:13 +00:00
Christophe Dumez
cc39504a61 - Attempt to fix search engine plugins copy on windows 2007-12-12 16:57:33 +00:00
Christophe Dumez
1baec5378f - Updated rc11 changelog 2007-12-12 12:32:38 +00:00
Christophe Dumez
b60b4fafff - DownloadThread now write in binary mode (should fix problems on Windows) 2007-12-12 12:24:12 +00:00
Christophe Dumez
3325dd0550 - Removed libcurl debug output 2007-12-11 20:31:20 +00:00
Christophe Dumez
29dc0fede0 - DownloadThread can now follow redirections (fixes Mininova search engine) 2007-12-11 20:23:13 +00:00
Christophe Dumez
19f6b8491e - Forgot to remove the temporary download file when addition fails 2007-12-11 20:01:33 +00:00
Christophe Dumez
01b1e78dcd - Fixed torrentreactor search engine 2007-12-11 19:33:19 +00:00
Christophe Dumez
bd546e3d18 - BUGFIX: Bypass exit confirmation on system shutdown 2007-12-09 16:39:55 +00:00
Christophe Dumez
6ca93dfbae - Fixed a compilation warning 2007-12-09 15:52:00 +00:00
Christophe Dumez
f175ce5249 - Fixed preview when path contains spaces (closes #175015)
- Version bump to rc10
2007-12-09 09:32:01 +00:00
13 changed files with 75 additions and 43 deletions

16
TODO
View File

@@ -53,11 +53,11 @@
TODO:
- Check search engine cpu usage
rc9->rc10 changelog:
- FEATURE: Greatly improved ETA calculation algorithm (use GASA)
- BUGFIX: Fixed proxy host max length in preferences
- BUGFIX: Added a 3 minutes search engine timeout
- BUGFIX: Limit search engine plugins to 10 result pages
- BUGFIX: Fixed nbResults != 0 when clearing results while a search is running
- BUGFIX: Fixed possible problem when closing to systray and cancelling app exit
- COSMETIC: Use more skin colors instead of hard coded ones
rc10->rc11? changelog:
- BUGFIX: Bypass exit confirmation on system shutdown
- BUGFIX: Download from urls are now able to follow redirections
- BUGFIX: Clean up for failed torrents downloaded from urls
- BUGFIX: Fixed downloads from URLs on Windows
- BUGFIX: Fixed search engine on Windows
- BUGFIX: Fixed torrent creation from a directory
- BUGFIX: Fixed save path when seeding automatically after torrent creation

View File

@@ -392,10 +392,10 @@ void GUI::on_actionExit_triggered() {
}
void GUI::previewFile(QString filePath) {
QDesktopServices::openUrl(filePath);
QDesktopServices::openUrl(QString("file://")+filePath);
}
unsigned int GUI::getCurrentTabIndex() const{
int GUI::getCurrentTabIndex() const{
if(isMinimized() || isHidden())
return -1;
return tabs->currentIndex();
@@ -449,7 +449,7 @@ void GUI::on_actionAbout_triggered() {
// Called when we close the program
void GUI::closeEvent(QCloseEvent *e) {
qDebug("Mainwindow received closeEvent");
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
bool goToSystrayOnExit = settings.value(QString::fromUtf8("Preferences/General/CloseToTray"), false).toBool();
if(!force_exit && systrayIntegration && goToSystrayOnExit && !this->isHidden()) {
@@ -461,14 +461,16 @@ void GUI::closeEvent(QCloseEvent *e) {
show();
if(!isMaximized())
showNormal();
if(QMessageBox::question(this,
tr("Are you sure you want to quit?")+QString::fromUtf8(" -- ")+tr("qBittorrent"),
tr("The download list is not empty.\nAre you sure you want to quit qBittorrent?"),
tr("&Yes"), tr("&No"),
QString(), 0, 1)) {
e->ignore();
force_exit = false;
return;
if(e->spontaneous() == true || force_exit == true) {
if(QMessageBox::question(this,
tr("Are you sure you want to quit?")+QString::fromUtf8(" -- ")+tr("qBittorrent"),
tr("The download list is not empty.\nAre you sure you want to quit qBittorrent?"),
tr("&Yes"), tr("&No"),
QString(), 0, 1)) {
e->ignore();
force_exit = false;
return;
}
}
}
hide();
@@ -486,6 +488,7 @@ void GUI::closeEvent(QCloseEvent *e) {
qApp->exit();
}
// Display window to create a torrent
void GUI::on_actionCreate_torrent_triggered() {
createtorrent *ct = new createtorrent(this);

View File

@@ -155,7 +155,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
GUI(QWidget *parent=0, QStringList torrentCmdLine=QStringList());
~GUI();
// Methods
unsigned int getCurrentTabIndex() const;
int getCurrentTabIndex() const;
QPoint screenCenter() const;
};

View File

@@ -519,6 +519,7 @@ void bittorrent::addTorrent(QString path, bool fromScanDir, QString from_url, bo
// Display warning to tell user we can't decode the torrent file
if(!from_url.isNull()) {
emit invalidTorrent(from_url);
QFile::remove(file);
}else{
emit invalidTorrent(file);
}
@@ -533,6 +534,8 @@ void bittorrent::addTorrent(QString path, bool fromScanDir, QString from_url, bo
// Display warning to tell user we can't decode the torrent file
if(!from_url.isNull()) {
emit invalidTorrent(from_url);
qDebug("File path is: %s", file.toUtf8().data());
QFile::remove(file);
}else{
emit invalidTorrent(file);
}
@@ -753,7 +756,7 @@ void bittorrent::loadFilesPriorities(QTorrentHandle &h) {
if( priority < 0 || priority > 7) {
priority = 1;
}
//qDebug("Setting piece piority to %d", priority);
qDebug("Setting piece piority to %d", priority);
v.push_back(priority);
}
h.prioritize_files(v);

View File

@@ -36,6 +36,7 @@
#include <libtorrent/file_pool.hpp>
#include "createtorrent_imp.h"
#include "misc.h"
using namespace libtorrent;
using namespace boost::filesystem;
@@ -120,11 +121,13 @@ void createtorrent::on_addURLSeed_button_clicked(){
// Subfunction to add files to a torrent_info structure
// Written by Arvid Norberg (libtorrent Author)
void add_files(torrent_info& t, path const& p, path const& l){
qDebug("p: %s, l: %s, l.leaf(): %s", p.string().c_str(), l.string().c_str(), l.leaf().c_str());
path f(p / l);
if (is_directory(f)){
for (directory_iterator i(f), end; i != end; ++i)
add_files(t, p, l / i->leaf());
}else{
qDebug("Adding %s", l.string().c_str());
t.add_file(l, file_size(f));
}
}
@@ -141,6 +144,8 @@ QStringList createtorrent::allItems(QListWidget *list){
// Main function that create a .torrent file
void createtorrent::on_createButton_clicked(){
QString input = textInputPath->text().trimmed();
if (input.endsWith(QDir::separator()))
input.chop(1);
if(input.isEmpty()){
QMessageBox::critical(0, tr("No input path set"), tr("Please type an input path first"));
return;
@@ -161,9 +166,8 @@ void createtorrent::on_createButton_clicked(){
try {
boost::intrusive_ptr<torrent_info> t(new torrent_info);
ofstream out(complete(path((const char*)destination.toUtf8())), std::ios_base::binary);
path full_path;
// Adding files to the torrent
full_path = complete(path(input.toUtf8().data()));
path full_path = complete(path(input.toUtf8().data()));
add_files(*t, full_path.branch_path(), full_path.leaf());
// Set piece size
int piece_size = getPieceSize();
@@ -200,8 +204,14 @@ void createtorrent::on_createButton_clicked(){
entry e = t->create_torrent();
libtorrent::bencode(std::ostream_iterator<char>(out), e);
out.flush();
if(checkStartSeeding->isChecked())
if(checkStartSeeding->isChecked()) {
// Create save path file
QFile savepath_file(misc::qBittorrentPath()+QString::fromUtf8("BT_backup")+QDir::separator()+misc::toQString(t->info_hash())+QString::fromUtf8(".savepath"));
savepath_file.open(QIODevice::WriteOnly | QIODevice::Text);
savepath_file.write(full_path.branch_path().string().c_str());
savepath_file.close();
emit torrent_to_seed(destination);
}
}
catch (std::exception& e){
std::cerr << e.what() << "\n";

View File

@@ -73,7 +73,7 @@ void subDownloadThread::run(){
filePath = tmpfile->fileName();
}
delete tmpfile;
FILE *f = fopen(filePath.toUtf8().data(), "w");
FILE *f = fopen(filePath.toUtf8().data(), "wb");
if(!f) {
std::cerr << "couldn't open destination file" << "\n";
return;
@@ -112,6 +112,14 @@ void subDownloadThread::run(){
// We have to define CURLOPT_WRITEFUNCTION or it will crash on windows
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
// Verbose
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
// No progress info (we don't use it)
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
// Redirections
curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, -1);
qDebug("Downloading %s", url.toUtf8().data());
res = curl_easy_perform(curl);
/* always cleanup */

View File

@@ -250,11 +250,13 @@ void engineSelectDlg::setRowColor(int row, QString color){
bool engineSelectDlg::checkInstalled(QString plugin_name) const {
QProcess nova;
QStringList params;
params << misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py";
params << "--supported_engines";
nova.start(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py", params, QIODevice::ReadOnly);
nova.start("python", params, QIODevice::ReadOnly);
nova.waitForStarted();
nova.waitForFinished();
QByteArray result = nova.readAll();
result = result.replace("\r", "");
result = result.replace("\n", "");
QList<QByteArray> plugins_list = result.split(',');
return plugins_list.contains(plugin_name.toUtf8());
@@ -280,11 +282,13 @@ void engineSelectDlg::loadSupportedSearchEngines(bool first) {
QStringList params;
// Ask nova core for the supported search engines
QProcess nova;
params << misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py";
params << "--supported_engines";
nova.start(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py", params, QIODevice::ReadOnly);
nova.start("python", params, QIODevice::ReadOnly);
nova.waitForStarted();
nova.waitForFinished();
QByteArray result = nova.readAll();
result = result.replace("\r", "");
result = result.replace("\n", "");
qDebug("read: %s", result.data());
QByteArray e;
@@ -295,11 +299,13 @@ void engineSelectDlg::loadSupportedSearchEngines(bool first) {
installed_engines[en] = old_engines.value(en, true);
}
params.clear();
params << misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py";
params << "--supported_engines_infos";
nova.start(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py", params, QIODevice::ReadOnly);
nova.start("python", params, QIODevice::ReadOnly);
nova.waitForStarted();
nova.waitForFinished();
result = nova.readAll();
result = result.replace("\r", "");
result = result.replace("\n", "");
qDebug("read: %s", result.data());
unsigned int i = 0;

View File

@@ -277,7 +277,7 @@ void SearchEngine::on_search_button_clicked(){
QStringList params;
QStringList engineNames;
search_stopped = false;
params << misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py";
params << enabled_engines.join(",");
params << pattern.split(" ");
// Update SearchEngine widgets
@@ -286,7 +286,7 @@ void SearchEngine::on_search_button_clicked(){
search_result_line_truncated.clear();
results_lbl->setText(tr("Results")+" <i>(0)</i>:");
// Launch search
searchProcess->start(misc::qBittorrentPath()+"search_engine"+QDir::separator()+"nova2.py", params, QIODevice::ReadOnly);
searchProcess->start("python", params, QIODevice::ReadOnly);
searchTimeout->start(180000); // 3min
}
@@ -318,6 +318,7 @@ void SearchEngine::downloadSelectedItem(const QModelIndex& index){
// line to search results calling appendSearchResult().
void SearchEngine::readSearchOutput(){
QByteArray output = searchProcess->readAllStandardOutput();
output.replace("\r", "");
QList<QByteArray> lines_list = output.split('\n');
QByteArray line;
if(!search_result_line_truncated.isEmpty()){
@@ -370,7 +371,7 @@ void SearchEngine::updateNova() {
QStringList files = shipped_subDir.entryList();
QString file;
foreach(file, files){
QString shipped_file = shipped_subDir.path()+QDir::separator()+file;
QString shipped_file = shipped_subDir.path()+"/"+file;
// Copy python classes
if(file.endsWith(".py")) {
if(misc::getPluginVersion(shipped_file) > misc::getPluginVersion(destDir+file) ) {

View File

@@ -1,4 +1,4 @@
#VERSION: 1.11
#VERSION: 1.12
#AUTHORS: Fabien Devaux (fab@gnux.info)
from novaprinter import prettyPrinter
import urllib
@@ -14,7 +14,7 @@ class btjunkie(object):
res = 0
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
section_re = re.compile('(?s)href="/torrent.*?<tr>')
section_re = re.compile('(?s)href="http://dl.btjunkie.org/torrent/.*?<tr>')
torrent_re = re.compile('(?s)href="(?P<link>.*?[^"]+).*?'
'class="BlckUnd">(?P<name>.*?)</a>.*?'
'>(?P<size>\d+MB)</font>.*?'
@@ -27,7 +27,7 @@ class btjunkie(object):
torrent_infos = m.groupdict()
torrent_infos['name'] = re.sub('</?font.*?>', '', torrent_infos['name'])
torrent_infos['engine_url'] = self.url
torrent_infos['link'] = self.url+torrent_infos['link']
#torrent_infos['link'] = self.url+torrent_infos['link']
prettyPrinter(torrent_infos)
res = res + 1
if res == 0:

View File

@@ -1,4 +1,4 @@
#VERSION: 1.01
#VERSION: 1.02
#AUTHORS: Gekko Dam Beer (gekko04@users.sourceforge.net)
from novaprinter import prettyPrinter
import sgmllib
@@ -22,9 +22,7 @@ class torrentreactor(object):
if params['href'].startswith('http://dl.torrentreactor.net/download.php'):
self.current_item = {}
self.td_counter = 0
equal = params['href'].find("=")
amp = params['href'].find("&", equal+1)
self.id = str(int(params['href'][equal+1:amp]))
self.current_item['link'] = params['href'].strip()
def handle_data(self, data):
if self.td_counter == 0:
@@ -47,11 +45,10 @@ class torrentreactor(object):
def start_td(self,attr):
if isinstance(self.td_counter,int):
self.td_counter += 1
if self.td_counter > 7:
if self.td_counter > 3:
self.td_counter = None
# add item to results
if self.current_item:
self.current_item['link']='http://download.torrentreactor.net/download.php?id=%s&name=%s'%(self.id, urllib.quote(self.current_item['name']))
self.current_item['engine_url'] = self.url
if not self.current_item['seeds'].isdigit():
self.current_item['seeds'] = 0
@@ -71,6 +68,7 @@ class torrentreactor(object):
results = []
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')
#print "loading page: "+self.url+'/search.php?search=&words=%s&cid=&sid=&type=2&orderby=a.seeds&asc=0&skip=%s'%(what,(i*35))
parser.feed(dat)
parser.close()
if len(results) <= 0:

View File

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

View File

@@ -11,7 +11,7 @@ TARGET = qbittorrent
CONFIG += qt thread x11 network
# Update this VERSION for each release
DEFINES += VERSION=\\\"v1.0.0rc9\\\"
DEFINES += VERSION=\\\"v1.0.0rc11\\\"
DEFINES += VERSION_MAJOR=1
DEFINES += VERSION_MINOR=0
DEFINES += VERSION_BUGFIX=0

View File

@@ -125,6 +125,7 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
// Display warning to tell user we can't decode the torrent file
if(!from_url.isNull()){
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+from_url+QString::fromUtf8("'"), QString::fromUtf8("red"));
QFile::remove(filePath);
}else{
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+filePath+QString::fromUtf8("'"), QString::fromUtf8("red"));
}
@@ -142,9 +143,11 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
// Display warning to tell user we can't decode the torrent file
if(!from_url.isNull()){
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+from_url+QString::fromUtf8("'"), QString::fromUtf8("red"));
QFile::remove(filePath);
}else{
emit setInfoBarGUI(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+filePath+QString::fromUtf8("'"), QString::fromUtf8("red"));
}
qDebug("path is %s", filePath.toUtf8().data());
emit setInfoBarGUI(tr("This file is either corrupted or this isn't a torrent."), QString::fromUtf8("red"));
if(fromScanDir){
// Remove .corrupt file in case it already exists