Commit c659c55d authored by Cristian Greco's avatar Cristian Greco

Imported Upstream version 2.0.4

parent 04861b97
......@@ -57,7 +57,7 @@ Translations authors:
copyright:
- Brazilian: Nick Marinho (nickmarinho@gmail.com)
- Bulgarian: Tsvetan & Boiko Bankov (emerge_life@users.sourceforge.net)
- Catalan: Gekko Dam Beer (gekko04@users.sourceforge.net)
- Catalan: Francisco Luque Contreras (frannoe@ya.com)
- Chinese (Simplified): Guo Yue (yue.guo0418@gmail.com)
- Chinese (Traditional): Yi-Shun Wang (dnextstep@gmail.com)
- Czech: Jirka Vilim (web@tets.cz)
......
* Wed Dec 30 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.4
- BUGFIX: Fix PeerGuardian .p2b binary filter support
- BUGFIX: Fix possible crash when closing a search engine tab
- BUGFIX: Make sure service port does not change
- BUGFIX: Fix possible DHT port saving issue
- BUGFIX: Fix communication between qBittorrent and Web UI (Qt 4.6)
- BUGFIX: Use Wildcard matching instead of full regex in RSS feed downloader
- BUGFIX: Fix code for listening on a random port whenever it failed to listen on the one defined
- BUGFIX: Use global maximum transfer rates as maximum values in per-torrent speed limiting dialogs
- BUGFIX: Fix global download rate limiting from Web UI
- COSMETIC: Display a disconnected icon in status bar whenever qBittorrent failed to listen on the port defined
* Wed Dec 23 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.3
- BUGFIX: Minor cosmetic fix to program preferences
- BUGFIX: Fix "Temp path" button in program preferences
......
[Desktop Entry]
Categories=Qt;Network;P2P;
Comment=V2.0.3
Comment=V2.0.4
Exec=qbittorrent %f
GenericName=Bittorrent client
GenericName[bg]=Торент клиент
......
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -64,7 +64,7 @@ class about : public QDialog, private Ui::AboutDlg{
te_translation->append(QString::fromUtf8(
"<i>- <u>Brazilian:</u> Nick Marinho (nickmarinho@gmail.com)<br>\
- <u>Bulgarian:</u> Tsvetan & Boiko Bankov (emerge_life@users.sourceforge.net)<br>\
- <u>Catalan:</u> Gekko Dam Beer (gekko04@users.sourceforge.net)<br>\
- <u>Catalan:</u> Francisco Luque Contreras (frannoe@ya.com)<br>\
- <u>Chinese (Simplified):</u> Guo Yue (yue.guo0418@gmail.com)<br>\
- <u>Chinese (Traditional):</u> Yi-Shun Wang (dnextstep@gmail.com)<br>\
- <u>Czech:</u> Jirka Vilim (web@tets.cz)<br>\
......
......@@ -63,7 +63,7 @@
enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4};
// Main constructor
Bittorrent::Bittorrent() : preAllocateAll(false), addInPause(false), ratio_limit(-1), UPnPEnabled(false), NATPMPEnabled(false), LSDEnabled(false), DHTEnabled(false), queueingEnabled(false), geoipDBLoaded(false), exiting(false) {
Bittorrent::Bittorrent() : preAllocateAll(false), addInPause(false), ratio_limit(-1), UPnPEnabled(false), NATPMPEnabled(false), LSDEnabled(false), DHTEnabled(false), current_dht_port(0), queueingEnabled(false), geoipDBLoaded(false), exiting(false) {
resolve_countries = false;
// To avoid some exceptions
fs::path::default_name_check(fs::no_check);
......@@ -241,9 +241,9 @@ void Bittorrent::configureSession() {
// Connection
// * Ports binding
unsigned short old_listenPort = getListenPort();
setListeningPort(Preferences::getSessionPort());
unsigned short new_listenPort = getListenPort();
if(new_listenPort != old_listenPort) {
unsigned short new_listenPort = Preferences::getSessionPort();
if(old_listenPort != new_listenPort) {
setListeningPort(new_listenPort);
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
......@@ -346,10 +346,13 @@ void Bittorrent::configureSession() {
if(Preferences::isDHTEnabled()) {
// Set DHT Port
if(enableDHT(true)) {
int dht_port = new_listenPort;
if(!Preferences::isDHTPortSameAsBT())
int dht_port;
if(Preferences::isDHTPortSameAsBT())
dht_port = 0;
else
dht_port = Preferences::getDHTPort();
setDHTPort(dht_port);
if(dht_port == 0) dht_port = new_listenPort;
addConsoleMessage(tr("DHT support [ON], port: UDP/%1").arg(dht_port), QString::fromUtf8("blue"));
} else {
addConsoleMessage(tr("DHT support [OFF]"), QString::fromUtf8("red"));
......@@ -1363,9 +1366,11 @@ void Bittorrent::setDeleteRatio(float ratio) {
// Set DHT port (>= 1000 or 0 if same as BT)
void Bittorrent::setDHTPort(int dht_port) {
if(dht_port == 0 || dht_port >= 1000) {
if(dht_port == current_dht_port) return;
struct dht_settings DHTSettings;
DHTSettings.service_port = dht_port;
s->set_dht_settings(DHTSettings);
current_dht_port = dht_port;
qDebug("Set DHT Port to %d", dht_port);
}
}
......@@ -1512,18 +1517,6 @@ void Bittorrent::readAlerts() {
}
}
}
else if (listen_failed_alert* p = dynamic_cast<listen_failed_alert*>(a.get())) {
// Level: fatal
int tried_port = p->endpoint.port();
srand(time(0));
int fallback_port = tried_port;
do {
fallback_port = rand() % 64512 + 1024;
} while(fallback_port == tried_port);
addConsoleMessage(tr("Couldn't listen on port %1, using %2 instead.").arg(QString::number(tried_port)).arg(QString::number(fallback_port)), QString::fromUtf8("red"));
setListeningPort(fallback_port);
//emit portListeningFailure();
}
/*else if (torrent_paused_alert* p = dynamic_cast<torrent_paused_alert*>(a.get())) {
QTorrentHandle h(p->handle);
qDebug("Received a torrent_paused_alert for %s", h.hash().toLocal8Bit().data());
......@@ -1643,6 +1636,7 @@ QHash<QString, TrackerInfos> Bittorrent::getTrackersInfo(QString hash) const{
}
int Bittorrent::getListenPort() const{
qDebug("LISTEN PORT: %d", s->listen_port());
return s->listen_port();
}
......
......@@ -107,6 +107,7 @@ private:
bool NATPMPEnabled;
bool LSDEnabled;
bool DHTEnabled;
int current_dht_port;
bool queueingEnabled;
QString defaultSavePath;
QString defaultTempPath;
......
......@@ -233,7 +233,7 @@ void EventManager::modifiedTorrent(QTorrentHandle h)
}
event["name"] = QVariant(h.name());
event["size"] = QVariant(misc::friendlyUnit(h.actual_size()));
event["progress"] = QVariant(h.progress());
event["progress"] = QVariant((double)h.progress());
event["dlspeed"] = QVariant(tr("%1/s", "e.g. 120 KiB/s").arg(misc::friendlyUnit(h.download_payload_rate())));
if(BTSession->isQueueingEnabled()) {
if(h.queue_position() >= 0)
......
......@@ -67,14 +67,14 @@ public:
foreach(const QString& token, match_tokens) {
if(token.isEmpty() || token == "")
continue;
QRegExp reg(token, Qt::CaseInsensitive);
QRegExp reg(token, Qt::CaseInsensitive, QRegExp::Wildcard);
if(reg.indexIn(s) < 0) return false;
}
// Checking not matching
QStringList notmatch_tokens = getNotMatchingTokens();
foreach(const QString& token, notmatch_tokens) {
if(token.isEmpty()) continue;
QRegExp reg(token, Qt::CaseInsensitive);
QRegExp reg(token, Qt::CaseInsensitive, QRegExp::Wildcard);
if(reg.indexIn(s) > -1) return false;
}
return true;
......
......@@ -71,7 +71,7 @@ class FilterParserThread : public QThread {
// PeerGuardian p2p file
parseP2PFilterFile(filePath);
} else {
if(filePath.endsWith(".p2p", Qt::CaseInsensitive)) {
if(filePath.endsWith(".p2b", Qt::CaseInsensitive)) {
// PeerGuardian p2b file
parseP2BFilterFile(filePath);
} else {
......
......@@ -46,7 +46,7 @@
#include <QTemporaryFile>
HttpConnection::HttpConnection(QTcpSocket *socket, Bittorrent *BTSession, HttpServer *parent)
: QObject(parent), socket(socket), parent(parent), BTSession(BTSession)
: QObject(parent), socket(socket), parent(parent), BTSession(BTSession)
{
socket->setParent(this);
connect(socket, SIGNAL(readyRead()), this, SLOT(read()));
......@@ -370,6 +370,18 @@ void HttpConnection::respondCommand(QString command)
h.file_priority(file_id, priority);
}
}
if(command == "getGlobalUpLimit") {
generator.setStatusLine(200, "OK");
generator.setContentTypeByExt("html");
generator.setMessage(QString::number(BTSession->getSession()->upload_rate_limit()));
write();
}
if(command == "getGlobalDlLimit") {
generator.setStatusLine(200, "OK");
generator.setContentTypeByExt("html");
generator.setMessage(QString::number(BTSession->getSession()->download_rate_limit()));
write();
}
if(command == "getTorrentUpLimit") {
QString hash = parser.post("hash");
QTorrentHandle h = BTSession->getTorrentHandle(hash);
......
......@@ -60,6 +60,7 @@
<file>Icons/skin/exit.png</file>
<file>Icons/skin/delete_all.png</file>
<file>Icons/skin/splash.png</file>
<file>Icons/skin/disconnected.png</file>
<file>Icons/skin/decrease.png</file>
<file>Icons/skin/uploading.png</file>
<file>Icons/skin/filterall.png</file>
......
......@@ -47,6 +47,7 @@ namespace json {
case QVariant::LongLong:
case QVariant::UInt:
case QVariant::ULongLong:
case QMetaType::Float:
return v.value<QString>();
case QVariant::String:
{
......
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -320,10 +320,6 @@ p, li { white-space: pre-wrap; }
<comment>e.g: Downloading &apos;xxx.torrent&apos;, please wait...</comment>
<translation type="unfinished">Bezig met downloaden van &apos;%1&apos;, even geduld alstublieft...</translation>
</message>
<message>
<source>Couldn&apos;t listen on port %1, using %2 instead.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ConsoleDlg</name>
......@@ -3764,6 +3760,10 @@ Changelog:
<comment>Upload speed: x B/s - Transferred: x MiB</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Offline. This usually means that qBittorrent failed to listen on the selected port for incoming connections.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TorrentFilesModel</name>
......
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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