Revision: 3066 http://skim-app.svn.sourceforge.net/skim-app/?rev=3066&view=rev Author: hofman Date: 2007-10-23 10:57:18 -0700 (Tue, 23 Oct 2007)
Log Message: ----------- Remove alias from recent documents before serializing. Modified Paths: -------------- trunk/SKBookmarkController.m Modified: trunk/SKBookmarkController.m =================================================================== --- trunk/SKBookmarkController.m 2007-10-23 17:38:43 UTC (rev 3065) +++ trunk/SKBookmarkController.m 2007-10-23 17:57:18 UTC (rev 3066) @@ -298,8 +298,8 @@ if (index != NSNotFound) [recentDocuments removeObjectAtIndex:index]; - NSData *data = [[BDAlias aliasWithPath:path] aliasData]; - NSMutableDictionary *bm = [NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInt:pageIndex], PAGE_INDEX_KEY, data, ALIAS_DATA_KEY, [setups count] ? setups : nil, SNAPSHOTS_KEY, nil]; + BDAlias *alias = [BDAlias aliasWithPath:path]; + NSMutableDictionary *bm = [NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInt:pageIndex], PAGE_INDEX_KEY, [alias aliasData], ALIAS_DATA_KEY, alias, ALIAS_KEY, [setups count] ? setups : nil, SNAPSHOTS_KEY, nil]; [recentDocuments insertObject:bm atIndex:0]; if ([recentDocuments count] > maxRecentDocumentsCount) [recentDocuments removeLastObject]; @@ -446,13 +446,14 @@ #pragma mark Notification handlers - (void)handleApplicationWillTerminateNotification:(NSNotification *)notification { + [recentDocuments makeObjectsPerformSelector:@selector(removeObjectForKey:) withObject:ALIAS_KEY]; NSDictionary *bookmarksDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[bookmarks valueForKey:@"dictionaryValue"], BOOKMARKS_KEY, recentDocuments, RECENT_DOCUMENTS_KEY, nil]; NSString *error = nil; NSPropertyListFormat format = NSPropertyListBinaryFormat_v1_0; NSData *data = [NSPropertyListSerialization dataFromPropertyList:bookmarksDictionary format:format errorDescription:&error]; if (error) { - NSLog(@"Error deserializing: %@", error); + NSLog(@"Error serializing: %@", error); [error release]; } else { [data writeToFile:[self bookmarksFilePath] atomically:YES]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit