[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

sullivan sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:11:02 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit cd07843a707b90ba87a0425655cd3bc17e04f3ab
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue May 7 01:27:20 2002 +0000

    	Some improvements to the bookmark changed notifications.
    
    	* Bookmarks.subproj/IFBookmarkGroup.h:
    	* Bookmarks.subproj/IFBookmarkGroup.m:
    	(-[IFBookmarkGroup _sendChangeNotificationForBookmark:childrenChanged:]):
    	(-[IFBookmarkGroup _setTopBookmark:]):
    	(-[IFBookmarkGroup _bookmarkDidChange:]):
    	(-[IFBookmarkGroup _bookmarkChildrenDidChange:]):
    	Send bookmark that changed and whether its children changed as part of
    	change notifications, so clients can choose to do less unnecessary work.
    
    	* Bookmarks.subproj/IFBookmarkLeaf.m:
    	(-[IFBookmarkLeaf setTitle:]): Check for the no-change case
    	and bail out without sending notification when you find it.
    
    	Fixed 2919147 (Organize Bookmarks menu item doesn't do anything).
    
    	First check-in of Bookmarks window. You can remove one or more bookmarks,
    	and you can edit the title & address of existing bookmarks, but that's all
    	so far. Removed the Erase All Bookmarks item from the Debug menu since you
    	can do it easily from the Bookmarks window now. Added keyboard equivalents
    	for the Bookmarks, History, and Activity Viewer windows in the style of
    	Mail. Also miscellaneous cleanups.
    
    	* BookmarksController.h: Added.
    	* BookmarksController.m: Added.
    	(-[BookmarksController shouldCascadeWindows]):
    	(-[BookmarksController _receivedBookmarksChangedNotification:]):
    	(-[BookmarksController _setUpToolbar]):
    	(-[BookmarksController windowDidLoad]):
    	(-[BookmarksController dealloc]):
    	(-[BookmarksController _removeAllBookmarks]):
    	(-[BookmarksController _removeSelectedBookmarks:]):
    	(-[BookmarksController outlineView:child:ofItem:]):
    	(-[BookmarksController outlineView:isItemExpandable:]):
    	(-[BookmarksController outlineView:numberOfChildrenOfItem:]):
    	(-[BookmarksController outlineView:objectValueForTableColumn:byItem:]):
    	(-[BookmarksController outlineView:setObjectValue:forTableColumn:byItem:]):
    	(-[BookmarksController outlineView:willDisplayCell:forTableColumn:item:]):
    	(-[BookmarksController toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:]):
    	(-[BookmarksController toolbarAllowedItemIdentifiers:]):
    	(-[BookmarksController toolbarDefaultItemIdentifiers:]):
    	(-[BookmarksController toolbarDidRemoveItem:]):
    	(-[BookmarksController toolbarWillAddItem:]):
    	(-[BookmarksController validateUserInterfaceItem:]):
    	New class that manages the Bookmarks window.
    
    	* AppController.h:
    	* AppController.m:
    	(-[AppController dealloc]): release bookmarks controller.
    	(-[AppController showBookmarks:]): create bookmarks controller if necessary,
    	and tell it to show its window.
    
    	* BrowserWindow.m:
    	Changed static strings to #defines.
    	(-[BrowserWindow setUpToolbar]): Remove call that explicitly sets toolbar
    	display mode; we've no reason to override the default.
    
    	* Debug/DebugUtilities.m:
    	(-[DebugUtilities createDebugMenu]):
    	Remove Erase All Bookmarks.
    
    	* English.lproj/Bookmarks.nib: New nib file for Bookmarks window.
    
    	* English.lproj/MainMenu.nib: Wired up "Organize Bookmarks..." and
    	"Bookmarks" menu items; added keyboard shortcuts for Window menu items.
    
    	* GlobalHistory.m:
    	(-[GlobalHistory outlineView:objectValueForTableColumn:byItem:]):
    	Changed two isEquals to isEqualToStrings.
    	(-[GlobalHistory _anyURLsSelected]): Replaced anyDatesSelected with this.
    	(-[GlobalHistory updateButtons]): Allow Add to Bookmarks to be enabled even if
    	some dates are selected; just ignore them (at least one non-date has to be selected).
    	(-[GlobalHistory addSelectedItemsToBookmarks:]): Removed obsolete comment.
    
    	* Resources/Images/delete.tiff: New image, stolen for mail, used in Bookmarks window.
    
    	* WebBrowser.pbproj/project.pbxproj: Updated for new files.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1103 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/Bookmarks.subproj/IFBookmarkGroup.h b/WebKit/Bookmarks.subproj/IFBookmarkGroup.h
index df55d7c..c2627b0 100644
--- a/WebKit/Bookmarks.subproj/IFBookmarkGroup.h
+++ b/WebKit/Bookmarks.subproj/IFBookmarkGroup.h
@@ -10,8 +10,16 @@
 #import <WebKit/IFBookmark.h>
 
 // notification sent when bookmarks are added/removed from group, or when bookmarks in group are modified
-#define IFBookmarkGroupChangedNotification		@"IFBookmarkGroupChangedNotification"
+#define IFBookmarkGroupChangedNotification	@"IFBookmarkGroupChangedNotification"
 
+// keys for userInfo for IFBookmarkGroupChangedNotification. These are always present.
+
+// The lowest common ancestor of all the IFBookmark objects that changed.
+#define IFModifiedBookmarkKey			@"IFModifiedBookmarkKey"
+
+// An NSNumber object representing a boolean that distinguishes changes
+// to the bookmark itself from changes to its children.
+#define	IFBookmarkChildrenChangedKey		@"IFBookmarkChildrenChangedKey"
 
 @interface IFBookmarkGroup : NSObject
 {
diff --git a/WebKit/Bookmarks.subproj/IFBookmarkGroup.m b/WebKit/Bookmarks.subproj/IFBookmarkGroup.m
index 05adb69..73696a9 100644
--- a/WebKit/Bookmarks.subproj/IFBookmarkGroup.m
+++ b/WebKit/Bookmarks.subproj/IFBookmarkGroup.m
@@ -51,15 +51,26 @@
     return _topBookmark;
 }
 
-- (void)_sendBookmarkGroupChangedNotification
+- (void)_sendChangeNotificationForBookmark:(IFBookmark *)bookmark
+                           childrenChanged:(BOOL)flag
 {
+    NSDictionary *userInfo;
+
+    WEBKIT_ASSERT (bookmark != nil);
+    
     if (_loading) {
         return;
     }
+
+    userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
+        bookmark, IFModifiedBookmarkKey,
+        [NSNumber numberWithBool:flag], IFBookmarkChildrenChangedKey,
+        nil];
     
     [[NSNotificationCenter defaultCenter]
-        postNotificationName: IFBookmarkGroupChangedNotification
-                      object: self];
+        postNotificationName:IFBookmarkGroupChangedNotification
+                      object:self
+                    userInfo:userInfo];
 }
 
 - (void)_setTopBookmark:(IFBookmark *)newTopBookmark
@@ -86,24 +97,20 @@
     }
 
     if (hadChildren || hasChildrenNow) {
-        [self _sendBookmarkGroupChangedNotification];
+        [self _sendChangeNotificationForBookmark:_topBookmark childrenChanged:YES];
     }
 }
 
 - (void)_bookmarkDidChange:(IFBookmark *)bookmark
 {
-    // FIXME: send enough info that organizing window can know
-    // to only update this item
-    [self _sendBookmarkGroupChangedNotification];
+    [self _sendChangeNotificationForBookmark:bookmark childrenChanged:NO];
 }
 
 - (void)_bookmarkChildrenDidChange:(IFBookmark *)bookmark
 {
     WEBKIT_ASSERT_VALID_ARG (bookmark, ![bookmark isLeaf]);
     
-    // FIXME: send enough info that organizing window can know
-    // to only update this folder deep
-    [self _sendBookmarkGroupChangedNotification];
+    [self _sendChangeNotificationForBookmark:bookmark childrenChanged:YES];
 }
 
 - (void)insertBookmark:(IFBookmark *)bookmark
diff --git a/WebKit/Bookmarks.subproj/IFBookmarkLeaf.m b/WebKit/Bookmarks.subproj/IFBookmarkLeaf.m
index c220ea3..6415961 100644
--- a/WebKit/Bookmarks.subproj/IFBookmarkLeaf.m
+++ b/WebKit/Bookmarks.subproj/IFBookmarkLeaf.m
@@ -78,6 +78,10 @@
 
 - (void)setTitle:(NSString *)title
 {
+    if ([title isEqualToString:[self title]]) {
+        return;
+    }
+    
     [_entry setTitle:title];
 
     [[self _group] _bookmarkDidChange:self];    
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroup.h b/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
index df55d7c..c2627b0 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
+++ b/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
@@ -10,8 +10,16 @@
 #import <WebKit/IFBookmark.h>
 
 // notification sent when bookmarks are added/removed from group, or when bookmarks in group are modified
-#define IFBookmarkGroupChangedNotification		@"IFBookmarkGroupChangedNotification"
+#define IFBookmarkGroupChangedNotification	@"IFBookmarkGroupChangedNotification"
 
+// keys for userInfo for IFBookmarkGroupChangedNotification. These are always present.
+
+// The lowest common ancestor of all the IFBookmark objects that changed.
+#define IFModifiedBookmarkKey			@"IFModifiedBookmarkKey"
+
+// An NSNumber object representing a boolean that distinguishes changes
+// to the bookmark itself from changes to its children.
+#define	IFBookmarkChildrenChangedKey		@"IFBookmarkChildrenChangedKey"
 
 @interface IFBookmarkGroup : NSObject
 {
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroup.m b/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
index 05adb69..73696a9 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
+++ b/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
@@ -51,15 +51,26 @@
     return _topBookmark;
 }
 
-- (void)_sendBookmarkGroupChangedNotification
+- (void)_sendChangeNotificationForBookmark:(IFBookmark *)bookmark
+                           childrenChanged:(BOOL)flag
 {
+    NSDictionary *userInfo;
+
+    WEBKIT_ASSERT (bookmark != nil);
+    
     if (_loading) {
         return;
     }
+
+    userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
+        bookmark, IFModifiedBookmarkKey,
+        [NSNumber numberWithBool:flag], IFBookmarkChildrenChangedKey,
+        nil];
     
     [[NSNotificationCenter defaultCenter]
-        postNotificationName: IFBookmarkGroupChangedNotification
-                      object: self];
+        postNotificationName:IFBookmarkGroupChangedNotification
+                      object:self
+                    userInfo:userInfo];
 }
 
 - (void)_setTopBookmark:(IFBookmark *)newTopBookmark
