You've already forked qBittorrent
							
							
				mirror of
				https://github.com/qbittorrent/qBittorrent
				synced 2025-10-30 23:30:54 +01:00 
			
		
		
		
	Compare commits
	
		
			57 Commits
		
	
	
		
			v4_0_x
			...
			release-2.
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 014b86290b | ||
|   | 9836d4ec07 | ||
|   | b5b14d4d43 | ||
|   | dff1666b6c | ||
|   | e6966bec31 | ||
|   | e92f6a3d96 | ||
|   | f70aab3877 | ||
|   | ec44efb261 | ||
|   | d227ed8b59 | ||
|   | 395c2c862a | ||
|   | e7eb61c0c3 | ||
|   | 7cd2ec57d3 | ||
|   | 4941f24fff | ||
|   | 94cb5fe0b6 | ||
|   | 4828ffa280 | ||
|   | 622d9701cb | ||
|   | 93c4b521bb | ||
|   | 9c7374e4a1 | ||
|   | 1d58e7fd7f | ||
|   | ed9c68eea0 | ||
|   | 1b8a87c54d | ||
|   | a33b978564 | ||
|   | f9cf937e20 | ||
|   | 7109685913 | ||
|   | bd222ac8bd | ||
|   | b675f4ac58 | ||
|   | 9989ec79c9 | ||
|   | 20167c2276 | ||
|   | e26a1d5342 | ||
|   | 3734e11879 | ||
|   | 4632c6fda9 | ||
|   | 62ff08b6b5 | ||
|   | f50b62624a | ||
|   | d380eb9958 | ||
|   | a71bdde022 | ||
|   | e8e6894b5c | ||
|   | d92f69fa0f | ||
|   | 77d7a1ec49 | ||
|   | d5c174a6f8 | ||
|   | 173999e504 | ||
|   | 1ed928bc39 | ||
|   | b85d51ba79 | ||
|   | 779b53722b | ||
|   | 76780c4c46 | ||
|   | da74f24a71 | ||
|   | 01c56865db | ||
|   | b541c9fa4c | ||
|   | aac0fbcbe4 | ||
|   | b315551edd | ||
|   | 58a885cb87 | ||
|   | d19282285c | ||
|   | e0d8ca39a5 | ||
|   | ec3169c9b0 | ||
|   | 7bfd7e9cda | ||
|   | 459bb8c51d | ||
|   | 9159a9f25d | ||
|   | 8ea8f8a9f7 | 
							
								
								
									
										4
									
								
								AUTHORS
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								AUTHORS
									
									
									
									
									
								
							| @@ -57,7 +57,7 @@ Translations authors: | |||||||
|   copyright: |   copyright: | ||||||
|   - Brazilian: Nick Marinho (nickmarinho@gmail.com) |   - Brazilian: Nick Marinho (nickmarinho@gmail.com) | ||||||
|   - Bulgarian: Tsvetan & Boiko Bankov (emerge_life@users.sourceforge.net) |   - 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 (Simplified): Guo Yue (yue.guo0418@gmail.com) | ||||||
|   - Chinese (Traditional): Yi-Shun Wang (dnextstep@gmail.com) |   - Chinese (Traditional): Yi-Shun Wang (dnextstep@gmail.com) | ||||||
|   - Czech: Jirka Vilim (web@tets.cz) |   - Czech: Jirka Vilim (web@tets.cz) | ||||||
| @@ -79,7 +79,7 @@ Translations authors: | |||||||
|   - Russian: Nick Khazov (m2k3d0n at users.sourceforge.net) |   - Russian: Nick Khazov (m2k3d0n at users.sourceforge.net) | ||||||
|   - Serbian: Anaximandar Milet (anaximandar at operamail.com) |   - Serbian: Anaximandar Milet (anaximandar at operamail.com) | ||||||
|   - Slovak:  helix84 |   - Slovak:  helix84 | ||||||
|   - Spanish: Vicente Raul Plata Fonseca (silverxnt@users.sourceforge.net) |   - Spanish: Francisco Luque Contreras (frannoe@ya.com) | ||||||
|   - Swedish: Daniel Nylander (po@danielnylander.se) |   - Swedish: Daniel Nylander (po@danielnylander.se) | ||||||
|   - Turkish: Hasan Yilmaz (iletisim@hedefturkce.com) |   - Turkish: Hasan Yilmaz (iletisim@hedefturkce.com) | ||||||
|   - Ukrainian: Andrey Shpachenko (masterfix@users.sourceforge.net) |   - Ukrainian: Andrey Shpachenko (masterfix@users.sourceforge.net) | ||||||
|   | |||||||
							
								
								
									
										39
									
								
								Changelog
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								Changelog
									
									
									
									
									
								
							| @@ -1,3 +1,42 @@ | |||||||
