[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:16:41 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 10ce15af0c4352f1c69f7f64c6bcbf2610fc4985
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jun 4 17:34:25 2002 +0000

    	Made changes here while working on Undo for removing history entries.
    
    	* History.subproj/IFWebHistory.h:
    	New methods addEntries: and removeEntries:, deleted method
    	removeEntriesForDay: (use removeEntries: instead).
    
    	* History.subproj/IFWebHistory.m:
    	(-[IFWebHistory addEntries:]),
    	(-[IFWebHistory removeEntries:]): New methods, each takes an array of
    	entries. Useful for doing multiple things at a time to minimize
    	notifications.
    	(-[IFWebHistory removeEntriesForDay:]): deleted this now-unnecessary method.
    	* History.subproj/IFWebHistoryPrivate.h:
    	* History.subproj/IFWebHistoryPrivate.m:
    	(-[IFWebHistoryPrivate removeEntries:]):
    	(-[IFWebHistoryPrivate removeAllEntries]):
    	(-[IFWebHistoryPrivate addEntries:]): Private implementations for the
    	public changes.
    
    
    	- fixed 2867813 -- should be able to Undo deleting history entries.
    	- fixed awkwardness where item in Bookmarks window would have its
    	name selected for edit when you made a multiple selection.
    
    	* GlobalHistory.h: added _performingUndoableAction ivar;
    	removed removeAll.
    
    	* GlobalHistory.m:
    	(-[GlobalHistory receivedEntriesChangedNotification:]):
    	if not _performingUndoableAction, throw away undo/redo stacks
    	when change comes in.
    
    	(-[GlobalHistory windowWillClose:]):
    	Throw away undo/redo stacks when window closes, to minimize
    	memory use.
    
    	(-[GlobalHistory removeSelectedItems:]):
    	Collect up items to remove and then remove them in one batch;
    	register for undo with _undoRemoveEntries. No longer special-case
    	removeAll.
    
    	(-[GlobalHistory _undoRemoveEntries:]):
    	Restore items previously removed; register for undo with
    	_removeEntries (since we don't restore selection, for various
    	reasons to boring to go into here).
    
    	(-[GlobalHistory _removeEntries:]): Remove again items previously
    	restored; register for undo with _undoRemoveEntries.
    
    	(-[GlobalHistory selectAll:]): Removed obsolete comment.
    
    	* OutlineViewPlus.m:
    	(-[OutlineViewPlus mouseDown:]): Only edit the clicked cell if
    	it's the only selected row.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1265 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index e2a985e..40c1205 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,24 @@
+2002-06-04  John Sullivan  <sullivan at apple.com>
+
+	Made changes here while working on Undo for removing history entries.
+
+	* History.subproj/IFWebHistory.h:
+	New methods addEntries: and removeEntries:, deleted method
+	removeEntriesForDay: (use removeEntries: instead).
+
+	* History.subproj/IFWebHistory.m:
+	(-[IFWebHistory addEntries:]),
+	(-[IFWebHistory removeEntries:]): New methods, each takes an array of
+	entries. Useful for doing multiple things at a time to minimize
+	notifications.
+	(-[IFWebHistory removeEntriesForDay:]): deleted this now-unnecessary method.
+	* History.subproj/IFWebHistoryPrivate.h:
+	* History.subproj/IFWebHistoryPrivate.m:
+	(-[IFWebHistoryPrivate removeEntries:]):
+	(-[IFWebHistoryPrivate removeAllEntries]):
+	(-[IFWebHistoryPrivate addEntries:]): Private implementations for the
+	public changes.
+
 2002-06-04  Darin Adler  <darin at apple.com>
 
 	- fixed 2943513 -- move StringTruncator into WebKit from WebBrowser so we
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index e2a985e..40c1205 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,24 @@
+2002-06-04  John Sullivan  <sullivan at apple.com>
+
+	Made changes here while working on Undo for removing history entries.
+
+	* History.subproj/IFWebHistory.h:
+	New methods addEntries: and removeEntries:, deleted method
+	removeEntriesForDay: (use removeEntries: instead).
+
+	* History.subproj/IFWebHistory.m:
+	(-[IFWebHistory addEntries:]),
+	(-[IFWebHistory removeEntries:]): New methods, each takes an array of
+	entries. Useful for doing multiple things at a time to minimize
+	notifications.
+	(-[IFWebHistory removeEntriesForDay:]): deleted this now-unnecessary method.
+	* History.subproj/IFWebHistoryPrivate.h:
+	* History.subproj/IFWebHistoryPrivate.m:
+	(-[IFWebHistoryPrivate removeEntries:]):
+	(-[IFWebHistoryPrivate removeAllEntries]):
+	(-[IFWebHistoryPrivate addEntries:]): Private implementations for the
+	public changes.
+
 2002-06-04  Darin Adler  <darin at apple.com>
 
 	- fixed 2943513 -- move StringTruncator into WebKit from WebBrowser so we
diff --git a/WebKit/History.subproj/IFWebHistory.h b/WebKit/History.subproj/IFWebHistory.h
index 4a2e5c5..56fb55b 100644
--- a/WebKit/History.subproj/IFWebHistory.h
+++ b/WebKit/History.subproj/IFWebHistory.h
@@ -24,8 +24,9 @@
 
 // modifying contents
 - (void)addEntry: (IFURIEntry *)entry;
+- (void)addEntries:(NSArray *)newEntries;
 - (void)removeEntry: (IFURIEntry *)entry;
-- (void)removeEntriesForDay: (NSCalendarDate *)calendarDate;
+- (void)removeEntries: (NSArray *)entries;
 - (void)removeAllEntries;
 
 // Update an entry in place. Any nil "new" parameters aren't updated.
diff --git a/WebKit/History.subproj/IFWebHistory.m b/WebKit/History.subproj/IFWebHistory.m
index d677c7c..b1b7eed 100644
--- a/WebKit/History.subproj/IFWebHistory.m
+++ b/WebKit/History.subproj/IFWebHistory.m
@@ -53,9 +53,9 @@
     }
 }
 
-- (void)removeEntriesForDay: (NSCalendarDate *)calendarDate
+- (void)removeEntries: (NSArray *)entries
 {
-    if ([_historyPrivate removeEntriesForDay: calendarDate]) {
+    if ([_historyPrivate removeEntries:entries]) {
         [self sendEntriesChangedNotification];
     }
 }
@@ -67,6 +67,12 @@
     }
 }
 
+- (void)addEntries:(NSArray *)newEntries
+{
+    [_historyPrivate addEntries:newEntries];
+    [self sendEntriesChangedNotification];
+}
+
 - (void)updateURL:(NSString *)newURLString
             title:(NSString *)newTitle
      displayTitle:(NSString *)newDisplayTitle
diff --git a/WebKit/History.subproj/IFWebHistoryPrivate.h b/WebKit/History.subproj/IFWebHistoryPrivate.h
index 7ab339c..131e49b 100644
--- a/WebKit/History.subproj/IFWebHistoryPrivate.h
+++ b/WebKit/History.subproj/IFWebHistoryPrivate.h
@@ -21,8 +21,9 @@
 - (id)initWithFile: (NSString *)file;
 
 - (void)addEntry: (IFURIEntry *)entry;
+- (void)addEntries:(NSArray *)newEntries;
 - (BOOL)removeEntry: (IFURIEntry *)entry;
-- (BOOL)removeEntriesForDay: (NSCalendarDate *)calendarDate;
+- (BOOL)removeEntries: (NSArray *)entries;
 - (BOOL)removeAllEntries;
 - (IFURIEntry *)updateURL:(NSString *)newURLString
                     title:(NSString *)newTitle
diff --git a/WebKit/History.subproj/IFWebHistoryPrivate.m b/WebKit/History.subproj/IFWebHistoryPrivate.m
index 1cb1596..c25547a 100644
--- a/WebKit/History.subproj/IFWebHistoryPrivate.m
+++ b/WebKit/History.subproj/IFWebHistoryPrivate.m
@@ -175,24 +175,19 @@
     return YES;
 }
 
-- (BOOL)removeEntriesForDay: (NSCalendarDate *)calendarDate
+- (BOOL)removeEntries: (NSArray *)entries
 {
-    int index;
-    NSEnumerator *entriesForDay;
-    IFURIEntry *entry;
+    int index, count;
 
-    if (![self findIndex: &index forDay: calendarDate]) {
+    count = [entries count];
+    if (count == 0) {
         return NO;
     }
 
-    entriesForDay = [[_entriesByDate objectAtIndex: index] objectEnumerator];
-    while ((entry = [entriesForDay nextObject]) != nil) {
-        [_urlDictionary removeObjectForKey: [[entry url] absoluteString]];
+    for (index = 0; index < count; ++index) {
+        [self removeEntry:[entries objectAtIndex:index]];
     }
-
-    [_datesWithEntries removeObjectAtIndex: index];
-    [_entriesByDate removeObjectAtIndex: index];
-
+    
     return YES;
 }
 
@@ -209,6 +204,22 @@
     return YES;
 }
 
+- (void)addEntries:(NSArray *)newEntries
+{
+    NSEnumerator *enumerator;
+    IFURIEntry *entry;
+
+    // There is no guarantee that the incoming entries are in any particular
+    // order, but if this is called with a set of entries that were created by
+    // iterating through the results of orderedLastVisitedDays and orderedEntriesLastVisitedOnDayy
+    // then they will be ordered chronologically from newest to oldest. We can make adding them
+    // faster (fewer compares) by inserting them from oldest to newest.
+    enumerator = [newEntries reverseObjectEnumerator];
+    while ((entry = [enumerator nextObject]) != nil) {
+        [self addEntry:entry];
+    }
+}
+
 - (IFURIEntry *)updateURL:(NSString *)newURLString
                     title:(NSString *)newTitle
              displayTitle:(NSString *)newDisplayTitle
diff --git a/WebKit/History.subproj/WebHistory.h b/WebKit/History.subproj/WebHistory.h
index 4a2e5c5..56fb55b 100644
--- a/WebKit/History.subproj/WebHistory.h
+++ b/WebKit/History.subproj/WebHistory.h
@@ -24,8 +24,9 @@
 
 // modifying contents
 - (void)addEntry: (IFURIEntry *)entry;
+- (void)addEntries:(NSArray *)newEntries;
 - (void)removeEntry: (IFURIEntry *)entry;
-- (void)removeEntriesForDay: (NSCalendarDate *)calendarDate;
+- (void)removeEntries: (NSArray *)entries;
 - (void)removeAllEntries;
 
 // Update an entry in place. Any nil "new" parameters aren't updated.
diff --git a/WebKit/History.subproj/WebHistory.m b/WebKit/History.subproj/WebHistory.m
index d677c7c..b1b7eed 100644
--- a/WebKit/History.subproj/WebHistory.m
+++ b/WebKit/History.subproj/WebHistory.m
@@ -53,9 +53,9 @@
     }
 }
 
