filemanager/src/filemanager/src/fmfindthread.cpp
changeset 48 1bebd60c0f00
parent 44 22e202702210
equal deleted inserted replaced
44:22e202702210 48:1bebd60c0f00
    15  * Description:
    15  * Description:
    16  *     The find thread header file of file manager
    16  *     The find thread header file of file manager
    17  */
    17  */
    18 
    18 
    19 #include "fmfindthread.h"
    19 #include "fmfindthread.h"
       
    20 #include "fmutils.h"
    20 #include "fmcommon.h"
    21 #include "fmcommon.h"
    21 
    22 
    22 #include <QDir>
    23 #include <QDir>
    23 
    24 
    24 // current path, it may come from findDirs.first().entryInfoList()
    25 // current path, it may come from findDirs.first().entryInfoList()
   115                 return;
   116                 return;
   116             }
   117             }
   117 			QString name = it->fileName();
   118 			QString name = it->fileName();
   118 			QString absolutPath = it->absoluteFilePath();
   119 			QString absolutPath = it->absoluteFilePath();
   119             if (findPattern.exactMatch( it->fileName() )) {
   120             if (findPattern.exactMatch( it->fileName() )) {
   120                 tempResultList.append( it->absoluteFilePath() );
   121                 if( !FmUtils::isSystemFolder( it->absoluteFilePath()) ) {
   121                 if (tempResultList.count() > notifyPerCount) {
   122                     tempResultList.append( it->absoluteFilePath() );
   122                     emitFound();
   123                     if (tempResultList.count() > notifyPerCount) {
   123                 } else if (time.elapsed() > notifyPerElapsedTime && tempResultList.count() > 0) {
   124                         emitFound();
   124                     emitFound();
   125                     } else if (time.elapsed() > notifyPerElapsedTime && tempResultList.count() > 0) {
       
   126                         emitFound();
       
   127                     }
   125                 }
   128                 }
   126             }
   129             }
   127 
   130 
   128             // exclude directory named ".." and "."
   131             // exclude directory named ".." and "."
   129             if (it->isDir() && it->fileName() != ParentDir && it->fileName() != CurrentDir ) {
   132             if (it->isDir() && it->fileName() != ParentDir && it->fileName() != CurrentDir ) {
   130                 findDirs.append( QDir( it->absoluteFilePath() ) );
   133                 if( !FmUtils::isSystemFolder( it->absoluteFilePath()) ) {
       
   134                     findDirs.append( QDir( it->absoluteFilePath() ) );
       
   135                 }
   131             }
   136             }
   132         }
   137         }
   133 
   138 
   134         findDirs.removeFirst();
   139         findDirs.removeFirst();
   135     }
   140     }