FolderWatcher: Check for hidden outside of loop

This commit is contained in:
Klaas Freitag 2014-11-05 16:48:27 +01:00
parent a78bb252de
commit 6eec896282

View File

@ -71,6 +71,12 @@ bool FolderWatcher::pathIsIgnored( const QString& path )
{
if( path.isEmpty() ) return true;
QFileInfo fInfo(path);
if( fInfo.isHidden() ) {
qDebug() << "* Discarded as is hidden!" << fInfo.filePath();
return true;
}
// Remember: here only directories are checked!
// If that changes to files too at some day, remember to check
// for the database name as well as the trailing slash rule for
@ -79,12 +85,6 @@ bool FolderWatcher::pathIsIgnored( const QString& path )
QRegExp regexp(pattern);
regexp.setPatternSyntax(QRegExp::Wildcard);
QFileInfo fInfo(path);
if( fInfo.isHidden() ) {
qDebug() << "* Discarded as is hidden!" << fInfo.filePath();
return true;
}
if(pattern.endsWith('/')) {
// directory only pattern. But since only dirs here, we cut off the trailing dir.
pattern.remove(pattern.length()-1, 1); // remove the last char.