[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:10:34 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b92696c58ca7e6cbf302d9595cce73fd5389998e
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu May 2 23:57:40 2002 +0000

    	* Bookmarks.subproj/IFBookmark.h:
    	* Bookmarks.subproj/IFBookmark.m:
    	(-[IFBookmark setTitle:]):
    	(-[IFBookmark setImage:]):
    	(-[IFBookmark setURLString:]):
    	(-[IFBookmark insertChild:atIndex:]):
    	(-[IFBookmark removeChild:]):
    	(-[IFBookmark _parent]):
    	(-[IFBookmark _group]):
    	* Bookmarks.subproj/IFBookmarkGroup.h:
    	* Bookmarks.subproj/IFBookmarkGroup.m:
    	(-[IFBookmarkGroup _resetTopBookmark]):
    	(-[IFBookmarkGroup _bookmarkDidChange:]):
    	(-[IFBookmarkGroup _bookmarkChildrenDidChange:]):
    	(-[IFBookmarkGroup removeBookmark:]):
    	(-[IFBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:withTitle:image:URLString:isLeaf:]):
    	* Bookmarks.subproj/IFBookmarkLeaf.m:
    	(-[IFBookmarkLeaf setTitle:]):
    	(-[IFBookmarkLeaf setImage:]):
    	(-[IFBookmarkLeaf setURLString:]):
    	* Bookmarks.subproj/IFBookmarkList.m:
    	(-[IFBookmarkList setTitle:]):
    	(-[IFBookmarkList setImage:]):
    	(-[IFBookmarkList removeChild:]):
    	(-[IFBookmarkList insertChild:atIndex:]):
    	* Bookmarks.subproj/IFBookmark_Private.h:
    	Made _parent and _group private; made setTitle, setImage, setURLString,
    	insertChild:atIndex:, and removeChild: public.
    
    	* Bookmarks.subproj/IFBookmarkGroup_Private.h: Added.
    	* WebKit.pbproj/project.pbxproj: Changed for new file.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1090 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/Bookmarks.subproj/IFBookmark.h b/WebKit/Bookmarks.subproj/IFBookmark.h
index 84c69ed..8c2864d 100644
--- a/WebKit/Bookmarks.subproj/IFBookmark.h
+++ b/WebKit/Bookmarks.subproj/IFBookmark.h
@@ -16,7 +16,10 @@
 }
 
 - (NSString *)title;
+- (void)setTitle:(NSString *)title;
+
 - (NSImage *)image;
+- (void)setImage:(NSImage *)image;
 
 // Distinguishes a single bookmark from a list 
 - (BOOL)isLeaf;
@@ -25,17 +28,20 @@
 // This is nil if isLeaf returns NO.
 - (NSString *)URLString;
 
-// Array of child IFBookmarks. This is nil if isLeaf returns YES.
+// Sets the string intended to represent URL for leaf bookmarks. URLString need not be
+// a valid URL string. Does nothing if isLeaf returns NO.
+- (void)setURLString:(NSString *)URLString;
+
+// Array of child IFBookmarks. Returns nil if isLeaf returns YES.
 - (NSArray *)children;
 
-// Number of children. This is 0 if isLeaf returns YES.
+// Number of children. Returns 0 if isLeaf returns YES.
 - (unsigned)numberOfChildren;
 
-// The list of bookmarks containing this one.
-- (IFBookmark *)parent;
+// Insert a bookmark into the list. Does nothing if isLeaf returns YES.
+- (void)insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index;
 
-// The IFBookmarkGroup containing this bookmark. To make changes to a bookmark,
-// use methods on its group.
-- (IFBookmarkGroup *)group;
+// Remove a bookmark from the list. Does nothing if isLeaf returns YES.
+- (void)removeChild:(IFBookmark *)bookmark;
 
 @end
diff --git a/WebKit/Bookmarks.subproj/IFBookmark.m b/WebKit/Bookmarks.subproj/IFBookmark.m
index ab45200..a9260d8 100644
--- a/WebKit/Bookmarks.subproj/IFBookmark.m
+++ b/WebKit/Bookmarks.subproj/IFBookmark.m
@@ -28,7 +28,7 @@
     return nil;
 }
 
-- (void)_setTitle:(NSString *)title
+- (void)setTitle:(NSString *)title
 {
     NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
@@ -39,7 +39,7 @@
     return nil;
 }
 
-- (void)_setImage:(NSImage *)image
+- (void)setImage:(NSImage *)image
 {
     NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
@@ -55,7 +55,7 @@
     return nil;
 }
 
-- (void)_setURLString:(NSString *)URLString
+- (void)setURLString:(NSString *)URLString
 {
     if ([self isLeaf]) {
         NSRequestConcreteImplementation(self, _cmd, [self class]);
@@ -78,21 +78,21 @@
     return 0;
 }
 
-- (void)_insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index
+- (void)insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index
 {
     if (![self isLeaf]) {
         NSRequestConcreteImplementation(self, _cmd, [self class]);
     }
 }
 
-- (void)_removeChild:(IFBookmark *)bookmark
+- (void)removeChild:(IFBookmark *)bookmark
 {
     if (![self isLeaf]) {
         NSRequestConcreteImplementation(self, _cmd, [self class]);
     }
 }
 
-- (IFBookmark *)parent
+- (IFBookmark *)_parent
 {
     return _parent;
 }
@@ -104,7 +104,7 @@
     _parent = parent;
 }
 
-- (IFBookmarkGroup *)group
+- (IFBookmarkGroup *)_group
 {
     return _group;
 }
diff --git a/WebKit/Bookmarks.subproj/IFBookmarkGroup.h b/WebKit/Bookmarks.subproj/IFBookmarkGroup.h
index 5c340d2..ae43a1d 100644
--- a/WebKit/Bookmarks.subproj/IFBookmarkGroup.h
+++ b/WebKit/Bookmarks.subproj/IFBookmarkGroup.h
@@ -42,10 +42,6 @@
                            image:(NSImage *)newImage
                        URLString:(NSString *)newURLString
                           isLeaf:(BOOL)flag;
-- (void)updateBookmark:(IFBookmark *)bookmark
-                 title:(NSString *)newTitle
-                 image:(NSString *)newImage
-             URLString:(NSString *)newURLString;
 
 // storing contents on disk
 
diff --git a/WebKit/Bookmarks.subproj/IFBookmarkGroup.m b/WebKit/Bookmarks.subproj/IFBookmarkGroup.m
index f510508..bd4db51 100644
--- a/WebKit/Bookmarks.subproj/IFBookmarkGroup.m
+++ b/WebKit/Bookmarks.subproj/IFBookmarkGroup.m
@@ -7,11 +7,16 @@
 //
 
 #import <WebKit/IFBookmarkGroup.h>
+#import <WebKit/IFBookmarkGroup_Private.h>
 #import <WebKit/IFBookmark_Private.h>
 #import <WebKit/IFBookmarkList.h>
 #import <WebKit/IFBookmarkLeaf.h>
 #import <WebKit/WebKitDebug.h>
 
+ at interface IFBookmarkGroup (IFForwardDeclarations)
+- (void)_resetTopBookmark;
+ at end
+
 @implementation IFBookmarkGroup
 
 + (IFBookmarkGroup *)bookmarkGroupWithFile: (NSString *)file
@@ -19,13 +24,6 @@
     return [[[IFBookmarkGroup alloc] initWithFile:file] autorelease];
 }
 
-- (void)_resetTopBookmark
-{
-    [_topBookmark _setGroup:nil];
-    [_topBookmark autorelease];
-    _topBookmark = [[[IFBookmarkList alloc] initWithTitle:nil image:nil group:self] retain];
-}
-
 - (id)initWithFile: (NSString *)file
 {
     if (![super init]) {
@@ -60,6 +58,42 @@
                       object: self];
 }
 
+- (void)_resetTopBookmark
+{
+    BOOL hadChildren;
+
+    hadChildren = [_topBookmark numberOfChildren] > 0;
+    
+    // bail out early if nothing needs resetting
+    if (!hadChildren && _topBookmark != nil) {
+        return;
+    }
+
+    [_topBookmark _setGroup:nil];
+    [_topBookmark autorelease];
+    _topBookmark = [[[IFBookmarkList alloc] initWithTitle:nil image:nil group:self] retain];
+
+    if (hadChildren) {
+        [self _sendBookmarkGroupChangedNotification];
+    }
+}
+
+- (void)_bookmarkDidChange:(IFBookmark *)bookmark
+{
+    // FIXME: send enough info that organizing window can know
+    // to only update this item
+    [self _sendBookmarkGroupChangedNotification];
+}
+
+- (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];
+}
+
 - (void)insertBookmark:(IFBookmark *)bookmark
                atIndex:(unsigned)index
             ofBookmark:(IFBookmark *)parent
@@ -69,17 +103,15 @@
 
 - (void)removeBookmark:(IFBookmark *)bookmark
 {
-    WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark group] == self);
-    WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark parent] != nil || bookmark == _topBookmark);
+    WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark _group] == self);
+    WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark _parent] != nil || bookmark == _topBookmark);
 
     if (bookmark == _topBookmark) {
         [self _resetTopBookmark];
     } else {
-        [[bookmark parent] _removeChild:bookmark];
+        [[bookmark _parent] removeChild:bookmark];
         [bookmark _setGroup:nil];
     }
-    
-    [self _sendBookmarkGroupChangedNotification];
 }
 
 - (void)addNewBookmarkToBookmark:(IFBookmark *)parent
@@ -105,7 +137,7 @@
 {
     IFBookmark *bookmark;
 
-    WEBKIT_ASSERT_VALID_ARG (parent, [parent group] == self);
+    WEBKIT_ASSERT_VALID_ARG (parent, [parent _group] == self);
     WEBKIT_ASSERT_VALID_ARG (parent, ![parent isLeaf]);
     WEBKIT_ASSERT_VALID_ARG (newURLString, flag ? (newURLString != nil) : (newURLString == nil));
 
@@ -120,16 +152,7 @@
                                                     group:self] autorelease];
     }
 
-    [parent _insertChild:bookmark atIndex:index];
-    [self _sendBookmarkGroupChangedNotification];
-}
-
-- (void)updateBookmark:(IFBookmark *)bookmark
-                 title:(NSString *)newTitle
-                 image:(NSString *)newImage
-             URLString:(NSString *)newURLString
-{
-    _logNotYetImplemented();
+    [parent insertChild:bookmark atIndex:index];
 }
 
 - (NSString *)file
diff --git a/WebKit/Bookmarks.subproj/IFBookmarkGroup_Private.h b/WebKit/Bookmarks.subproj/IFBookmarkGroup_Private.h
new file mode 100644
index 0000000..0d6c275
--- /dev/null
+++ b/WebKit/Bookmarks.subproj/IFBookmarkGroup_Private.h
@@ -0,0 +1,18 @@
+/*
+ *  IFBookmarkGroup_Private.h
+ *  WebKit
+ *
+ *  Created by John Sullivan on Thu May 2 2002.
+ *  Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+ *
+ */
+
+#import <WebKit/IFBookmarkGroup.h>
+
+ at interface IFBookmarkGroup(IFPrivate)
+
+- (void)_bookmarkDidChange:(IFBookmark *)bookmark;
+- (void)_bookmarkChildrenDidChange:(IFBookmark *)bookmark;
+
+ at end
+
diff --git a/WebKit/Bookmarks.subproj/IFBookmarkLeaf.m b/WebKit/Bookmarks.subproj/IFBookmarkLeaf.m
index 1a4328d..b96fd9b 100644
--- a/WebKit/Bookmarks.subproj/IFBookmarkLeaf.m
+++ b/WebKit/Bookmarks.subproj/IFBookmarkLeaf.m
@@ -9,6 +9,7 @@
 #import <WebKit/IFBookmarkLeaf.h>
 #import <WebKit/IFBookmark_Private.h>
 #import <WebKit/IFBookmarkGroup.h>
+#import <WebKit/IFBookmarkGroup_Private.h>
 #import <WebKit/IFURIEntry.h>
 #import <WebKit/WebKitDebug.h>
 
@@ -45,9 +46,11 @@
     return [_entry title];
 }
 
-- (void)_setTitle:(NSString *)title
+- (void)setTitle:(NSString *)title
 {
     [_entry setTitle:title];
+
+    [[self _group] _bookmarkDidChange:self];    
 }
 
 - (NSImage *)image
@@ -55,9 +58,11 @@
     return [_entry image];
 }
 
-- (void)_setImage:(NSImage *)image
+- (void)setImage:(NSImage *)image
 {
     [_entry setImage:image];
+
+    [[self _group] _bookmarkDidChange:self];    
 }
 
 - (BOOL)isLeaf
@@ -70,13 +75,16 @@
     return _URLString;
 }
 
-- (void)_setURLString:(NSString *)URLString
+- (void)setURLString:(NSString *)URLString
 {
-    NSString *oldValue;
+    if ([URLString isEqualToString:_URLString]) {
+        return;
+    }
 
-    oldValue = _URLString;
+    [_URLString release];
     _URLString = [[NSString stringWithString:URLString] retain];
-    [oldValue release];
+
+    [[self _group] _bookmarkDidChange:self];    
 }
 
 @end