-- (void)removeEntriesForDay: (NSCalendarDate *)calendarDate
+- (void)removeEntries: (NSArray *)entries
 {
-    if ([_historyPrivate removeEntriesForDay: calendarDate]) {
+    if ([_historyPrivate removeEntries:entries]) {
         [self sendEntriesChangedNotification];
     }
 }
@@ -67,6 +67,12 @@
     }
 }
 
+- (void)addEntries:(NSArray *)newEntries
+{
+    [_historyPrivate addEntries:newEntries];
+    [self sendEntriesChangedNotification];
+}
+
 - (void)updateURL:(NSString *)newURLString
             title:(NSString *)newTitle
      displayTitle:(NSString *)newDisplayTitle
diff --git a/WebKit/History.subproj/WebHistoryPrivate.h b/WebKit/History.subproj/WebHistoryPrivate.h
index 7ab339c..131e49b 100644
--- a/WebKit/History.subproj/WebHistoryPrivate.h
+++ b/WebKit/History.subproj/WebHistoryPrivate.h
@@ -21,8 +21,9 @@
 - (id)initWithFile: (NSString *)file;
 
 - (void)addEntry: (IFURIEntry *)entry;
+- (void)addEntries:(NSArray *)newEntries;
 - (BOOL)removeEntry: (IFURIEntry *)entry;
-- (BOOL)removeEntriesForDay: (NSCalendarDate *)calendarDate;
+- (BOOL)removeEntries: (NSArray *)entries;
 - (BOOL)removeAllEntries;
 - (IFURIEntry *)updateURL:(NSString *)newURLString
                     title:(NSString *)newTitle
diff --git a/WebKit/History.subproj/WebHistoryPrivate.m b/WebKit/History.subproj/WebHistoryPrivate.m
index 1cb1596..c25547a 100644
--- a/WebKit/History.subproj/WebHistoryPrivate.m
+++ b/WebKit/History.subproj/WebHistoryPrivate.m
@@ -175,24 +175,19 @@
     return YES;
 }
 
-- (BOOL)removeEntriesForDay: (NSCalendarDate *)calendarDate
+- (BOOL)removeEntries: (NSArray *)entries
 {
-    int index;
-    NSEnumerator *entriesForDay;
-    IFURIEntry *entry;
+    int index, count;
 
-    if (![self findIndex: &index forDay: calendarDate]) {
+    count = [entries count];
+    if (count == 0) {
         return NO;
     }
 
-    entriesForDay = [[_entriesByDate objectAtIndex: index] objectEnumerator];
-    while ((entry = [entriesForDay nextObject]) != nil) {
-        [_urlDictionary removeObjectForKey: [[entry url] absoluteString]];
+    for (index = 0; index < count; ++index) {
+        [self removeEntry:[entries objectAtIndex:index]];
     }
-
-    [_datesWithEntries removeObjectAtIndex: index];
-    [_entriesByDate removeObjectAtIndex: index];
-
+    
     return YES;
 }
 
@@ -209,6 +204,22 @@
     return YES;
 }
 
+- (void)addEntries:(NSArray *)newEntries
+{
+    NSEnumerator *enumerator;
+    IFURIEntry *entry;
+
+    // There is no guarantee that the incoming entries are in any particular
+    // order, but if this is called with a set of entries that were created by
+    // iterating through the results of orderedLastVisitedDays and orderedEntriesLastVisitedOnDayy
+    // then they will be ordered chronologically from newest to oldest. We can make adding them
+    // faster (fewer compares) by inserting them from oldest to newest.
+    enumerator = [newEntries reverseObjectEnumerator];
+    while ((entry = [enumerator nextObject]) != nil) {
+        [self addEntry:entry];
+    }
+}
+
 - (IFURIEntry *)updateURL:(NSString *)newURLString
                     title:(NSString *)newTitle
              displayTitle:(NSString *)newDisplayTitle

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list