mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-02 18:04:32 +00:00
Merge pull request #10125 from Chocobo1/boost
Replace boost::function with std::function
This commit is contained in:
commit
77fc731dec
@ -30,7 +30,6 @@
|
|||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include <boost/bind.hpp>
|
|
||||||
#include <libtorrent/bencode.hpp>
|
#include <libtorrent/bencode.hpp>
|
||||||
#include <libtorrent/create_torrent.hpp>
|
#include <libtorrent/create_torrent.hpp>
|
||||||
#include <libtorrent/storage.hpp>
|
#include <libtorrent/storage.hpp>
|
||||||
@ -108,7 +107,7 @@ void TorrentCreatorThread::run()
|
|||||||
std::sort(dirs.begin(), dirs.end(), Utils::String::naturalLessThan<Qt::CaseInsensitive>);
|
std::sort(dirs.begin(), dirs.end(), Utils::String::naturalLessThan<Qt::CaseInsensitive>);
|
||||||
|
|
||||||
QStringList fileNames;
|
QStringList fileNames;
|
||||||
QHash<QString, boost::int64_t> fileSizeMap;
|
QHash<QString, qint64> fileSizeMap;
|
||||||
|
|
||||||
for (const auto &dir : asConst(dirs)) {
|
for (const auto &dir : asConst(dirs)) {
|
||||||
QStringList tmpNames; // natural sort files within each dir
|
QStringList tmpNames; // natural sort files within each dir
|
||||||
|
@ -49,8 +49,6 @@
|
|||||||
#include <libtorrent/time.hpp>
|
#include <libtorrent/time.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/bind.hpp>
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
@ -1596,8 +1594,8 @@ void TorrentHandle::handleTorrentFinishedAlert(const libtorrent::torrent_finishe
|
|||||||
const bool recheckTorrentsOnCompletion = Preferences::instance()->recheckTorrentsOnCompletion();
|
const bool recheckTorrentsOnCompletion = Preferences::instance()->recheckTorrentsOnCompletion();
|
||||||
if (isMoveInProgress() || (m_renameCount > 0)) {
|
if (isMoveInProgress() || (m_renameCount > 0)) {
|
||||||
if (recheckTorrentsOnCompletion)
|
if (recheckTorrentsOnCompletion)
|
||||||
m_moveFinishedTriggers.append(boost::bind(&TorrentHandle::forceRecheck, this));
|
m_moveFinishedTriggers.append([this]() { forceRecheck(); });
|
||||||
m_moveFinishedTriggers.append(boost::bind(&Session::handleTorrentFinished, m_session, this));
|
m_moveFinishedTriggers.append([this]() { m_session->handleTorrentFinished(this); });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (recheckTorrentsOnCompletion && m_unchecked)
|
if (recheckTorrentsOnCompletion && m_unchecked)
|
||||||
@ -1890,7 +1888,7 @@ void TorrentHandle::adjustActualSavePath()
|
|||||||
if (!isMoveInProgress())
|
if (!isMoveInProgress())
|
||||||
adjustActualSavePath_impl();
|
adjustActualSavePath_impl();
|
||||||
else
|
else
|
||||||
m_moveFinishedTriggers.append(boost::bind(&TorrentHandle::adjustActualSavePath_impl, this));
|
m_moveFinishedTriggers.append([this]() { adjustActualSavePath_impl(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentHandle::adjustActualSavePath_impl()
|
void TorrentHandle::adjustActualSavePath_impl()
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
#ifndef BITTORRENT_TORRENTHANDLE_H
|
#ifndef BITTORRENT_TORRENTHANDLE_H
|
||||||
#define BITTORRENT_TORRENTHANDLE_H
|
#define BITTORRENT_TORRENTHANDLE_H
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@ -44,8 +46,6 @@
|
|||||||
#include <libtorrent/torrent_status.hpp>
|
#include <libtorrent/torrent_status.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/function.hpp>
|
|
||||||
|
|
||||||
#include "base/tristatebool.h"
|
#include "base/tristatebool.h"
|
||||||
#include "private/speedmonitor.h"
|
#include "private/speedmonitor.h"
|
||||||
#include "infohash.h"
|
#include "infohash.h"
|
||||||
@ -383,7 +383,7 @@ namespace BitTorrent
|
|||||||
QVector<qreal> availableFileFractions() const;
|
QVector<qreal> availableFileFractions() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef boost::function<void ()> EventTrigger;
|
typedef std::function<void ()> EventTrigger;
|
||||||
|
|
||||||
void updateStatus();
|
void updateStatus();
|
||||||
void updateStatus(const libtorrent::torrent_status &nativeStatus);
|
void updateStatus(const libtorrent::torrent_status &nativeStatus);
|
||||||
|
@ -28,9 +28,6 @@
|
|||||||
|
|
||||||
#include "reverseresolution.h"
|
#include "reverseresolution.h"
|
||||||
|
|
||||||
#include <boost/asio/ip/tcp.hpp>
|
|
||||||
#include <boost/version.hpp>
|
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QHostInfo>
|
#include <QHostInfo>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user