Compare commits
	
		
			223 Commits
		
	
	
		
			release-2.
			...
			release-2.
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | e9da810eae | ||
|   | 9a40d7037d | ||
|   | db29364346 | ||
|   | 57d5a739ed | ||
|   | c66df12f8c | ||
|   | 6a8f568d74 | ||
|   | 56c20b1cc4 | ||
|   | 0de843911d | ||
|   | 5a58ace305 | ||
|   | b8f30381c9 | ||
|   | 1197c544aa | ||
|   | 4faaf2b642 | ||
|   | b9f22ef490 | ||
|   | c3e9e85d21 | ||
|   | 1f99a3817f | ||
|   | 0daa61be6c | ||
|   | 9216bb850a | ||
|   | 2706efdb3c | ||
|   | 7a8089fa82 | ||
|   | 8415449ecd | ||
|   | 1603faf873 | ||
|   | 54f1294ef5 | ||
|   | 91068ac17b | ||
|   | 4169ae176f | ||
|   | b2beabd8df | ||
|   | 8ec109e079 | ||
|   | 0c8464e0c8 | ||
|   | 042cbc73ec | ||
|   | 609eb5f518 | ||
|   | 3500553b15 | ||
|   | ca06f9be5c | ||
|   | 287ecf165b | ||
|   | fdf71c3006 | ||
|   | cc6179b26f | ||
|   | 7765b763f0 | ||
|   | 84abef1184 | ||
|   | 0755eccf4f | ||
|   | 425150cd01 | ||
|   | 55d1076573 | ||
|   | 6e74eb45b2 | ||
|   | e258a1a2d2 | ||
|   | 6070fac3f5 | ||
|   | ac3a88d3e3 | ||
|   | e3360713de | ||
|   | 6cb6d2724b | ||
|   | ff8354b1f6 | ||
|   | 1a2cb6aee7 | ||
|   | 25998d69a7 | ||
|   | 3e55e8dc6e | ||
|   | b8b2f96d76 | ||
|   | cc609badec | ||
|   | a1aa507bdb | ||
|   | 779b2baa74 | ||
|   | 58e0d6b11e | ||
|   | 1827337f90 | ||
|   | 08044bc47d | ||
|   | 272852f25b | ||
|   | 6575866907 | ||
|   | 816b61da76 | ||
|   | d0a6366b35 | ||
|   | d4753b2624 | ||
|   | 323fd791c5 | ||
|   | 56e45a11a8 | ||
|   | f04d912fb6 | ||
|   | 2985f85f82 | ||
|   | 49c0e9423e | ||
|   | 15a4abff5b | ||
|   | bd51ffd7ca | ||
|   | 1288c7092b | ||
|   | 9650b268b2 | ||
|   | 30c4c62d2e | ||
|   | 8b6a5d985f | ||
|   | 0bd1410b95 | ||
|   | f1451dafee | ||
|   | 74f16c8e76 | ||
|   | 1b954f157f | ||
|   | e8931c5747 | ||
|   | 31165675b8 | ||
|   | 4001ed304e | ||
|   | e8b3016771 | ||
|   | e3e9461901 | ||
|   | 45c068f0f7 | ||
|   | 4b2d09a07b | ||
|   | 2d57d9d32c | ||
|   | 4a01d01cba | ||
|   | 98cc53e287 | ||
|   | 5ad0bf1d34 | ||
|   | 35a9d30143 | ||
|   | 6bc0aebe0d | ||
|   | c099af380a | ||
|   | 59651545ae | ||
|   | 8469570f80 | ||
|   | d513b7d0d8 | ||
|   | 13e06b3444 | ||
|   | d6206d91eb | ||
|   | cae8a3173d | ||
|   | 48e6b46967 | ||
|   | 9c1bc13d6f | ||
|   | c15a890952 | ||
|   | 12b4ee72fa | ||
|   | e5290e61ca | ||
|   | 08cbe38f96 | ||
|   | 47e337dc5d | ||
|   | cfc4e7c8f6 | ||
|   | 4eb8be372e | ||
|   | 11f79432b5 | ||
|   | ec15e8247d | ||
|   | 6b4588ef6d | ||
|   | ef0a826180 | ||
|   | d79f779c0a | ||
|   | 1dadc08625 | ||
|   | 5f49af5ade | ||
|   | 1e67f0afa4 | ||
|   | dd9cf6c3ab | ||
|   | 36483d795e | ||
|   | 303c209839 | ||
|   | 6790889cc3 | ||
|   | 3a24b66adc | ||
|   | 1a3f5e81e3 | ||
|   | 818a79c9db | ||
|   | 93f635f9f4 | ||
|   | 73ec018732 | ||
|   | 68832df0c4 | ||
|   | ce817836c0 | ||
|   | 89fbfdbd1b | ||
|   | 797d89fc3c | ||
|   | abc6e1c719 | ||
|   | 31558aea8d | ||
|   | be711920fd | ||
|   | 5d899bbe7c | ||
|   | 9c63e418cf | ||
|   | 984e7c7c7b | ||
|   | 1ae460bc67 | ||
|   | c7ffa9096c | ||
|   | 01448f4c14 | ||
|   | 7e8754baf3 | ||
|   | 8206ec9012 | ||
|   | a611361823 | ||
|   | 59c77a3f9c | ||
|   | 8ce9649310 | ||
|   | fe5ac5d083 | ||
|   | 8740627c12 | ||
|   | c47f2e449b | ||
|   | db09e40690 | ||
|   | 3ca3f91590 | ||
|   | ee9a8d0563 | ||
|   | 3542980e50 | ||
|   | f243b8535a | ||
|   | 7953809024 | ||
|   | 3ac65a477c | ||
|   | 00cab62381 | ||
|   | ab31300201 | ||
|   | 754eb2788f | ||
|   | 8dcb9f17bc | ||
|   | 38121920a1 | ||
|   | e815f934e1 | ||
|   | 4a305222be | ||
|   | dcfed67173 | ||
|   | db43606620 | ||
|   | 3b16a89c36 | ||
|   | 4c03e708e0 | ||
|   | 3e0fc5234f | ||
|   | 5ba7e643b9 | ||
|   | c53e265b70 | ||
|   | 2b5f12e014 | ||
|   | ee518973ea | ||
|   | aa08552686 | ||
|   | fa43393b65 | ||
|   | 48dcfb56ad | ||
|   | 511fa5d988 | ||
|   | 5694c8aa8b | ||
|   | e3098c5191 | ||
|   | dbacb1961c | ||
|   | 1092064115 | ||
|   | 7988f15da7 | ||
|   | 689df74d7e | ||
|   | c59dde4f58 | ||
|   | 4bc36b4d28 | ||
|   | 430c7d2deb | ||
|   | d72c79b259 | ||
|   | efbf470585 | ||
|   | 4e20723ae6 | ||
|   | f3268bf49e | ||
|   | 5aba9179c4 | ||
|   | 450814ae23 | ||
|   | ba22fa8331 | ||
|   | 5ce02cb612 | ||
|   | 1013f39a42 | ||
|   | cd5c4bf464 | ||
|   | 84bfc54b03 | ||
|   | 5b3b5eb2ef | ||
|   | 990a863d41 | ||
|   | 7f27d10735 | ||
|   | 1377a75a53 | ||
|   | bcd33fc861 | ||
|   | 46d8fa1656 | ||
|   | 28cf69b84d | ||
|   | 89389df74d | ||
|   | 77c29f48cb | ||
|   | c5d92f3d69 | ||
|   | 54487c8247 | ||
|   | be64008870 | ||
|   | 8113b150dd | ||
|   | 4a33367cb0 | ||
|   | 0af5d82114 | ||
|   | 10c4fd330a | ||
|   | 9a30d5a295 | ||
|   | 724b47d999 | ||
|   | 2c0f7c33a2 | ||
|   | ce33e266fe | ||
|   | 2f291daefa | ||
|   | 722f2aeb5d | ||
|   | d5b9598b5b | ||
|   | cc7d74b67c | ||
|   | e853b0b736 | ||
|   | 5e395b24a9 | ||
|   | 9c3789f83f | ||
|   | 758595dc8c | ||
|   | 01f9e989ef | ||
|   | eb9f0cb559 | ||
|   | 2592948182 | ||
|   | 6f6ab1c439 | ||
|   | b10e606dda | 
							
								
								
									
										125
									
								
								Changelog
									
									
									
									
									
								
							
							
						
						| @@ -1,28 +1,103 @@ | ||||
| * Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.3.0 | ||||
|     - FEATURE: Simplified torrent root folder renaming/truncating (< v2.3.0 is no longer forward compatible) | ||||
|     - FEATURE: Remember previous save paths in torrent addition dialog | ||||
|     - FEATURE: Max number of half-open connections can now be edited | ||||
|     - FEATURE: Added support for strict super seeding | ||||
|     - FEATURE: The user can force listening on a particular network interface | ||||
|     - FEATURE: Added cookie support for RSS feeds | ||||
|     - FEATURE: User can force tracker reannounce | ||||
|     - FEATURE: Added "No action" setting for double-click action | ||||
|     - FEATURE: Several torrents can be moved at once | ||||
|     - FEATURE: Added error state for torrents (error is displayed in a tooltip) | ||||
|     - FEATURE: Added filter for paused/error torrents | ||||
|     - FEATURE: Add Check/Uncheck all feature in Web UI | ||||
|     - FEATURE: Search engine can now be disabled | ||||
|     - FEATURE: Torrents can be automatically paused once they reach a given ratio | ||||
|     - FEATURE: Several files can now be disabled at once | ||||
|     - FEATURE: Added "Select All/None" buttons to files list | ||||
|     - BUGFIX: Hide seeding torrents files priorities in Web UI | ||||
|     - BUGFIX: The user can disable permanently recursive torrent download | ||||
|     - BUGFIX: Peer Exchange status is now correctly reported | ||||
|     - BUGFIX: Use an INI file instead of the registry on Windows (More reliable) | ||||
|     - COSMETIC: Display peers country name in tooltip | ||||
|     - COSMETIC: Display number of torrents in transfers tab label | ||||
|     - COSMETIC: Simplified program preferences | ||||
|     - COSMETIC: Fix naming of actions opening new dialogs (use Name...) | ||||
| * Wed Jun 23 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.10 | ||||
|     - BUGFIX: Fix Web UI in qBittorrent nox version | ||||
|     - BUGFIX: Improved ETA display (more user friendly) | ||||
|     - BUGFIX: Fix possible compilation errors with libtorrent v0.15 | ||||
|     - BUGFIX: Fix minor issues in torrent creation tool | ||||
|     - BUGFIX: Use checkable actions to avoid issues on systems hiding menu icons (e.g. recent Gnome) | ||||
|     - BUGFIX: Use busy cursor for search plugin updates | ||||
|     - BUGFIX: Free disk space calculation now works if destination folder does not exist | ||||
|     - BUGFIX: Fix "append .!qB extension to incomplete files" feature | ||||
|     - BUGFIX: Several OS/2 fixes by Silvan Scherrer | ||||
|     - COSMETIC: Display "Alternative speed limits" button as pressed when enabled | ||||
|  | ||||
| * Sun Jun 13 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.9 | ||||
|     - FEATURE: Official support for Win32 platform | ||||
|     - FEATURE: Better integration with Mac OS | ||||
|     - BUGFIX: Fix torrent availability computation (closes #587337) | ||||
|     - BUGFIX: Disable torrent addition dialog as a default | ||||
|     - BUGFIX: Fix Web UI authentication with Opera Browser | ||||
|     - BUGFIX: Fix Javascript error in Web UI when using IE | ||||
|     - BUGFIX: Fix a lot of encoding problems on non UTF-8 systems | ||||
|     - BUGFIX: Fix race condition allowing to run multiple instances (closes #286968) | ||||
|     - BUGFIX: Fix window hiding problem when having a modal window (closes #589070) | ||||
|  | ||||
| * Mon May 24 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.8 | ||||
|     - BUGFIX: ETA for finished torrent is now 0 instead of Infinite (closes #583704) | ||||
|     - BUGFIX: Fix sorting of ETA column when having infinite values (closes #583347) | ||||
|     - BUGFIX: Torrent queue position now starts at 1 (closes #581130) | ||||
|     - BUGFIX: Fix unicode issue in start seeding after torrent creation code | ||||
|     - BUGFIX: Fix torrent error state clearance on resuming | ||||
|     - BUGFIX: Fix possible checkbox update in Web UI | ||||
|     - COSMETIC: Fix torrent properties layout | ||||
|  | ||||
| * Wed May 12 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.7 | ||||
|     - BUGFIX: Fix unicode problem in torrent moving code | ||||
|     - BUGFIX: Fix possible initialization problem in Web UI | ||||
|     - BUGFIX: Fix torrent moving after completion feature | ||||
|     - BUGFIX: Improved empty folder removing code | ||||
|     - BUGFIX: Use guid or news url as RSS items identifier (instead of title) | ||||
|     - BUGFIX: Fix possible crash in RSS item selection code | ||||
|     - BUGFIX: Added support for url encoded ampersands in RSS | ||||
|     - COSMETIC: Sort torrent labels in popup menu | ||||
|     - I18N: Added Croatian translation | ||||
|  | ||||
| * Sun Apr 18 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.6 | ||||
|     - BUGFIX: Announce to all trackers at once | ||||
|     - BUGFIX: Added support for single-thread boost | ||||
|     - BUGFIX: Remove old folder when moving a torrent | ||||
|     - BUGFIX: Improved reliability of torrent moving | ||||
|     - BUGFIX: Stop rechecking torrents when they are moved | ||||
|     - BUGFIX: Status filters height stays correct when the visual style changes | ||||
|     - I18N: Added Arabic translation | ||||
|  | ||||
| * Wed Apr 07 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.5 | ||||
|     - BUGFIX: Fix crash when adding a new torrent label | ||||
|     - BUGFIX: Fix HTTPS protocol support in torrent/rss downloader | ||||
|     - BUGFIX: Fix default width of file name column in torrent content | ||||
|     - BUGFIX: Fix torrent addition dialog buttons height | ||||
|     - BUGFIX: Fix deprecation warnings with libtorrent v0.15 | ||||
|     - BUGFIX: Fix "Download from URL" title size in Web UI | ||||
|     - BUGFIX: Fix transparency of speed limits icons | ||||
|     - BUGFIX: Dropped dependency on Qt gif library | ||||
|     - BUGFIX: Improved libboost detection by configure file | ||||
|     - BUGFIX: Bring back compatibility with boost v1.34 | ||||
|     - COSMETIC: Added icons to menu actions in Web UI | ||||
|  | ||||
| * Tue Apr 06 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.4 | ||||
|     - BUGFIX: Fix possible crash when adding a torrent | ||||
|     - BUGFIX: Fix failure to remember some torrents on startup | ||||
|     - BUGFIX: Fix torrent addition window layout (torrent content not expanding) | ||||
|     - BUGFIX: Fix about dialog in Web UI | ||||
|     - BUGFIX: Correctly clear trackers error messages once they work | ||||
|     - BUGFIX: Display correct share ratio for paused torrents | ||||
|     - COSMETIC: Improved alternative speed limits icons | ||||
|  | ||||
| * Sun Apr 04 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.3 | ||||
|     - BUGFIX: Fix possible crash when deleting a torrent just after pausing it | ||||
|     - BUGFIX: Enable Apply button when alternative rate limits are changed | ||||
|     - BUGFIX: Source compatibility with Windows (Thanks Ishan Arora) | ||||
|     - BUGFIX: Source compatibility with eCS (OS/2) (Thanks Silvan Scherrer) | ||||
|     - BUGFIX: Cleaner binutils gold linker support | ||||
|     - BUGFIX: Clean fix for progress display with cleanlooks style | ||||
|  | ||||
| * Mon Mar 22 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.2 | ||||
|     - FEATURE: DHT port can be set from Web UI | ||||
|     - BUGFIX: Fix possible crash with folder scanning | ||||
|     - BUGFIX: Fix Mac compilation | ||||
|     - BUGFIX: Save fast resume data every 3 minutes (for robustness) | ||||
|     - I18N: Updated Polish translation (thanks Szymon Świerkosz) | ||||
|  | ||||
| * Sat Mar 20 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.1 | ||||
|     - FEATURE: Display pieces that are being downloaded | ||||
|     - FEATURE: Added back folder watching in Web UI | ||||
|     - FEATURE: Added back file prioritizing in Web UI | ||||
|     - BUGFIX: Fix compilation with Qt 4.4 | ||||
|     - BUGFIX: Fix Web UI compatibility with Safari | ||||
|     - BUGFIX: Fix progress display with cleanlook style | ||||
|     - BUGFIX: Fix file filtering in complex torrents | ||||
|     - BUGFIX: Ask for user confirmation for recursive torrent download | ||||
|     - BUGFIX: Fix "add file" dialog in torrent creation tool | ||||
|     - BUGFIX: Fix "Ctrl+A" in Web UI | ||||
|  | ||||
| * Sun Mar 14 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.0 | ||||
|     - FEATURE: User can set alternative speed limits for fast toggling | ||||
|   | ||||
							
								
								
									
										84
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						| @@ -18,24 +18,15 @@ Main options: | ||||
|   --help              This help text. | ||||
|  | ||||
| Dependency options: | ||||
|   --disable-gui                                   Disable qBittorrent | ||||
|                                                  Graphical user interface for | ||||
|                                                  headless running | ||||
|   --with-libboost-inc=[path]                      Path to libboost include | ||||
|                                                  files | ||||
|   --with-libboost-lib=[path]                      Path to libboost library | ||||
|                                                  files | ||||
|   --disable-libnotify                            Disable use of libnotify | ||||
|   --disable-geoip-database                       Disable use of geoip-database | ||||
|   --with-geoip-database-embedded                  Geoip Database will be | ||||
|                                                  embedded in qBittorrent | ||||
|                                                  executable (please follow | ||||
|                                                  instructions in | ||||
|                                                  src/geoip/README) | ||||
|   --disable-qtsingleapplication                  Disable use of libboost | ||||
|   --with-qtsingleapplication=[system|shipped]     Use the shipped | ||||
|                                                  qtsingleapplication library | ||||
|                                                  or the system one | ||||
|   --disable-gui                      Disable qBittorrent Graphical user | ||||
|                                     interface for headless running | ||||
|   --with-libboost-inc=[path]         Path to libboost include files | ||||
|   --with-libboost-lib=[path]         Path to libboost library files | ||||
|   --disable-libnotify               Disable use of libnotify | ||||
|   --disable-geoip-database          Disable use of geoip-database | ||||
|   --with-geoip-database-embedded     Geoip Database will be embedded in | ||||
|                                     qBittorrent executable (please follow | ||||
|                                     instructions in src/geoip/README) | ||||
|  | ||||
| EOT | ||||
| } | ||||
| @@ -182,16 +173,6 @@ while [ $# -gt 0 ]; do | ||||
| 			shift | ||||
| 			;; | ||||
|  | ||||
| 		--disable-qtsingleapplication) | ||||
| 			QC_DISABLE_qtsingleapplication="Y" | ||||
| 			shift | ||||
| 			;; | ||||
|  | ||||
| 		--with-qtsingleapplication=*) | ||||
| 			QC_WITH_QTSINGLEAPPLICATION=$optarg | ||||
| 			shift | ||||
| 			;; | ||||
|  | ||||
| 		--verbose) | ||||
| 			QC_VERBOSE="Y" | ||||
| 			shift | ||||
| @@ -219,8 +200,6 @@ echo QC_WITH_LIBBOOST_LIB=$QC_WITH_LIBBOOST_LIB | ||||
| echo QC_DISABLE_libnotify=$QC_DISABLE_libnotify | ||||
| echo QC_DISABLE_geoip_database=$QC_DISABLE_geoip_database | ||||
| echo QC_WITH_GEOIP_DATABASE_EMBEDDED=$QC_WITH_GEOIP_DATABASE_EMBEDDED | ||||
| echo QC_DISABLE_qtsingleapplication=$QC_DISABLE_qtsingleapplication | ||||
| echo QC_WITH_QTSINGLEAPPLICATION=$QC_WITH_QTSINGLEAPPLICATION | ||||
| echo | ||||
| fi | ||||
|  | ||||
| @@ -550,21 +529,10 @@ public: | ||||
| 			} else { | ||||
| 				return false; | ||||
| 			} | ||||
| 			QStringList incs3; | ||||
|                         QString req_ver3 = "2.0"; | ||||
|                         QString version3, libs3, other3; | ||||
| 			if(conf->findPkgConfig("gtk+-2.0", mode, req_ver3, &version3, &incs3, &libs3, &other3)) { | ||||
|                                 for(int n = 0; n < incs3.count(); ++n) | ||||
|                                 conf->addIncludePath(incs3[n]); | ||||
|                                 if(!libs3.isEmpty()) | ||||
|                                         conf->addLib(libs3); | ||||
|                         } else { | ||||
|                                 return false; | ||||
|                         } | ||||
| 		} else { | ||||
| 			return false; | ||||
| 		} | ||||
|  | ||||
| 		 | ||||
| 		return true; | ||||
| 	} | ||||
| }; | ||||
| @@ -606,33 +574,6 @@ public: | ||||
| #endif | ||||
| 	} | ||||
| }; | ||||
| #line 1 "qtsingleapplication.qcm" | ||||
| /* | ||||
| -----BEGIN QCMOD----- | ||||
| name: libboost | ||||
| arg: with-qtsingleapplication=[system|shipped], Use the shipped qtsingleapplication library or the system one | ||||
| -----END QCMOD----- | ||||
| */ | ||||
| class qc_qtsingleapplication : public ConfObj | ||||
| { | ||||
| public: | ||||
| 	qc_qtsingleapplication(Conf *c) : ConfObj(c) {} | ||||
| 	QString name() const { return "qtsingleapplication library"; } | ||||
| 	QString shortname() const { return "qtsingleapplication"; } | ||||
|  | ||||
| 	bool exec(){ | ||||
|         	QString s; | ||||
| 		s = conf->getenv("QC_WITH_QTSINGLEAPPLICATION"); | ||||
|                 if(s.compare("system", Qt::CaseInsensitive) == 0) { | ||||
|                   // System | ||||
|                   conf->addDefine("USE_SYSTEM_QTSINGLEAPPLICATION"); | ||||
|                   printf(" [system] "); | ||||
|                 } else { | ||||
|                   printf(" [shipped] "); | ||||
| 		} | ||||
| 		return true; | ||||
| 	} | ||||
| }; | ||||
|  | ||||
| EOT | ||||
| cat >$1/modules_new.cpp <<EOT | ||||
| @@ -654,9 +595,6 @@ cat >$1/modules_new.cpp <<EOT | ||||
|     o = new qc_geoip_database(conf); | ||||
|     o->required = false; | ||||
|     o->disabled = false; | ||||
|     o = new qc_qtsingleapplication(conf); | ||||
|     o->required = false; | ||||
|     o->disabled = false; | ||||
|  | ||||
| EOT | ||||
| cat >$1/conf4.h <<EOT | ||||
| @@ -1608,8 +1546,6 @@ export QC_WITH_LIBBOOST_LIB | ||||
| export QC_DISABLE_libnotify | ||||
| export QC_DISABLE_geoip_database | ||||
| export QC_WITH_GEOIP_DATABASE_EMBEDDED | ||||
| export QC_DISABLE_qtsingleapplication | ||||
| export QC_WITH_QTSINGLEAPPLICATION | ||||
| export QC_VERBOSE | ||||
| rm -rf .qconftemp | ||||
| ( | ||||
|   | ||||
| @@ -19,6 +19,4 @@ | ||||
|   </dep> | ||||
|   <dep type='geoip-database'> | ||||
|   </dep> | ||||
|   <dep type='qtsingleapplication'> | ||||
|   </dep> | ||||
| </qconf> | ||||
|   | ||||
| @@ -40,21 +40,10 @@ public: | ||||
| 			} else { | ||||
| 				return false; | ||||
| 			} | ||||
| 			QStringList incs3; | ||||
|                         QString req_ver3 = "2.0"; | ||||
|                         QString version3, libs3, other3; | ||||
| 			if(conf->findPkgConfig("gtk+-2.0", mode, req_ver3, &version3, &incs3, &libs3, &other3)) { | ||||
|                                 for(int n = 0; n < incs3.count(); ++n) | ||||
|                                 conf->addIncludePath(incs3[n]); | ||||
|                                 if(!libs3.isEmpty()) | ||||
|                                         conf->addLib(libs3); | ||||
|                         } else { | ||||
|                                 return false; | ||||
|                         } | ||||
| 		} else { | ||||
| 			return false; | ||||
| 		} | ||||
|  | ||||
| 		 | ||||
| 		return true; | ||||
| 	} | ||||
| }; | ||||
|   | ||||
							
								
								
									
										222
									
								
								src/GUI.cpp
									
									
									
									
									
								
							
							
						
						
							
								
								
									
										17
									
								
								src/GUI.h
									
									
									
									
									
								
							
							
						
						| @@ -37,6 +37,8 @@ | ||||
| #include "ui_mainwindow.h" | ||||
| #include "qtorrenthandle.h" | ||||
|  | ||||
| enum TabIndex{TAB_TRANSFER, TAB_SEARCH, TAB_RSS}; | ||||
|  | ||||
| class Bittorrent; | ||||
| class QTimer; | ||||
| class downloadFromURL; | ||||
| @@ -56,7 +58,6 @@ class consoleDlg; | ||||
| class about; | ||||
| class createtorrent; | ||||
| class downloadFromURL; | ||||
| class HidableTabWidget; | ||||
|  | ||||
| class GUI : public QMainWindow, private Ui::MainWindow{ | ||||
|   Q_OBJECT | ||||
| @@ -66,7 +67,7 @@ public: | ||||
|   GUI(QWidget *parent=0, QStringList torrentCmdLine=QStringList()); | ||||
|   ~GUI(); | ||||
|   // Methods | ||||
|   QWidget* getCurrentTabWidget() const; | ||||
|   int getCurrentTabIndex() const; | ||||
|   TransferListWidget* getTransferList() const { return transferList; } | ||||
|   QMenu* getTrayIconMenu(); | ||||
|  | ||||
| @@ -76,7 +77,6 @@ public slots: | ||||
|   void showNotificationBaloon(QString title, QString msg) const; | ||||
|   void downloadFromURLList(const QStringList& urls); | ||||
|   void updateAltSpeedsBtn(bool alternative); | ||||
|   void updateNbTorrents(unsigned int nb_downloading, unsigned int nb_seeding, unsigned int nb_active, unsigned int nb_inactive, unsigned int nb_paused); | ||||
|  | ||||
| protected slots: | ||||
|   // GUI related slots | ||||
| @@ -127,7 +127,6 @@ protected: | ||||
|   void showEvent(QShowEvent *); | ||||
|   bool event(QEvent * event); | ||||
|   void displayRSSTab(bool enable); | ||||
|   void displaySearchTab(bool enable); | ||||
|  | ||||
| private: | ||||
|   // Bittorrent | ||||
| @@ -135,7 +134,7 @@ private: | ||||
|   QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers; // Still needed? | ||||
|   // GUI related | ||||
|   QTimer *guiUpdater; | ||||
|   HidableTabWidget *tabs; | ||||
|   QTabWidget *tabs; | ||||
|   StatusBar *status_bar; | ||||
|   QPointer<options_imp> options; | ||||
|   QPointer<consoleDlg> console; | ||||
| @@ -161,15 +160,9 @@ private: | ||||
|   QSplitter *hSplitter; | ||||
|   QSplitter *vSplitter; | ||||
|   // Search | ||||
|   QPointer<SearchEngine> searchEngine; | ||||
|   SearchEngine *searchEngine; | ||||
|   // RSS | ||||
|   QPointer<RSSImp> rssWidget; | ||||
|  | ||||
| private slots: | ||||
|     void on_actionSearch_engine_triggered(); | ||||
|     void on_actionRSS_Reader_triggered(); | ||||
|     void on_actionSpeed_in_title_bar_triggered(); | ||||
|     void on_actionTop_tool_bar_triggered(); | ||||
| }; | ||||
|  | ||||
| #endif | ||||
|   | ||||
| Before Width: | Height: | Size: 322 B | 
							
								
								
									
										
											BIN
										
									
								
								src/Icons/L.gif
									
									
									
									
									
								
							
							
						
						| Before Width: | Height: | Size: 66 B | 
							
								
								
									
										
											BIN
										
									
								
								src/Icons/locale.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 1.3 KiB | 
| Before Width: | Height: | Size: 2.3 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/Icons/oxygen/mail-queue.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 860 B | 
							
								
								
									
										
											BIN
										
									
								
								src/Icons/oxygen/wallet.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 1.2 KiB | 
| @@ -1,6 +1,6 @@ | ||||
| [Desktop Entry] | ||||
| Categories=Qt;Network;P2P; | ||||
| Comment=V2.3.0 | ||||
| Comment=V2.2.10 | ||||
| Exec=qbittorrent %f | ||||
| GenericName=Bittorrent client | ||||
| GenericName[ar]=العميل Bittorrent | ||||
|   | ||||
| Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/Icons/skin/checkingUP.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 3.3 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/Icons/skin/delete_perm22.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 1.6 KiB | 
| Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 257 B | 
| Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.9 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/Icons/skin/pausedUP.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 2.9 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/Icons/skin/properties.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 2.4 KiB | 
| Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/Icons/skin/queuedUP.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 2.9 KiB | 
| Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 80 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/Icons/skin/stalled.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 315 B | 
| @@ -47,7 +47,7 @@ | ||||
| 	<key>CFBundlePackageType</key> | ||||
| 	<string>APPL</string> | ||||
| 	<key>CFBundleGetInfoString</key> | ||||
| 	<string>2.3.0</string> | ||||
| 	<string>2.2.10</string> | ||||
| 	<key>CFBundleSignature</key> | ||||
| 	<string>????</string> | ||||
| 	<key>CFBundleExecutable</key> | ||||
|   | ||||
| @@ -5,22 +5,19 @@ | ||||
| #include <QHeaderView> | ||||
| #include <QSpinBox> | ||||
| #include <QCheckBox> | ||||
| #include <QComboBox> | ||||
| #include <QNetworkInterface> | ||||
| #include <libtorrent/version.hpp> | ||||
| #include "preferences.h" | ||||
|  | ||||
| enum AdvSettingsCols {PROPERTY, VALUE}; | ||||
| enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE }; | ||||
| #define ROW_COUNT 12 | ||||
| enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS }; | ||||
| #define ROW_COUNT 9 | ||||
|  | ||||
| class AdvancedSettings: public QTableWidget { | ||||
|   Q_OBJECT | ||||
|  | ||||
| private: | ||||
|   QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max, *spin_list_refresh, *spin_maxhalfopen; | ||||
|   QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts, *cb_super_seeding; | ||||
|   QComboBox *combo_iface; | ||||
|   QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max, *spin_list_refresh; | ||||
|   QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts; | ||||
|  | ||||
| public: | ||||
|   AdvancedSettings(QWidget *parent=0): QTableWidget(parent) { | ||||
| @@ -49,9 +46,6 @@ public: | ||||
|     delete spin_list_refresh; | ||||
|     delete cb_resolve_countries; | ||||
|     delete cb_resolve_hosts; | ||||
|     delete spin_maxhalfopen; | ||||
|     delete cb_super_seeding; | ||||
|     delete combo_iface; | ||||
|   } | ||||
|  | ||||
| public slots: | ||||
| @@ -72,19 +66,6 @@ public slots: | ||||
|     // Peer resolution | ||||
|     Preferences::resolvePeerCountries(cb_resolve_countries->isChecked()); | ||||
|     Preferences::resolvePeerHostNames(cb_resolve_hosts->isChecked()); | ||||
|     // Max Half-Open connections | ||||
|     Preferences::setMaxHalfOpenConnections(spin_maxhalfopen->value()); | ||||
| #if LIBTORRENT_VERSION_MINOR > 14 | ||||
|     // Super seeding | ||||
|     Preferences::enableSuperSeeding(cb_super_seeding->isChecked()); | ||||
| #endif | ||||
|     // Network interface | ||||
|     if(combo_iface->currentIndex() == 0) { | ||||
|       // All interfaces (default) | ||||
|       Preferences::setNetworkInterface(QString::null); | ||||
|     } else { | ||||
|       Preferences::setNetworkInterface(combo_iface->currentText()); | ||||
|     } | ||||
|   } | ||||
|  | ||||
| protected slots: | ||||
| @@ -153,39 +134,6 @@ protected slots: | ||||
|     connect(cb_resolve_hosts, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged())); | ||||
|     cb_resolve_hosts->setChecked(Preferences::resolvePeerHostNames()); | ||||
|     setCellWidget(RESOLVE_HOSTS, VALUE, cb_resolve_hosts); | ||||
|     // Max Half Open connections | ||||
|     setItem(MAX_HALF_OPEN, PROPERTY, new QTableWidgetItem(tr("Maximum number of half-open connections [0: Disabled]"))); | ||||
|     spin_maxhalfopen = new QSpinBox(); | ||||
|     connect(spin_maxhalfopen, SIGNAL(valueChanged(int)), this, SLOT(emitSettingsChanged())); | ||||
|     spin_maxhalfopen->setMinimum(0); | ||||
|     spin_maxhalfopen->setMaximum(99999); | ||||
|     spin_maxhalfopen->setValue(Preferences::getMaxHalfOpenConnections()); | ||||
|     setCellWidget(MAX_HALF_OPEN, VALUE, spin_maxhalfopen); | ||||
|     // Super seeding | ||||
|     setItem(SUPER_SEEDING, PROPERTY, new QTableWidgetItem(tr("Strict super seeding"))); | ||||
|     cb_super_seeding = new QCheckBox(); | ||||
|     connect(cb_super_seeding, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged())); | ||||
| #if LIBTORRENT_VERSION_MINOR > 14 | ||||
|     cb_super_seeding->setChecked(Preferences::isSuperSeedingEnabled()); | ||||
| #else | ||||
|     cb_super_seeding->setEnabled(false); | ||||
| #endif | ||||
|     setCellWidget(SUPER_SEEDING, VALUE, cb_super_seeding); | ||||
|     // Network interface | ||||
|     setItem(NETWORK_IFACE, PROPERTY, new QTableWidgetItem(tr("Network Interface (requires restart)"))); | ||||
|     combo_iface = new QComboBox; | ||||
|     combo_iface->addItem(tr("Any interface", "i.e. Any network interface")); | ||||
|     const QString ¤t_iface = Preferences::getNetworkInterface(); | ||||
|     int i = 1; | ||||
|     foreach(const QNetworkInterface& iface, QNetworkInterface::allInterfaces()) { | ||||
|       if(iface.name() == "lo") continue; | ||||
|       combo_iface->addItem(iface.name()); | ||||
|       if(!current_iface.isEmpty() && iface.name() == current_iface) | ||||
|         combo_iface->setCurrentIndex(i); | ||||
|       ++i; | ||||
|     } | ||||
|     connect(combo_iface, SIGNAL(currentIndexChanged(int)), this, SLOT(emitSettingsChanged())); | ||||
|     setCellWidget(NETWORK_IFACE, VALUE, combo_iface); | ||||
|   } | ||||
|  | ||||
|   void emitSettingsChanged() { | ||||
|   | ||||
| @@ -118,7 +118,6 @@ public: | ||||
|   bool useTemporaryFolder() const; | ||||
|   QString getDefaultSavePath() const; | ||||
|   ScanFoldersModel* getScanFoldersModel() const; | ||||
|   bool isPexEnabled() const; | ||||
| #if LIBTORRENT_VERSION_MINOR < 15 | ||||
|   void saveDHTEntry(); | ||||
| #endif | ||||
| @@ -154,7 +153,8 @@ public slots: | ||||
|   void setMaxUploadsPerTorrent(int max); | ||||
|   void setDownloadRateLimit(long rate); | ||||
|   void setUploadRateLimit(long rate); | ||||
|   void setMaxRatio(float ratio); | ||||
|   void setGlobalRatio(float ratio); | ||||
|   void setDeleteRatio(float ratio); | ||||
|   void setDHTPort(int dht_port); | ||||
|   void setPeerProxySettings(const proxy_settings &proxySettings); | ||||
|   void setHTTPProxySettings(const proxy_settings &proxySettings); | ||||
| @@ -162,10 +162,10 @@ public slots: | ||||
|   void startTorrentsInPause(bool b); | ||||
|   void setDefaultTempPath(QString temppath); | ||||
|   void setAppendLabelToSavePath(bool append); | ||||
|   void appendLabelToTorrentSavePath(QTorrentHandle &h); | ||||
|   void changeLabelInTorrentSavePath(QTorrentHandle &h, QString old_label, QString new_label); | ||||
|   void appendLabelToTorrentSavePath(QTorrentHandle h); | ||||
|   void changeLabelInTorrentSavePath(QTorrentHandle h, QString old_label, QString new_label); | ||||
| #if LIBTORRENT_VERSION_MINOR > 14 | ||||
|   void appendqBextensionToTorrent(QTorrentHandle &h, bool append); | ||||
|   void appendqBextensionToTorrent(QTorrentHandle h, bool append); | ||||
|   void setAppendqBExtension(bool append); | ||||
| #endif | ||||
|   void applyEncryptionSettings(pe_settings se); | ||||
| @@ -189,13 +189,13 @@ public slots: | ||||
|   void recursiveTorrentDownload(const QTorrentHandle &h); | ||||
|  | ||||
| protected: | ||||
|   QString getSavePath(QString hash, bool fromScanDir = false, QString filePath = QString::null, QString root_folder=QString::null); | ||||
|   QString getSavePath(QString hash, bool fromScanDir = false, QString filePath = QString()); | ||||
|   bool initWebUi(QString username, QString password, int port); | ||||
|  | ||||
| protected slots: | ||||
|   void addTorrentsFromScanFolder(QStringList&); | ||||
|   void readAlerts(); | ||||
|   void processBigRatios(); | ||||
|   void deleteBigRatios(); | ||||
|   void takeETASamples(); | ||||
|   void exportTorrentFiles(QString path); | ||||
|   void saveTempFastResumeData(); | ||||
| @@ -226,7 +226,6 @@ private: | ||||
|   QPointer<BandwidthScheduler> bd_scheduler; | ||||
|   QMap<QUrl, QString> savepath_fromurl; | ||||
|   QHash<QString, QHash<QString, TrackerInfos> > trackersInfos; | ||||
|   QHash<QString, QString> savePathsToRemove; | ||||
|   QStringList torrentsToPausedAfterChecking; | ||||
|   QTimer resumeDataTimer; | ||||
|   // Ratio | ||||
| @@ -242,7 +241,6 @@ private: | ||||
|   bool preAllocateAll; | ||||
|   bool addInPause; | ||||
|   float ratio_limit; | ||||
|   int high_ratio_action; | ||||
|   bool UPnPEnabled; | ||||
|   bool NATPMPEnabled; | ||||
|   bool LSDEnabled; | ||||
|   | ||||
| @@ -1,95 +0,0 @@ | ||||
| /* | ||||
|  * Bittorrent Client using Qt4 and libtorrent. | ||||
|  * Copyright (C) 2010  Christophe Dumez | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or | ||||
|  * modify it under the terms of the GNU General Public License | ||||
|  * as published by the Free Software Foundation; either version 2 | ||||
|  * of the License, or (at your option) any later version. | ||||
|  * | ||||
|  * This program is distributed in the hope that it will be useful, | ||||
|  * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
|  * GNU General Public License for more details. | ||||
|  * | ||||
|  * You should have received a copy of the GNU General Public License | ||||
|  * along with this program; if not, write to the Free Software | ||||
|  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. | ||||
|  * | ||||
|  * In addition, as a special exception, the copyright holders give permission to | ||||
|  * link this program with the OpenSSL project's "OpenSSL" library (or with | ||||
|  * modified versions of it that use the same license as the "OpenSSL" library), | ||||
|  * and distribute the linked executables. You must obey the GNU General Public | ||||
|  * License in all respects for all of the code used other than "OpenSSL".  If you | ||||
|  * modify file(s), you may extend this exception to your version of the file(s), | ||||
|  * but you are not obligated to do so. If you do not wish to do so, delete this | ||||
|  * exception statement from your version. | ||||
|  * | ||||
|  * Contact : chris@qbittorrent.org arnaud@qbittorrent.org | ||||
|  */ | ||||
|  | ||||
| #include "cookiesdlg.h" | ||||
| #include "ui_cookiesdlg.h" | ||||
|  | ||||
| #include <QNetworkCookie> | ||||
|  | ||||
| enum CookiesCols { COOKIE_KEY, COOKIE_VALUE}; | ||||
|  | ||||
| CookiesDlg::CookiesDlg(QWidget *parent, const QList<QByteArray> &raw_cookies) : | ||||
|     QDialog(parent), | ||||
|     ui(new Ui::CookiesDlg) | ||||
| { | ||||
|   ui->setupUi(this); | ||||
|   ui->infos_lbl->setText(tr("Common keys for cookies are : '%1', '%2'.\nYou should get this information from your Web browser preferences.").arg("uid").arg("pass")); | ||||
|   foreach(const QByteArray &raw_cookie, raw_cookies) { | ||||
|     QList<QByteArray> cookie_parts = raw_cookie.split('='); | ||||
|     if(cookie_parts.size() != 2) continue; | ||||
|     const int i = ui->cookiesTable->rowCount(); | ||||
|     ui->cookiesTable->setRowCount(i+1); | ||||
|     ui->cookiesTable->setItem(i, COOKIE_KEY, new QTableWidgetItem(cookie_parts.first().data())); | ||||
|     ui->cookiesTable->setItem(i, COOKIE_VALUE, new QTableWidgetItem(cookie_parts.last().data())); | ||||
|   } | ||||
| } | ||||
|  | ||||
| CookiesDlg::~CookiesDlg() | ||||
| { | ||||
|   delete ui; | ||||
| } | ||||
|  | ||||
| void CookiesDlg::on_add_btn_clicked() { | ||||
|   ui->cookiesTable->setRowCount(ui->cookiesTable->rowCount()+1); | ||||
|   // Edit first column | ||||
|   ui->cookiesTable->editItem(ui->cookiesTable->item(ui->cookiesTable->rowCount()-1, COOKIE_KEY)); | ||||
| } | ||||
|  | ||||
| void CookiesDlg::on_del_btn_clicked() { | ||||
|   // Get selected cookie | ||||
|   QList<QTableWidgetItem*> selection = ui->cookiesTable->selectedItems(); | ||||
|   if(!selection.isEmpty()) { | ||||
|     ui->cookiesTable->removeRow(selection.first()->row()); | ||||
|   } | ||||
| } | ||||
|  | ||||
| QList<QByteArray> CookiesDlg::getCookies() const { | ||||
|   QList<QByteArray> ret; | ||||
|   for(int i=0; i<ui->cookiesTable->rowCount(); ++i) { | ||||
|     QString key = ui->cookiesTable->item(i, COOKIE_KEY)->text().trimmed(); | ||||
|     QString value = ui->cookiesTable->item(i, COOKIE_VALUE)->text().trimmed(); | ||||
|     if(!key.isEmpty() && !value.isEmpty()) { | ||||
|       const QString raw_cookie = key+"="+value; | ||||
|       qDebug("Cookie: %s", qPrintable(raw_cookie)); | ||||
|       ret << raw_cookie.toLocal8Bit(); | ||||
|     } | ||||
|   } | ||||
|   return ret; | ||||
| } | ||||
|  | ||||
| QList<QByteArray> CookiesDlg::askForCookies(QWidget *parent, const QList<QByteArray> &raw_cookies, bool *ok) { | ||||
|   CookiesDlg dlg(parent, raw_cookies); | ||||
|   if(dlg.exec()) { | ||||
|     *ok = true; | ||||
|     return dlg.getCookies(); | ||||
|   } | ||||
|   *ok = false; | ||||
|   return QList<QByteArray>(); | ||||
| } | ||||
| @@ -1,58 +0,0 @@ | ||||
| /* | ||||
|  * Bittorrent Client using Qt4 and libtorrent. | ||||
|  * Copyright (C) 2010  Christophe Dumez | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or | ||||
|  * modify it under the terms of the GNU General Public License | ||||
|  * as published by the Free Software Foundation; either version 2 | ||||
|  * of the License, or (at your option) any later version. | ||||
|  * | ||||
|  * This program is distributed in the hope that it will be useful, | ||||
|  * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
|  * GNU General Public License for more details. | ||||
|  * | ||||
|  * You should have received a copy of the GNU General Public License | ||||
|  * along with this program; if not, write to the Free Software | ||||
|  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. | ||||
|  * | ||||
|  * In addition, as a special exception, the copyright holders give permission to | ||||
|  * link this program with the OpenSSL project's "OpenSSL" library (or with | ||||
|  * modified versions of it that use the same license as the "OpenSSL" library), | ||||
|  * and distribute the linked executables. You must obey the GNU General Public | ||||
|  * License in all respects for all of the code used other than "OpenSSL".  If you | ||||
|  * modify file(s), you may extend this exception to your version of the file(s), | ||||
|  * but you are not obligated to do so. If you do not wish to do so, delete this | ||||
|  * exception statement from your version. | ||||
|  * | ||||
|  * Contact : chris@qbittorrent.org arnaud@qbittorrent.org | ||||
|  */ | ||||
|  | ||||
| #ifndef COOKIESDLG_H | ||||
| #define COOKIESDLG_H | ||||
|  | ||||
| #include <QDialog> | ||||
|  | ||||
| namespace Ui { | ||||
|     class CookiesDlg; | ||||
| } | ||||
|  | ||||
| class CookiesDlg : public QDialog | ||||
| { | ||||
|     Q_OBJECT | ||||
|  | ||||
| public: | ||||
|     explicit CookiesDlg(QWidget *parent = 0, const QList<QByteArray> &raw_cookies = QList<QByteArray>()); | ||||
|     ~CookiesDlg(); | ||||
|     QList<QByteArray> getCookies() const; | ||||
|     static QList<QByteArray> askForCookies(QWidget *parent, const QList<QByteArray> &raw_cookies, bool *ok); | ||||
|  | ||||
|   protected slots: | ||||
|     void on_add_btn_clicked(); | ||||
|     void on_del_btn_clicked(); | ||||
|  | ||||
| private: | ||||
|     Ui::CookiesDlg *ui; | ||||
| }; | ||||
|  | ||||
| #endif // COOKIESDLG_H | ||||
| @@ -33,7 +33,6 @@ | ||||
|  | ||||
| #include <QDialog> | ||||
| #include "ui_confirmdeletiondlg.h" | ||||
| #include "preferences.h" | ||||
| #include "misc.h" | ||||
|  | ||||
| class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg { | ||||
| @@ -43,9 +42,6 @@ class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg { | ||||
|   DeletionConfirmationDlg(QWidget *parent=0): QDialog(parent) { | ||||
|     setupUi(this); | ||||
|     move(misc::screenCenter(this)); | ||||
|     checkPermDelete->setChecked(Preferences::deleteTorrentFilesAsDefault()); | ||||
|     connect(checkPermDelete, SIGNAL(clicked()), this, SLOT(updateRememberButtonState())); | ||||
|     buttonBox->setFocus(); | ||||
|   } | ||||
|  | ||||
|   bool shouldDeleteLocalFiles() const { | ||||
| @@ -61,15 +57,6 @@ class DeletionConfirmationDlg : public QDialog, private Ui::confirmDeletionDlg { | ||||
|     return false; | ||||
|   } | ||||
|  | ||||
| private slots: | ||||
|   void updateRememberButtonState() { | ||||
|     rememberBtn->setEnabled(checkPermDelete->isChecked() != Preferences::deleteTorrentFilesAsDefault()); | ||||
|   } | ||||
|  | ||||
|   void on_rememberBtn_clicked() { | ||||
|     Preferences::setDeleteTorrentFilesAsDefault(checkPermDelete->isChecked()); | ||||
|     rememberBtn->setEnabled(false); | ||||
|   } | ||||
| }; | ||||
|  | ||||
| #endif // DELETIONCONFIRMATIONDLG_H | ||||
|   | ||||
| @@ -28,34 +28,35 @@ | ||||
|  * Contact : chris@qbittorrent.org | ||||
|  */ | ||||
|  | ||||
| #include "downloadthread.h" | ||||
| #include <QTemporaryFile> | ||||
| #include <QSettings> | ||||
| #include <QNetworkAccessManager> | ||||
| #include <QNetworkRequest> | ||||
| #include <QNetworkProxy> | ||||
| #include <QNetworkCookie> | ||||
| #include <QNetworkCookieJar> | ||||
|  | ||||
| #include "downloadthread.h" | ||||
| #include "preferences.h" | ||||
| #include "qinisettings.h" | ||||
|  | ||||
| enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4, SOCKS4=5}; | ||||
|  | ||||
| /** Download Thread **/ | ||||
|  | ||||
| downloadThread::downloadThread(QObject* parent) : QObject(parent) { | ||||
|   connect(&networkManager, SIGNAL(finished (QNetworkReply*)), this, SLOT(processDlFinished(QNetworkReply*))); | ||||
|   networkManager = new QNetworkAccessManager(this); | ||||
|   connect(networkManager, SIGNAL(finished (QNetworkReply*)), this, SLOT(processDlFinished(QNetworkReply*))); | ||||
| #ifndef QT_NO_OPENSSL | ||||
|   connect(&networkManager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), this, SLOT(ignoreSslErrors(QNetworkReply*,QList<QSslError>))); | ||||
|   connect(networkManager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), this, SLOT(ignoreSslErrors(QNetworkReply*,QList<QSslError>))); | ||||
| #endif | ||||
| } | ||||
|  | ||||
| downloadThread::~downloadThread(){ | ||||
|   qDebug("Deleting network manager"); | ||||
|   delete networkManager; | ||||
|   qDebug("Deleted network manager"); | ||||
| } | ||||
|  | ||||
| void downloadThread::processDlFinished(QNetworkReply* reply) { | ||||
|   QString url = reply->url().toEncoded().data(); | ||||
|   qDebug("Download finished: %s", qPrintable(url)); | ||||
|   if(reply->error() != QNetworkReply::NoError) { | ||||
|     // Failure | ||||
|     qDebug("Download failure (%s), reason: %s", qPrintable(url), qPrintable(errorCodeToString(reply->error()))); | ||||
|     emit downloadFailure(url, errorCodeToString(reply->error())); | ||||
|   } else { | ||||
|     QVariant redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); | ||||
| @@ -100,28 +101,7 @@ void downloadThread::processDlFinished(QNetworkReply* reply) { | ||||
|   reply->deleteLater(); | ||||
| } | ||||
|  | ||||
| void downloadThread::loadCookies(const QString &host_name, QString url) { | ||||
|   const QList<QByteArray> &raw_cookies = Preferences::getHostNameCookies(host_name); | ||||
|   QNetworkCookieJar *cookie_jar = networkManager.cookieJar(); | ||||
|   QList<QNetworkCookie> cookies; | ||||
|   qDebug("Loading cookies for host name: %s", qPrintable(host_name)); | ||||
|   foreach(const QByteArray& raw_cookie, raw_cookies) { | ||||
|     QList<QByteArray> cookie_parts = raw_cookie.split('='); | ||||
|     if(cookie_parts.size() == 2) { | ||||
|       qDebug("Loading cookie: %s", raw_cookie.constData()); | ||||
|       cookies << QNetworkCookie(cookie_parts.first(), cookie_parts.last()); | ||||
|     } | ||||
|   } | ||||
|   cookie_jar->setCookiesFromUrl(cookies, url); | ||||
|   networkManager.setCookieJar(cookie_jar); | ||||
| } | ||||
|  | ||||
| void downloadThread::downloadTorrentUrl(QString url){ | ||||
|   // Load cookies | ||||
|   QString host_name = QUrl::fromEncoded(url.toLocal8Bit()).host(); | ||||
|   if(!host_name.isEmpty()) | ||||
|     loadCookies(host_name, url); | ||||
|   // Process request | ||||
|   QNetworkReply *reply = downloadUrl(url); | ||||
|   connect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(checkDownloadSize(qint64,qint64))); | ||||
| } | ||||
| @@ -129,24 +109,14 @@ void downloadThread::downloadTorrentUrl(QString url){ | ||||
| QNetworkReply* downloadThread::downloadUrl(QString url){ | ||||
|   // Update proxy settings | ||||
|   applyProxySettings(); | ||||
|   // Load cookies | ||||
|   QString host_name = QUrl::fromEncoded(url.toLocal8Bit()).host(); | ||||
|   if(!host_name.isEmpty()) | ||||
|     loadCookies(host_name, url); | ||||
|   // Process download request | ||||
|   qDebug("url is %s", qPrintable(url)); | ||||
|   const QUrl &qurl = QUrl::fromEncoded(url.toLocal8Bit()); | ||||
|   QNetworkRequest request(qurl); | ||||
|   QNetworkRequest request; | ||||
|   request.setUrl(QUrl::fromEncoded(url.toLocal8Bit())); | ||||
|   // Spoof Firefox 3.5 user agent to avoid | ||||
|   // Web server banning | ||||
|   request.setRawHeader("User-Agent", "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5"); | ||||
|   qDebug("Downloading %s...", request.url().toEncoded().data()); | ||||
|   qDebug("%d cookies for this URL", networkManager.cookieJar()->cookiesForUrl(url).size()); | ||||
|   for(int i=0; i<networkManager.cookieJar()->cookiesForUrl(url).size(); ++i) { | ||||
|     qDebug("%s=%s", networkManager.cookieJar()->cookiesForUrl(url).at(i).name().data(), networkManager.cookieJar()->cookiesForUrl(url).at(i).value().data()); | ||||
|     qDebug("Domain: %s, Path: %s", qPrintable(networkManager.cookieJar()->cookiesForUrl(url).at(i).domain()), qPrintable(networkManager.cookieJar()->cookiesForUrl(url).at(i).path())); | ||||
|   } | ||||
|   return networkManager.get(request); | ||||
|   qDebug("Downloading %s...", qPrintable(request.url().toString())); | ||||
|   return networkManager->get(request); | ||||
| } | ||||
|  | ||||
| void downloadThread::checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal) { | ||||
| @@ -170,7 +140,7 @@ void downloadThread::checkDownloadSize(qint64 bytesReceived, qint64 bytesTotal) | ||||
|  | ||||
| void downloadThread::applyProxySettings() { | ||||
|   QNetworkProxy proxy; | ||||
|   QIniSettings settings("qBittorrent", "qBittorrent"); | ||||
|   QSettings settings("qBittorrent", "qBittorrent"); | ||||
|   int intValue = settings.value(QString::fromUtf8("Preferences/Connection/HTTPProxyType"), 0).toInt(); | ||||
|   if(intValue > 0) { | ||||
|     // Proxy enabled | ||||
| @@ -198,7 +168,7 @@ void downloadThread::applyProxySettings() { | ||||
|   } else { | ||||
|     proxy.setType(QNetworkProxy::NoProxy); | ||||
|   } | ||||
|   networkManager.setProxy(proxy); | ||||
|   networkManager->setProxy(proxy); | ||||
| } | ||||
|  | ||||
| QString downloadThread::errorCodeToString(QNetworkReply::NetworkError status) { | ||||
|   | ||||