diff --git a/WebKit/Bookmarks.subproj/IFBookmarkList.m b/WebKit/Bookmarks.subproj/IFBookmarkList.m
index 250dbf1..e4a0875 100644
--- a/WebKit/Bookmarks.subproj/IFBookmarkList.m
+++ b/WebKit/Bookmarks.subproj/IFBookmarkList.m
@@ -8,6 +8,7 @@
 
 #import <WebKit/IFBookmarkList.h>
 #import <WebKit/IFBookmark_Private.h>
+#import <WebKit/IFBookmarkGroup_Private.h>
 #import <WebKit/WebKitDebug.h>
 
 @implementation IFBookmarkList
@@ -41,13 +42,16 @@
     return _title;
 }
 
-- (void)_setTitle:(NSString *)title
+- (void)setTitle:(NSString *)title
 {
-    NSString *oldTitle;
+    if ([title isEqualToString:_title]) {
+        return;
+    }
 
-    oldTitle = _title;
+    [_title release];
     _title = [[NSString stringWithString:title] retain];
-    [oldTitle release];
+
+    [[self _group] _bookmarkDidChange:self]; 
 }
 
 - (NSImage *)image
@@ -55,11 +59,17 @@
     return _image;
 }
 
-- (void)_setImage:(NSImage *)image
+- (void)setImage:(NSImage *)image
 {
+    if ([image isEqual:_image]) {
+        return;
+    }
+    
     [image retain];
     [_image release];
     _image = image;
+
+    [[self _group] _bookmarkDidChange:self]; 
 }
 
 - (BOOL)isLeaf
@@ -77,17 +87,22 @@
     return [_list count];
 }
 
-- (void)_removeChild:(IFBookmark *)bookmark
+- (void)removeChild:(IFBookmark *)bookmark
 {
-    WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark parent] == self);
+    WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark _parent] == self);
     [_list removeObject:bookmark];
     [bookmark _setParent:nil];
+
+    [[self _group] _bookmarkChildrenDidChange:self]; 
 }
 
 
-- (void)_insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index
+- (void)insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index
 {
     [_list insertObject:bookmark atIndex:index];
+    [bookmark _setParent:self];
+    
+    [[self _group] _bookmarkChildrenDidChange:self]; 
 }
 
 @end
diff --git a/WebKit/Bookmarks.subproj/IFBookmark_Private.h b/WebKit/Bookmarks.subproj/IFBookmark_Private.h
index 29e5c67..e450ab2 100644
--- a/WebKit/Bookmarks.subproj/IFBookmark_Private.h
+++ b/WebKit/Bookmarks.subproj/IFBookmark_Private.h
@@ -11,13 +11,11 @@
 
 @interface IFBookmark(IFPrivate)
 
-- (void)_setTitle:(NSString *)title;
-- (void)_setImage:(NSImage *)image;
-- (void)_setURLString:(NSString *)URLString;
+- (IFBookmark *)_parent;
 - (void)_setParent:(IFBookmark *)parent;
+
+- (IFBookmarkGroup *)_group;
 - (void)_setGroup:(IFBookmarkGroup *)group;
-- (void)_insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index;
-- (void)_removeChild:(IFBookmark *)bookmark;
 
 @end
 
diff --git a/WebKit/Bookmarks.subproj/WebBookmark.h b/WebKit/Bookmarks.subproj/WebBookmark.h
index 84c69ed..8c2864d 100644
--- a/WebKit/Bookmarks.subproj/WebBookmark.h
+++ b/WebKit/Bookmarks.subproj/WebBookmark.h
@@ -16,7 +16,10 @@
 }
 
 - (NSString *)title;
+- (void)setTitle:(NSString *)title;
+
 - (NSImage *)image;
+- (void)setImage:(NSImage *)image;
 
 // Distinguishes a single bookmark from a list 
 - (BOOL)isLeaf;
@@ -25,17 +28,20 @@
 // This is nil if isLeaf returns NO.
 - (NSString *)URLString;
 
-// Array of child IFBookmarks. This is nil if isLeaf returns YES.
+// Sets the string intended to represent URL for leaf bookmarks. URLString need not be
+// a valid URL string. Does nothing if isLeaf returns NO.
+- (void)setURLString:(NSString *)URLString;
+
+// Array of child IFBookmarks. Returns nil if isLeaf returns YES.
 - (NSArray *)children;
 
-// Number of children. This is 0 if isLeaf returns YES.
+// Number of children. Returns 0 if isLeaf returns YES.
 - (unsigned)numberOfChildren;
 
