Class sh::filesystem::FilesystemOperationTransfers

class sh::filesystem::FilesystemOperationTransfers

Used by FilesystemOperation for managing the execution of transfer operations.

This class is only used directly by FilesystemOperation (but some inner class might be interesting).

Public Functions

FilesystemOperationTransfers(FilesystemOperation *filesystem, std::shared_ptr<FilesystemOperationProgressMonitor> progressmon)

Constructed only by the infrastructure and made available otherwise.

void executestepqueue()

Executes the queue.

The execution model is as follows: The complete queue of OperationStepClass steps becomes expanded, filesystem conflicts gets resolved and then all steps become executed.

In detail:

At first there is an interleaved process of expanding all steps (see OperationStepClass::expand) and checking/resolving filesystem conflicts in the fresh tree (see doreview). It checks all steps in the queue for conflicts (e.g. destination already exists). It expands each step which has no conflicts (by enqueueing it to the stepqueue). After those checks, it asks FilesystemOperationProgressMonitor::resolveConflicts for a resolution for all outstanding conflicts. With all the steps, which were (or are) in conflict, the entire process becomes repeated. This ends when all steps are expanded and no open conflicts exist anymore.

When this process is done, the execution phase begins. It iterates the queue. It takes the (in FIFO manner) first element (if one is there, otherwise stops). For that step, it makes a late-time conflict check at first. If a conflict appears, it becomes temporarily unexpanded. A resolution loop as above will run for this element, eventually leading to re-expansion. After the check, when no conflicts are open, it executes the step.

void addMoveItem(std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest)

adds one move transfer into the queue.

void addCopyItem(std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest)

adds one copy transfer into the queue.

~FilesystemOperationTransfers()

Private Functions

void _compile_moveItem(std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, QList<OperationStepClass*> *result, QList<OperationStepClass*> withExpansion)

Adds a move transfer step into given list.

void _compile_copyItem(std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, QList<OperationStepClass*> *result, QList<OperationStepClass*> withExpansion)

Adds a copy transfer step into given list.

void computeProgress()

Computes the current progress (how many items/bytes are transferred from which total?) and notifies the progress monitor.

bool doreview(QList<OperationStepClass*> reviewsteps)

Makes checks if the given queue has conflicts and for asks resolveConflicts how to handle them.

For each non-conflicting step, it triggers its expansion, thereby modifying the stepqueue.

It returns when no open conflicts exist.

Return

If there were any conflicts.

Private Members

QList<OperationStepClass*> stepqueue

The queue of steps for execution.

OperationStepClass *currentstep = 0

The step which is currently in execution (or 0).

QList<OperationStepClass*> donesteps

Steps which were already executed.

FilesystemOperation *filesystem
std::shared_ptr<FilesystemOperationProgressMonitor> progressmon
class OperationStep

One step of execution in a transfer operation by FilesystemOperation.

It is typically about a certain source and destination in the filesystem. It also can stay in conflict (due to checks from FilesystemOperationTransfers::doreview) and provides methods for resolving them (in FilesystemOperationTransfers::FilesystemOperationProgressMonitor::resolveConflicts).

Different subclasses implement distinct kinds of operations (e.g. copying or deleting).

Subclassed by sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> source, std::shared_ptr<const sh::filesystem::Eurl> destination)

Constructed only by the infrastructure and made available otherwise.

QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

~OperationStep()

Friends

friend class FilesystemOperationTransfers
class OperationStep_ApplyDirectoryDetails : public sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep_ApplyDirectoryDetails(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> item, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, QList<OperationStepClass*> withExpansion)
void execute(Operation *op)

Implement this and handle the execution part of this step here.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> _detailvals
quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class OperationStep_CopyDirectory : public sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep_CopyDirectory(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, QList<OperationStepClass*> withExpansion)
void execute(Operation *op)

Implement this and handle the execution part of this step here.

QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class OperationStep_CopyFile : public sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep_CopyFile(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, QList<OperationStepClass*> withExpansion)
void execute(Operation *op)

Implement this and handle the execution part of this step here.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class OperationStep_CopyLink : public sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep_CopyLink(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, QList<OperationStepClass*> withExpansion)
void execute(Operation *op)

Implement this and handle the execution part of this step here.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class OperationStep_DeleteItem : public sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep_DeleteItem(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> src, std::shared_ptr<const sh::filesystem::Eurl> dest, QList<OperationStepClass*> withExpansion)
void execute(Operation *op)

Implement this and handle the execution part of this step here.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class OperationStep_RenameItem : public sh::filesystem::FilesystemOperationTransfers::OperationStepClass

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStep_RenameItem(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> src, QString destpath, QList<OperationStepClass*> withExpansion)
QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

void execute(Operation *op)

Implement this and handle the execution part of this step here.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class OperationStepClass : public sh::filesystem::FilesystemOperationTransfers::OperationStep

A base class for all implementations.

They are used from inside FilesystemOperationTransfers::executestepqueue.

Subclassed by sh::filesystem::FilesystemOperationTransfers::OperationStep_ApplyDirectoryDetails, sh::filesystem::FilesystemOperationTransfers::OperationStep_CopyDirectory, sh::filesystem::FilesystemOperationTransfers::OperationStep_CopyFile, sh::filesystem::FilesystemOperationTransfers::OperationStep_CopyLink, sh::filesystem::FilesystemOperationTransfers::OperationStep_DeleteItem, sh::filesystem::FilesystemOperationTransfers::OperationStep_RenameItem

Public Types

enum ConflictResolution

Enumeration of ways how to resolve a filesystem conflict.

Values:

enumerator Skip

Skip this element.

enumerator OverwriteDestination

Overwrite the destination.

enumerator RenameDestinationBefore

Rename the file at the destination before transferring.

enumerator UseDifferentDestinationName

Transfer to another destination filename.

enumerator MergeDirectories

Merge source into destination directory (recursively).

enumerator Unresolved

No strategy.

enumerator Indirect

Indirectly solved. Only set by the engine.

Public Functions

OperationStepClass(FilesystemOperationTransfers *transfers, std::shared_ptr<const sh::filesystem::Eurl> source, std::shared_ptr<const Eurl> destination, QList<OperationStepClass*> withExpansion)
void execute(Operation *op) = 0

Implement this and handle the execution part of this step here.

QList<OperationStepClass*> expand()

Implement this and handle the expansion part of this step here.

bool checkconflicts(Operation *op)

Implement this for customizing the conflict checking.

bool hasOwnProgressIncreaseHandling()

If it takes care on its own to signal increases in the transfer progress.

void _unexpand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

void _expand(QList<OperationStepClass*> *intlist)

Bookkeeping in FilesystemOperationTransfers.

~OperationStepClass()
QList<QPair<sh::filesystem::DetailColumn*, QVariant>> getFileDetails(sh::filesystem::Operation *op, std::shared_ptr<const sh::filesystem::Eurl> source)
void applyFileDetails(sh::filesystem::Operation *op, QList<QPair<sh::filesystem::DetailColumn*, QVariant>> values, std::shared_ptr<const sh::filesystem::Eurl> destination)
QString conflictDescription()

The description of the conflict (if any) as text.

ConflictResolution conflictResolution()

The currently chosen conflict resolution.

QString conflictResolution_renameDestinationBeforeTo()

Returns new destination name (if current conflict resolution is ConflictResolution::RenameDestinationBefore).

QString conflictResolution_differentDestinationNameTo()

Returns new destination name (if current conflict resolution is ConflictResolution::UseDifferentDestinationName).

std::shared_ptr<const sh::filesystem::Eurl> source()

Returns the source location to be transferred (if specified).

std::shared_ptr<const sh::filesystem::Eurl> originalDestination()

Returns the destination location (if specified).

This is the complete target path, never the parent directory of the new element.

This is the original destination location. See also effectiveDestination.

std::shared_ptr<const sh::filesystem::Eurl> effectiveDestination()

Returns the real destination location with conflict resolution applied.

int sourcetype()

Returns the node type of the source.

Should be overwritten in subclasses whenever it can determine the source type faster than the infrastructure.

void setConflictResolve_Skip()

Set conflict resolution to ConflictResolution::Skip.

void setConflictResolve_OverwriteDestination()

Set conflict resolution to ConflictResolution::OverwriteDestination.

void setConflictResolve_RenameDestinationBefore(QString newname)

Set conflict resolution to ConflictResolution::RenameDestinationBefore.

void setConflictResolve_UseDifferentDestinationName(QString newname)

Set conflict resolution to ConflictResolution::UseDifferentDestinationName.

void setConflictResolve_MergeDirectories()

Set conflict resolution to ConflictResolution::MergeDirectories.

See also setConflictResolve_MergeDirectories_isAllowed.

bool setConflictResolve_MergeDirectories_checkAllowed()

Checks if conflict resolution ConflictResolution::MergeDirectories is allowed.

Public Members

quint64 _cntItems = 0

Number of items to be transferred in this step (used for progress monitoring).

quint64 _cntBytes = 0

Number of byte to be transferred in this step (used for progress monitoring).

bool _isExpanded = false

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _expandnodes

Bookkeeping in FilesystemOperationTransfers.

OperationStepClass *_parentnode = 0

Bookkeeping in FilesystemOperationTransfers.

bool _deleteonunexpand = true

Bookkeeping in FilesystemOperationTransfers.

QList<OperationStepClass*> _withExpansion
class SingleStepMonitor : public sh::filesystem::FilesystemHandler::HandlerTransfer

Used for managing detailled progress changes about a single step.

Public Functions

SingleStepMonitor(OperationStepClass *step)
void respectCancel()
void incrementTransferredBytes(qint64 donebytes)
~SingleStepMonitor()

Private Members

OperationStepClass *step
qint64 _donebytes = 0