|  | * Web Dec 31 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.5 | ||||||
|  |     - BUGFIX: Fix crash with downloaded/availability bars when the torrent has too many pieces | ||||||
|  |  | ||||||
|  | * 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 | ||||||
|  |     - BUGFIX: Handle paths with [~, ., ..] properly | ||||||
|  |     - BUGFIX: Trackers are now displayed for torrents without metadata | ||||||
|  |     - BUGFIX: Fix issue with speed limiting (unlimited was not handled properly) | ||||||
|  |     - BUGFIX: Use the save path set in program preferences as a default in torrent addition dialog | ||||||
|  |  | ||||||
|  | * Fri Dec 18 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.2 | ||||||
|  |     - BUGFIX: Fix .qbittorrent folder not being created (critical bug introduced in v2.0.1 that makes qBittorrent unusuable for new users) | ||||||
|  |     - BUGFIX: Fix RSS Feed downloader for some feeds | ||||||
|  |     - BUGFIX: Do not use home folder as a fallback when the save path is not accessible | ||||||
|  |     - BUGFIX: Fix Mininova, ThePirateBay search engine plugins | ||||||
|  |     - BUGFIX: Read RSS articles are remembered on restart for feeds with no torrents attached | ||||||
|  |  | ||||||
|  | * Sun Dec 13 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.1 | ||||||
|  |     - BUGFIX: µTorrent user-agent is now spoofed correctly | ||||||
|  |     - BUGFIX: Fix column hiding behavior when queueing system is disabled | ||||||
|  |     - BUGFIX: Fix link to plugins.qbittorrent.org in plugins dialog | ||||||
|  |     - BUGFIX: ~/qBT_dir is created only when it is actually used | ||||||
|  |     - BUGFIX: Fix possible missing slot message (toggleSelectedTorrentsSuperSeeding) | ||||||
|  |     - BUGFIX: Fix possible crash in torrent properties (files) | ||||||
|  |     - BUGFIX: Added Hex Magnet Links support (Thanks Haypo) | ||||||
|  |  | ||||||
| * Thu Dec 10 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.0 | * Thu Dec 10 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.0 | ||||||
|     - FEATURE: Added program option to disable splash screen |     - FEATURE: Added program option to disable splash screen | ||||||
|     - FEATURE: Dropped dependency on libcurl and libzzip |     - FEATURE: Dropped dependency on libcurl and libzzip | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 743 B | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 659 B | 
| @@ -1,6 +1,6 @@ | |||||||
| [Desktop Entry] | [Desktop Entry] | ||||||
| Categories=Qt;Network;P2P; | Categories=Qt;Network;P2P; | ||||||
| Comment=V2.0.0 | Comment=V2.0.5 | ||||||
| Exec=qbittorrent %f | Exec=qbittorrent %f | ||||||
| GenericName=Bittorrent client | GenericName=Bittorrent client | ||||||
| GenericName[bg]=Торент клиент | GenericName[bg]=Торент клиент | ||||||
|   | |||||||
							
								
								
									
										
											BIN
										
									
								
								src/Icons/skin/disconnected.png
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/Icons/skin/disconnected.png
									
									
									
									
									
										Executable file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 1.4 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 79 KiB | 
