--- a/UI/FindFileDialog.py Fri Nov 01 15:48:48 2013 +0100 +++ b/UI/FindFileDialog.py Sun Nov 03 15:58:22 2013 +0100 @@ -146,7 +146,7 @@ self.__lastFileItem.setExpanded(True) if self.__replaceMode: self.__lastFileItem.setFlags( - self.__lastFileItem.flags() | \ + self.__lastFileItem.flags() | Qt.ItemFlags(Qt.ItemIsUserCheckable | Qt.ItemIsTristate)) # Qt bug: # item is not user checkable if setFirstColumnSpanned @@ -250,10 +250,10 @@ Private slot called to enable the find button. """ if self.findtextCombo.currentText() == "" or \ - (self.__replaceMode and \ + (self.__replaceMode and self.replacetextCombo.currentText() == "") or \ - (self.dirButton.isChecked() and \ - (self.dirCombo.currentText() == "" or \ + (self.dirButton.isChecked() and + (self.dirCombo.currentText() == "" or not os.path.exists(os.path.abspath( self.dirCombo.currentText())))) or \ (self.filterCheckBox.isChecked() and self.filterEdit.text() == ""): @@ -302,16 +302,16 @@ if self.filterCheckBox.isChecked(): fileFilter = self.filterEdit.text() fileFilterList = \ - ["^{0}$".format(filter.replace(".", "\.").replace("*", ".*")) \ + ["^{0}$".format(filter.replace(".", "\.").replace("*", ".*")) for filter in fileFilter.split(";")] filterRe = re.compile("|".join(fileFilterList)) if self.projectButton.isChecked(): if self.filterCheckBox.isChecked(): - files = [self.project.getRelativePath(file) \ - for file in \ + files = [self.project.getRelativePath(file) + for file in self.__getFileList( - self.project.getProjectPath(), filterRe)] + self.project.getProjectPath(), filterRe)] else: files = [] if self.sourcesCheckBox.isChecked(): @@ -330,7 +330,7 @@ ["^{0}$".format( assoc.replace(".", "\.").replace("*", ".*")) for assoc in list( - Preferences.getEditorLexerAssocs().keys()) + Preferences.getEditorLexerAssocs().keys()) if assoc not in self.formsExt + self.interfacesExt]) if self.formsCheckBox.isChecked(): filters.append(self.filterForms) @@ -557,10 +557,10 @@ path = os.path.abspath(path) files = [] for dirname, _, names in os.walk(path): - files.extend([os.path.join(dirname, f) \ - for f in names \ + files.extend([os.path.join(dirname, f) + for f in names if re.match(filterRe, f)] - ) + ) return files def setSearchDirectory(self, searchDir): @@ -611,8 +611,8 @@ self.trUtf8("Replace in Files"), self.trUtf8( """<p>Could not read the file <b>{0}</b>.""" - """ Skipping it.</p><p>Reason: {1}</p>""")\ - .format(fn, str(err)) + """ Skipping it.</p><p>Reason: {1}</p>""") + .format(fn, str(err)) ) progress += 1 self.findProgress.setValue(progress) @@ -627,8 +627,8 @@ self.trUtf8( """<p>The current and the original hash of the""" """ file <b>{0}</b> are different. Skipping it.""" - """</p><p>Hash 1: {1}</p><p>Hash 2: {2}</p>""")\ - .format(fn, origHash, hash) + """</p><p>Hash 1: {1}</p><p>Hash 2: {2}</p>""") + .format(fn, origHash, hash) ) progress += 1 self.findProgress.setValue(progress) @@ -652,8 +652,8 @@ self.trUtf8("Replace in Files"), self.trUtf8( """<p>Could not save the file <b>{0}</b>.""" - """ Skipping it.</p><p>Reason: {1}</p>""")\ - .format(fn, str(err)) + """ Skipping it.</p><p>Reason: {1}</p>""") + .format(fn, str(err)) ) progress += 1