@@ -86,24 +97,20 @@
     }
 
     if (hadChildren || hasChildrenNow) {
-        [self _sendBookmarkGroupChangedNotification];
+        [self _sendChangeNotificationForBookmark:_topBookmark childrenChanged:YES];
     }
 }
 
 - (void)_bookmarkDidChange:(IFBookmark *)bookmark
 {
-    // FIXME: send enough info that organizing window can know
-    // to only update this item
-    [self _sendBookmarkGroupChangedNotification];
+    [self _sendChangeNotificationForBookmark:bookmark childrenChanged:NO];
 }
 
 - (void)_bookmarkChildrenDidChange:(IFBookmark *)bookmark
 {
     WEBKIT_ASSERT_VALID_ARG (bookmark, ![bookmark isLeaf]);
     
-    // FIXME: send enough info that organizing window can know
-    // to only update this folder deep
-    [self _sendBookmarkGroupChangedNotification];
+    [self _sendChangeNotificationForBookmark:bookmark childrenChanged:YES];
 }
 
 - (void)insertBookmark:(IFBookmark *)bookmark
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m b/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
index c220ea3..6415961 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
+++ b/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
@@ -78,6 +78,10 @@
 
 - (void)setTitle:(NSString *)title
 {
+    if ([title isEqualToString:[self title]]) {
+        return;
+    }
+    
     [_entry setTitle:title];
 
     [[self _group] _bookmarkDidChange:self];    
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 823fe27..98fb864 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,20 @@
+2002-05-06  John Sullivan  <sullivan at apple.com>
+
+	Some improvements to the bookmark changed notifications.
+
+	* Bookmarks.subproj/IFBookmarkGroup.h:
+	* Bookmarks.subproj/IFBookmarkGroup.m:
+	(-[IFBookmarkGroup _sendChangeNotificationForBookmark:childrenChanged:]):
+	(-[IFBookmarkGroup _setTopBookmark:]):
+	(-[IFBookmarkGroup _bookmarkDidChange:]):
+	(-[IFBookmarkGroup _bookmarkChildrenDidChange:]):
+	Send bookmark that changed and whether its children changed as part of
+	change notifications, so clients can choose to do less unnecessary work.
+
+	* Bookmarks.subproj/IFBookmarkLeaf.m:
+	(-[IFBookmarkLeaf setTitle:]): Check for the no-change case
+	and bail out without sending notification when you find it.
+
 2002-05-06  Darin Adler  <darin at apple.com>
 
 	* WebKitPrefix.h: Added.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 823fe27..98fb864 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,20 @@
+2002-05-06  John Sullivan  <sullivan at apple.com>
+
+	Some improvements to the bookmark changed notifications.
+
+	* Bookmarks.subproj/IFBookmarkGroup.h:
+	* Bookmarks.subproj/IFBookmarkGroup.m:
+	(-[IFBookmarkGroup _sendChangeNotificationForBookmark:childrenChanged:]):
+	(-[IFBookmarkGroup _setTopBookmark:]):
+	(-[IFBookmarkGroup _bookmarkDidChange:]):
+	(-[IFBookmarkGroup _bookmarkChildrenDidChange:]):
+	Send bookmark that changed and whether its children changed as part of
+	change notifications, so clients can choose to do less unnecessary work.
+
+	* Bookmarks.subproj/IFBookmarkLeaf.m:
+	(-[IFBookmarkLeaf setTitle:]): Check for the no-change case
+	and bail out without sending notification when you find it.
+
 2002-05-06  Darin Adler  <darin at apple.com>
 
 	* WebKitPrefix.h: Added.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list