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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:23:38 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 0db748f835188d933e1223350ff4e12d1a3c6515
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 10 18:05:22 2002 +0000

    	Did some tweaks that weren't really necessary. But at least one is a significant
    	improvement so I decided to commit rather then just discarding the changes.
    
            * Bookmarks.subproj/IFBookmark.m:
            (-[IFBookmark title]): Take out special case for separator.
            (-[IFBookmark setTitle:]): Take out special case for separator.
            (-[IFBookmark image]): Take out special case for separator.
            (-[IFBookmark setImage:]): Take out special case for separator.
            (-[IFBookmark setURLString:]): Take out special case for non-leaf.
            (-[IFBookmark children]): Take out request for concrete implementation;
    	this is not useful since it's specific to one subclass.
            (-[IFBookmark numberOfChildren]): Take out request for concrete implementation;
    	this is not useful since it's specific to one subclass.
            (-[IFBookmark _numberOfDescendants]): Take out request for concrete implementation;
    	this is not useful since it's specific to one subclass.
            (-[IFBookmark insertChild:atIndex:]): Take out special case for non-list.
            (-[IFBookmark removeChild:]): Take out special case for non-list.
            (+[IFBookmark bookmarkFromDictionaryRepresentation:withGroup:]): Refactored to
    	eliminate repeated code.
    
            * Bookmarks.subproj/IFBookmarkLeaf.m:
            (-[IFBookmarkLeaf copyWithZone:]): Use allocWithZone to be more pedantically correct.
    
            * Bookmarks.subproj/IFBookmarkSeparator.m:
            (-[IFBookmarkSeparator title]): Override to return nil.
            (-[IFBookmarkSeparator image]): Override to return nil.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1523 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/Bookmarks.subproj/IFBookmark.m b/WebKit/Bookmarks.subproj/IFBookmark.m
index f1bfb5d..b19d39c 100644
--- a/WebKit/Bookmarks.subproj/IFBookmark.m
+++ b/WebKit/Bookmarks.subproj/IFBookmark.m
@@ -24,7 +24,7 @@ static unsigned _highestUsedID = 0;
 
 + (NSString *)_generateUniqueIdentifier
 {
-    return [[NSNumber numberWithInt:_highestUsedID++] stringValue];
+    return [[NSNumber numberWithInt:++_highestUsedID] stringValue];
 }
 
 - (id)init
@@ -56,32 +56,24 @@ static unsigned _highestUsedID = 0;
 
 - (NSString *)title
 {
-    if ([self bookmarkType] != IFBookmarkTypeSeparator) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
     return nil;
 }
 
 - (void)setTitle:(NSString *)title
 {
-    if ([self bookmarkType] != IFBookmarkTypeSeparator) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
 
 - (NSImage *)image
 {
-    if ([self bookmarkType] != IFBookmarkTypeSeparator) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
     return nil;
 }
 
 - (void)setImage:(NSImage *)image
 {
-    if ([self bookmarkType] != IFBookmarkTypeSeparator) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
 
 - (IFBookmarkType)bookmarkType
@@ -97,47 +89,32 @@ static unsigned _highestUsedID = 0;
 
 - (void)setURLString:(NSString *)URLString
 {
-    if ([self bookmarkType] == IFBookmarkTypeLeaf) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
 
 - (NSArray *)children
 {
-    if ([self bookmarkType] == IFBookmarkTypeList) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
     return nil;
 }
 
 - (unsigned)numberOfChildren
 {
-    if ([self bookmarkType] == IFBookmarkTypeList) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
     return 0;
 }
 
 - (unsigned)_numberOfDescendants
 {
-    if ([self bookmarkType] == IFBookmarkTypeList) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
     return 0;
 }
 
 - (void)insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index
 {
-    if ([self bookmarkType] == IFBookmarkTypeList) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
 
 - (void)removeChild:(IFBookmark *)bookmark
 {
-    if ([self bookmarkType] == IFBookmarkTypeList) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
 
 - (IFBookmark *)parent
@@ -188,16 +165,20 @@ static unsigned _highestUsedID = 0;
 {
     NSString *typeString;
     
+    Class class = nil;
+    
     typeString = [dict objectForKey:IFBookmarkTypeKey];
     if ([typeString isEqualToString:IFBookmarkTypeListValue]) {
-        return [[[IFBookmarkList alloc] initFromDictionaryRepresentation:dict
-                                                               withGroup:group] autorelease];
+        class = [IFBookmarkList class];
     } else if ([typeString isEqualToString:IFBookmarkTypeLeafValue]) {
-        return [[[IFBookmarkLeaf alloc] initFromDictionaryRepresentation:dict
-                                                                withGroup:group] autorelease];
+        class = [IFBookmarkLeaf class];
     } else if ([typeString isEqualToString:IFBookmarkTypeSeparatorValue]) {
-        return [[[IFBookmarkSeparator alloc] initFromDictionaryRepresentation:dict
-                                                                     withGroup:group] autorelease];
+        class = [IFBookmarkSeparator class];
+    }
+    
+    if (class) {
+        return [[[class alloc] initFromDictionaryRepresentation:dict
+                                                      withGroup:group] autorelease];
     }
 
     return nil;
@@ -215,5 +196,4 @@ static unsigned _highestUsedID = 0;
     return nil;
 }
 
-
 @end
diff --git a/WebKit/Bookmarks.subproj/IFBookmarkLeaf.m b/WebKit/Bookmarks.subproj/IFBookmarkLeaf.m
index c225182..9a07548 100644
--- a/WebKit/Bookmarks.subproj/IFBookmarkLeaf.m
+++ b/WebKit/Bookmarks.subproj/IFBookmarkLeaf.m
@@ -64,7 +64,7 @@
 {
     NSMutableDictionary *dict;
 
-    dict = [NSMutableDictionary dictionaryWithCapacity: 3];
+    dict = [NSMutableDictionary dictionaryWithCapacity:3];
 
     [dict setObject:IFBookmarkTypeLeafValue forKey:IFBookmarkTypeKey];
     [dict setObject:[_entry dictionaryRepresentation] forKey:URIDictionaryKey];
@@ -84,10 +84,10 @@
 
 - (id)copyWithZone:(NSZone *)zone
 {
-    return [[IFBookmarkLeaf alloc] initWithURLString:_URLString
-                                               title:[self title]
-                                               image:[self image]
-                                               group:[self group]];
+    return [[IFBookmarkLeaf allocWithZone:zone] initWithURLString:_URLString
+                                                            title:[self title]
+                                                            image:[self image]
+                                                            group:[self group]];
 }
 
 - (NSString *)title
@@ -142,5 +142,4 @@
     [[self group] _bookmarkDidChange:self];    
 }
 
-
 @end
diff --git a/WebKit/Bookmarks.subproj/IFBookmarkSeparator.m b/WebKit/Bookmarks.subproj/IFBookmarkSeparator.m
index f8f0d09..e1f75f3 100644
--- a/WebKit/Bookmarks.subproj/IFBookmarkSeparator.m
+++ b/WebKit/Bookmarks.subproj/IFBookmarkSeparator.m
@@ -49,4 +49,14 @@
     return [[IFBookmarkSeparator alloc] initWithGroup:[self group]];
 }
 
+- (NSString *)title
+{
+    return nil;
+}
+
+- (NSImage *)image
+{
+    return nil;
+}
+
 @end
diff --git a/WebKit/Bookmarks.subproj/WebBookmark.m b/WebKit/Bookmarks.subproj/WebBookmark.m
index f1bfb5d..b19d39c 100644
--- a/WebKit/Bookmarks.subproj/WebBookmark.m
+++ b/WebKit/Bookmarks.subproj/WebBookmark.m
@@ -24,7 +24,7 @@ static unsigned _highestUsedID = 0;
 
 + (NSString *)_generateUniqueIdentifier
 {
-    return [[NSNumber numberWithInt:_highestUsedID++] stringValue];
+    return [[NSNumber numberWithInt:++_highestUsedID] stringValue];
 }
 
 - (id)init
@@ -56,32 +56,24 @@ static unsigned _highestUsedID = 0;
 
 - (NSString *)title
 {
-    if ([self bookmarkType] != IFBookmarkTypeSeparator) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
     return nil;
 }
 
 - (void)setTitle:(NSString *)title
 {
-    if ([self bookmarkType] != IFBookmarkTypeSeparator) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
 
 - (NSImage *)image
 {
-    if ([self bookmarkType] != IFBookmarkTypeSeparator) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
     return nil;
 }
 
 - (void)setImage:(NSImage *)image
 {
-    if ([self bookmarkType] != IFBookmarkTypeSeparator) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
 
 - (IFBookmarkType)bookmarkType
@@ -97,47 +89,32 @@ static unsigned _highestUsedID = 0;
 
 - (void)setURLString:(NSString *)URLString
 {
-    if ([self bookmarkType] == IFBookmarkTypeLeaf) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
 
 - (NSArray *)children
 {
-    if ([self bookmarkType] == IFBookmarkTypeList) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
     return nil;
 }
 
 - (unsigned)numberOfChildren
 {
-    if ([self bookmarkType] == IFBookmarkTypeList) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
     return 0;
 }
 
 - (unsigned)_numberOfDescendants
 {
-    if ([self bookmarkType] == IFBookmarkTypeList) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
     return 0;
 }
 
 - (void)insertChild:(IFBookmark *)bookmark atIndex:(unsigned)index
 {
-    if ([self bookmarkType] == IFBookmarkTypeList) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
 
 - (void)removeChild:(IFBookmark *)bookmark
 {
-    if ([self bookmarkType] == IFBookmarkTypeList) {
-        NSRequestConcreteImplementation(self, _cmd, [self class]);
-    }
+    NSRequestConcreteImplementation(self, _cmd, [self class]);
 }
 
 - (IFBookmark *)parent
@@ -188,16 +165,20 @@ static unsigned _highestUsedID = 0;
 {
     NSString *typeString;
     
+    Class class = nil;
+    
     typeString = [dict objectForKey:IFBookmarkTypeKey];
     if ([typeString isEqualToString:IFBookmarkTypeListValue]) {
-        return [[[IFBookmarkList alloc] initFromDictionaryRepresentation:dict
-                                                               withGroup:group] autorelease];
+        class = [IFBookmarkList class];
     } else if ([typeString isEqualToString:IFBookmarkTypeLeafValue]) {
-        return [[[IFBookmarkLeaf alloc] initFromDictionaryRepresentation:dict
-                                                                withGroup:group] autorelease];
+        class = [IFBookmarkLeaf class];
     } else if ([typeString isEqualToString:IFBookmarkTypeSeparatorValue]) {
-        return [[[IFBookmarkSeparator alloc] initFromDictionaryRepresentation:dict
-                                                                     withGroup:group] autorelease];
+        class = [IFBookmarkSeparator class];
+    }
+    
+    if (class) {
+        return [[[class alloc] initFromDictionaryRepresentation:dict
+                                                      withGroup:group] autorelease];
     }
 
     return nil;
@@ -215,5 +196,4 @@ static unsigned _highestUsedID = 0;
     return nil;
 }
 
-
 @end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m b/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
index c225182..9a07548 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
+++ b/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
@@ -64,7 +64,7 @@
 {
     NSMutableDictionary *dict;
 
-    dict = [NSMutableDictionary dictionaryWithCapacity: 3];
+    dict = [NSMutableDictionary dictionaryWithCapacity:3];
 
     [dict setObject:IFBookmarkTypeLeafValue forKey:IFBookmarkTypeKey];
     [dict setObject:[_entry dictionaryRepresentation] forKey:URIDictionaryKey];
@@ -84,10 +84,10 @@
 
 - (id)copyWithZone:(NSZone *)zone
 {
-    return [[IFBookmarkLeaf alloc] initWithURLString:_URLString
-                                               title:[self title]
-                                               image:[self image]
-                                               group:[self group]];
+    return [[IFBookmarkLeaf allocWithZone:zone] initWithURLString:_URLString
+                                                            title:[self title]
+                                                            image:[self image]
+                                                            group:[self group]];
 }
 
 - (NSString *)title
@@ -142,5 +142,4 @@
     [[self group] _bookmarkDidChange:self];    
 }
 
-
 @end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkSeparator.m b/WebKit/Bookmarks.subproj/WebBookmarkSeparator.m
index f8f0d09..e1f75f3 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkSeparator.m
+++ b/WebKit/Bookmarks.subproj/WebBookmarkSeparator.m
@@ -49,4 +49,14 @@
     return [[IFBookmarkSeparator alloc] initWithGroup:[self group]];
 }
 
+- (NSString *)title
+{
+    return nil;
+}
+
+- (NSImage *)image
+{
+    return nil;
+}
+
 @end
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index b0ef3be..269e283 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,34 @@
 2002-07-10  Darin Adler  <darin at apple.com>
 
+	Did some tweaks that weren't really necessary. But at least one is a significant
+	improvement so I decided to commit rather then just discarding the changes.
+
+        * Bookmarks.subproj/IFBookmark.m:
+        (-[IFBookmark title]): Take out special case for separator.
+        (-[IFBookmark setTitle:]): Take out special case for separator.
+        (-[IFBookmark image]): Take out special case for separator.
+        (-[IFBookmark setImage:]): Take out special case for separator.
+        (-[IFBookmark setURLString:]): Take out special case for non-leaf.
+        (-[IFBookmark children]): Take out request for concrete implementation;
+	this is not useful since it's specific to one subclass.
+        (-[IFBookmark numberOfChildren]): Take out request for concrete implementation;
+	this is not useful since it's specific to one subclass.
+        (-[IFBookmark _numberOfDescendants]): Take out request for concrete implementation;
+	this is not useful since it's specific to one subclass.
+        (-[IFBookmark insertChild:atIndex:]): Take out special case for non-list.
+        (-[IFBookmark removeChild:]): Take out special case for non-list.
+        (+[IFBookmark bookmarkFromDictionaryRepresentation:withGroup:]): Refactored to
+	eliminate repeated code.
+
+        * Bookmarks.subproj/IFBookmarkLeaf.m:
+        (-[IFBookmarkLeaf copyWithZone:]): Use allocWithZone to be more pedantically correct.
+
+        * Bookmarks.subproj/IFBookmarkSeparator.m:
+        (-[IFBookmarkSeparator title]): Override to return nil.
+        (-[IFBookmarkSeparator image]): Override to return nil.
+
+2002-07-10  Darin Adler  <darin at apple.com>
+
         * Misc.subproj/WebKitDebug.m: Remove workaround for long-ago fixed
 	C compiler bug.
 
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index b0ef3be..269e283 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,34 @@
 2002-07-10  Darin Adler  <darin at apple.com>
 
+	Did some tweaks that weren't really necessary. But at least one is a significant
+	improvement so I decided to commit rather then just discarding the changes.
+
+        * Bookmarks.subproj/IFBookmark.m:
+        (-[IFBookmark title]): Take out special case for separator.
+        (-[IFBookmark setTitle:]): Take out special case for separator.
+        (-[IFBookmark image]): Take out special case for separator.
+        (-[IFBookmark setImage:]): Take out special case for separator.
+        (-[IFBookmark setURLString:]): Take out special case for non-leaf.
+        (-[IFBookmark children]): Take out request for concrete implementation;
+	this is not useful since it's specific to one subclass.
+        (-[IFBookmark numberOfChildren]): Take out request for concrete implementation;
+	this is not useful since it's specific to one subclass.
+        (-[IFBookmark _numberOfDescendants]): Take out request for concrete implementation;
+	this is not useful since it's specific to one subclass.
+        (-[IFBookmark insertChild:atIndex:]): Take out special case for non-list.
+        (-[IFBookmark removeChild:]): Take out special case for non-list.
+        (+[IFBookmark bookmarkFromDictionaryRepresentation:withGroup:]): Refactored to
+	eliminate repeated code.
+
+        * Bookmarks.subproj/IFBookmarkLeaf.m:
+        (-[IFBookmarkLeaf copyWithZone:]): Use allocWithZone to be more pedantically correct.
+
+        * Bookmarks.subproj/IFBookmarkSeparator.m:
+        (-[IFBookmarkSeparator title]): Override to return nil.
+        (-[IFBookmarkSeparator image]): Override to return nil.
+
+2002-07-10  Darin Adler  <darin at apple.com>
+
         * Misc.subproj/WebKitDebug.m: Remove workaround for long-ago fixed
 	C compiler bug.
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list