mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
Removed refreshDetailsWithSelected which wasn't needed anymore.
This commit is contained in:
@@ -50,7 +50,6 @@ class DupeGuru(app.DupeGuru, Broadcaster):
|
||||
self.progress = cocoa.ThreadedJobPerformer()
|
||||
self.display_delta_values = False
|
||||
self.selected_dupes = []
|
||||
self.RefreshDetailsWithSelected()
|
||||
|
||||
#--- Override
|
||||
@staticmethod
|
||||
@@ -93,6 +92,12 @@ class DupeGuru(app.DupeGuru, Broadcaster):
|
||||
curr_path = self.directories.get_subfolders(curr_path)[current_index]
|
||||
return self.get_folder_path(node_path[1:], curr_path)
|
||||
|
||||
def _select_dupes(self, dupes):
|
||||
if dupes == self.selected_dupes:
|
||||
return
|
||||
self.selected_dupes = dupes
|
||||
self.notify('dupes_selected')
|
||||
|
||||
#---Public
|
||||
def AddSelectedToIgnoreList(self):
|
||||
for dupe in self.selected_dupes:
|
||||
@@ -113,9 +118,6 @@ class DupeGuru(app.DupeGuru, Broadcaster):
|
||||
def PurgeIgnoreList(self):
|
||||
self.scanner.ignore_list.Filter(lambda f,s:op.exists(f) and op.exists(s))
|
||||
|
||||
def RefreshDetailsWithSelected(self):
|
||||
self.notify('details_table_changed')
|
||||
|
||||
def RemoveDirectory(self,index):
|
||||
try:
|
||||
del self.directories[index]
|
||||
@@ -141,8 +143,7 @@ class DupeGuru(app.DupeGuru, Broadcaster):
|
||||
NSWorkspace.sharedWorkspace().selectFile_inFileViewerRootedAtPath_(path,'')
|
||||
|
||||
def start_scanning(self):
|
||||
self.selected_dupes = []
|
||||
self.RefreshDetailsWithSelected()
|
||||
self._select_dupes([])
|
||||
try:
|
||||
app.DupeGuru.start_scanning(self)
|
||||
return 0
|
||||
@@ -187,13 +188,12 @@ class DupeGuru(app.DupeGuru, Broadcaster):
|
||||
return g.ref
|
||||
|
||||
selected = [extract_dupe(self.GetObjects(p)) for p in node_paths]
|
||||
self.selected_dupes = [dupe for dupe in selected if dupe is not None]
|
||||
self._select_dupes([dupe for dupe in selected if dupe is not None])
|
||||
|
||||
def SelectPowerMarkerNodePaths(self,node_paths):
|
||||
rows = [p[0] for p in node_paths]
|
||||
self.selected_dupes = [
|
||||
self.results.dupes[row] for row in rows if row in xrange(len(self.results.dupes))
|
||||
]
|
||||
dupes = [self.results.dupes[row] for row in rows if row in xrange(len(self.results.dupes))]
|
||||
self._select_dupes(dupes)
|
||||
|
||||
def SetDirectoryState(self, node_path, state):
|
||||
p = self.get_folder_path(node_path)
|
||||
|
||||
@@ -71,9 +71,6 @@ class PyDupeGuruBase(PyApp):
|
||||
def saveResults(self):
|
||||
self.app.save()
|
||||
|
||||
def refreshDetailsWithSelected(self):
|
||||
self.app.RefreshDetailsWithSelected()
|
||||
|
||||
def selectedResultNodePaths(self):
|
||||
return self.app.selected_result_node_paths()
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class DetailsPanel(Listener):
|
||||
return self._table[row_index]
|
||||
|
||||
#--- Event Handlers
|
||||
def details_table_changed(self):
|
||||
def dupes_selected(self):
|
||||
self._refresh()
|
||||
self.view.refresh()
|
||||
|
||||
|
||||
@@ -253,11 +253,9 @@ class TCDupeGuru(TestCase):
|
||||
|
||||
def test_refreshDetailsWithSelected(self):
|
||||
self.app.SelectPowerMarkerNodePaths(r2np([0,2]))
|
||||
self.app.RefreshDetailsWithSelected()
|
||||
eq_(self.dpanel.row(0), ('Filename', 'bar bleh', 'foo bar'))
|
||||
self.check_gui_calls(self.dpanel_gui, ['refresh'])
|
||||
self.app.SelectPowerMarkerNodePaths([])
|
||||
self.app.RefreshDetailsWithSelected()
|
||||
eq_(self.dpanel.row(0), ('Filename', '---', '---'))
|
||||
self.check_gui_calls(self.dpanel_gui, ['refresh'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user