| @@ -64,7 +64,7 @@ class about : public QDialog, private Ui::AboutDlg{ | |||||||
|       te_translation->append(QString::fromUtf8( |       te_translation->append(QString::fromUtf8( | ||||||
|           "<i>- <u>Brazilian:</u> Nick Marinho (nickmarinho@gmail.com)<br>\ |           "<i>- <u>Brazilian:</u> Nick Marinho (nickmarinho@gmail.com)<br>\ | ||||||
|           - <u>Bulgarian:</u> Tsvetan & Boiko Bankov (emerge_life@users.sourceforge.net)<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 (Simplified):</u> Guo Yue (yue.guo0418@gmail.com)<br>\ | ||||||
|           - <u>Chinese (Traditional):</u> Yi-Shun Wang (dnextstep@gmail.com)<br>\ |           - <u>Chinese (Traditional):</u> Yi-Shun Wang (dnextstep@gmail.com)<br>\ | ||||||
|           - <u>Czech:</u> Jirka Vilim (web@tets.cz)<br>\ |           - <u>Czech:</u> Jirka Vilim (web@tets.cz)<br>\ | ||||||
| @@ -84,7 +84,7 @@ class about : public QDialog, private Ui::AboutDlg{ | |||||||
|           - <u>Russian:</u> Nick Khazov (m2k3d0n@users.sourceforge.net) and Alexey Morsov (samurai@ricom.ru)<br>\ |           - <u>Russian:</u> Nick Khazov (m2k3d0n@users.sourceforge.net) and Alexey Morsov (samurai@ricom.ru)<br>\ | ||||||
|           - <u>Serbian:</u> Anaximandar Milet (anaximandar@operamail.com)<br>\ |           - <u>Serbian:</u> Anaximandar Milet (anaximandar@operamail.com)<br>\ | ||||||
|           - <u>Slovak:</u>  helix84<br>\ |           - <u>Slovak:</u>  helix84<br>\ | ||||||
|           - <u>Spanish:</u> Vicente Raul Plata Fonseca (silverxnt@users.sourceforge.net) and Gabriel de Oliveira (deadloop@hotmail.com)<br>\ |           - <u>Spanish:</u> Francisco Luque Contreras (frannoe@ya.com)<br>\ | ||||||
|           - <u>Swedish:</u> Daniel Nylander (po@danielnylander.se)<br>\ |           - <u>Swedish:</u> Daniel Nylander (po@danielnylander.se)<br>\ | ||||||
|           - <u>Turkish:</u> Hasan YILMAZ (iletisim@hedefturkce.com) and Erdem Bingöl (erdem84@gmail.com)<br>\ |           - <u>Turkish:</u> Hasan YILMAZ (iletisim@hedefturkce.com) and Erdem Bingöl (erdem84@gmail.com)<br>\ | ||||||
|           - <u>Ukrainian:</u> Andrey Shpachenko (masterfix@users.sourceforge.net)<br><br>")); |           - <u>Ukrainian:</u> Andrey Shpachenko (masterfix@users.sourceforge.net)<br><br>")); | ||||||
|   | |||||||
| @@ -63,7 +63,7 @@ | |||||||
| enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4}; | enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4}; | ||||||
|  |  | ||||||
| // Main constructor | // 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; |   resolve_countries = false; | ||||||
|   // To avoid some exceptions |   // To avoid some exceptions | ||||||
|   fs::path::default_name_check(fs::no_check); |   fs::path::default_name_check(fs::no_check); | ||||||
| @@ -241,9 +241,9 @@ void Bittorrent::configureSession() { | |||||||
|   // Connection |   // Connection | ||||||
|   // * Ports binding |   // * Ports binding | ||||||
|   unsigned short old_listenPort = getListenPort(); |   unsigned short old_listenPort = getListenPort(); | ||||||
|   setListeningPort(Preferences::getSessionPort()); |   unsigned short new_listenPort = Preferences::getSessionPort(); | ||||||
|   unsigned short new_listenPort = getListenPort(); |   if(old_listenPort != new_listenPort) { | ||||||
|   if(new_listenPort != old_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))); |     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 |   // * Global download limit | ||||||
| @@ -346,10 +346,13 @@ void Bittorrent::configureSession() { | |||||||
|   if(Preferences::isDHTEnabled()) { |   if(Preferences::isDHTEnabled()) { | ||||||
|     // Set DHT Port |     // Set DHT Port | ||||||
|     if(enableDHT(true)) { |     if(enableDHT(true)) { | ||||||
|       int dht_port = new_listenPort; |       int dht_port; | ||||||
|       if(!Preferences::isDHTPortSameAsBT()) |       if(Preferences::isDHTPortSameAsBT()) | ||||||
|  |         dht_port = 0; | ||||||
|  |       else | ||||||
|         dht_port = Preferences::getDHTPort(); |         dht_port = Preferences::getDHTPort(); | ||||||
|       setDHTPort(dht_port); |       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")); |       addConsoleMessage(tr("DHT support [ON], port: UDP/%1").arg(dht_port), QString::fromUtf8("blue")); | ||||||
|     } else { |     } else { | ||||||
|       addConsoleMessage(tr("DHT support [OFF]"), QString::fromUtf8("red")); |       addConsoleMessage(tr("DHT support [OFF]"), QString::fromUtf8("red")); | ||||||
| @@ -1362,10 +1365,12 @@ void Bittorrent::setDeleteRatio(float ratio) { | |||||||
|  |  | ||||||
| // Set DHT port (>= 1000 or 0 if same as BT) | // Set DHT port (>= 1000 or 0 if same as BT) | ||||||
| void Bittorrent::setDHTPort(int dht_port) { | void Bittorrent::setDHTPort(int dht_port) { | ||||||
|   if(dht_port == 0 or dht_port >= 1000) { |   if(dht_port == 0 || dht_port >= 1000) { | ||||||
|  |     if(dht_port == current_dht_port) return; | ||||||
|     struct dht_settings DHTSettings; |     struct dht_settings DHTSettings; | ||||||
|     DHTSettings.service_port = dht_port; |     DHTSettings.service_port = dht_port; | ||||||
|     s->set_dht_settings(DHTSettings); |     s->set_dht_settings(DHTSettings); | ||||||
|  |     current_dht_port = dht_port; | ||||||
|     qDebug("Set DHT Port to %d", 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())) { |     /*else if (torrent_paused_alert* p = dynamic_cast<torrent_paused_alert*>(a.get())) { | ||||||
|       QTorrentHandle h(p->handle); |       QTorrentHandle h(p->handle); | ||||||
|       qDebug("Received a torrent_paused_alert for %s", h.hash().toLocal8Bit().data()); |       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{ | int Bittorrent::getListenPort() const{ | ||||||
|  |   qDebug("LISTEN PORT: %d", s->listen_port()); | ||||||
|   return s->listen_port(); |   return s->listen_port(); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -1664,14 +1658,16 @@ QString Bittorrent::getSavePath(QString hash) { | |||||||
|     qDebug("Using default save path because none was set: %s", defaultSavePath.toLocal8Bit().data()); |     qDebug("Using default save path because none was set: %s", defaultSavePath.toLocal8Bit().data()); | ||||||
|     savePath = defaultSavePath; |     savePath = defaultSavePath; | ||||||
|   } |   } | ||||||
|  |   // Clean path | ||||||
|  |   savePath = misc::expandPath(savePath); | ||||||
|   // Checking if savePath Dir exists |   // Checking if savePath Dir exists | ||||||
|   // create it if it is not |   // create it if it is not | ||||||
|   QDir saveDir(savePath); |   QDir saveDir(savePath); | ||||||
|   if(!saveDir.exists()) { |   if(!saveDir.exists()) { | ||||||
|     if(!saveDir.mkpath(saveDir.path())) { |     if(!saveDir.mkpath(saveDir.absolutePath())) { | ||||||
|       std::cerr << "Couldn't create the save directory: " << saveDir.path().toLocal8Bit().data() << "\n"; |       std::cerr << "Couldn't create the save directory: " << saveDir.path().toLocal8Bit().data() << "\n"; | ||||||
|       // XXX: handle this better |       // XXX: handle this better | ||||||
|       return QDir::homePath(); |       //return QDir::homePath(); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   return savePath; |   return savePath; | ||||||
|   | |||||||
| @@ -107,6 +107,7 @@ private: | |||||||
|   bool NATPMPEnabled; |   bool NATPMPEnabled; | ||||||
|   bool LSDEnabled; |   bool LSDEnabled; | ||||||
|   bool DHTEnabled; |   bool DHTEnabled; | ||||||
|  |   int current_dht_port; | ||||||
|   bool queueingEnabled; |   bool queueingEnabled; | ||||||
|   QString defaultSavePath; |   QString defaultSavePath; | ||||||
|   QString defaultTempPath; |   QString defaultTempPath; | ||||||
|   | |||||||
| @@ -36,6 +36,7 @@ | |||||||
| #include <QList> | #include <QList> | ||||||
| #include <QPixmap> | #include <QPixmap> | ||||||
| #include <libtorrent/bitfield.hpp> | #include <libtorrent/bitfield.hpp> | ||||||
|  | #include <math.h> | ||||||
|  |  | ||||||
| using namespace libtorrent; | using namespace libtorrent; | ||||||
| #define BAR_HEIGHT 18 | #define BAR_HEIGHT 18 | ||||||
| @@ -55,19 +56,46 @@ public: | |||||||
|   void setProgress(bitfield pieces) { |   void setProgress(bitfield pieces) { | ||||||
|     if(pieces.empty()) { |     if(pieces.empty()) { | ||||||
|       // Empty bar |       // Empty bar | ||||||
|       pixmap = QPixmap(1, 1); |       QPixmap pix = QPixmap(1, 1); | ||||||
|       QPainter painter(&pixmap); |       pix.fill(); | ||||||
|       painter.setPen(Qt::white); |       pixmap = pix; | ||||||
|       painter.drawPoint(0,0); |  | ||||||
|     } else { |     } else { | ||||||
|       pixmap = QPixmap(pieces.size(), 1); |       int nb_pieces = pieces.size(); | ||||||
|       QPainter painter(&pixmap); |       // Reduce the number of pieces before creating the pixmap | ||||||
|       for(uint i=0; i<pieces.size(); ++i) { |       // otherwise it can crash when there are too many pieces | ||||||
|         if(pieces[i]) |       if(nb_pieces > width()) { | ||||||
|           painter.setPen(Qt::blue); |         int ratio = floor(nb_pieces/(double)width()); | ||||||
|         else |         QVector<bool> scaled_pieces; | ||||||
|           painter.setPen(Qt::white); |         for(int i=0; i<nb_pieces; i+= ratio) { | ||||||
|         painter.drawPoint(i,0); |           bool have = true; | ||||||
|  |           for(int j=i; j<qMin(i+ratio, nb_pieces); ++j) { | ||||||
|  |             if(!pieces[i]) { have = false; break; } | ||||||
|  |           } | ||||||
|  |           scaled_pieces << have; | ||||||
|  |         } | ||||||
|  |         QPixmap pix = QPixmap(scaled_pieces.size(), 1); | ||||||
|  |         pix.fill(); | ||||||
|  |         QPainter painter(&pix); | ||||||
|  |         for(int i=0; i<scaled_pieces.size(); ++i) { | ||||||
|  |           if(scaled_pieces[i]) | ||||||
|  |             painter.setPen(Qt::blue); | ||||||
|  |           else | ||||||
|  |             painter.setPen(Qt::white); | ||||||
|  |           painter.drawPoint(i,0); | ||||||
|  |         } | ||||||
|  |         pixmap = pix; | ||||||
|  |       } else { | ||||||
|  |         QPixmap pix = QPixmap(pieces.size(), 1); | ||||||
|  |         pix.fill(); | ||||||
|  |         QPainter painter(&pix); | ||||||
|  |         for(uint i=0; i<pieces.size(); ++i) { | ||||||
|  |           if(pieces[i]) | ||||||
|  |             painter.setPen(Qt::blue); | ||||||
|  |           else | ||||||
|  |             painter.setPen(Qt::white); | ||||||
|  |           painter.drawPoint(i,0); | ||||||
|  |         } | ||||||
|  |         pixmap = pix; | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     update(); |     update(); | ||||||
|   | |||||||
| @@ -233,7 +233,7 @@ void EventManager::modifiedTorrent(QTorrentHandle h) | |||||||
|   } |   } | ||||||
|   event["name"] = QVariant(h.name()); |   event["name"] = QVariant(h.name()); | ||||||
|   event["size"] = QVariant(misc::friendlyUnit(h.actual_size())); |   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()))); |   event["dlspeed"] = QVariant(tr("%1/s", "e.g. 120 KiB/s").arg(misc::friendlyUnit(h.download_payload_rate()))); | ||||||
|   if(BTSession->isQueueingEnabled()) { |   if(BTSession->isQueueingEnabled()) { | ||||||
|     if(h.queue_position() >= 0) |     if(h.queue_position() >= 0) | ||||||
|   | |||||||
| @@ -67,14 +67,14 @@ public: | |||||||
|     foreach(const QString& token, match_tokens) { |     foreach(const QString& token, match_tokens) { | ||||||
|       if(token.isEmpty() || token == "") |       if(token.isEmpty() || token == "") | ||||||
|         continue; |         continue; | ||||||
|       QRegExp reg(token, Qt::CaseInsensitive); |       QRegExp reg(token, Qt::CaseInsensitive, QRegExp::Wildcard); | ||||||
|       if(reg.indexIn(s) < 0) return false; |       if(reg.indexIn(s) < 0) return false; | ||||||
|     } |     } | ||||||
|     // Checking not matching |     // Checking not matching | ||||||
|     QStringList notmatch_tokens = getNotMatchingTokens(); |     QStringList notmatch_tokens = getNotMatchingTokens(); | ||||||
|     foreach(const QString& token, notmatch_tokens) { |     foreach(const QString& token, notmatch_tokens) { | ||||||
|       if(token.isEmpty()) continue; |       if(token.isEmpty()) continue; | ||||||
|       QRegExp reg(token, Qt::CaseInsensitive); |       QRegExp reg(token, Qt::CaseInsensitive, QRegExp::Wildcard); | ||||||
|       if(reg.indexIn(s) > -1) return false; |       if(reg.indexIn(s) > -1) return false; | ||||||
|     } |     } | ||||||
|     return true; |     return true; | ||||||
|   | |||||||
| @@ -71,7 +71,7 @@ class FilterParserThread : public QThread  { | |||||||
|           // PeerGuardian p2p file |           // PeerGuardian p2p file | ||||||
|           parseP2PFilterFile(filePath); |           parseP2PFilterFile(filePath); | ||||||
|         } else { |         } else { | ||||||
|             if(filePath.endsWith(".p2p", Qt::CaseInsensitive)) { |             if(filePath.endsWith(".p2b", Qt::CaseInsensitive)) { | ||||||
|               // PeerGuardian p2b file |               // PeerGuardian p2b file | ||||||
|               parseP2BFilterFile(filePath); |               parseP2BFilterFile(filePath); | ||||||
|             } else { |             } else { | ||||||
|   | |||||||
| @@ -46,7 +46,7 @@ | |||||||
| #include <QTemporaryFile> | #include <QTemporaryFile> | ||||||
|  |  | ||||||
| HttpConnection::HttpConnection(QTcpSocket *socket, Bittorrent *BTSession, HttpServer *parent) | 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); |   socket->setParent(this); | ||||||
|   connect(socket, SIGNAL(readyRead()), this, SLOT(read())); |   connect(socket, SIGNAL(readyRead()), this, SLOT(read())); | ||||||
| @@ -370,6 +370,18 @@ void HttpConnection::respondCommand(QString command) | |||||||
|       h.file_priority(file_id, priority); |       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") { |   if(command == "getTorrentUpLimit") { | ||||||
|     QString hash = parser.post("hash"); |     QString hash = parser.post("hash"); | ||||||
|     QTorrentHandle h = BTSession->getTorrentHandle(hash); |     QTorrentHandle h = BTSession->getTorrentHandle(hash); | ||||||
|   | |||||||
| @@ -60,6 +60,7 @@ | |||||||
|   <file>Icons/skin/exit.png</file> |   <file>Icons/skin/exit.png</file> | ||||||
|   <file>Icons/skin/delete_all.png</file> |   <file>Icons/skin/delete_all.png</file> | ||||||
|   <file>Icons/skin/splash.png</file> |   <file>Icons/skin/splash.png</file> | ||||||
|  |   <file>Icons/skin/disconnected.png</file> | ||||||
|   <file>Icons/skin/decrease.png</file> |   <file>Icons/skin/decrease.png</file> | ||||||
|   <file>Icons/skin/uploading.png</file> |   <file>Icons/skin/uploading.png</file> | ||||||
|   <file>Icons/skin/filterall.png</file> |   <file>Icons/skin/filterall.png</file> | ||||||
| @@ -144,7 +145,6 @@ | |||||||
|   <file>Icons/oxygen/encrypted.png</file> |   <file>Icons/oxygen/encrypted.png</file> | ||||||
|   <file>Icons/oxygen/edit_clear.png</file> |   <file>Icons/oxygen/edit_clear.png</file> | ||||||
|   <file>Icons/oxygen/download.png</file> |   <file>Icons/oxygen/download.png</file> | ||||||
|   <file>Icons/oxygen/application-x-kgetlist-no.png</file> |  | ||||||
|   <file>Icons/oxygen/gear.png</file> |   <file>Icons/oxygen/gear.png</file> | ||||||
|   <file>Icons/oxygen/remove.png</file> |   <file>Icons/oxygen/remove.png</file> | ||||||
|   <file>Icons/oxygen/dialog-warning.png</file> |   <file>Icons/oxygen/dialog-warning.png</file> | ||||||
| @@ -165,7 +165,6 @@ | |||||||
|   <file>Icons/oxygen/help-about.png</file> |   <file>Icons/oxygen/help-about.png</file> | ||||||
|   <file>Icons/oxygen/list-add.png</file> |   <file>Icons/oxygen/list-add.png</file> | ||||||
|   <file>Icons/oxygen/network-server.png</file> |   <file>Icons/oxygen/network-server.png</file> | ||||||
|   <file>Icons/oxygen/application-x-kgetlist.png</file> |  | ||||||
|   <file>Icons/oxygen/folder.png</file> |   <file>Icons/oxygen/folder.png</file> | ||||||
|   <file>Icons/oxygen/urlseed.png</file> |   <file>Icons/oxygen/urlseed.png</file> | ||||||
|   <file>Icons/oxygen/edit-cut.png</file> |   <file>Icons/oxygen/edit-cut.png</file> | ||||||
|   | |||||||
| @@ -47,6 +47,7 @@ namespace json { | |||||||
|                 case QVariant::LongLong: |                 case QVariant::LongLong: | ||||||
|                 case QVariant::UInt: |                 case QVariant::UInt: | ||||||
|                 case QVariant::ULongLong: |                 case QVariant::ULongLong: | ||||||
|  |                 case QMetaType::Float: | ||||||
|       return v.value<QString>(); |       return v.value<QString>(); | ||||||
|                 case QVariant::String: |                 case QVariant::String: | ||||||
|       { |       { | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user