LibrePCB Developers Documentation
AsyncCopyOperation Class Referencefinal

High-level helper class to asynchronously and recursively copy directories with progress indicator. More...

#include <asynccopyoperation.h>

Inherits QThread.

+ Collaboration diagram for AsyncCopyOperation:

Signals

void started ()
 
void progressStatus (const QString &status)
 
void progressPercent (int percent)
 
void succeeded ()
 
void failed (const QString &error)
 
void finished ()
 

Public Member Functions

 AsyncCopyOperation ()=delete
 
 AsyncCopyOperation (const AsyncCopyOperation &other)=delete
 
 AsyncCopyOperation (const FilePath &source, const FilePath &destination, QObject *parent=nullptr) noexcept
 
 ~AsyncCopyOperation () noexcept
 
const FilePathgetSource () const noexcept
 
const FilePathgetDestination () const noexcept
 
void abort () noexcept
 Abort a running copy operation. More...
 
AsyncCopyOperationoperator= (const AsyncCopyOperation &rhs)=delete
 

Private Member Functions

void run () noexcept override
 

Private Attributes

FilePath mSource
 
FilePath mDestination
 
volatile bool mAbort
 

Detailed Description

High-level helper class to asynchronously and recursively copy directories with progress indicator.

Constructor & Destructor Documentation

◆ AsyncCopyOperation() [1/3]

AsyncCopyOperation ( )
delete

◆ AsyncCopyOperation() [2/3]

AsyncCopyOperation ( const AsyncCopyOperation other)
delete

◆ AsyncCopyOperation() [3/3]

AsyncCopyOperation ( const FilePath source,
const FilePath destination,
QObject *  parent = nullptr 
)
noexcept

◆ ~AsyncCopyOperation()

~AsyncCopyOperation ( )
noexcept
+ Here is the call graph for this function:

Member Function Documentation

◆ getSource()

const FilePath & getSource ( ) const
inlinenoexcept

◆ getDestination()

const FilePath & getDestination ( ) const
inlinenoexcept

◆ abort()

void abort ( )
noexcept

Abort a running copy operation.

If the copy operation was not finished yet, it is completely reverted, i.e. the destination will be deleted to revert to the state as before starting the copy operation.

Note
This calls QThread::wait() so the calling thread blocks until the operation is completely aborted. If no copy operation is running, this method has no effect.
+ Here is the caller graph for this function:

◆ operator=()

AsyncCopyOperation & operator= ( const AsyncCopyOperation rhs)
delete

◆ started

void started ( )
signal
+ Here is the caller graph for this function:

◆ progressStatus

void progressStatus ( const QString &  status)
signal
+ Here is the caller graph for this function:

◆ progressPercent

void progressPercent ( int  percent)
signal
+ Here is the caller graph for this function:

◆ succeeded

void succeeded ( )
signal
+ Here is the caller graph for this function:

◆ failed

void failed ( const QString &  error)
signal
+ Here is the caller graph for this function:

◆ finished

void finished ( )
signal
+ Here is the caller graph for this function:

◆ run()

void run ( )
overrideprivatenoexcept
+ Here is the call graph for this function:

Member Data Documentation

◆ mSource

FilePath mSource
private

◆ mDestination

FilePath mDestination
private

◆ mAbort

volatile bool mAbort
private

The documentation for this class was generated from the following files: