Class sh::filesystem::FilesystemOperationProgressMonitor

class sh::filesystem::FilesystemOperationProgressMonitor : public std::enable_shared_from_this<FilesystemOperationProgressMonitor>

Implement this class and use an instance of it as parameter in some methods of sh::filesystem::FilesystemOperation for some additional functionality.

This includes monitoring the progress, specifying a resolution when conflicts in the filesystem would occur and more.

It also makes sense to directly instantiate this class in some cases.

Subclassed by sh::actions::common::ActionAbstractTransferTree::MyFilesystemOperationProgressMonitor, sh::scripting::api::ApiFilesystemOperationProgressMonitor

Public Functions

FilesystemOperationProgressMonitor(sh::actions::ActionExecutionInfo *actionExecution = 0)

Is intended to be directly constructed from everywhere.

Parameters

bool hasItemInfo()

Checks if this progress monitor provides information about how many items of a certain total number are transferred so far.

quint64 doneItems()

Checks how many items are transferred so far.

quint64 allItems()

Checks how many items are to be transferred in total (as predicted in the current moment).

bool hasBytesInfo()

Checks if this progress monitor provides information about how many byte of a certain total number are transferred so far.

quint64 doneBytes()

Checks how many bytes are transferred so far.

quint64 allBytes()

Checks how many bytes are to be transferred in total (as predicted in the current moment).

QString getItemInfoFrom()

Returns the current source of transfer (as textual information).

QString getItemInfoTo()

Returns the current destination of transfer (as textual information).

QString estimation()

Returns the current performance and time estimation (as textual information).

~FilesystemOperationProgressMonitor()

Private Functions

void setProgress(quint64 doneitems, quint64 allitems, quint64 donebytes, quint64 allbytes)

Used by FilesystemOperationTransfers for setting status changes.

void incProgress(quint64 doneitems, quint64 allitems, quint64 donebytes, quint64 allbytes)

Used by FilesystemOperationTransfers for setting status changes.

void setItemInfo(QString from, QString to)

Used by FilesystemOperationTransfers for setting status changes.

void setEstimation(QString estimation)

Used by FilesystemOperationTransfers for setting status changes.

void _enablestatistics()
void _computestatistics()
void _triggerchanged()
void _stoptriggerchanged()

Private Members

QDateTime _laststatistictime
quint64 _laststatisticdonebytes = 0
quint64 _laststatisticdoneitems = 0
double _statisticbytespeed = 0.0
double _statisticitemspeed = 0.0
int _statisticcountdown = 4
QMutex _mutex
QMutex _triggermutex
quint64 _allitems = 0
quint64 _doneitems = 0
quint64 _allbytes = 0
quint64 _donebytes = 0
bool _triggerchanged_changedrunning = false
bool _triggerchanged_changedrunagain = false
bool _triggerchanged_stopped = false
QString _itemfrom
QString _itemto
QString _estimation
QList<std::shared_ptr<const sh::filesystem::Eurl>> changes
bool _begancomputestatistics = false

Friends

friend class FilesystemOperationTransfers
friend class FilesystemOperation