Loading...
Searching...
No Matches

A folder walk running on the task pool, and the handle to it. More...

Detailed Description

A folder walk running on the task pool, and the handle to it.

The only state shared between the two threads: the GUI samples the progress, the walk reads the cancel flag. Held by shared_ptr on both sides so the state outlives a window closed mid-search.

Public Types

using OnFinished = std::function< void(FileIndex, bool cancelled)>
 Called on context's thread when the walk ends, cancelled or not.
 

Public Member Functions

 FileScan (QString folder)
 
void cancel () noexcept
 
bool cancelled () const noexcept
 
int filesSeen () const noexcept
 
QString currentFolder () const
 The folder the walk is inside right now.
 
const QString & root () const noexcept
 

Static Public Member Functions

static std::shared_ptr< FileScan > start (const QString &folder, QObject *context, OnFinished onFinished)
 

Friends

class FileIndex
 

Member Function Documentation

◆ start()

std::shared_ptr< FileScan > Process::FileScan::start ( const QString &  folder,
QObject *  context,
OnFinished  onFinished 
)
static

Start walking folder on a task-pool thread. onFinished does not run if context died first.


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