-// The list of bookmarks containing this one.
-- (IFBookmark *)parent;
+// Insert a bookmark into the list. Does nothing if isLeaf returns YES.
+- (void)insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index;
 
-// The IFBookmarkGroup containing this bookmark. To make changes to a bookmark,
-// use methods on its group.
-- (IFBookmarkGroup *)group;
+// Remove a bookmark from the list. Does nothing if isLeaf returns YES.
+- (void)removeChild:(IFBookmark *)bookmark;
 
 @end
diff --git a/WebKit/Bookmarks.subproj/WebBookmark.m b/WebKit/Bookmarks.subproj/WebBookmark.m
index ab45200..a9260d8 100644
--- a/WebKit/Bookmarks.subproj/WebBookmark.m
+++ b/WebKit/Bookmarks.subproj/WebBookmark.m
@@ -28,7 +28,7 @@
     return nil;
 }
 
-- (void)_setTitle:(NSString *)title
+- (void)setTitle:(NSString *)title
 {
     NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
@@ -39,7 +39,7 @@
     return nil;
 }
 
-- (void)_setImage:(NSImage *)image
+- (void)setImage:(NSImage *)image
 {
     NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
@@ -55,7 +55,7 @@
     return nil;
 }
 
-- (void)_setURLString:(NSString *)URLString
+- (void)setURLString:(NSString *)URLString
 {
     if ([self isLeaf]) {
         NSRequestConcreteImplementation(self, _cmd, [self class]);
@@ -78,21 +78,21 @@
     return 0;
 }
 
-- (void)_insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index
+- (void)insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index
 {
     if (![self isLeaf]) {
         NSRequestConcreteImplementation(self, _cmd, [self class]);
     }
 }
 
-- (void)_removeChild:(IFBookmark *)bookmark
+- (void)removeChild:(IFBookmark *)bookmark
 {
     if (![self isLeaf]) {
         NSRequestConcreteImplementation(self, _cmd, [self class]);
     }
 }
 
-- (IFBookmark *)parent
+- (IFBookmark *)_parent
 {
     return _parent;
 }
@@ -104,7 +104,7 @@
     _parent = parent;
 }
 
-- (IFBookmarkGroup *)group
+- (IFBookmarkGroup *)_group
 {
     return _group;
 }
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroup.h b/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
index 5c340d2..ae43a1d 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
+++ b/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
@@ -42,10 +42,6 @@
                            image:(NSImage *)newImage
                        URLString:(NSString *)newURLString
                           isLeaf:(BOOL)flag;
-- (void)updateBookmark:(IFBookmark *)bookmark
-                 title:(NSString *)newTitle
-                 image:(NSString *)newImage
-             URLString:(NSString *)newURLString;
 
 // storing contents on disk
 
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroup.m b/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
index f510508..bd4db51 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
+++ b/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
@@ -7,11 +7,16 @@
 //
 
 #import <WebKit/IFBookmarkGroup.h>
+#import <WebKit/IFBookmarkGroup_Private.h>
 #import <WebKit/IFBookmark_Private.h>
 #import <WebKit/IFBookmarkList.h>
 #import <WebKit/IFBookmarkLeaf.h>
 #import <WebKit/WebKitDebug.h>
 
+ at interface IFBookmarkGroup (IFForwardDeclarations)
+- (void)_resetTopBookmark;
+ at end
+
 @implementation IFBookmarkGroup
 
 + (IFBookmarkGroup *)bookmarkGroupWithFile: (NSString *)file
@@ -19,13 +24,6 @@
     return [[[IFBookmarkGroup alloc] initWithFile:file] autorelease];
 }
 
-- (void)_resetTopBookmark
-{
-    [_topBookmark _setGroup:nil];
-    [_topBookmark autorelease];
-    _topBookmark = [[[IFBookmarkList alloc] initWithTitle:nil image:nil group:self] retain];
-}
-
 - (id)initWithFile: (NSString *)file
 {
     if (![super init]) {
@@ -60,6 +58,42 @@
                       object: self];
 }
 
