update metadata when an item changes, and make changes to the url trigger an

item update notification.
This commit is contained in:
pinkerton%aol.net 2005-05-06 08:03:33 +00:00
parent 8f6f8cf984
commit 78c114c9f4
3 changed files with 9 additions and 1 deletions

View File

@ -147,6 +147,7 @@ NSString* const URLLoadSuccessKey = @"url_bool";
mURL = aURL;
[self setStatus:kBookmarkOKStatus];
[self refreshIcon];
[self itemUpdatedNote];
}
}

View File

@ -88,7 +88,7 @@ enum
+(void) setSuppressAllUpdateNotifications:(BOOL)suppressUpdates;
+(BOOL) allowNotifications;
-(void) setAccumulateUpdateNotifications:(BOOL)suppressUpdates;
-(void) itemUpdatedNote; //right now, just on title & icon - for BookmarkButton & BookmarkMenu notes
-(void) itemUpdatedNote; // not everything triggers an item update, only certain properties changing
// Methods called on startup for both bookmark & folder
-(void) refreshIcon;

View File

@ -575,6 +575,13 @@ static unsigned gFirstUserCollection = 0;
- (void)bookmarkChanged:(NSNotification *)aNote
{
if (aNote) {
// have this item rewrite its metadata. |aNote| is non-nil when a bookmark has really
// changed, not when we're using it from other routines to force a write bookmark notification.
id item = [aNote object];
if ([item isKindOfClass:[Bookmark class]])
[item writeBookmarksMetadataToPath:mMetadataPath];
}
NSNotificationQueue* nq = [NSNotificationQueue defaultQueue];
NSNotification *note = [NSNotification notificationWithName:WriteBookmarkNotification object:self userInfo:nil];
[nq enqueueNotification:note postingStyle:NSPostASAP coalesceMask:NSNotificationCoalescingOnName forModes:[NSArray arrayWithObject:NSDefaultRunLoopMode]];