From d013e0922d95a72af3db9447f464fbfbb6b4624a Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 6 Jan 2019 18:31:32 +0800 Subject: [PATCH 1/3] Use the proper Qt type --- src/base/bittorrent/torrentcreatorthread.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/base/bittorrent/torrentcreatorthread.cpp b/src/base/bittorrent/torrentcreatorthread.cpp index 081a06fa9..5e53ec734 100644 --- a/src/base/bittorrent/torrentcreatorthread.cpp +++ b/src/base/bittorrent/torrentcreatorthread.cpp @@ -30,7 +30,6 @@ #include -#include #include #include #include @@ -108,7 +107,7 @@ void TorrentCreatorThread::run() std::sort(dirs.begin(), dirs.end(), Utils::String::naturalLessThan); QStringList fileNames; - QHash fileSizeMap; + QHash fileSizeMap; for (const auto &dir : asConst(dirs)) { QStringList tmpNames; // natural sort files within each dir From 06e82d10f6db00f0ee6338b5dd6843f793f9fa9f Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 6 Jan 2019 19:11:05 +0800 Subject: [PATCH 2/3] Replace boost::function with std::function --- src/base/bittorrent/torrenthandle.cpp | 8 +++----- src/base/bittorrent/torrenthandle.h | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index 069ad11ab..bcc86983e 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -49,8 +49,6 @@ #include #endif -#include - #ifdef Q_OS_WIN #include #endif @@ -1596,8 +1594,8 @@ void TorrentHandle::handleTorrentFinishedAlert(const libtorrent::torrent_finishe const bool recheckTorrentsOnCompletion = Preferences::instance()->recheckTorrentsOnCompletion(); if (isMoveInProgress() || (m_renameCount > 0)) { if (recheckTorrentsOnCompletion) - m_moveFinishedTriggers.append(boost::bind(&TorrentHandle::forceRecheck, this)); - m_moveFinishedTriggers.append(boost::bind(&Session::handleTorrentFinished, m_session, this)); + m_moveFinishedTriggers.append([this]() { forceRecheck(); }); + m_moveFinishedTriggers.append([this]() { m_session->handleTorrentFinished(this); }); } else { if (recheckTorrentsOnCompletion && m_unchecked) @@ -1890,7 +1888,7 @@ void TorrentHandle::adjustActualSavePath() if (!isMoveInProgress()) adjustActualSavePath_impl(); else - m_moveFinishedTriggers.append(boost::bind(&TorrentHandle::adjustActualSavePath_impl, this)); + m_moveFinishedTriggers.append([this]() { adjustActualSavePath_impl(); }); } void TorrentHandle::adjustActualSavePath_impl() diff --git a/src/base/bittorrent/torrenthandle.h b/src/base/bittorrent/torrenthandle.h index 8e5c0d698..27bf0c902 100644 --- a/src/base/bittorrent/torrenthandle.h +++ b/src/base/bittorrent/torrenthandle.h @@ -30,6 +30,8 @@ #ifndef BITTORRENT_TORRENTHANDLE_H #define BITTORRENT_TORRENTHANDLE_H +#include + #include #include #include @@ -44,8 +46,6 @@ #include #endif -#include - #include "base/tristatebool.h" #include "private/speedmonitor.h" #include "infohash.h" @@ -383,7 +383,7 @@ namespace BitTorrent QVector availableFileFractions() const; private: - typedef boost::function EventTrigger; + typedef std::function EventTrigger; void updateStatus(); void updateStatus(const libtorrent::torrent_status &nativeStatus); From b7627db98c134a198edecb27043dc2c39cb121c9 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 6 Jan 2019 19:13:39 +0800 Subject: [PATCH 3/3] Remove unused headers --- src/base/net/reverseresolution.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/base/net/reverseresolution.cpp b/src/base/net/reverseresolution.cpp index 058f444f9..68c075baa 100644 --- a/src/base/net/reverseresolution.cpp +++ b/src/base/net/reverseresolution.cpp @@ -28,9 +28,6 @@ #include "reverseresolution.h" -#include -#include - #include #include #include