+- (void)_resetTopBookmark
+{
+    BOOL hadChildren;
+
+    hadChildren = [_topBookmark numberOfChildren] > 0;
+    
+    // bail out early if nothing needs resetting
+    if (!hadChildren && _topBookmark != nil) {
+        return;
+    }
+
+    [_topBookmark _setGroup:nil];
+    [_topBookmark autorelease];
+    _topBookmark = [[[IFBookmarkList alloc] initWithTitle:nil image:nil group:self] retain];
+
+    if (hadChildren) {
+        [self _sendBookmarkGroupChangedNotification];
+    }
+}
+
+- (void)_bookmarkDidChange:(IFBookmark *)bookmark
+{
+    // FIXME: send enough info that organizing window can know
+    // to only update this item
+    [self _sendBookmarkGroupChangedNotification];
+}
+
+- (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];
+}
+
 - (void)insertBookmark:(IFBookmark *)bookmark
                atIndex:(unsigned)index
             ofBookmark:(IFBookmark *)parent
@@ -69,17 +103,15 @@
 
 - (void)removeBookmark:(IFBookmark *)bookmark
 {
-    WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark group] == self);
-    WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark parent] != nil || bookmark == _topBookmark);
+    WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark _group] == self);
+    WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark _parent] != nil || bookmark == _topBookmark);
 
     if (bookmark == _topBookmark) {
         [self _resetTopBookmark];
     } else {
-        [[bookmark parent] _removeChild:bookmark];
+        [[bookmark _parent] removeChild:bookmark];
         [bookmark _setGroup:nil];
     }
-    
-    [self _sendBookmarkGroupChangedNotification];
 }
 
 - (void)addNewBookmarkToBookmark:(IFBookmark *)parent
@@ -105,7 +137,7 @@
 {
     IFBookmark *bookmark;
 
-    WEBKIT_ASSERT_VALID_ARG (parent, [parent group] == self);
+    WEBKIT_ASSERT_VALID_ARG (parent, [parent _group] == self);
     WEBKIT_ASSERT_VALID_ARG (parent, ![parent isLeaf]);
     WEBKIT_ASSERT_VALID_ARG (newURLString, flag ? (newURLString != nil) : (newURLString == nil));
 
@@ -120,16 +152,7 @@
                                                     group:self] autorelease];
     }
 
-    [parent _insertChild:bookmark atIndex:index];
-    [self _sendBookmarkGroupChangedNotification];
-}
-
-- (void)updateBookmark:(IFBookmark *)bookmark
-                 title:(NSString *)newTitle
-                 image:(NSString *)newImage
-             URLString:(NSString *)newURLString
-{
-    _logNotYetImplemented();
+    [parent insertChild:bookmark atIndex:index];
 }
 
 - (NSString *)file
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroupPrivate.h b/WebKit/Bookmarks.subproj/WebBookmarkGroupPrivate.h
new file mode 100644
index 0000000..0d6c275
--- /dev/null
+++ b/WebKit/Bookmarks.subproj/WebBookmarkGroupPrivate.h
@@ -0,0 +1,18 @@
+/*
+ *  IFBookmarkGroup_Private.h
+ *  WebKit
+ *
+ *  Created by John Sullivan on Thu May 2 2002.
+ *  Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+ *
+ */
+
+#import <WebKit/IFBookmarkGroup.h>
+
+ at interface IFBookmarkGroup(IFPrivate)
+
+- (void)_bookmarkDidChange:(IFBookmark *)bookmark;
+- (void)_bookmarkChildrenDidChange:(IFBookmark *)bookmark;
+
+ at end
+
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m b/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
index 1a4328d..b96fd9b 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
+++ b/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
@@ -9,6 +9,7 @@
 #import <WebKit/IFBookmarkLeaf.h>
 #import <WebKit/IFBookmark_Private.h>
 #import <WebKit/IFBookmarkGroup.h>
+#import <WebKit/IFBookmarkGroup_Private.h>
 #import <WebKit/IFURIEntry.h>
 #import <WebKit/WebKitDebug.h>
 
@@ -45,9 +46,11 @@
     return [_entry title];
 }
 
-- (void)_setTitle:(NSString *)title
+- (void)setTitle:(NSString *)title
 {
     [_entry setTitle:title];
+
+    [[self _group] _bookmarkDidChange:self];    
 }
 
 - (NSImage *)image
@@ -55,9 +58,11 @@
     return [_entry image];
 }
 
-- (void)_setImage:(NSImage *)image
+- (void)setImage:(NSImage *)image
 {
     [_entry setImage:image];
+
+    [[self _group] _bookmarkDidChange:self];    
 }
 
 - (BOOL)isLeaf
@@ -70,13 +75,16 @@
     return _URLString;
 }
 
