diff --git a/filesystem/filewatcher/filewatcher.cpp b/filesystem/filewatcher/filewatcher.cpp index b558f60..4df3732 100644 --- a/filesystem/filewatcher/filewatcher.cpp +++ b/filesystem/filewatcher/filewatcher.cpp @@ -470,15 +470,9 @@ QStringList FileWatcher::getChildFile(QString parent, int depth, int maxdepth, i return res; if (recurType & HIDDEN) - if (recurType & DIR) dir.setFilter(QDir::Dirs|QDir::Files|QDir::NoDotAndDotDot|QDir::Hidden); - else - dir.setFilter(QDir::Files|QDir::NoDotAndDotDot|QDir::Hidden); else - if (recurType & DIR) dir.setFilter(QDir::Dirs|QDir::Files|QDir::NoDotAndDotDot); - else - dir.setFilter(QDir::Files); dir.setSorting(QDir::DirsFirst); @@ -511,7 +505,8 @@ QStringList FileWatcher::getChildFile(QString parent, int depth, int maxdepth, i sprintf(buf, "%s is dir, search for it's subfile.\n", finfo.absoluteFilePath().toStdString().c_str()); logfile.write(buf); res.append(this->getChildFile(finfo.absoluteFilePath(), depth + 1, maxdepth)); - res.append(finfo.absoluteFilePath()); + if (recurType & DIR) + res.append(finfo.absoluteFilePath()); sprintf(buf, "append %s\n", finfo.absoluteFilePath().toStdString().c_str()); logfile.write(buf); }