13 from PyQt4.QtCore import * |
13 from PyQt4.QtCore import * |
14 from PyQt4.QtGui import * |
14 from PyQt4.QtGui import * |
15 |
15 |
16 from E4Gui.E4Completers import E4DirCompleter |
16 from E4Gui.E4Completers import E4DirCompleter |
17 |
17 |
18 from Ui_FindFileNameDialog import Ui_FindFileNameDialog |
18 from .Ui_FindFileNameDialog import Ui_FindFileNameDialog |
19 from Utilities import direntries |
19 from Utilities import direntries |
20 import Utilities |
20 import Utilities |
21 |
21 |
22 |
22 |
23 class FindFileNameDialog(QWidget, Ui_FindFileNameDialog): |
23 class FindFileNameDialog(QWidget, Ui_FindFileNameDialog): |
96 fileNamePattern = patternFormat % (fileName, os.extsep, |
96 fileNamePattern = patternFormat % (fileName, os.extsep, |
97 fileExt and fileExt or '*') |
97 fileExt and fileExt or '*') |
98 |
98 |
99 searchPaths = [] |
99 searchPaths = [] |
100 if self.searchDirCheckBox.isChecked() and \ |
100 if self.searchDirCheckBox.isChecked() and \ |
101 self.searchDirEdit.text() == "": |
101 self.searchDirEdit.text() != "": |
102 searchPaths.append(self.searchDirEdit.text()) |
102 searchPaths.append(self.searchDirEdit.text()) |
103 if self.projectCheckBox.isChecked(): |
103 if self.projectCheckBox.isChecked(): |
104 searchPaths.append(self.project.ppath) |
104 searchPaths.append(self.project.ppath) |
105 if self.syspathCheckBox.isChecked(): |
105 if self.syspathCheckBox.isChecked(): |
106 searchPaths.extend(sys.path) |
106 searchPaths.extend(sys.path) |
117 files = direntries(path, True, fileNamePattern, False, self.checkStop) |
117 files = direntries(path, True, fileNamePattern, False, self.checkStop) |
118 if files: |
118 if files: |
119 found = True |
119 found = True |
120 for file in files: |
120 for file in files: |
121 fp, fn = os.path.split(file) |
121 fp, fn = os.path.split(file) |
122 if locations.has_key(fn): |
122 if fn in locations: |
123 if fp in locations[fn]: |
123 if fp in locations[fn]: |
124 continue |
124 continue |
125 else: |
125 else: |
126 locations[fn].append(fp) |
126 locations[fn].append(fp) |
127 else: |
127 else: |