Revision: 3067
http://skim-app.svn.sourceforge.net/skim-app/?rev=3067&view=rev
Author: hofman
Date: 2007-10-23 11:30:12 -0700 (Tue, 23 Oct 2007)
Log Message:
-----------
Cache the alias data, because the alias can become invalid.
Modified Paths:
--------------
trunk/SKBookmark.h
trunk/SKBookmark.m
Modified: trunk/SKBookmark.h
===================================================================
--- trunk/SKBookmark.h 2007-10-23 17:57:18 UTC (rev 3066)
+++ trunk/SKBookmark.h 2007-10-23 18:30:12 UTC (rev 3067)
@@ -51,6 +51,7 @@
@interface SKBookmark : NSObject <NSCopying> {
BDAlias *alias;
+ NSData *aliasData;
NSString *label;
unsigned int pageIndex;
NSMutableArray *children;
Modified: trunk/SKBookmark.m
===================================================================
--- trunk/SKBookmark.m 2007-10-23 17:57:18 UTC (rev 3066)
+++ trunk/SKBookmark.m 2007-10-23 18:30:12 UTC (rev 3067)
@@ -89,6 +89,7 @@
if (anAlias) {
bookmarkType = SKBookmarkTypeBookmark;
alias = [anAlias retain];
+ aliasData = [[alias aliasData] retain];
pageIndex = aPageIndex;
label = [aLabel copy];
children = nil;
@@ -112,6 +113,7 @@
if (self = [super init]) {
bookmarkType = SKBookmarkTypeFolder;
alias = nil;
+ aliasData = nil;
pageIndex = NSNotFound;
label = [aLabel copy];
children = [aChildren mutableCopy];
@@ -128,6 +130,7 @@
if (self = [super init]) {
bookmarkType = SKBookmarkTypeSeparator;
alias = nil;
+ aliasData = nil;
pageIndex = NSNotFound;
label = nil;
children = nil;
@@ -162,6 +165,7 @@
- (void)dealloc {
[[[SKBookmarkController sharedBookmarkController] undoManager]
removeAllActionsWithTarget:self];
[alias release];
+ [aliasData release];
[label release];
[children release];
[super dealloc];
@@ -198,7 +202,7 @@
}
- (NSData *)aliasData {
- return [alias aliasData];
+ return [self path] ? [alias aliasData] : aliasData;
}
- (NSImage *)icon {
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit