1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Removed logic duplication across toolkit code in "Open Selected" action.

This commit is contained in:
Virgil Dupras
2010-02-06 12:36:43 +01:00
parent 9edee82fa1
commit 37238c7f57
4 changed files with 19 additions and 15 deletions

View File

@@ -117,6 +117,11 @@ class DupeGuru(DupeGuruBase, QObject):
raise NotImplementedError()
#--- Override
@staticmethod
def _open_path(path):
url = QUrl.fromLocalFile(unicode(path))
QDesktopServices.openUrl(url)
@staticmethod
def _recycle_dupe(dupe):
platform.recycle_file(dupe.path)
@@ -182,14 +187,7 @@ class DupeGuru(DupeGuruBase, QObject):
def openDebugLog(self):
debugLogPath = op.join(self.appdata, 'debug.log')
url = QUrl.fromLocalFile(debugLogPath)
QDesktopServices.openUrl(url)
def open_selected(self):
if not self.selected_dupes:
return
url = QUrl.fromLocalFile(unicode(self.selected_dupes[0].path))
QDesktopServices.openUrl(url)
self._open_path(debugLogPath)
def remove_marked_duplicates(self):
marked = [d for d in self.results.dupes if self.results.is_marked(d)]