Skip to content

Commit

Permalink
follow_sym option fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
m1lhaus committed Dec 31, 2015
1 parent 78373b4 commit d3b8610
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions components/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ def __init__(self, names_filter):
super(RecursiveBrowser, self).__init__()
self._stop = False

self.block_size = 5 # send limit / parsing this block takes about 50ms
self.follow_sym = QSettings().value("components/disk/RecursiveBrowser/follow_symlinks", False, bool)
self.names_filter = tuple([ext.replace('*', '') for ext in names_filter]) # i.e. remove * from *.mp3
self.iteratorFlags = QDirIterator.Subdirectories | QDirIterator.FollowSymlinks if self.follow_sym else QDirIterator.Subdirectories

logger.debug(u"Recursive disk browser initialized.")

Expand All @@ -84,7 +81,8 @@ def scanFiles(self, target_dir):
self.parseDataSignal.emit([target_dir, ])
else:
logger.debug(u"Starting recursive file-search and parsing.")
for root, dirs, files in scandir.walk(target_dir, followlinks=self.follow_sym):
follow_sym = QSettings().value("components/disk/RecursiveBrowser/follow_symlinks", False, bool)
for root, dirs, files in scandir.walk(target_dir, followlinks=follow_sym):
# remove dirs starting with dot and sort the result
for i, ddir in reversed(list(enumerate(dirs))):
if ddir[0] == ".":
Expand Down

0 comments on commit d3b8610

Please sign in to comment.