Browse Source

Move initialization default values to header

adaptive-webui-19844
Chocobo1 5 years ago
parent
commit
ac2d063add
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 5
      src/base/bittorrent/torrenthandleimpl.cpp
  2. 10
      src/base/bittorrent/torrenthandleimpl.h

5
src/base/bittorrent/torrenthandleimpl.cpp

@ -166,8 +166,6 @@ TorrentHandleImpl::TorrentHandleImpl(Session *session, const lt::torrent_handle
: QObject(session) : QObject(session)
, m_session(session) , m_session(session)
, m_nativeHandle(nativeHandle) , m_nativeHandle(nativeHandle)
, m_state(TorrentState::Unknown)
, m_renameCount(0)
, m_useAutoTMM(params.savePath.isEmpty()) , m_useAutoTMM(params.savePath.isEmpty())
, m_name(params.name) , m_name(params.name)
, m_savePath(Utils::Fs::toNativePath(params.savePath)) , m_savePath(Utils::Fs::toNativePath(params.savePath))
@ -177,10 +175,7 @@ TorrentHandleImpl::TorrentHandleImpl(Session *session, const lt::torrent_handle
, m_ratioLimit(params.ratioLimit) , m_ratioLimit(params.ratioLimit)
, m_seedingTimeLimit(params.seedingTimeLimit) , m_seedingTimeLimit(params.seedingTimeLimit)
, m_tempPathDisabled(params.disableTempPath) , m_tempPathDisabled(params.disableTempPath)
, m_fastresumeDataRejected(false)
, m_hasMissingFiles(false)
, m_hasRootFolder(params.hasRootFolder) , m_hasRootFolder(params.hasRootFolder)
, m_needsToSetFirstLastPiecePriority(false)
{ {
if (m_useAutoTMM) if (m_useAutoTMM)
m_savePath = Utils::Fs::toNativePath(m_session->categorySavePath(m_category)); m_savePath = Utils::Fs::toNativePath(m_session->categorySavePath(m_category));

10
src/base/bittorrent/torrenthandleimpl.h

@ -298,7 +298,7 @@ namespace BitTorrent
Session *const m_session; Session *const m_session;
lt::torrent_handle m_nativeHandle; lt::torrent_handle m_nativeHandle;
lt::torrent_status m_nativeStatus; lt::torrent_status m_nativeStatus;
TorrentState m_state; TorrentState m_state = TorrentState::Unknown;
TorrentInfo m_torrentInfo; TorrentInfo m_torrentInfo;
SpeedMonitor m_speedMonitor; SpeedMonitor m_speedMonitor;
@ -308,7 +308,7 @@ namespace BitTorrent
// m_moveFinishedTriggers is activated only when the following conditions are met: // m_moveFinishedTriggers is activated only when the following conditions are met:
// all file rename jobs complete, all file move jobs complete // all file rename jobs complete, all file move jobs complete
QQueue<EventTrigger> m_moveFinishedTriggers; QQueue<EventTrigger> m_moveFinishedTriggers;
int m_renameCount; int m_renameCount = 0;
// Until libtorrent provide an "old_name" field in `file_renamed_alert` // Until libtorrent provide an "old_name" field in `file_renamed_alert`
// we will rely on this workaround to remove empty leftover folders // we will rely on this workaround to remove empty leftover folders
@ -325,10 +325,10 @@ namespace BitTorrent
qreal m_ratioLimit; qreal m_ratioLimit;
int m_seedingTimeLimit; int m_seedingTimeLimit;
bool m_tempPathDisabled; bool m_tempPathDisabled;
bool m_fastresumeDataRejected; bool m_fastresumeDataRejected = false;
bool m_hasMissingFiles; bool m_hasMissingFiles = false;
bool m_hasRootFolder; bool m_hasRootFolder;
bool m_needsToSetFirstLastPiecePriority; bool m_needsToSetFirstLastPiecePriority = false;
QHash<QString, TrackerInfo> m_trackerInfos; QHash<QString, TrackerInfo> m_trackerInfos;

Loading…
Cancel
Save