17#include <QCoreApplication>
18#include <QSharedPointer>
19#include <boost/algorithm/string.hpp>
27static std::unique_ptr<QThreadPool>
tp = {
nullptr};
35 tp = std::make_unique<QThreadPool>();
92 parent->connect(worker, SIGNAL(finished(
const FindFilesSearchResults &)), parent, SIGNAL(fileFindingFinished()),
93 Qt::QueuedConnection);
95 this->connect(
this, SIGNAL(
disconnectWorkers()), worker, SLOT(disconnectWorker()), Qt::QueuedConnection);
110 QCoreApplication::sendPostedEvents();
static std::unique_ptr< QThreadPool > tp
std::function< FindFilesWorker *(const FindFilesSearchParameters &)> ThreadAllocator
void connectWorker(const QObject *parent, const FindFilesWorker *worker)
Connect worker to relevant signals/slots.
static void destroyThreadPool()
Destroy the static thread pool instance.
FindFilesThreadPoolManager()
Create a new thread pool manager for finding files.
const std::unique_ptr< QThreadPool > & poolInstance() const
Get a handle to the static file finder thread pool instance.
void setAllocator(ThreadAllocator allocator)
Set the worker object allocator for this thread pool.
void waitForDone()
Block execution and wait for all threads to finish processing.
ThreadAllocator m_workerAllocator
Handle to the allocator function for creating new worker threads.
void createWorker(const QObject *parent, const FindFilesSearchParameters ¶meters)
Create a new worker thread. This will cancel any currently running threads.
bool isSearchRunning() const
Check if a search is already in progress.
void cancelWorker()
Cancel the currently running worker.
A class to allow the asynchronous finding of files.
POD struct to hold details about the parameters of a file search.
POD struct to hold details about the results of a file search.