[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 07:28:14 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 0b16255bc294b5a94d6f7b280c15f35a4afa7c75
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Mar 7 22:58:20 2003 +0000

    WebKit:
    
    	WebKit part of fixes to these two synching-related bugs:
    
    	3190844 -- Bookmarks Bar and Menu collections need to be
    	marked specially in Bookmarks file
    
    	3192197 -- Safari should write out UUID-full Bookmarks
    	file after reading UUID-free one
    
            Reviewed by Trey
    
            * Bookmarks.subproj/WebBookmark.h:
            * Bookmarks.subproj/WebBookmark.m:
            (-[WebBookmark setUUID:]):
    	Removed the leading underscore, made this method public.
    	Removed unnecessary constraint that new or old UUID had
    	to be nil; now short-circuits the no-change case.
            (-[WebBookmark copyWithZone:]):
    	updated for name change
            (-[WebBookmark initFromDictionaryRepresentation:withGroup:]):
    	ditto
    
            * Bookmarks.subproj/WebBookmarkGroup.h:
            * Bookmarks.subproj/WebBookmarkGroup.m:
            (-[WebBookmarkGroup bookmarkForUUID:]):
    	new public method to find a bookmark from a UUID.
            (-[WebBookmarkGroup _addBookmark:]):
    	updated for name change
    
            * Bookmarks.subproj/WebBookmarkPrivate.h:
    	removed declaration for old _setUUID
    
    WebBrowser:
    
    	WebBrowser part of fixes to these two synching-related bugs:
    
    	3190844 -- Bookmarks Bar and Menu collections need to be
    	marked specially in Bookmarks file
    
    	3192197 -- Safari should write out UUID-full Bookmarks
    	file after reading UUID-free one
    
            Reviewed by Trey
    
            * BookmarksController.m:
            (-[BookmarksController bookmark:isFolderTitled:]):
    	new convenience method
            (-[BookmarksController findOrCreateBookmarkSourceTitled:withUUID:index:]):
    	new method, replaces old code to bless the Bookmarks Bar and Bookmarks Menu
    	folders. Now sets the new well-known UUID for these folders, and ensures
    	that the bookmarks file will be saved if the UUIDs were not there
    	previously. I also removed some of the old backward-compatibility-to-ancient-
    	prelease-version hacks.
            (-[BookmarksController updateBookmarkSources]):
    	reworked to call new methods
    
            * English.lproj/Localizable.strings:
            * English.lproj/StringsNotToBeLocalized.txt:
    	Kept these up to date
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3778 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/Bookmarks.subproj/WebBookmark.h b/WebKit/Bookmarks.subproj/WebBookmark.h
index 9538c3d..c13ab37 100644
--- a/WebKit/Bookmarks.subproj/WebBookmark.h
+++ b/WebKit/Bookmarks.subproj/WebBookmark.h
@@ -56,6 +56,12 @@ typedef enum {
 // Globally unique ID for this bookmark.
 - (NSString *)UUID;
 
+// Set a globally unique ID for this bookmark. If any existing bookmark in this
+// group has this UUID, the existing one will be changed. Normally clients do
+// not need to call this; it is handled internally automatically. Occasionally
+// a client might want to assign a specific UUID to a specific bookmark.
+- (void)setUUID:(NSString *)newUUID;
+
 // Array of child WebBookmarks. Returns nil if bookmarkType is not WebBookmarkTypeList.
 // This creates a copy of the internal data structure, and thus is safe to (for example),
 // iterate through, removing items from their parent as you go.
diff --git a/WebKit/Bookmarks.subproj/WebBookmark.m b/WebKit/Bookmarks.subproj/WebBookmark.m
index d0117a0..88d0dfd 100644
--- a/WebKit/Bookmarks.subproj/WebBookmark.m
+++ b/WebKit/Bookmarks.subproj/WebBookmark.m
@@ -46,7 +46,7 @@
     // since the copy isn't in a group yet. When it's added
     // to a group, the UUID will be uniqued if necessary at that time.
     if ([self _hasUUID]) {
-        [copy _setUUID:[self UUID]];
+        [copy setUUID:[self UUID]];
     }
     
     // parent and group are left nil for fresh copies
@@ -144,10 +144,12 @@
     _parent = parent;
 }
 
-- (void)_setUUID:(NSString *)UUID
+- (void)setUUID:(NSString *)UUID
 {
-    ASSERT(_UUID == nil || UUID == nil);
-
+    if (UUID == _UUID || [UUID isEqualToString:_UUID]) {
+        return;
+    }
+    
     NSString *oldUUID = _UUID;
     _UUID = [UUID copy];
 
@@ -235,7 +237,7 @@
     [self init];
 
     [self setIdentifier:[dict objectForKey:WebBookmarkIdentifierKey]];
-    [self _setUUID:[dict objectForKey:WebBookmarkUUIDKey]];
+    [self setUUID:[dict objectForKey:WebBookmarkUUIDKey]];
     [group _addBookmark:self];
 
     return self;
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroup.h b/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
index cad3766..54ed7e5 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
+++ b/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
@@ -67,4 +67,7 @@ extern NSString *WebBookmarkChildrenKey;
 // Save bookmark group to file. It is the client's responsibility to call this at appropriate times.
 - (BOOL)saveBookmarkGroup;
 
+// Return the existing bookmark with the given UUID, or nil if none
+- (WebBookmark *)bookmarkForUUID:(NSString *)UUID;
+
 @end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroup.m b/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
index d4657d3..738eac3 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
+++ b/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
@@ -67,6 +67,11 @@ NSString *TagKey = @"WebBookmarkGroupTag";
     [super dealloc];
 }
 
+- (WebBookmark *)bookmarkForUUID:(NSString *)UUID
+{
+    return [_bookmarksByUUID objectForKey:UUID];
+}
+
 - (void)_addBookmark:(WebBookmark *)bookmark
 {
     if ([bookmark group] == self) {
@@ -79,7 +84,7 @@ NSString *TagKey = @"WebBookmarkGroupTag";
         NSString *UUID = [bookmark UUID];
         // Clear UUID on former owner of this UUID (if any) -- new copy gets to keep it
         // FIXME 3153832: this means copy/paste transfers the UUID to the new bookmark.
-        [[_bookmarksByUUID objectForKey:UUID] _setUUID:nil];
+        [[_bookmarksByUUID objectForKey:UUID] setUUID:nil];
         [_bookmarksByUUID setObject:bookmark forKey:UUID];
     }
 
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkPrivate.h b/WebKit/Bookmarks.subproj/WebBookmarkPrivate.h
index 1e608c7..d6a9b75 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkPrivate.h
+++ b/WebKit/Bookmarks.subproj/WebBookmarkPrivate.h
@@ -22,9 +22,6 @@
 - (void)_setParent:(WebBookmark *)parent;
 - (void)_setGroup:(WebBookmarkGroup *)group;
 
-// Set the globally unique id for this bookmark to the specified value.
-- (void)_setUUID:(NSString *)UUID;
-
 // Returns YES if UUID is non-nil; can't simply use -[WebBookmark UUID] because
 // it will generate a UUID if there isn't one already.
 - (BOOL)_hasUUID;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 64ac821..de37ffc 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,36 @@
+2003-03-07  John Sullivan  <sullivan at apple.com>
+
+	WebKit part of fixes to these two synching-related bugs:
+
+	3190844 -- Bookmarks Bar and Menu collections need to be
+	marked specially in Bookmarks file
+
+	3192197 -- Safari should write out UUID-full Bookmarks 
+	file after reading UUID-free one
+
+        Reviewed by Trey
+
+        * Bookmarks.subproj/WebBookmark.h:
+        * Bookmarks.subproj/WebBookmark.m:
+        (-[WebBookmark setUUID:]):
+	Removed the leading underscore, made this method public.
+	Removed unnecessary constraint that new or old UUID had
+	to be nil; now short-circuits the no-change case.
+        (-[WebBookmark copyWithZone:]):
+	updated for name change
+        (-[WebBookmark initFromDictionaryRepresentation:withGroup:]):
+	ditto
+
+        * Bookmarks.subproj/WebBookmarkGroup.h:
+        * Bookmarks.subproj/WebBookmarkGroup.m:
+        (-[WebBookmarkGroup bookmarkForUUID:]):
+	new public method to find a bookmark from a UUID.
+        (-[WebBookmarkGroup _addBookmark:]):
+	updated for name change
+
+        * Bookmarks.subproj/WebBookmarkPrivate.h:
+	removed declaration for old _setUUID
+
 2003-03-07  Darin Adler  <darin at apple.com>
 
         Reviewed by John.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list