eVaf
eVaf::FileFinder::Engine::Internal::Worker Class Reference

Worker thread searching for files. More...

#include </var/tmp/work/evaf/src/apps/FileFinder/Engine/engine.h>

Signals

void finished (bool canceled)
 Signal indicating that a search is finished. More...
 
void found (QString const &fileName, QString const &dir)
 A file was found during the search. More...
 

Public Member Functions

bool busy () const
 Indicates that a search is ongoing and the worker thread busy. More...
 
void cancel ()
 Cancels an ongoing search. More...
 
void search (QString const &dir, bool recursive, Filter const &filter)
 Starts a new search. More...
 
void stop ()
 Stops and terminates the worker thread. More...
 
 Worker (QObject *parent=0)
 
virtual ~Worker ()
 

Protected Member Functions

virtual void run ()
 

Detailed Description

Worker thread searching for files.

The Worker class is a separate thread that searches for files and then emits the found() signal on every file found.

Definition at line 178 of file engine.h.

Constructor & Destructor Documentation

eVaf::FileFinder::Engine::Internal::Worker::Worker ( QObject parent = 0)
virtual eVaf::FileFinder::Engine::Internal::Worker::~Worker ( )
virtual

Member Function Documentation

bool eVaf::FileFinder::Engine::Internal::Worker::busy ( ) const

Indicates that a search is ongoing and the worker thread busy.

void eVaf::FileFinder::Engine::Internal::Worker::cancel ( )

Cancels an ongoing search.

void eVaf::FileFinder::Engine::Internal::Worker::finished ( bool  canceled)
signal

Signal indicating that a search is finished.

Parameters
canceledTrue if the search was canceled instead of finished
void eVaf::FileFinder::Engine::Internal::Worker::found ( QString const &  fileName,
QString const &  dir 
)
signal

A file was found during the search.

Parameters
fileNameName of the file with a path relative to the search directory
dirSearch directory
virtual void eVaf::FileFinder::Engine::Internal::Worker::run ( )
protectedvirtual
void eVaf::FileFinder::Engine::Internal::Worker::search ( QString const &  dir,
bool  recursive,
Filter const &  filter 
)

Starts a new search.

Parameters
dirDirectory where to search
recursiveIf true, searches recurively in sub-directories
filterSearch filter

The search() function starts a new search. If a search is already ongoing, cancels it and starts a new one.

Search results are reported back with the found() signal and the finished() signal indicates that the search is done.

void eVaf::FileFinder::Engine::Internal::Worker::stop ( )

Stops and terminates the worker thread.


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