mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
[#179] Refactored folder deletion so that it uses selection in the core's directory_tree instead of using the one from the GUI layer.
This commit is contained in:
@@ -105,7 +105,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
NSIndexPath *path = [outline selectedIndexPath];
|
||||
NSInteger state = [outline intProperty:@"state" valueAtPath:path];
|
||||
if (([path length] == 1) && (state != 2)) {
|
||||
[_py removeDirectory:i2n([path indexAtPosition:0])];
|
||||
[[outline py] removeSelectedDirectory];
|
||||
}
|
||||
else {
|
||||
NSInteger newState = state == 2 ? 0 : 2; // If excluded, put it back
|
||||
|
||||
@@ -11,4 +11,5 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
@interface PyDirectoryOutline : PyOutline
|
||||
- (void)addDirectory:(NSString *)directoryPath;
|
||||
- (void)removeSelectedDirectory;
|
||||
@end
|
||||
@@ -15,7 +15,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
- (PyResultTable *)resultTable;
|
||||
//Actions
|
||||
- (NSNumber *)addDirectory:(NSString *)name;
|
||||
- (void)removeDirectory:(NSNumber *)index;
|
||||
- (void)loadResultsFrom:(NSString *)filename;
|
||||
- (void)saveResultsAs:(NSString *)filename;
|
||||
- (void)loadSession;
|
||||
|
||||
@@ -38,9 +38,6 @@ class PyDupeGuruBase(PyFairware):
|
||||
def addDirectory_(self, directory):
|
||||
return self.py.add_directory(directory)
|
||||
|
||||
def removeDirectory_(self, index):
|
||||
self.py.remove_directory(index)
|
||||
|
||||
#---Results
|
||||
def clearIgnoreList(self):
|
||||
self.py.scanner.ignore_list.Clear()
|
||||
|
||||
@@ -8,6 +8,9 @@ class PyDirectoryOutline(PyOutline):
|
||||
def addDirectory_(self, path):
|
||||
self.py.add_directory(path)
|
||||
|
||||
def removeSelectedDirectory(self):
|
||||
self.py.remove_selected()
|
||||
|
||||
# python --> cocoa
|
||||
def refresh_states(self):
|
||||
# Under cocoa, both refresh() and refresh_states() do the same thing.
|
||||
|
||||
Reference in New Issue
Block a user