Closed Bug 385828 Opened 17 years ago Closed 17 years ago

Insertion, removal and move operations of items should update the last-modified field of their containing folder

Categories

(Firefox :: Bookmarks & History, defect, P2)

defect

Tracking

()

RESOLVED FIXED
Firefox 3 alpha7

People

(Reporter: asaf, Assigned: asaf)

References

Details

Attachments

(2 files, 1 obsolete file)

Insertion, removal and move operations of items should update the last-modified field of their containing folder.
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → mano
Status: NEW → ASSIGNED
Attachment #269763 - Flags: review?(dietrich)
Attachment #269763 - Attachment is patch: true
Attachment #269763 - Attachment mime type: application/octet-stream → text/plain
Comment on attachment 269763 [details] [diff] [review]
patch


Index: toolkit/components/places/src/nsNavBookmarks.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/toolkit/components/places/src/nsNavBookmarks.cpp,v
>retrieving revision 1.103
>diff -u -p -8 -r1.103 nsNavBookmarks.cpp
>--- toolkit/components/places/src/nsNavBookmarks.cpp	15 Jun 2007 00:40:44 -0000	1.103
>+++ toolkit/components/places/src/nsNavBookmarks.cpp	25 Jun 2007 23:41:28 -0000
>@@ -939,16 +939,19 @@ nsNavBookmarks::InsertBookmark(PRInt64 a
>   NS_ENSURE_SUCCESS(rv, rv);
>   *aNewBookmarkId = rowId;
> 
>   rv = transaction.Commit();
>   NS_ENSURE_SUCCESS(rv, rv);
> 
>   AddBookmarkToHash(childID, 0);
> 
>+  rv = SetItemLastModified(aFolder, PR_Now());
>+  NS_ENSURE_SUCCESS(rv, rv);
>+
>   ENUMERATE_WEAKARRAY(mObservers, nsINavBookmarkObserver,
>                       OnItemAdded(rowId, aFolder, index))
> 
>   return NS_OK;
> }
> 
> NS_IMETHODIMP
> nsNavBookmarks::RemoveItem(PRInt64 aItemId)

can you move the call to before transaction.Commit()? that way the lastModified update query will be rolled up in the pre-existing transaction, instead of starting a new one. this goes for the other changes as well.

r=me otherwise.
Attachment #269763 - Flags: review?(dietrich) → review+
Attached patch as checked inSplinter Review
mozilla/toolkit/components/places/src/nsNavBookmarks.cpp 1.106
Attachment #269763 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Backed out, it turned all unit test tinderboxes orange:

gmake[4]: Entering directory `/build/slave/trunk_linux/mozilla/objdir/browser/components/places/tests'
../../../../_tests/xpcshell-simple/test_browser_places/unit/test_bookmarks_html.js: FAIL
../../../../_tests/xpcshell-simple/test_browser_places/unit/test_bookmarks_html.js.log:
>>>>>>>
*** test pending
*** exiting
*** CHECK FAILED: 1184056830.946454 == 1177541050
JS frame :: /build/slave/trunk_linux/mozilla/tools/test-harness/xpcshell-simple/head.js :: do_throw :: line 99
JS frame :: /build/slave/trunk_linux/mozilla/tools/test-harness/xpcshell-simple/head.js :: do_check_eq :: line 114
JS frame :: ../../../../_tests/xpcshell-simple/test_browser_places/unit/test_bookmarks_html.js :: testCanonicalBookmarks :: line 223
JS frame :: ../../../../_tests/xpcshell-simple/test_browser_places/unit/test_bookmarks_html.js :: run_test :: line 112
JS frame :: /build/slave/trunk_linux/mozilla/tools/test-harness/xpcshell-simple/tail.js :: _execute_test :: line 41
JS frame :: /build/slave/trunk_linux/mozilla/tools/test-harness/xpcshell-simple/execute_test.js :: <TOP_LEVEL> :: line 38
2147500036
*** FAIL ***
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch fix importSplinter Review
Attachment #271810 - Flags: review?(dietrich)
Comment on attachment 271810 [details] [diff] [review]
fix import

Index: browser/components/places/src/nsPlacesImportExportService.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/browser/components/places/src/nsPlacesImportExportService.cpp,v
>retrieving revision 1.24
>diff -u -p -8 -r1.24 nsPlacesImportExportService.cpp
>--- browser/components/places/src/nsPlacesImportExportService.cpp	8 Jul 2007 07:08:05 -0000	1.24
>+++ browser/components/places/src/nsPlacesImportExportService.cpp	11 Jul 2007 08:48:55 -0000
>@@ -644,18 +644,27 @@ BookmarkContentSink::HandleContainerBegi
> //    pop the toplevel frame
> 
> void
> BookmarkContentSink::HandleContainerEnd()
> {
>   BookmarkImportFrame& frame = CurFrame();
>   if (frame.mContainerNesting > 0)
>     frame.mContainerNesting --;
>-  if (mFrames.Length() > 1 && frame.mContainerNesting == 0)
>+  if (mFrames.Length() > 1 && frame.mContainerNesting == 0) {
>+    // ww also need to re-set the imported last-modified date here. Otherwise

s/ww/we/
Attachment #271810 - Flags: review?(dietrich) → review+
mozilla/browser/components/places/src/nsPlacesImportExportService.cpp 1.26
mozilla/toolkit/components/places/src/nsNavBookmarks.cpp 1.108
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Priority: -- → P2
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3 M7
Flags: in-testsuite?
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".

In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body   contains   places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.

Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.

Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: