8 * @brief SearchWorker does searching in the background.
10 class SearchWorker
: public QThread
15 explicit SearchWorker(QObject
*parent
= 0);
18 void startSearch(QString directory
, QString searchTerm
);
22 signals
: // signals, can be connected from a thread to another
24 void progressChanged(QString directory
);
26 void matchFound(QString fullname
);
28 // one of these is emitted when thread ends
30 void errorOccurred(QString message
, QString filename
);
37 Cancelled
= 0, NotCancelled
= 1
40 QString
searchRecursively(QString directory
, QString searchTerm
);
44 QAtomicInt m_cancelled
; // atomic so no locks needed
45 QString m_currentDirectory
;
48 #endif // SEARCHWORKER_H