* @brief Module for the FileFinder application that searches for files
* @author Enar Vaikene
*
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
*
* This file is part of the eVaf C++ cross-platform application development framework.
*
Internal::Engine::Engine()
: iFileFinder()
- , mWorker(0)
+ , mWorker(nullptr)
{
setObjectName(QString("%1.Engine").arg(VER_MODULE_NAME_STR));
void Internal::Engine::done()
{
- if (mWorker) {
+ if (mWorker != nullptr) {
mWorker->stop();
delete mWorker;
- mWorker = 0;
+ mWorker = nullptr;
}
EVAF_INFO("%s finalized", qPrintable(objectName()));
void Internal::Engine::search(QString const & dir, bool recursive, Filter const & filter)
{
- if (mWorker)
+ if (mWorker != nullptr)
mWorker->search(dir, recursive, filter);
}
bool Internal::Engine::busy() const
{
- if (mWorker)
+ if (mWorker != nullptr)
return mWorker->busy();
return false;
}
void Internal::Engine::cancel()
{
- if (mWorker)
+ if (mWorker != nullptr)
mWorker->cancel();
}
bool e = false;
while (offset < sz) {
- QChar ch = pattern.at(offset++);
+ QChar const ch = pattern.at(offset++);
if (e) {
e = false;
if (ch == '*' || ch == '?' || ch == '[' || ch == ']')
QDir dir(l);
// Get the list of files in this directory
- QStringList files = dir.entryList(QDir::Files | QDir::NoSymLinks);
+ QStringList const files = dir.entryList(QDir::Files | QDir::NoSymLinks);
foreach (QString const & file, files) {
// Check for the cancel flag
* ReadBufferSize bytes of data. Every block is checked twice, but we make sure that
* also strings that stretch from one block to another are checked.
*/
- QByteArray b = f.read(ReadBufferSize);
+ QByteArray const b = f.read(ReadBufferSize);
buf.append(b);
if (buf.size() > (2 * ReadBufferSize))
buf.remove(0, ReadBufferSize);
// Process sub-directories
if (mRecursive) {
- QStringList dirs = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
+ QStringList const dirs = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
foreach (QString const & directory, dirs) {
// Check for the cancel flag