mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 06:37:17 +00:00
Removed logic duplication across toolkit code in "Open Selected" action.
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user