-- (void)_setURLString:(NSString *)URLString
+- (void)setURLString:(NSString *)URLString
 {
-    NSString *oldValue;
+    if ([URLString isEqualToString:_URLString]) {
+        return;
+    }
 
-    oldValue = _URLString;
+    [_URLString release];
     _URLString = [[NSString stringWithString:URLString] retain];
-    [oldValue release];
+
+    [[self _group] _bookmarkDidChange:self];    
 }
 
 @end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkList.m b/WebKit/Bookmarks.subproj/WebBookmarkList.m
index 250dbf1..e4a0875 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkList.m
+++ b/WebKit/Bookmarks.subproj/WebBookmarkList.m
@@ -8,6 +8,7 @@
 
 #import <WebKit/IFBookmarkList.h>
 #import <WebKit/IFBookmark_Private.h>
+#import <WebKit/IFBookmarkGroup_Private.h>
 #import <WebKit/WebKitDebug.h>
 
 @implementation IFBookmarkList
@@ -41,13 +42,16 @@
     return _title;
 }
 
-- (void)_setTitle:(NSString *)title
+- (void)setTitle:(NSString *)title
 {
-    NSString *oldTitle;
+    if ([title isEqualToString:_title]) {
+        return;
+    }
 
-    oldTitle = _title;
+    [_title release];
     _title = [[NSString stringWithString:title] retain];
-    [oldTitle release];
+
+    [[self _group] _bookmarkDidChange:self]; 
 }
 
 - (NSImage *)image
@@ -55,11 +59,17 @@
     return _image;
 }
 
-- (void)_setImage:(NSImage *)image
+- (void)setImage:(NSImage *)image
 {
+    if ([image isEqual:_image]) {
+        return;
+    }
+    
     [image retain];
     [_image release];
     _image = image;
+
+    [[self _group] _bookmarkDidChange:self]; 
 }
 
 - (BOOL)isLeaf
@@ -77,17 +87,22 @@
     return [_list count];
 }
 
-- (void)_removeChild:(IFBookmark *)bookmark
+- (void)removeChild:(IFBookmark *)bookmark
 {
-    WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark parent] == self);
+    WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark _parent] == self);
     [_list removeObject:bookmark];
     [bookmark _setParent:nil];
+
+    [[self _group] _bookmarkChildrenDidChange:self]; 
 }
 
 
-- (void)_insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index
+- (void)insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index
 {
     [_list insertObject:bookmark atIndex:index];
+    [bookmark _setParent:self];
+    
+    [[self _group] _bookmarkChildrenDidChange:self]; 
 }
 
 @end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkPrivate.h b/WebKit/Bookmarks.subproj/WebBookmarkPrivate.h
index 29e5c67..e450ab2 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkPrivate.h
+++ b/WebKit/Bookmarks.subproj/WebBookmarkPrivate.h
@@ -11,13 +11,11 @@
 
 @interface IFBookmark(IFPrivate)
 
-- (void)_setTitle:(NSString *)title;
-- (void)_setImage:(NSImage *)image;
-- (void)_setURLString:(NSString *)URLString;
+- (IFBookmark *)_parent;
 - (void)_setParent:(IFBookmark *)parent;
+
+- (IFBookmarkGroup *)_group;
 - (void)_setGroup:(IFBookmarkGroup *)group;
-- (void)_insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index;
-- (void)_removeChild:(IFBookmark *)bookmark;
 
 @end
 
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index fb15480..5dfc0c4 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,43 @@
 2002-05-02  John Sullivan  <sullivan at apple.com>
 
+	Changed API such that mutating methods can now be called on bookmark objects,
+	which in turn tell their group that they have changed (so the group can send
+	out notifications).
+
+	* Bookmarks.subproj/IFBookmark.h:
+	* Bookmarks.subproj/IFBookmark.m:
+	(-[IFBookmark setTitle:]):
+	(-[IFBookmark setImage:]):
+	(-[IFBookmark setURLString:]):
+	(-[IFBookmark insertChild:atIndex:]):
+	(-[IFBookmark removeChild:]):
+	(-[IFBookmark _parent]):
+	(-[IFBookmark _group]):
+	* Bookmarks.subproj/IFBookmarkGroup.h:
+	* Bookmarks.subproj/IFBookmarkGroup.m:
+	(-[IFBookmarkGroup _resetTopBookmark]):
+	(-[IFBookmarkGroup _bookmarkDidChange:]):
+	(-[IFBookmarkGroup _bookmarkChildrenDidChange:]):
+	(-[IFBookmarkGroup removeBookmark:]):
+	(-[IFBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:withTitle:image:URLString:isLeaf:]):
+	* Bookmarks.subproj/IFBookmarkLeaf.m:
+	(-[IFBookmarkLeaf setTitle:]):
+	(-[IFBookmarkLeaf setImage:]):
+	(-[IFBookmarkLeaf setURLString:]):
+	* Bookmarks.subproj/IFBookmarkList.m:
+	(-[IFBookmarkList setTitle:]):
+	(-[IFBookmarkList setImage:]):
+	(-[IFBookmarkList removeChild:]):
+	(-[IFBookmarkList insertChild:atIndex:]):
+	* Bookmarks.subproj/IFBookmark_Private.h:
+	Made _parent and _group private; made setTitle, setImage, setURLString,
+	insertChild:atIndex:, and removeChild: public.
+
+	* Bookmarks.subproj/IFBookmarkGroup_Private.h: Added.
+	* WebKit.pbproj/project.pbxproj: Changed for new file.
+
+2002-05-02  John Sullivan  <sullivan at apple.com>
+
 	Implemented removing the root node bookmark (i.e.,
 	removing all bookmarks with one call).
 
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index fb15480..5dfc0c4 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,43 @@
 2002-05-02  John Sullivan  <sullivan at apple.com>
 
