Commit fdc91e8a authored by Cristian Greco's avatar Cristian Greco

Imported Upstream version 2.1.6

parent d3b0002b
* Thu Mar 4 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.6
- BUGFIX: Fix Web UI authentication with Konqueror
- BUGFIX: Fix save path display in properties
- BUGFIX: Fix ratio calculation for directly seeded torrents (Thanks phorane)
- BUGFIX: Fix memory leak in RSS parser
- BUGFIX: Only one log window can be opened at a time
- BUGFIX: Command-line parameters are no longer required to be in UTF-8
* Web Feb 10 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.1.5
- BUGFIX: Fix actions on selected torrents (non-selected torrents could be affected)
- BUGFIX: Only one program preferences dialog is allowed at a time
......
......@@ -217,7 +217,10 @@ GUI::~GUI() {
delete status_bar;
delete transferList;
delete guiUpdater;
if (console)
delete console;
if(options)
delete options;
if(rssWidget)
delete rssWidget;
delete searchEngine;
......@@ -393,7 +396,7 @@ void GUI::readParamsOnSocket() {
if(clientConnection) {
QByteArray params = clientConnection->readAll();
if(!params.isEmpty()) {
processParams(QString::fromUtf8(params.data()).split(QString::fromUtf8("\n")));
processParams(QString::fromLocal8Bit(params.constData()).split("\n"));
qDebug("Received parameters from another instance");
}
clientConnection->deleteLater();
......@@ -420,7 +423,11 @@ void GUI::on_actionSet_global_upload_limit_triggered() {
}
void GUI::on_actionShow_console_triggered() {
new consoleDlg(this, BTSession);
if(!console) {
console = new consoleDlg(this, BTSession);
} else {
console->setFocus();
}
}
void GUI::on_actionSet_global_download_limit_triggered() {
......@@ -911,6 +918,9 @@ void GUI::on_actionOptions_triggered() {
if(!options) {
options = new options_imp(this);
connect(options, SIGNAL(status_changed()), this, SLOT(optionsSaved()));
} else {
// Get focus
options->setFocus();
}
}
......
......@@ -55,6 +55,7 @@ class TransferListFiltersWidget;
class QSplitter;
class PropertiesWidget;
class StatusBar;
class consoleDlg;
class GUI : public QMainWindow, private Ui::MainWindow{
Q_OBJECT
......@@ -68,6 +69,7 @@ private:
QTabWidget *tabs;
StatusBar *status_bar;
QPointer<options_imp> options;
QPointer<consoleDlg> console;
QPointer<QSystemTrayIcon> systrayIcon;
QPointer<QTimer> systrayCreator;
QMenu *myTrayIconMenu;
......
[Desktop Entry]
Categories=Qt;Network;P2P;
Comment=V2.1.5
Comment=V2.1.6
Exec=qbittorrent %f
GenericName=Bittorrent client
GenericName[bg]=Торент клиент
......
This diff was suppressed by a .gitattributes entry.
......@@ -1232,14 +1232,14 @@ bool Bittorrent::enableDHT(bool b) {
float Bittorrent::getRealRatio(QString hash) const{
QTorrentHandle h = getTorrentHandle(hash);
Q_ASSERT(h.all_time_download() >= 0);
Q_ASSERT(h.total_done() >= 0);
Q_ASSERT(h.all_time_upload() >= 0);
if(h.all_time_download() == 0) {
if(h.total_done() == 0) {
if(h.all_time_upload() == 0)
return 0;
return 101;
}
float ratio = (float)h.all_time_upload()/(float)h.all_time_download();
float ratio = (float)h.all_time_upload()/(float)h.total_done();
Q_ASSERT(ratio >= 0.);
if(ratio > 100.)
ratio = 100.;
......
......@@ -282,7 +282,9 @@ QVariantMap EventManager::getPropGeneralInfo(QString hash) const {
QTorrentHandle h = BTSession->getTorrentHandle(hash);
if(h.is_valid() && h.has_metadata()) {
// Save path
data["save_path"] = TorrentPersistentData::getSavePath(hash);
QString p = TorrentPersistentData::getSavePath(hash);
if(p.isEmpty()) p = h.save_path();
data["save_path"] = p;
// Creation date
data["creation_date"] = h.creation_date();
// Comment
......
......@@ -138,6 +138,7 @@ void HttpConnection::respond() {
return;
}
QString auth = parser.value("Authorization");
qDebug("Auth: %s", auth.split(" ").first().toLocal8Bit().data());
if (QString::compare(auth.split(" ").first(), "Digest", Qt::CaseInsensitive) != 0 || !parent->isAuthorized(auth.toLocal8Bit(), parser.method())) {
// Update failed attempt counter
parent->client_failed_attempts.insert(socket->peerAddress().toString(), nb_fail+1);
......
......@@ -207,7 +207,7 @@ bool HttpServer::isAuthorized(QByteArray auth, QString method) const {
}
QByteArray prop_cnonce = regex_cnonce.cap(1).toLocal8Bit();
qDebug("prop cnonce is: %s", prop_cnonce.data());
QRegExp regex_qop(".*qop=(\\w+).*");
QRegExp regex_qop(".*qop=[\"]?(\\w+)[\"]?.*");
if(regex_qop.indexIn(auth) < 0) {
qDebug("AUTH-PROB: missing qop");
return false;
......
......@@ -40,6 +40,7 @@
#include "qgnomelook.h"
#include <QMotifStyle>
#include <QCDEStyle>
#include <QPushButton>
#ifdef Q_WS_WIN
#include <QWindowsXPStyle>
#endif
......@@ -112,7 +113,7 @@ public:
msgBox.setText(tr("qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.\n\nNo further notices will be issued."));
msgBox.setWindowTitle(tr("Legal notice"));
msgBox.addButton(tr("Cancel"), QMessageBox::RejectRole);
QAbstractButton *agree_button =(QAbstractButton*)msgBox.addButton(tr("I Agree"), QMessageBox::AcceptRole);
QAbstractButton *agree_button =msgBox.addButton(tr("I Agree"), QMessageBox::AcceptRole);
msgBox.exec();
if(msgBox.clickedButton() == agree_button) {
// Save the answer
......@@ -255,12 +256,12 @@ int main(int argc, char *argv[]){
// Check for executable parameters
if(argc > 1){
if(QString::fromUtf8(argv[1]) == QString::fromUtf8("--version")){
if(QString::fromLocal8Bit(argv[1]) == QString::fromUtf8("--version")){
std::cout << "qBittorrent " << VERSION << '\n';
delete app;
return 0;
}
if(QString::fromUtf8(argv[1]) == QString::fromUtf8("--help")){
if(QString::fromLocal8Bit(argv[1]) == QString::fromUtf8("--help")){
UsageDisplay::displayUsage(argv[0]);
delete app;
return 0;
......@@ -268,11 +269,11 @@ int main(int argc, char *argv[]){
for(int i=1; i<argc; ++i) {
#ifndef DISABLE_GUI
if(QString::fromUtf8(argv[i]) == QString::fromUtf8("--no-splash")) {
if(QString::fromLocal8Bit(argv[i]) == QString::fromUtf8("--no-splash")) {
no_splash = true;
} else {
#endif
if(QString::fromUtf8(argv[i]).startsWith("--webui-port=")) {
if(QString::fromLocal8Bit(argv[i]).startsWith("--webui-port=")) {
QStringList parts = QString::fromUtf8(argv[i]).split("=");
if(parts.size() == 2) {
bool ok = false;
......
......@@ -208,7 +208,10 @@ Bittorrent* PropertiesWidget::getBTSession() const {
void PropertiesWidget::updateSavePath(QTorrentHandle& _h) {
if(h.is_valid() && h == _h) {
save_path->setText(TorrentPersistentData::getSavePath(h.hash()));
QString p = TorrentPersistentData::getSavePath(h.hash());
if(p.isEmpty())
p = h.save_path();
save_path->setText(p);
}
}
......@@ -223,7 +226,10 @@ void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) {
try {
// Save path
save_path->setText(TorrentPersistentData::getSavePath(h.hash()));
QString p = TorrentPersistentData::getSavePath(h.hash());
if(p.isEmpty())
p = h.save_path();
save_path->setText(p);
// Creation date
lbl_creationDate->setText(h.creation_date());
// Hash
......
......@@ -336,6 +336,11 @@ bool QTorrentHandle::is_checking() const {
return h.status().state == torrent_status::checking_files || h.status().state == torrent_status::checking_resume_data;
}
size_type QTorrentHandle::total_done() {
Q_ASSERT(h.is_valid());
return h.status().total_done;
}
size_type QTorrentHandle::all_time_download() {
Q_ASSERT(h.is_valid());
return h.status().all_time_download;
......
......@@ -107,6 +107,7 @@ class QTorrentHandle {
size_type total_payload_upload();
size_type all_time_upload();
size_type all_time_download();
size_type total_done();
QStringList files_path() const;
int num_uploads() const;
bool is_seed() const;
......
......@@ -92,6 +92,7 @@ public:
enum FileType {STREAM, FOLDER};
RssFile(): QObject() {}
virtual ~RssFile() {}
virtual unsigned int getNbUnRead() const = 0;
virtual FileType getType() const = 0;
......
......@@ -11,10 +11,10 @@ CONFIG += qt \
thread
# Update this VERSION for each release
DEFINES += VERSION=\\\"v2.1.5\\\"
DEFINES += VERSION=\\\"v2.1.6\\\"
DEFINES += VERSION_MAJOR=2
DEFINES += VERSION_MINOR=1
DEFINES += VERSION_BUGFIX=5
DEFINES += VERSION_BUGFIX=6
# NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL
DEFINES += VERSION_TYPE=NORMAL
......@@ -105,6 +105,7 @@ contains(DEFINES, DISABLE_GUI) {
unix:QMAKE_LFLAGS_SHAPP += -rdynamic
CONFIG += link_pkgconfig
PKGCONFIG += "libtorrent-rasterbar"
QT += network
!contains(DEFINES, DISABLE_GUI) {
QT += xml
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment