You've already forked qBittorrent
							
							
				mirror of
				https://github.com/qbittorrent/qBittorrent
				synced 2025-10-30 23:30:54 +01:00 
			
		
		
		
	Compare commits
	
		
			73 Commits
		
	
	
		
			v4_3_x
			...
			release-4.
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | ea5a29018f | ||
|   | c8d0a715e8 | ||
|   | 2cfc6514ab | ||
|   | 1d78bc7206 | ||
|   | e5577e43f8 | ||
|   | 17c0463906 | ||
|   | 4168772904 | ||
|   | 44f2186749 | ||
|   | 0c918bcc3a | ||
|   | 0a8925dc75 | ||
|   | a446597597 | ||
|   | 54354a2732 | ||
|   | d94b8f08ab | ||
|   | 0d8189efeb | ||
|   | 00c886e426 | ||
|   | 551fc35439 | ||
|   | 9ff17c8d9d | ||
|   | ec37732e99 | ||
|   | 8a414f32a8 | ||
|   | bac06acb49 | ||
|   | ae1e3c2a81 | ||
|   | 67940eb0f9 | ||
|   | 007aa8480e | ||
|   | dedec10c58 | ||
|   | 75219e21be | ||
|   | 10f5964f8e | ||
|   | a4a64d51c0 | ||
|   | 1014313d88 | ||
|   | e486bb4c29 | ||
|   | 5c3d9ffb46 | ||
|   | 2e474fd8db | ||
|   | b2b110ae1f | ||
|   | 68a34e0738 | ||
|   | 38fa575958 | ||
|   | 6cfeefe054 | ||
|   | 8007971a53 | ||
|   | d66bd30fae | ||
|   | 3fa59b1b12 | ||
|   | 20e7aff393 | ||
|   | 4b7ce87f57 | ||
|   | 2075533468 | ||
|   | a4ad5c8d11 | ||
|   | 35f2f56757 | ||
|   | e6f4aa6a2f | ||
|   | 92fc62bb0d | ||
|   | 44b57a59f5 | ||
|   | 97b8e02bf5 | ||
|   | 5df42420cb | ||
|   | 0ede11a1b7 | ||
|   | 7d9c282db9 | ||
|   | bc0e0813a4 | ||
|   | f3aebb3001 | ||
|   | 800f966df9 | ||
|   | e33df4dd8c | ||
|   | 96d9d810fd | ||
|   | 8707a1bc86 | ||
|   | 0c988a5fd4 | ||
|   | b396ca771d | ||
|   | a37dfcf961 | ||
|   | 31989740cd | ||
|   | 501191289b | ||
|   | 8971e92d78 | ||
|   | 0c96e79d0d | ||
|   | 0704c0f5e6 | ||
|   | 9cb190ebe7 | ||
|   | 667f84995c | ||
|   | 7a93fae6e4 | ||
|   | 0d6deca15c | ||
|   | f54d7d46f2 | ||
|   | 8cf00ba5e1 | ||
|   | ecc9c6bbd9 | ||
|   | e11199f988 | ||
|   | e9ed621178 | 
| @@ -1,6 +1,8 @@ | ||||
| cmake_minimum_required(VERSION 3.5) | ||||
| cmake_policy(VERSION 3.5) | ||||
|  | ||||
| message(WARNING "No official support for cmake build system. If it is broken, please submit patches!") | ||||
|  | ||||
| list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) | ||||
| include(FunctionReadVersion) | ||||
|  | ||||
|   | ||||
| @@ -239,11 +239,11 @@ The headers should be placed in the following group order: | ||||
|   4. Boost library headers | ||||
|   5. Libtorrent headers | ||||
|   6. Qt headers | ||||
|   7. qBittorrent own headers, starting from *base* headers. | ||||
|   7. qBittorrent's own headers, starting from the *base* headers. | ||||
|  | ||||
| The headers should be ordered alphabetically within each group.   | ||||
| If there are conditionals for the same header group, then put them at the bottom of the respective group.   | ||||
| If there are conditionals for the different header groups, then put them above of the "qBittorrent own headers" group. | ||||
| If there are conditionals that contain headers from several different header groups, then put them above the "qBittorrent's own headers" group. | ||||
|  | ||||
| One exception is the header containing the library version (for example, QtGlobal), this particular header isn't constrained by the aforementioned order. | ||||
|  | ||||
| @@ -285,13 +285,13 @@ Example: | ||||
| #include <QFont> | ||||
| #endif | ||||
|  | ||||
| // conditional for the different header groups | ||||
| // conditional that contains headers from several different header groups | ||||
| #if LIBTORRENT_VERSION_NUM >= 10100 | ||||
| #include <memory> | ||||
| #include <QElapsedTimer> | ||||
| #endif | ||||
|  | ||||
| // qBittorrent own headers | ||||
| // qBittorrent's own headers | ||||
| #include "base/bittorrent/infohash.h" | ||||
| #include "anothermodule.h" | ||||
| #include "ui_examplewidget.h" | ||||
|   | ||||
							
								
								
									
										36
									
								
								Changelog
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								Changelog
									
									
									
									
									
								
							| @@ -1,3 +1,39 @@ | ||||
| * Sun May 27 2018 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.1.1 | ||||
|     - FEATURE: Add 'Moving' state for torrents being relocated/moved (sledgehammer999) | ||||
|     - FEATURE: Show rechecking progress (sledgehammer999) | ||||
|     - FEATURE: Add option to remember last used save path (glassez) | ||||
|     - FEATURE: Torrent name is also renamed if the content was renamed in the "Add New Torrent" dialog (glassez) | ||||
|     - FEATURE: Relax behavior of "Download first and last piece first". It applies to all files and not only to the previewable. (Chocobo1) | ||||
|     - BUGFIX: Fix issues with translatable strings (Chocobo1) | ||||
|     - BUGFIX: Fix displayed tracker messages (Chocobo1) | ||||
|     - BUGFIX: Make settings file recovery more robust (Chocobo1) | ||||
|     - BUGFIX: Retry saving settings when operation failed (Chocobo1) | ||||
|     - BUGFIX: Log successful torrent move (sledgehammer999) | ||||
|     - BUGFIX: Fix deletion of old logs (sledgehammer999) | ||||
|     - BUGFIX: Delete non-commited fastresume files (sledgehammer999) | ||||
|     - BUGFIX: Don't migrate torrents that have newer fastresumes (sledgehammer999) | ||||
|     - BUGFIX: Fix adding multiple torrents at once from WebUI (glassez) | ||||
|     - BUGFIX: Improve "Run External Program" behavior. On Windows, a backslash isn't appended to paths from path variables (Chocobo1) | ||||
|     - BUGFIX: Suppress multiple I/O errors for the same torrent (sledgehammer999) | ||||
|     - BUGFIX: Replace raster qbt logo with vector version (Chocobo1) | ||||
|     - WEBUI: Fix wrong API method names (glassez) | ||||
|     - WEBUI: Filter torrent info endpoint by hashes (Marcel Petersen) | ||||
|     - WEBUI: Fix invalid API calls in WebUI (glassez) | ||||
|     - WEBUI: Improve legacy API params handling (glassez) | ||||
|     - WEBUI: Fix params handling for some legacy API methods (glassez) | ||||
|     - WEBUI: Apply locale changes immediately in WebUI (Chocobo1) | ||||
|     - WEBUI: Use 32px icons for favicon (Chocobo1) | ||||
|     - WEBUI/RSS: Properly set RSS settings via API (glassez) | ||||
|     - RSS: Fix auto-downloading rule when Smart filter with regular Episode filter are used (glassez) | ||||
|     - RSS: Make "Ignoring days" to behave like other filters (glassez) | ||||
|     - RSS: Place "Use Smart Episode Filter" more correctly (glassez) | ||||
|     - RSS: Use RSS feed update time as a fallback (glassez) | ||||
|     - COSMETIC: Fix Stats dialog size (sledgehammer999) | ||||
|     - MACOS: Fix GUI scaling factor on macOS (Chocobo1) | ||||
|     - WINDOWS: Update icons (adem4ik) | ||||
|     - LINUX: Fix open destination folder with Nautilus > 3.28 (Evgeny Lensky) | ||||
|     - OTHER: Code improvements and refactoring (thalieht, Nick Korotysh, Chocobo1) | ||||
|  | ||||
| * Sat May 05 2018 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.1.0 | ||||
|     - FEATURE: Add "Coalesce reads & writes" checkbox in advanced options (Chocobo1) | ||||
|     - FEATURE: Smart Filter for RSS (Stephen Dawkins) | ||||
|   | ||||
| @@ -11,18 +11,17 @@ macro(qbt_set_compiler_options) | ||||
|         #-Wshadow -Wconversion ? | ||||
|         set(_GCC_COMMON_C_AND_CXX_FLAGS "-Wall -Wextra" | ||||
|             "-Wfloat-equal -Wcast-qual -Wcast-align" | ||||
|             "-Wsign-conversion -Winvalid-pch -Werror=return-type -Wno-long-long" | ||||
| #			-fstack-protector-all | ||||
|             "-Werror -Wno-error=deprecated-declarations" | ||||
|             "-Wsign-conversion -Winvalid-pch -Wno-long-long" | ||||
|             #"-fstack-protector-all" | ||||
|             #"-Werror -Wno-error=deprecated-declarations" | ||||
|         ) | ||||
|         set (_GCC_COMMON_CXX_FLAGS  "-fexceptions -frtti" | ||||
|         set(_GCC_COMMON_CXX_FLAGS "-fexceptions -frtti" | ||||
|             "-Woverloaded-virtual -Wold-style-cast" | ||||
|             "-Wnon-virtual-dtor -Wfloat-equal -Wcast-qual -Wcast-align" | ||||
|             "-Werror=overloaded-virtual" | ||||
|     # 		"-Weffc++" | ||||
|             "-Werror -Wno-error=cpp" | ||||
|             #"-Weffc++" | ||||
|             #"-Werror -Wno-error=cpp" | ||||
|             # we should modify code to make these ones obsolete | ||||
|             "-Wno-error=sign-conversion -Wno-error=float-equal" | ||||
|             #"-Wno-error=sign-conversion -Wno-error=float-equal" | ||||
|         ) | ||||
|  | ||||
|         if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) | ||||
|   | ||||
| @@ -58,4 +58,4 @@ DEFINES += BOOST_USE_WINAPI_VERSION=0x0501 | ||||
| #DEFINES += TORRENT_LINKING_SHARED | ||||
|  | ||||
| # Enable stack trace support | ||||
| CONFIG += strace_win | ||||
| CONFIG += stacktrace | ||||
|   | ||||
							
								
								
									
										24
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								configure
									
									
									
									
										vendored
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| #! /bin/sh | ||||
| # Guess values for system-dependent variables and create Makefiles. | ||||
| # Generated by GNU Autoconf 2.69 for qbittorrent v4.1.0alpha. | ||||
| # Generated by GNU Autoconf 2.69 for qbittorrent v4.1.1. | ||||
| # | ||||
| # Report bugs to <bugs.qbittorrent.org>. | ||||
| # | ||||
| @@ -580,8 +580,8 @@ MAKEFLAGS= | ||||
| # Identity of this package. | ||||
| PACKAGE_NAME='qbittorrent' | ||||
| PACKAGE_TARNAME='qbittorrent' | ||||
| PACKAGE_VERSION='v4.1.0alpha' | ||||
| PACKAGE_STRING='qbittorrent v4.1.0alpha' | ||||
| PACKAGE_VERSION='v4.1.1' | ||||
| PACKAGE_STRING='qbittorrent v4.1.1' | ||||
| PACKAGE_BUGREPORT='bugs.qbittorrent.org' | ||||
| PACKAGE_URL='https://www.qbittorrent.org/' | ||||
|  | ||||
| @@ -1297,7 +1297,7 @@ if test "$ac_init_help" = "long"; then | ||||
|   # Omit some internal or obsolete options to make the list less imposing. | ||||
|   # This message is too long to be a string in the A/UX 3.1 sh. | ||||
|   cat <<_ACEOF | ||||
| \`configure' configures qbittorrent v4.1.0alpha to adapt to many kinds of systems. | ||||
| \`configure' configures qbittorrent v4.1.1 to adapt to many kinds of systems. | ||||
|  | ||||
| Usage: $0 [OPTION]... [VAR=VALUE]... | ||||
|  | ||||
| @@ -1368,7 +1368,7 @@ fi | ||||
|  | ||||
| if test -n "$ac_init_help"; then | ||||
|   case $ac_init_help in | ||||
|      short | recursive ) echo "Configuration of qbittorrent v4.1.0alpha:";; | ||||
|      short | recursive ) echo "Configuration of qbittorrent v4.1.1:";; | ||||
|    esac | ||||
|   cat <<\_ACEOF | ||||
|  | ||||
| @@ -1503,7 +1503,7 @@ fi | ||||
| test -n "$ac_init_help" && exit $ac_status | ||||
| if $ac_init_version; then | ||||
|   cat <<\_ACEOF | ||||
| qbittorrent configure v4.1.0alpha | ||||
| qbittorrent configure v4.1.1 | ||||
| generated by GNU Autoconf 2.69 | ||||
|  | ||||
| Copyright (C) 2012 Free Software Foundation, Inc. | ||||
| @@ -1642,7 +1642,7 @@ cat >config.log <<_ACEOF | ||||
| This file contains any messages produced by compilers while | ||||
| running configure, to aid debugging if configure makes a mistake. | ||||
|  | ||||
| It was created by qbittorrent $as_me v4.1.0alpha, which was | ||||
| It was created by qbittorrent $as_me v4.1.1, which was | ||||
| generated by GNU Autoconf 2.69.  Invocation command line was | ||||
|  | ||||
|   $ $0 $@ | ||||
| @@ -3820,7 +3820,7 @@ fi | ||||
|  | ||||
| # Define the identity of the package. | ||||
|  PACKAGE='qbittorrent' | ||||
|  VERSION='v4.1.0alpha' | ||||
|  VERSION='v4.1.1' | ||||
|  | ||||
|  | ||||
| cat >>confdefs.h <<_ACEOF | ||||
| @@ -6140,7 +6140,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | ||||
| # report actual input values of CONFIG_FILES etc. instead of their | ||||
| # values after options handling. | ||||
| ac_log=" | ||||
| This file was extended by qbittorrent $as_me v4.1.0alpha, which was | ||||
| This file was extended by qbittorrent $as_me v4.1.1, which was | ||||
| generated by GNU Autoconf 2.69.  Invocation command line was | ||||
|  | ||||
|   CONFIG_FILES    = $CONFIG_FILES | ||||
| @@ -6198,7 +6198,7 @@ _ACEOF | ||||
| cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | ||||
| ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" | ||||
| ac_cs_version="\\ | ||||
| qbittorrent config.status v4.1.0alpha | ||||
| qbittorrent config.status v4.1.1 | ||||
| configured by $0, generated by GNU Autoconf 2.69, | ||||
|   with options \\"\$ac_cs_config\\" | ||||
|  | ||||
| @@ -7455,7 +7455,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | ||||
| # report actual input values of CONFIG_FILES etc. instead of their | ||||
| # values after options handling. | ||||
| ac_log=" | ||||
| This file was extended by qbittorrent $as_me v4.1.0alpha, which was | ||||
| This file was extended by qbittorrent $as_me v4.1.1, which was | ||||
| generated by GNU Autoconf 2.69.  Invocation command line was | ||||
|  | ||||
|   CONFIG_FILES    = $CONFIG_FILES | ||||
| @@ -7513,7 +7513,7 @@ _ACEOF | ||||
| cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | ||||
| ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" | ||||
| ac_cs_version="\\ | ||||
| qbittorrent config.status v4.1.0alpha | ||||
| qbittorrent config.status v4.1.1 | ||||
| configured by $0, generated by GNU Autoconf 2.69, | ||||
|   with options \\"\$ac_cs_config\\" | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| AC_INIT([qbittorrent], [v4.1.0alpha], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/]) | ||||
| AC_INIT([qbittorrent], [v4.1.1], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/]) | ||||
| AC_CONFIG_AUX_DIR([build-aux]) | ||||
| AC_CONFIG_MACRO_DIR([m4]) | ||||
| AC_PROG_CC | ||||
|   | ||||
							
								
								
									
										2
									
								
								dist/mac/Info.plist
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/mac/Info.plist
									
									
									
									
										vendored
									
									
								
							| @@ -45,7 +45,7 @@ | ||||
| 	<key>CFBundlePackageType</key> | ||||
| 	<string>APPL</string> | ||||
| 	<key>CFBundleShortVersionString</key> | ||||
| 	<string>4.1.0</string> | ||||
| 	<string>4.1.1</string> | ||||
| 	<key>CFBundleSignature</key> | ||||
| 	<string>qBit</string> | ||||
| 	<key>CFBundleExecutable</key> | ||||
|   | ||||
							
								
								
									
										2
									
								
								dist/windows/options.nsi
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/windows/options.nsi
									
									
									
									
										vendored
									
									
								
							| @@ -27,7 +27,7 @@ XPStyle on | ||||
| !define CSIDL_LOCALAPPDATA '0x1C' ;Local Application Data path | ||||
|  | ||||
| ; Program specific | ||||
| !define PROG_VERSION "4.1.0" | ||||
| !define PROG_VERSION "4.1.1" | ||||
|  | ||||
| !define MUI_FINISHPAGE_RUN | ||||
| !define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun | ||||
|   | ||||
| @@ -93,7 +93,7 @@ namespace | ||||
| #define SETTINGS_KEY(name) "Application/" name | ||||
|  | ||||
|     // FileLogger properties keys | ||||
| #define FILELOGGER_SETTINGS_KEY(name) SETTINGS_KEY("FileLogger/") name | ||||
| #define FILELOGGER_SETTINGS_KEY(name) QStringLiteral(SETTINGS_KEY("FileLogger/") name) | ||||
|     const QString KEY_FILELOGGER_ENABLED = FILELOGGER_SETTINGS_KEY("Enabled"); | ||||
|     const QString KEY_FILELOGGER_PATH = FILELOGGER_SETTINGS_KEY("Path"); | ||||
|     const QString KEY_FILELOGGER_BACKUP = FILELOGGER_SETTINGS_KEY("Backup"); | ||||
| @@ -151,11 +151,11 @@ Application::Application(const QString &id, int &argc, char **argv) | ||||
| #endif | ||||
|  | ||||
| #if defined(Q_OS_WIN) && !defined(DISABLE_GUI) | ||||
|     connect(this, SIGNAL(commitDataRequest(QSessionManager &)), this, SLOT(shutdownCleanup(QSessionManager &)), Qt::DirectConnection); | ||||
|     connect(this, &QGuiApplication::commitDataRequest, this, &Application::shutdownCleanup, Qt::DirectConnection); | ||||
| #endif | ||||
|  | ||||
|     connect(this, SIGNAL(messageReceived(const QString &)), SLOT(processMessage(const QString &))); | ||||
|     connect(this, SIGNAL(aboutToQuit()), SLOT(cleanup())); | ||||
|     connect(this, &Application::messageReceived, this, &Application::processMessage); | ||||
|     connect(this, &QCoreApplication::aboutToQuit, this, &Application::cleanup); | ||||
|  | ||||
|     if (isFileLoggerEnabled()) | ||||
|         m_fileLogger = new FileLogger(fileLoggerPath(), isFileLoggerBackup(), fileLoggerMaxSize(), isFileLoggerDeleteOld(), fileLoggerAge(), static_cast<FileLogger::FileLogAgeType>(fileLoggerAgeType())); | ||||
| @@ -290,9 +290,21 @@ void Application::runExternalProgram(const BitTorrent::TorrentHandle *torrent) c | ||||
|     std::sort(tags.begin(), tags.end(), Utils::String::naturalLessThan<Qt::CaseInsensitive>); | ||||
|     program.replace("%G", tags.join(',')); | ||||
|  | ||||
| #if defined(Q_OS_WIN) | ||||
|     const auto chopPathSep = [](const QString &str) -> QString | ||||
|     { | ||||
|         if (str.endsWith('\\')) | ||||
|             return str.mid(0, (str.length() -1)); | ||||
|         return str; | ||||
|     }; | ||||
|     program.replace("%F", chopPathSep(Utils::Fs::toNativePath(torrent->contentPath()))); | ||||
|     program.replace("%R", chopPathSep(Utils::Fs::toNativePath(torrent->rootPath()))); | ||||
|     program.replace("%D", chopPathSep(Utils::Fs::toNativePath(torrent->savePath()))); | ||||
| #else | ||||
|     program.replace("%F", Utils::Fs::toNativePath(torrent->contentPath())); | ||||
|     program.replace("%R", Utils::Fs::toNativePath(torrent->rootPath())); | ||||
|     program.replace("%D", Utils::Fs::toNativePath(torrent->savePath())); | ||||
| #endif | ||||
|     program.replace("%C", QString::number(torrent->filesCount())); | ||||
|     program.replace("%Z", QString::number(torrent->totalSize())); | ||||
|     program.replace("%T", torrent->currentTracker()); | ||||
| @@ -301,9 +313,7 @@ void Application::runExternalProgram(const BitTorrent::TorrentHandle *torrent) c | ||||
|     Logger *logger = Logger::instance(); | ||||
|     logger->addMessage(tr("Torrent: %1, running external program, command: %2").arg(torrent->name(), program)); | ||||
|  | ||||
| #if defined(Q_OS_UNIX) | ||||
|     QProcess::startDetached(QLatin1String("/bin/sh"), {QLatin1String("-c"), program}); | ||||
| #else | ||||
| #if defined(Q_OS_WIN) | ||||
|     std::unique_ptr<wchar_t[]> programWchar(new wchar_t[program.length() + 1] {}); | ||||
|     program.toWCharArray(programWchar.get()); | ||||
|  | ||||
| @@ -320,6 +330,8 @@ void Application::runExternalProgram(const BitTorrent::TorrentHandle *torrent) c | ||||
|     QProcess::startDetached(QString::fromWCharArray(args[0]), argList); | ||||
|  | ||||
|     ::LocalFree(args); | ||||
| #else | ||||
|     QProcess::startDetached(QLatin1String("/bin/sh"), {QLatin1String("-c"), program}); | ||||
| #endif | ||||
| } | ||||
|  | ||||
| @@ -489,8 +501,8 @@ int Application::exec(const QStringList ¶ms) | ||||
| #endif | ||||
|  | ||||
|     BitTorrent::Session::initInstance(); | ||||
|     connect(BitTorrent::Session::instance(), SIGNAL(torrentFinished(BitTorrent::TorrentHandle *const)), SLOT(torrentFinished(BitTorrent::TorrentHandle *const))); | ||||
|     connect(BitTorrent::Session::instance(), SIGNAL(allTorrentsFinished()), SLOT(allTorrentsFinished()), Qt::QueuedConnection); | ||||
|     connect(BitTorrent::Session::instance(), &BitTorrent::Session::torrentFinished, this, &Application::torrentFinished); | ||||
|     connect(BitTorrent::Session::instance(), &BitTorrent::Session::allTorrentsFinished, this, &Application::allTorrentsFinished, Qt::QueuedConnection); | ||||
|  | ||||
| #ifndef DISABLE_COUNTRIES_RESOLUTION | ||||
|     Net::GeoIPManager::initInstance(); | ||||
| @@ -660,7 +672,7 @@ void Application::shutdownCleanup(QSessionManager &manager) | ||||
|     // According to the qt docs we shouldn't call quit() inside a slot. | ||||
|     // aboutToQuit() is never emitted if the user hits "Cancel" in | ||||
|     // the above dialog. | ||||
|     QTimer::singleShot(0, qApp, SLOT(quit())); | ||||
|     QTimer::singleShot(0, qApp, &QCoreApplication::quit); | ||||
| } | ||||
| #endif | ||||
|  | ||||
|   | ||||
| @@ -110,7 +110,7 @@ public: | ||||
| protected: | ||||
| #ifndef DISABLE_GUI | ||||
| #ifdef Q_OS_MAC | ||||
|     bool event(QEvent *); | ||||
|     bool event(QEvent *) override; | ||||
| #endif | ||||
|     bool notify(QObject* receiver, QEvent* event) override; | ||||
| #endif | ||||
|   | ||||
| @@ -41,7 +41,7 @@ FileLogger::FileLogger(const QString &path, const bool backup, const int maxSize | ||||
| { | ||||
|     m_flusher.setInterval(0); | ||||
|     m_flusher.setSingleShot(true); | ||||
|     connect(&m_flusher, SIGNAL(timeout()), SLOT(flushLog())); | ||||
|     connect(&m_flusher, &QTimer::timeout, this, &FileLogger::flushLog); | ||||
|  | ||||
|     changePath(path); | ||||
|     if (deleteOld) | ||||
| @@ -51,7 +51,7 @@ FileLogger::FileLogger(const QString &path, const bool backup, const int maxSize | ||||
|     foreach (const Log::Msg& msg, logger->getMessages()) | ||||
|         addLogMessage(msg); | ||||
|  | ||||
|     connect(logger, SIGNAL(newLogMessage(const Log::Msg &)), SLOT(addLogMessage(const Log::Msg &))); | ||||
|     connect(logger, &Logger::newLogMessage, this, &FileLogger::addLogMessage); | ||||
| } | ||||
|  | ||||
| FileLogger::~FileLogger() | ||||
| @@ -83,21 +83,21 @@ void FileLogger::changePath(const QString& newPath) | ||||
| void FileLogger::deleteOld(const int age, const FileLogAgeType ageType) | ||||
| { | ||||
|     QDateTime date = QDateTime::currentDateTime(); | ||||
|     QDir dir(m_path); | ||||
|  | ||||
|     switch (ageType) { | ||||
|     case DAYS: | ||||
|         date = date.addDays(age); | ||||
|         break; | ||||
|     case MONTHS: | ||||
|         date = date.addMonths(age); | ||||
|         break; | ||||
|     default: | ||||
|         date = date.addYears(age); | ||||
|     } | ||||
|     QDir dir(Utils::Fs::branchPath(m_path)); | ||||
|  | ||||
|     foreach (const QFileInfo file, dir.entryInfoList(QStringList("qbittorrent.log.bak*"), QDir::Files | QDir::Writable, QDir::Time | QDir::Reversed)) { | ||||
|         if (file.lastModified() < date) | ||||
|         QDateTime modificationDate = file.lastModified(); | ||||
|         switch (ageType) { | ||||
|         case DAYS: | ||||
|             modificationDate = modificationDate.addDays(age); | ||||
|             break; | ||||
|         case MONTHS: | ||||
|             modificationDate = modificationDate.addMonths(age); | ||||
|             break; | ||||
|         default: | ||||
|             modificationDate = modificationDate.addYears(age); | ||||
|         } | ||||
|         if (modificationDate > date) | ||||
|             break; | ||||
|         Utils::Fs::forceRemove(file.absoluteFilePath()); | ||||
|     } | ||||
|   | ||||
| @@ -329,7 +329,7 @@ void showSplashScreen() | ||||
|     painter.drawText(224 - painter.fontMetrics().width(version), 270, version); | ||||
|     QSplashScreen *splash = new QSplashScreen(splash_img); | ||||
|     splash->show(); | ||||
|     QTimer::singleShot(1500, splash, SLOT(deleteLater())); | ||||
|     QTimer::singleShot(1500, splash, &QObject::deleteLater); | ||||
|     qApp->processEvents(); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -138,7 +138,7 @@ bool straceWin::makeRelativePath(const QString& dir, QString& file) | ||||
|  | ||||
| QString straceWin::getSourcePathAndLineNumber(HANDLE hProcess, DWORD64 addr) | ||||
| { | ||||
|     IMAGEHLP_LINE64 line = {0}; | ||||
|     IMAGEHLP_LINE64 line {}; | ||||
|     line.SizeOfStruct = sizeof(IMAGEHLP_LINE64); | ||||
|     DWORD dwDisplacement = 0; | ||||
|  | ||||
|   | ||||
| @@ -114,12 +114,27 @@ bool upgradeResumeFile(const QString &filepath, const QVariantHash &oldTorrent = | ||||
|     bool v3_3 = false; | ||||
|     int queuePosition = 0; | ||||
|     QString outFilePath = filepath; | ||||
|     QRegExp rx(QLatin1String("([A-Fa-f0-9]{40})\\.fastresume\\.(\\d+)$")); | ||||
|     QRegExp rx(QLatin1String("([A-Fa-f0-9]{40})\\.fastresume\\.(.+)$")); | ||||
|     if (rx.indexIn(filepath) != -1) { | ||||
|         // old v3.3.x format | ||||
|         // Old v3.3.x format had a number at the end indicating the queue position. | ||||
|         // The naming scheme was '<infohash>.fastresume.<queueposition>'. | ||||
|         // However, QSaveFile, which uses QTemporaryFile internally, might leave | ||||
|         // non-commited files behind eg after a crash. These files have the | ||||
|         // naming scheme '<infohash>.fastresume.XXXXXX' where each X is a random | ||||
|         // character. So we detect if the last part is present. Then check if it | ||||
|         // is 6 chars long. If all the 6 chars are digits we assume it is an old | ||||
|         // v3.3.x format. Otherwise it is considered a non-commited fastresume | ||||
|         // and is deleted, because it may be a corrupted/incomplete fastresume. | ||||
|         // NOTE: When the upgrade code is removed, we must continue to perform | ||||
|         // cleanup of non-commited QSaveFile/QTemporaryFile fastresumes | ||||
|         queuePosition = rx.cap(2).toInt(); | ||||
|         if ((rx.cap(2).size() == 6) && (queuePosition <= 99999)) { | ||||
|             Utils::Fs::forceRemove(filepath); | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         v3_3 = true; | ||||
|         outFilePath.replace(QRegExp("\\.\\d+$"), ""); | ||||
|         outFilePath.replace(QRegExp("\\.fastresume\\..+$"), ".fastresume"); | ||||
|     } | ||||
|     else { | ||||
|         queuePosition = fastOld.dict_find_int_value("qBt-queuePosition", 0); | ||||
| @@ -130,6 +145,15 @@ bool upgradeResumeFile(const QString &filepath, const QVariantHash &oldTorrent = | ||||
|     // in versions < 3.3 we have -1 for seeding torrents, so we convert it to 0 | ||||
|     fastNew["qBt-queuePosition"] = (queuePosition >= 0 ? queuePosition : 0); | ||||
|  | ||||
|     if (v3_3) { | ||||
|         QFileInfo oldFile(filepath); | ||||
|         QFileInfo newFile(outFilePath); | ||||
|         if (newFile.exists() | ||||
|             && (oldFile.lastModified() < newFile.lastModified())) { | ||||
|             Utils::Fs::forceRemove(filepath); | ||||
|             return true; | ||||
|         } | ||||
|     } | ||||
|     QFile file2(outFilePath); | ||||
|     QVector<char> out; | ||||
|     libtorrent::bencode(std::back_inserter(out), fastNew); | ||||
|   | ||||
| @@ -34,14 +34,14 @@ | ||||
| #include <QFile> | ||||
| #include <QObject> | ||||
|  | ||||
| class AsyncFileStorageError: public std::runtime_error | ||||
| class AsyncFileStorageError : public std::runtime_error | ||||
| { | ||||
| public: | ||||
|     explicit AsyncFileStorageError(const QString &message); | ||||
|     QString message() const; | ||||
| }; | ||||
|  | ||||
| class AsyncFileStorage: public QObject | ||||
| class AsyncFileStorage : public QObject | ||||
| { | ||||
|     Q_OBJECT | ||||
|  | ||||
|   | ||||
| @@ -55,7 +55,7 @@ void BandwidthScheduler::start() | ||||
|  | ||||
| bool BandwidthScheduler::isTimeForAlternative() const | ||||
| { | ||||
|     const Preferences* const pref = Preferences::instance(); | ||||
|     const Preferences *const pref = Preferences::instance(); | ||||
|  | ||||
|     QTime start = pref->getSchedulerStartTime(); | ||||
|     QTime end = pref->getSchedulerEndTime(); | ||||
|   | ||||
| @@ -33,7 +33,7 @@ | ||||
| #include <QObject> | ||||
| #include <QTimer> | ||||
|  | ||||
| class BandwidthScheduler: public QObject | ||||
| class BandwidthScheduler : public QObject | ||||
| { | ||||
|     Q_OBJECT | ||||
|     Q_DISABLE_COPY(BandwidthScheduler) | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Bittorrent Client using Qt and libt. | ||||
|  * Bittorrent Client using Qt and libtorrent. | ||||
|  * Copyright (C) 2006  Christophe Dumez <chris@qbittorrent.org> | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or | ||||
| @@ -147,13 +147,13 @@ int FilterParserThread::parseDATFilterFile() | ||||
|         if (bytesRead < 0) | ||||
|             break; | ||||
|         int dataSize = bytesRead + offset; | ||||
|         if (bytesRead == 0 && dataSize == 0) | ||||
|         if ((bytesRead == 0) && (dataSize == 0)) | ||||
|             break; | ||||
|  | ||||
|         for (start = 0; start < dataSize; ++start) { | ||||
|             endOfLine = -1; | ||||
|             // The file might have ended without the last line having a newline | ||||
|             if (!(bytesRead == 0 && dataSize > 0)) { | ||||
|             if (!((bytesRead == 0) && (dataSize > 0))) { | ||||
|                 for (int i = start; i < dataSize; ++i) { | ||||
|                     if (buffer[i] == '\n') { | ||||
|                         endOfLine = i; | ||||
| @@ -295,13 +295,13 @@ int FilterParserThread::parseP2PFilterFile() | ||||
|         if (bytesRead < 0) | ||||
|             break; | ||||
|         int dataSize = bytesRead + offset; | ||||
|         if (bytesRead == 0 && dataSize == 0) | ||||
|         if ((bytesRead == 0) && (dataSize == 0)) | ||||
|             break; | ||||
|  | ||||
|         for (start = 0; start < dataSize; ++start) { | ||||
|             endOfLine = -1; | ||||
|             // The file might have ended without the last line having a newline | ||||
|             if (!(bytesRead == 0 && dataSize > 0)) { | ||||
|             if (!((bytesRead == 0) && (dataSize > 0))) { | ||||
|                 for (int i = start; i < dataSize; ++i) { | ||||
|                     if (buffer[i] == '\n') { | ||||
|                         endOfLine = i; | ||||
| @@ -610,7 +610,7 @@ int FilterParserThread::findAndNullDelimiter(char *const data, char delimiter, i | ||||
|     return -1; | ||||
| } | ||||
|  | ||||
| int FilterParserThread::trim(char* const data, int start, int end) | ||||
| int FilterParserThread::trim(char *const data, int start, int end) | ||||
| { | ||||
|     if (start >= end) return start; | ||||
|     int newStart = start; | ||||
|   | ||||
| @@ -22,7 +22,7 @@ Statistics::Statistics(Session *session) | ||||
|     , m_dirty(false) | ||||
| { | ||||
|     load(); | ||||
|     connect(&m_timer, SIGNAL(timeout()), this, SLOT(gather())); | ||||
|     connect(&m_timer, &QTimer::timeout, this, &Statistics::gather); | ||||
|     m_timer.start(60 * 1000); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -9,7 +9,7 @@ namespace BitTorrent | ||||
|     class Session; | ||||
| } | ||||
|  | ||||
| class Statistics : QObject | ||||
| class Statistics : public QObject | ||||
| { | ||||
|     Q_OBJECT | ||||
|     Q_DISABLE_COPY(Statistics) | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -30,18 +30,14 @@ | ||||
| #ifndef BITTORRENT_SESSION_H | ||||
| #define BITTORRENT_SESSION_H | ||||
|  | ||||
| #include <vector> | ||||
| #include <libtorrent/version.hpp> | ||||
|  | ||||
| #if LIBTORRENT_VERSION_NUM >= 10100 | ||||
| #include <QElapsedTimer> | ||||
| #endif | ||||
| #include <vector> | ||||
|  | ||||
| #include <QFile> | ||||
| #include <QHash> | ||||
| #include <QList> | ||||
| #include <QMap> | ||||
| #if LIBTORRENT_VERSION_NUM < 10100 | ||||
| #include <QMutex> | ||||
| #endif | ||||
| #include <QNetworkConfigurationManager> | ||||
| #include <QPointer> | ||||
| #include <QSet> | ||||
| @@ -49,6 +45,12 @@ | ||||
| #include <QVector> | ||||
| #include <QWaitCondition> | ||||
|  | ||||
| #if LIBTORRENT_VERSION_NUM < 10100 | ||||
| #include <QMutex> | ||||
| #else | ||||
| #include <QElapsedTimer> | ||||
| #endif | ||||
|  | ||||
| #include "base/settingvalue.h" | ||||
| #include "base/tristatebool.h" | ||||
| #include "base/types.h" | ||||
| @@ -111,7 +113,6 @@ class QTimer; | ||||
| class QStringList; | ||||
| class QString; | ||||
| class QUrl; | ||||
| template<typename T> class QList; | ||||
|  | ||||
| class FilterParserThread; | ||||
| class BandwidthScheduler; | ||||
| @@ -562,7 +563,7 @@ namespace BitTorrent | ||||
|             bool requestedFileDeletion; | ||||
|         }; | ||||
|  | ||||
|         explicit Session(QObject *parent = 0); | ||||
|         explicit Session(QObject *parent = nullptr); | ||||
|         ~Session(); | ||||
|  | ||||
|         bool hasPerTorrentRatioLimit() const; | ||||
| @@ -760,6 +761,10 @@ namespace BitTorrent | ||||
|         QStringMap m_categories; | ||||
|         QSet<QString> m_tags; | ||||
|  | ||||
|         // I/O errored torrents | ||||
|         QSet<InfoHash> m_recentErroredTorrents; | ||||
|         QTimer *m_recentErroredTorrentsTimer; | ||||
|  | ||||
| #if LIBTORRENT_VERSION_NUM < 10100 | ||||
|         QMutex m_alertsMutex; | ||||
|         QWaitCondition m_alertsWaitCondition; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * Bittorrent Client using Qt and libtorrent. | ||||
|  * Copyright (C) 2010  Christophe Dumez | ||||
|  * Copyright (C) 2010  Christophe Dumez <chris@qbittorrent.org> | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or | ||||
|  * modify it under the terms of the GNU General Public License | ||||
| @@ -24,8 +24,6 @@ | ||||
|  * 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 | ||||
|  */ | ||||
|  | ||||
| #include "torrentcreatorthread.h" | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * Bittorrent Client using Qt and libtorrent. | ||||
|  * Copyright (C) 2010  Christophe Dumez | ||||
|  * Copyright (C) 2010  Christophe Dumez <chris@qbittorrent.org> | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or | ||||
|  * modify it under the terms of the GNU General Public License | ||||
| @@ -24,8 +24,6 @@ | ||||
|  * 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 | ||||
|  */ | ||||
|  | ||||
| #ifndef BITTORRENT_TORRENTCREATORTHREAD_H | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -149,6 +149,8 @@ namespace BitTorrent | ||||
|         PausedDownloading, | ||||
|         PausedUploading, | ||||
|  | ||||
|         Moving, | ||||
|  | ||||
|         MissingFiles, | ||||
|         Error | ||||
|     }; | ||||
| @@ -331,7 +333,7 @@ namespace BitTorrent | ||||
|         void setName(const QString &name); | ||||
|         void setSequentialDownload(bool b); | ||||
|         void toggleSequentialDownload(); | ||||
|         void setFirstLastPiecePriority(bool b); | ||||
|         void setFirstLastPiecePriority(bool enabled); | ||||
|         void toggleFirstLastPiecePriority(); | ||||
|         void pause(); | ||||
|         void resume(bool forced = false); | ||||
| @@ -388,23 +390,23 @@ namespace BitTorrent | ||||
|         void updateState(); | ||||
|         void updateTorrentInfo(); | ||||
|  | ||||
|         void handleStorageMovedAlert(libtorrent::storage_moved_alert *p); | ||||
|         void handleStorageMovedFailedAlert(libtorrent::storage_moved_failed_alert *p); | ||||
|         void handleTrackerReplyAlert(libtorrent::tracker_reply_alert *p); | ||||
|         void handleTrackerWarningAlert(libtorrent::tracker_warning_alert *p); | ||||
|         void handleTrackerErrorAlert(libtorrent::tracker_error_alert *p); | ||||
|         void handleTorrentCheckedAlert(libtorrent::torrent_checked_alert *p); | ||||
|         void handleTorrentFinishedAlert(libtorrent::torrent_finished_alert *p); | ||||
|         void handleTorrentPausedAlert(libtorrent::torrent_paused_alert *p); | ||||
|         void handleTorrentResumedAlert(libtorrent::torrent_resumed_alert *p); | ||||
|         void handleSaveResumeDataAlert(libtorrent::save_resume_data_alert *p); | ||||
|         void handleSaveResumeDataFailedAlert(libtorrent::save_resume_data_failed_alert *p); | ||||
|         void handleFastResumeRejectedAlert(libtorrent::fastresume_rejected_alert *p); | ||||
|         void handleFileRenamedAlert(libtorrent::file_renamed_alert *p); | ||||
|         void handleFileRenameFailedAlert(libtorrent::file_rename_failed_alert *p); | ||||
|         void handleFileCompletedAlert(libtorrent::file_completed_alert *p); | ||||
|         void handleMetadataReceivedAlert(libtorrent::metadata_received_alert *p); | ||||
|         void handleStatsAlert(libtorrent::stats_alert *p); | ||||
|         void handleStorageMovedAlert(const libtorrent::storage_moved_alert *p); | ||||
|         void handleStorageMovedFailedAlert(const libtorrent::storage_moved_failed_alert *p); | ||||
|         void handleTrackerReplyAlert(const libtorrent::tracker_reply_alert *p); | ||||
|         void handleTrackerWarningAlert(const libtorrent::tracker_warning_alert *p); | ||||
|         void handleTrackerErrorAlert(const libtorrent::tracker_error_alert *p); | ||||
|         void handleTorrentCheckedAlert(const libtorrent::torrent_checked_alert *p); | ||||
|         void handleTorrentFinishedAlert(const libtorrent::torrent_finished_alert *p); | ||||
|         void handleTorrentPausedAlert(const libtorrent::torrent_paused_alert *p); | ||||
|         void handleTorrentResumedAlert(const libtorrent::torrent_resumed_alert *p); | ||||
|         void handleSaveResumeDataAlert(const libtorrent::save_resume_data_alert *p); | ||||
|         void handleSaveResumeDataFailedAlert(const libtorrent::save_resume_data_failed_alert *p); | ||||
|         void handleFastResumeRejectedAlert(const libtorrent::fastresume_rejected_alert *p); | ||||
|         void handleFileRenamedAlert(const libtorrent::file_renamed_alert *p); | ||||
|         void handleFileRenameFailedAlert(const libtorrent::file_rename_failed_alert *p); | ||||
|         void handleFileCompletedAlert(const libtorrent::file_completed_alert *p); | ||||
|         void handleMetadataReceivedAlert(const libtorrent::metadata_received_alert *p); | ||||
|         void handleStatsAlert(const libtorrent::stats_alert *p); | ||||
|  | ||||
|         void resume_impl(bool forced, bool uploadMode); | ||||
|         bool isMoveInProgress() const; | ||||
|   | ||||
| @@ -26,20 +26,20 @@ | ||||
|  * exception statement from your version. | ||||
|  */ | ||||
|  | ||||
| #include <QDebug> | ||||
| #include <QString> | ||||
| #include <QList> | ||||
| #include <QUrl> | ||||
| #include <QDateTime> | ||||
| #include "torrentinfo.h" | ||||
|  | ||||
| #include <libtorrent/error_code.hpp> | ||||
|  | ||||
| #include "base/utils/misc.h" | ||||
| #include <QDateTime> | ||||
| #include <QDebug> | ||||
| #include <QString> | ||||
| #include <QUrl> | ||||
|  | ||||
| #include "base/utils/fs.h" | ||||
| #include "base/utils/misc.h" | ||||
| #include "base/utils/string.h" | ||||
| #include "infohash.h" | ||||
| #include "trackerentry.h" | ||||
| #include "torrentinfo.h" | ||||
|  | ||||
| namespace libt = libtorrent; | ||||
| using namespace BitTorrent; | ||||
| @@ -315,7 +315,7 @@ QVector<QByteArray> TorrentInfo::pieceHashes() const | ||||
|     return hashes; | ||||
| } | ||||
|  | ||||
| TorrentInfo::PieceRange TorrentInfo::filePieces(const QString& file) const | ||||
| TorrentInfo::PieceRange TorrentInfo::filePieces(const QString &file) const | ||||
| { | ||||
|     if (!isValid()) // if we do not check here the debug message will be printed, which would be not correct | ||||
|         return {}; | ||||
| @@ -353,8 +353,8 @@ void TorrentInfo::renameFile(uint index, const QString &newPath) | ||||
|  | ||||
| int BitTorrent::TorrentInfo::fileIndex(const QString& fileName) const | ||||
| { | ||||
|     // the check whether the object valid is not needed here | ||||
|     // because filesCount() returns -1 in that case and the loop exits immediately | ||||
|     // the check whether the object is valid is not needed here | ||||
|     // because if filesCount() returns -1 the loop exits immediately | ||||
|     for (int i = 0; i < filesCount(); ++i) | ||||
|         if (fileName == filePath(i)) | ||||
|             return i; | ||||
| @@ -362,24 +362,29 @@ int BitTorrent::TorrentInfo::fileIndex(const QString& fileName) const | ||||
|     return -1; | ||||
| } | ||||
|  | ||||
| bool TorrentInfo::hasRootFolder() const | ||||
| QString TorrentInfo::rootFolder() const | ||||
| { | ||||
|     QString testRootFolder; | ||||
|     QString rootFolder; | ||||
|     for (int i = 0; i < filesCount(); ++i) { | ||||
|         const QString filePath = this->filePath(i); | ||||
|         if (QDir::isAbsolutePath(filePath)) continue; | ||||
|  | ||||
|         const auto filePathElements = filePath.splitRef('/'); | ||||
|         // if at least one file has no root folder, no common root folder exists | ||||
|         if (filePathElements.count() <= 1) return false; | ||||
|         if (filePathElements.count() <= 1) return ""; | ||||
|  | ||||
|         if (testRootFolder.isEmpty()) | ||||
|             testRootFolder = filePathElements.at(0).toString(); | ||||
|         else if (testRootFolder != filePathElements.at(0)) | ||||
|             return false; | ||||
|         if (rootFolder.isEmpty()) | ||||
|             rootFolder = filePathElements.at(0).toString(); | ||||
|         else if (rootFolder != filePathElements.at(0)) | ||||
|             return ""; | ||||
|     } | ||||
|  | ||||
|     return true; | ||||
|     return rootFolder; | ||||
| } | ||||
|  | ||||
| bool TorrentInfo::hasRootFolder() const | ||||
| { | ||||
|     return !rootFolder().isEmpty(); | ||||
| } | ||||
|  | ||||
| void TorrentInfo::stripRootFolder() | ||||
|   | ||||
| @@ -29,21 +29,21 @@ | ||||
| #ifndef BITTORRENT_TORRENTINFO_H | ||||
| #define BITTORRENT_TORRENTINFO_H | ||||
|  | ||||
| #include <QCoreApplication> | ||||
| #include <QtGlobal> | ||||
|  | ||||
| #include <libtorrent/torrent_info.hpp> | ||||
| #include <libtorrent/version.hpp> | ||||
|  | ||||
| #include <QCoreApplication> | ||||
| #include <QList> | ||||
| #include <QtGlobal> | ||||
| #include <QVector> | ||||
|  | ||||
| #include "base/indexrange.h" | ||||
|  | ||||
| class QString; | ||||
| class QUrl; | ||||
| class QDateTime; | ||||
| class QStringList; | ||||
| class QByteArray; | ||||
| template<typename T> class QList; | ||||
| template<typename T> class QVector; | ||||
| class QDateTime; | ||||
| class QString; | ||||
| class QStringList; | ||||
| class QUrl; | ||||
|  | ||||
| namespace BitTorrent | ||||
| { | ||||
| @@ -52,7 +52,7 @@ namespace BitTorrent | ||||
|  | ||||
|     class TorrentInfo | ||||
|     { | ||||
|         Q_DECLARE_TR_FUNCTIONS("TorrentInfo") | ||||
|         Q_DECLARE_TR_FUNCTIONS(TorrentInfo) | ||||
|  | ||||
|     public: | ||||
| #if LIBTORRENT_VERSION_NUM < 10100 | ||||
| @@ -104,6 +104,7 @@ namespace BitTorrent | ||||
|  | ||||
|         void renameFile(uint index, const QString &newPath); | ||||
|  | ||||
|         QString rootFolder() const; | ||||
|         bool hasRootFolder() const; | ||||
|         void stripRootFolder(); | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Bittorrent Client using Qt4 and libtorrent. | ||||
|  * Bittorrent Client using Qt and libtorrent. | ||||
|  * Copyright (C) 2015  Vladimir Golovnev <glassez@yandex.ru> | ||||
|  * Copyright (C) 2006  Christophe Dumez <chris@qbittorrent.org> | ||||
|  * | ||||
| @@ -27,6 +27,8 @@ | ||||
|  * exception statement from your version. | ||||
|  */ | ||||
|  | ||||
| #include "tracker.h" | ||||
|  | ||||
| #include <vector> | ||||
|  | ||||
| #include <libtorrent/bencode.hpp> | ||||
| @@ -37,7 +39,6 @@ | ||||
| #include "base/preferences.h" | ||||
| #include "base/utils/bytearray.h" | ||||
| #include "base/utils/string.h" | ||||
| #include "tracker.h" | ||||
|  | ||||
| // static limits | ||||
| static const int MAX_TORRENTS = 100; | ||||
| @@ -277,5 +278,3 @@ void Tracker::replyWithPeerList(const TrackerAnnounceRequest &annonceReq) | ||||
|     // HTTP reply | ||||
|     print(reply, Http::CONTENT_TYPE_TXT); | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -28,14 +28,14 @@ | ||||
|  | ||||
| #include "filesystemwatcher.h" | ||||
|  | ||||
| #include <QtGlobal> | ||||
|  | ||||
| #if defined(Q_OS_MAC) || defined(Q_OS_FREEBSD) | ||||
| #include <cstring> | ||||
| #include <sys/mount.h> | ||||
| #include <sys/param.h> | ||||
| #endif | ||||
|  | ||||
| #include <QtGlobal> | ||||
|  | ||||
| #include "base/algorithm.h" | ||||
| #include "base/bittorrent/magneturi.h" | ||||
| #include "base/bittorrent/torrentinfo.h" | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * Bittorrent Client using Qt and libtorrent. | ||||
|  * Copyright (C) 2018  Mike Tzou (Chocobo1) | ||||
|  * Copyright (C) 2014  Vladimir Golovnev <glassez@yandex.ru> | ||||
|  * Copyright (C) 2006  Ishan Arora and Christophe Dumez | ||||
|  * Copyright (C) 2006  Ishan Arora and Christophe Dumez <chris@qbittorrent.org> | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or | ||||
|  * modify it under the terms of the GNU General Public License | ||||
| @@ -26,8 +26,6 @@ | ||||
|  * 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 | ||||
|  */ | ||||
|  | ||||
| #include "connection.h" | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user