From 126de7096720497a973d321487bef5cd88eddea7 Mon Sep 17 00:00:00 2001 From: hsoft Date: Wed, 10 Jun 2009 09:46:24 +0000 Subject: [PATCH] [#20 state:fixed] Added default excludes to the windows version. --HG-- extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%4031 --- se/qt/app.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/se/qt/app.py b/se/qt/app.py index 3859a5f8..77a78f3e 100644 --- a/se/qt/app.py +++ b/se/qt/app.py @@ -6,12 +6,22 @@ # Copyright 2009 Hardcoded Software (http://www.hardcoded.net) from dupeguru import data +from dupeguru.directories import Directories as DirectoriesBase, STATE_EXCLUDED from base.app import DupeGuru as DupeGuruBase from details_dialog import DetailsDialog from preferences import Preferences from preferences_dialog import PreferencesDialog +class Directories(DirectoriesBase): + ROOT_PATH_TO_EXCLUDE = frozenset(['windows', 'program files']) + def _default_state_for_path(self, path): + result = DirectoriesBase._default_state_for_path(self, path) + if result is not None: + return result + if len(path) == 2 and path[1].lower() in self.ROOT_PATH_TO_EXCLUDE: + return STATE_EXCLUDED + class DupeGuru(DupeGuruBase): LOGO_NAME = 'logo_se' NAME = 'dupeGuru' @@ -21,6 +31,10 @@ class DupeGuru(DupeGuruBase): def __init__(self): DupeGuruBase.__init__(self, data, appid=4) + def _setup(self): + self.directories = Directories() + DupeGuruBase._setup(self) + def _update_options(self): DupeGuruBase._update_options(self) self.scanner.min_match_percentage = self.prefs.filter_hardness