Revision: 15176 http://sourceforge.net/p/skim-app/code/15176 Author: hofman Date: 2025-05-09 21:42:32 +0000 (Fri, 09 May 2025) Log Message: ----------- enum for reopen options
Modified Paths: -------------- trunk/SKApplicationController.m Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2025-05-09 09:27:19 UTC (rev 15175) +++ trunk/SKApplicationController.m 2025-05-09 21:42:32 UTC (rev 15176) @@ -111,6 +111,12 @@ NSString *SKPageLabelsChangedNotification = @"SKPageLabelsChangedNotification"; +enum { + SKReopenNever = 0, + SKReopenOnDefaultLaunch = 1, + SKReopenAlways = 2 +}; + @interface SKApplicationController () @property (nonatomic, readonly) SKDownloadController *downloadController; @end @@ -200,7 +206,7 @@ [PDFPage setUsesSequentialPageNumbering:[[NSUserDefaults standardUserDefaults] boolForKey:SKSequentialPageNumberingKey]]; [sud addObserver:self forKeyPath:SKSequentialPageNumberingKey options:0 context:&SKApplicationControllerDefaultsObservationContext]; - if ([sud integerForKey:SKReopenLastOpenFilesKey] == 2 || [sud boolForKey:SKIsRelaunchKey]) { + if ([sud integerForKey:SKReopenLastOpenFilesKey] == SKReopenAlways || [sud boolForKey:SKIsRelaunchKey]) { // just remove this in case opening the last open files crashes the app after a relaunch if ([sud objectForKey:SKIsRelaunchKey]) { [sud removeObjectForKey:SKIsRelaunchKey]; @@ -213,7 +219,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification{ NSUserDefaults *sud = [NSUserDefaults standardUserDefaults]; - if (didReopen == NO && [sud integerForKey:SKReopenLastOpenFilesKey] == 1 && [[[aNotification userInfo] objectForKey:NSApplicationLaunchIsDefaultLaunchKey] boolValue]) + if (didReopen == NO && [sud integerForKey:SKReopenLastOpenFilesKey] == SKReopenOnDefaultLaunch && [[[aNotification userInfo] objectForKey:NSApplicationLaunchIsDefaultLaunchKey] boolValue]) [self reopenLastOpenFiles]; [NSApp setServicesProvider:[NSDocumentController sharedDocumentController]]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit