mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
Reduced code duplication among editions in AppDelegate.m.
This commit is contained in:
@@ -49,4 +49,36 @@ http://www.hardcoded.net/licenses/hs_license
|
||||
[py loadIgnoreList];
|
||||
[py loadResults];
|
||||
}
|
||||
|
||||
- (void)applicationWillBecomeActive:(NSNotification *)aNotification
|
||||
{
|
||||
if (![[result window] isVisible])
|
||||
[result showWindow:NSApp];
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification *)aNotification
|
||||
{
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
[ud setObject: [result getColumnsOrder] forKey:@"columnsOrder"];
|
||||
[ud setObject: [result getColumnsWidth] forKey:@"columnsWidth"];
|
||||
[py saveIgnoreList];
|
||||
[py saveResults];
|
||||
NSInteger sc = [ud integerForKey:@"sessionCountSinceLastIgnorePurge"];
|
||||
if (sc >= 10)
|
||||
{
|
||||
sc = -1;
|
||||
[py purgeIgnoreList];
|
||||
}
|
||||
sc++;
|
||||
[ud setInteger:sc forKey:@"sessionCountSinceLastIgnorePurge"];
|
||||
// NSApplication does not release nib instances objects, we must do it manually
|
||||
// Well, it isn't needed because the memory is freed anyway (we are quitting the application
|
||||
// But I need to release RecentDirectories so it saves the user defaults
|
||||
[recentDirectories release];
|
||||
}
|
||||
|
||||
- (void)recentDirecoryClicked:(NSString *)directory
|
||||
{
|
||||
[[self directoryPanel] addDirectory:directory];
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user