+	Changed API such that mutating methods can now be called on bookmark objects,
+	which in turn tell their group that they have changed (so the group can send
+	out notifications).
+
+	* Bookmarks.subproj/IFBookmark.h:
+	* Bookmarks.subproj/IFBookmark.m:
+	(-[IFBookmark setTitle:]):
+	(-[IFBookmark setImage:]):
+	(-[IFBookmark setURLString:]):
+	(-[IFBookmark insertChild:atIndex:]):
+	(-[IFBookmark removeChild:]):
+	(-[IFBookmark _parent]):
+	(-[IFBookmark _group]):
+	* Bookmarks.subproj/IFBookmarkGroup.h:
+	* Bookmarks.subproj/IFBookmarkGroup.m:
+	(-[IFBookmarkGroup _resetTopBookmark]):
+	(-[IFBookmarkGroup _bookmarkDidChange:]):
+	(-[IFBookmarkGroup _bookmarkChildrenDidChange:]):
+	(-[IFBookmarkGroup removeBookmark:]):
+	(-[IFBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:withTitle:image:URLString:isLeaf:]):
+	* Bookmarks.subproj/IFBookmarkLeaf.m:
+	(-[IFBookmarkLeaf setTitle:]):
+	(-[IFBookmarkLeaf setImage:]):
+	(-[IFBookmarkLeaf setURLString:]):
+	* Bookmarks.subproj/IFBookmarkList.m:
+	(-[IFBookmarkList setTitle:]):
+	(-[IFBookmarkList setImage:]):
+	(-[IFBookmarkList removeChild:]):
+	(-[IFBookmarkList insertChild:atIndex:]):
+	* Bookmarks.subproj/IFBookmark_Private.h:
+	Made _parent and _group private; made setTitle, setImage, setURLString,
+	insertChild:atIndex:, and removeChild: public.
+
+	* Bookmarks.subproj/IFBookmarkGroup_Private.h: Added.
+	* WebKit.pbproj/project.pbxproj: Changed for new file.
+
+2002-05-02  John Sullivan  <sullivan at apple.com>
+
 	Implemented removing the root node bookmark (i.e.,
 	removing all bookmarks with one call).
 
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 6d0e14c..f941892 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -225,6 +225,7 @@
 				F5065224027F557E01C1A526,
 				F5065226027F557E01C1A526,
 				F5065228027F557E01C1A526,
+				F50AD3880282028B01C1A526,
 			);
 			isa = PBXHeadersBuildPhase;
 		};
@@ -1084,6 +1085,7 @@
 				F5065218027F557E01C1A526,
 				F5065219027F557E01C1A526,
 				F506521A027F557E01C1A526,
+				F50AD3870282028B01C1A526,
 				F506521B027F557E01C1A526,
 				F506521C027F557E01C1A526,
 				F506521D027F557E01C1A526,
@@ -1210,6 +1212,18 @@
 			settings = {
 			};
 		};
+		F50AD3870282028B01C1A526 = {
+			isa = PBXFileReference;
+			name = IFBookmarkGroup_Private.h;
+			path = Bookmarks.subproj/IFBookmarkGroup_Private.h;
+			refType = 2;
+		};
+		F50AD3880282028B01C1A526 = {
+			fileRef = F50AD3870282028B01C1A526;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 		F5143A370221DCCE01A80181 = {
 			isa = PBXFileReference;
 			name = IFWebFrame.mm;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list