Browse Source

Fix indentation size in qtlibtorrent/* files.

adaptive-webui-19844
Vladimir Golovnev (Glassez) 10 years ago
parent
commit
0e4ef42ddf
  1. 4
      src/core/qtlibtorrent/alertdispatcher.h
  2. 4
      src/core/qtlibtorrent/filterparserthread.h
  3. 22
      src/core/qtlibtorrent/qbtsession.cpp
  4. 66
      src/core/qtlibtorrent/qbtsession.h
  5. 16
      src/core/qtlibtorrent/torrentmodel.cpp
  6. 2
      src/core/qtlibtorrent/torrentmodel.h
  7. 46
      src/core/qtlibtorrent/torrentspeedmonitor.cpp

4
src/core/qtlibtorrent/alertdispatcher.h

@ -41,8 +41,8 @@
#include <memory> #include <memory>
namespace libtorrent { namespace libtorrent {
class session; class session;
class alert; class alert;
} }
class QAlertDispatcher : public QObject { class QAlertDispatcher : public QObject {

4
src/core/qtlibtorrent/filterparserthread.h

@ -36,8 +36,8 @@
#include <QStringList> #include <QStringList>
namespace libtorrent { namespace libtorrent {
class session; class session;
struct ip_filter; struct ip_filter;
} }
using namespace std; using namespace std;

22
src/core/qtlibtorrent/qbtsession.cpp

@ -108,13 +108,13 @@ QBtSession::QBtSession()
DHTEnabled(false), queueingEnabled(false), DHTEnabled(false), queueingEnabled(false),
m_torrentExportEnabled(false), m_torrentExportEnabled(false),
m_finishedTorrentExportEnabled(false) m_finishedTorrentExportEnabled(false)
#ifndef DISABLE_GUI #ifndef DISABLE_GUI
, geoipDBLoaded(false), resolve_countries(false) , geoipDBLoaded(false), resolve_countries(false)
#endif #endif
, m_tracker(0), m_shutdownAct(NO_SHUTDOWN) , m_tracker(0), m_shutdownAct(NO_SHUTDOWN)
#if LIBTORRENT_VERSION_NUM < 10000 #if LIBTORRENT_VERSION_NUM < 10000
, m_upnp(0), m_natpmp(0) , m_upnp(0), m_natpmp(0)
#endif #endif
, m_alertDispatcher(0) , m_alertDispatcher(0)
{ {
BigRatioTimer = new QTimer(this); BigRatioTimer = new QTimer(this);
@ -289,9 +289,9 @@ void QBtSession::handleMagnetRedirect(const QString &url_new, const QString &url
} }
#endif #endif
addMagnetSkipAddDlg(url_new, savePath_label.first, savePath_label.second, addMagnetSkipAddDlg(url_new, savePath_label.first, savePath_label.second,
#ifndef DISABLE_GUI #ifndef DISABLE_GUI
state, state,
#endif #endif
url_old); url_old);
} }
else else
@ -1215,7 +1215,7 @@ void QBtSession::initializeAddTorrentParams(const QString &hash, add_torrent_par
p.storage_mode = storage_mode_sparse; p.storage_mode = storage_mode_sparse;
// Priorities // Priorities
/*if (TorrentTempData::hasTempData(hash)) { /*if (TorrentTempData::hasTempData(hash)) {
std::vector<int> fp; std::vector<int> fp;
TorrentTempData::getFilesPriority(hash, fp); TorrentTempData::getFilesPriority(hash, fp);
if (!fp.empty()) { if (!fp.empty()) {
@ -2832,10 +2832,10 @@ void QBtSession::addMagnetInteractive(const QString& uri)
} }
#ifndef DISABLE_GUI #ifndef DISABLE_GUI
void QBtSession::addMagnetSkipAddDlg(const QString& uri, const QString& save_path, const QString& label, void QBtSession::addMagnetSkipAddDlg(const QString& uri, const QString& save_path, const QString& label,
const RssDownloadRule::AddPausedState &aps, const QString &uri_old) { const RssDownloadRule::AddPausedState &aps, const QString &uri_old) {
#else #else
void QBtSession::addMagnetSkipAddDlg(const QString& uri, const QString& save_path, const QString& label, const QString &uri_old) { void QBtSession::addMagnetSkipAddDlg(const QString& uri, const QString& save_path, const QString& label, const QString &uri_old) {
#endif #endif
if (!save_path.isEmpty() || !label.isEmpty()) if (!save_path.isEmpty() || !label.isEmpty())
savepathLabel_fromurl[uri] = qMakePair(fsutils::fromNativePath(save_path), label); savepathLabel_fromurl[uri] = qMakePair(fsutils::fromNativePath(save_path), label);
@ -2860,10 +2860,10 @@ void QBtSession::addMagnetInteractive(const QString& uri)
} }
#ifndef DISABLE_GUI #ifndef DISABLE_GUI
void QBtSession::downloadUrlAndSkipDialog(QString url, QString save_path, QString label, void QBtSession::downloadUrlAndSkipDialog(QString url, QString save_path, QString label,
const QList<QNetworkCookie>& cookies, const RssDownloadRule::AddPausedState &aps) { const QList<QNetworkCookie>& cookies, const RssDownloadRule::AddPausedState &aps) {
#else #else
void QBtSession::downloadUrlAndSkipDialog(QString url, QString save_path, QString label, const QList<QNetworkCookie>& cookies) { void QBtSession::downloadUrlAndSkipDialog(QString url, QString save_path, QString label, const QList<QNetworkCookie>& cookies) {
#endif #endif
//emit aboutToDownloadFromUrl(url); //emit aboutToDownloadFromUrl(url);
const QUrl qurl = QUrl::fromEncoded(url.toUtf8()); const QUrl qurl = QUrl::fromEncoded(url.toUtf8());

66
src/core/qtlibtorrent/qbtsession.h

@ -49,42 +49,42 @@
#endif #endif
namespace libtorrent { namespace libtorrent {
struct add_torrent_params; struct add_torrent_params;
struct pe_settings; struct pe_settings;
struct proxy_settings; struct proxy_settings;
class session; class session;
struct session_status; struct session_status;
class alert; class alert;
struct torrent_finished_alert; struct torrent_finished_alert;
struct save_resume_data_alert; struct save_resume_data_alert;
struct file_renamed_alert; struct file_renamed_alert;
struct torrent_deleted_alert; struct torrent_deleted_alert;
struct storage_moved_alert; struct storage_moved_alert;
struct storage_moved_failed_alert; struct storage_moved_failed_alert;
struct metadata_received_alert; struct metadata_received_alert;
struct file_error_alert; struct file_error_alert;
struct file_completed_alert; struct file_completed_alert;
struct torrent_paused_alert; struct torrent_paused_alert;
struct tracker_error_alert; struct tracker_error_alert;
struct tracker_reply_alert; struct tracker_reply_alert;
struct tracker_warning_alert; struct tracker_warning_alert;
struct portmap_error_alert; struct portmap_error_alert;
struct portmap_alert; struct portmap_alert;
struct peer_blocked_alert; struct peer_blocked_alert;
struct peer_ban_alert; struct peer_ban_alert;
struct fastresume_rejected_alert; struct fastresume_rejected_alert;
struct url_seed_alert; struct url_seed_alert;
struct listen_succeeded_alert; struct listen_succeeded_alert;
struct listen_failed_alert; struct listen_failed_alert;
struct torrent_checked_alert; struct torrent_checked_alert;
struct external_ip_alert; struct external_ip_alert;
struct state_update_alert; struct state_update_alert;
struct stats_alert; struct stats_alert;
#if LIBTORRENT_VERSION_NUM < 10000 #if LIBTORRENT_VERSION_NUM < 10000
class upnp; class upnp;
class natpmp; class natpmp;
#endif #endif
} }

16
src/core/qtlibtorrent/torrentmodel.cpp

@ -43,42 +43,42 @@ namespace {
QIcon get_paused_icon() { QIcon get_paused_icon() {
static QIcon cached = QIcon(":/icons/skin/paused.png"); static QIcon cached = QIcon(":/icons/skin/paused.png");
return cached; return cached;
} }
QIcon get_queued_icon() { QIcon get_queued_icon() {
static QIcon cached = QIcon(":/icons/skin/queued.png"); static QIcon cached = QIcon(":/icons/skin/queued.png");
return cached; return cached;
} }
QIcon get_downloading_icon() { QIcon get_downloading_icon() {
static QIcon cached = QIcon(":/icons/skin/downloading.png"); static QIcon cached = QIcon(":/icons/skin/downloading.png");
return cached; return cached;
} }
QIcon get_stalled_downloading_icon() { QIcon get_stalled_downloading_icon() {
static QIcon cached = QIcon(":/icons/skin/stalledDL.png"); static QIcon cached = QIcon(":/icons/skin/stalledDL.png");
return cached; return cached;
} }
QIcon get_uploading_icon() { QIcon get_uploading_icon() {
static QIcon cached = QIcon(":/icons/skin/uploading.png"); static QIcon cached = QIcon(":/icons/skin/uploading.png");
return cached; return cached;
} }
QIcon get_stalled_uploading_icon() { QIcon get_stalled_uploading_icon() {
static QIcon cached = QIcon(":/icons/skin/stalledUP.png"); static QIcon cached = QIcon(":/icons/skin/stalledUP.png");
return cached; return cached;
} }
QIcon get_checking_icon() { QIcon get_checking_icon() {
static QIcon cached = QIcon(":/icons/skin/checking.png"); static QIcon cached = QIcon(":/icons/skin/checking.png");
return cached; return cached;
} }
QIcon get_error_icon() { QIcon get_error_icon() {
static QIcon cached = QIcon(":/icons/skin/error.png"); static QIcon cached = QIcon(":/icons/skin/error.png");
return cached; return cached;
} }
} }
TorrentModelItem::TorrentModelItem(const QTorrentHandle &h) TorrentModelItem::TorrentModelItem(const QTorrentHandle &h)

2
src/core/qtlibtorrent/torrentmodel.h

@ -45,7 +45,7 @@ struct TorrentStatusReport {
}; };
class TorrentModelItem : public QObject { class TorrentModelItem : public QObject {
Q_OBJECT Q_OBJECT
public: public:
enum State {STATE_DOWNLOADING, STATE_DOWNLOADING_META, STATE_ALLOCATING, STATE_STALLED_DL, STATE_SEEDING, STATE_STALLED_UP, STATE_QUEUED_DL, STATE_QUEUED_UP, STATE_CHECKING_UP, STATE_CHECKING_DL, STATE_QUEUED_CHECK, STATE_QUEUED_FASTCHECK, STATE_PAUSED_DL, STATE_PAUSED_UP, STATE_PAUSED_MISSING, STATE_INVALID}; enum State {STATE_DOWNLOADING, STATE_DOWNLOADING_META, STATE_ALLOCATING, STATE_STALLED_DL, STATE_SEEDING, STATE_STALLED_UP, STATE_QUEUED_DL, STATE_QUEUED_UP, STATE_CHECKING_UP, STATE_CHECKING_DL, STATE_QUEUED_CHECK, STATE_QUEUED_FASTCHECK, STATE_PAUSED_DL, STATE_PAUSED_UP, STATE_PAUSED_MISSING, STATE_INVALID};

46
src/core/qtlibtorrent/torrentspeedmonitor.cpp

@ -38,7 +38,7 @@ using namespace libtorrent;
namespace { namespace {
template<class T> struct Sample { template<class T> struct Sample {
Sample() Sample()
: download() : download()
, upload() , upload()
@ -57,46 +57,46 @@ namespace {
T download; T download;
T upload; T upload;
}; };
template <typename T> template <typename T>
Sample<T>& operator+=(Sample<T>& lhs, Sample<T> const& rhs) { Sample<T>& operator+=(Sample<T>& lhs, Sample<T> const& rhs) {
lhs.download += rhs.download; lhs.download += rhs.download;
lhs.upload += rhs.upload; lhs.upload += rhs.upload;
return lhs; return lhs;
} }
template <typename T> template <typename T>
Sample<T>& operator-=(Sample<T>& lhs, Sample<T> const& rhs) { Sample<T>& operator-=(Sample<T>& lhs, Sample<T> const& rhs) {
lhs.download -= rhs.download; lhs.download -= rhs.download;
lhs.upload -= rhs.upload; lhs.upload -= rhs.upload;
return lhs; return lhs;
} }
template <typename T> template <typename T>
Sample<T> operator+(Sample<T> const& lhs, Sample<T> const& rhs) { Sample<T> operator+(Sample<T> const& lhs, Sample<T> const& rhs) {
return Sample<T>(lhs.download + rhs.download, lhs.upload + rhs.upload); return Sample<T>(lhs.download + rhs.download, lhs.upload + rhs.upload);
} }
template <typename T> template <typename T>
Sample<T> operator-(Sample<T> const& lhs, Sample<T> const& rhs) { Sample<T> operator-(Sample<T> const& lhs, Sample<T> const& rhs) {
return Sample<T>(lhs.download - rhs.download, lhs.upload - rhs.upload); return Sample<T>(lhs.download - rhs.download, lhs.upload - rhs.upload);
} }
template <typename T> template <typename T>
Sample<T> operator*(Sample<T> const& lhs, T rhs) { Sample<T> operator*(Sample<T> const& lhs, T rhs) {
return Sample<T>(lhs.download * rhs, lhs.upload * rhs); return Sample<T>(lhs.download * rhs, lhs.upload * rhs);
} }
template <typename T> template <typename T>
Sample<T> operator*(T lhs,Sample<T> const& rhs) { Sample<T> operator*(T lhs,Sample<T> const& rhs) {
return Sample<T>(lhs * rhs.download, lhs * rhs.upload); return Sample<T>(lhs * rhs.download, lhs * rhs.upload);
} }
template <typename T> template <typename T>
Sample<T> operator/(Sample<T> const& lhs, T rhs) { Sample<T> operator/(Sample<T> const& lhs, T rhs) {
return Sample<T>(lhs.download / rhs, lhs.upload / rhs); return Sample<T>(lhs.download / rhs, lhs.upload / rhs);
} }
} }
class SpeedSample { class SpeedSample {

Loading…
Cancel
Save