From 6eec8962820ead4fd46f4ae8192d47cd8a813309 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Wed, 5 Nov 2014 16:48:27 +0100 Subject: [PATCH] FolderWatcher: Check for hidden outside of loop --- src/mirall/folderwatcher.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mirall/folderwatcher.cpp b/src/mirall/folderwatcher.cpp index 303534cb02..7ff915383a 100644 --- a/src/mirall/folderwatcher.cpp +++ b/src/mirall/folderwatcher.cpp @@ -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.