mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
update metadata when an item changes, and make changes to the url trigger an
item update notification.
This commit is contained in:
parent
8f6f8cf984
commit
78c114c9f4
@ -147,6 +147,7 @@ NSString* const URLLoadSuccessKey = @"url_bool";
|
||||
mURL = aURL;
|
||||
[self setStatus:kBookmarkOKStatus];
|
||||
[self refreshIcon];
|
||||
[self itemUpdatedNote];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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]];
|
||||
|
Loading…
Reference in New Issue
Block a user