Revision: 7427
http://skim-app.svn.sourceforge.net/skim-app/?rev=7427&view=rev
Author: hofman
Date: 2011-08-10 17:37:01 +0000 (Wed, 10 Aug 2011)
Log Message:
-----------
Only synchronize after relaunch if needed, synchronize after saving last open
files so we can use it after a crash
Modified Paths:
--------------
trunk/SKApplicationController.m
Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m 2011-08-10 17:18:24 UTC (rev 7426)
+++ trunk/SKApplicationController.m 2011-08-10 17:37:01 UTC (rev 7427)
@@ -150,6 +150,7 @@
- (void)registerCurrentDocuments:(NSNotification *)aNotification {
[[NSUserDefaults standardUserDefaults] setObject:[[(SKApplication *)NSApp
orderedDocuments] valueForKey:CURRENTDOCUMENTSETUP_KEY]
forKey:SKLastOpenFileNamesKey];
[[[NSDocumentController sharedDocumentController] documents]
makeObjectsPerformSelector:@selector(saveRecentDocumentInfo)];
+ [[NSUserDefaults standardUserDefaults] synchronize];
}
- (void)handleWindowDidBecomeMainNotification:(NSNotification *)aNotification {
@@ -163,8 +164,10 @@
if ([sud boolForKey:SKReopenLastOpenFilesKey] || [sud
boolForKey:SKIsRelaunchKey]) {
// just remove this in case opening the last open files crashes the
app after a relaunch
- [sud removeObjectForKey:SKIsRelaunchKey];
- [sud synchronize];
+ if ([sud objectForKey:SKIsRelaunchKey]) {
+ [sud removeObjectForKey:SKIsRelaunchKey];
+ [sud synchronize];
+ }
NSArray *files = [sud objectForKey:SKLastOpenFileNamesKey];
NSEnumerator *fileEnum = [files reverseObjectEnumerator];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit