Closed
Bug 1081108
Opened 10 years ago
Closed 9 years ago
Implement reorder in Bookmarks.jsm
Categories
(Toolkit :: Places, defect)
Toolkit
Places
Tracking
()
People
(Reporter: mak, Assigned: mak)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
We must implement reorder in Bookmarks.jsm so we can finally replace usage of setItemIndex.
Flags: qe-verify-
Flags: firefox-backlog+
Updated•10 years ago
|
Assignee: nobody → mano
Status: NEW → ASSIGNED
Iteration: --- → 36.2
Updated•10 years ago
|
Iteration: 36.2 → 36.3
Comment 1•10 years ago
|
||
We're dropping it from this iteration for now and will pick it up again later.
Assignee: mano → nobody
Status: ASSIGNED → NEW
Iteration: 36.3 → ---
Updated•10 years ago
|
Assignee: nobody → mak77
Status: NEW → ASSIGNED
Iteration: --- → 37.1
Updated•10 years ago
|
Iteration: 37.1 → 37.2
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8537495 -
Flags: review?(mano)
Assignee | ||
Comment 3•10 years ago
|
||
/r/1523 - Bug 1081108 - Implement reorder in Bookmarks.jsm. r=Mano Pull down this commit: hg pull review -r 813c0839f7c141447e352f3ed3f6e22fc0aa250a
Comment 4•10 years ago
|
||
https://reviewboard.mozilla.org/r/1523/#review1019 ::: toolkit/components/places/Bookmarks.jsm (Diff revision 1) > + throw new Error("No folder found for the provided GUID."); This sounds as if the guid isn't found. The error message should reflect that the pointed item isn't a folder. ::: toolkit/components/places/Bookmarks.jsm (Diff revision 1) > + // Reorder the children array according to the wanted order, provided s/wanted/specified ::: toolkit/components/places/Bookmarks.jsm (Diff revision 1) > + return (i != -1 && j != -1 && i < j) || (i != -1 && j == -1) ? -1 : 1; So, given a folder that looks like this pre-sort: [a, b, d, c] and a [a, b] reorder call, does this ensure that c will still follow d? ::: toolkit/components/places/Bookmarks.jsm (Diff revision 1) > + // Update the position now. If any unknown GUID should have been Either "Should any unknown guid have been inserted meanwhile" or "If any unknown guid have been inserted meanwhile" ::: toolkit/components/places/Bookmarks.jsm (Diff revision 1) > + // To do the update in one step, we build a VALUES (guid, position) a single step/query ::: toolkit/components/places/Bookmarks.jsm (Diff revision 1) > + i, child.type, If you use child.index here (rather than i), you can use a for-of loop. ::: toolkit/components/places/Bookmarks.jsm (Diff revision 1) > + JOIN sorting b ON b.p <= a.p trailing space ::: toolkit/components/places/Bookmarks.jsm (Diff revision 1) > + // table. We use count() in the sorting table to avoid skipping values We then ::: toolkit/components/places/tests/bookmarks/test_bookmarks_notifications.js (Diff revision 1) > + }, Remove , ::: toolkit/components/places/tests/bookmarks/test_bookmarks_notifications.js (Diff revision 1) > + } sorted = [for (bm of bookmarks] yield PlacesUtils.bookmarks.insert(b)]
Assignee | ||
Comment 5•10 years ago
|
||
https://reviewboard.mozilla.org/r/1523/#review1021 > If you use child.index here (rather than i), you can use a for-of loop. child.index is NOT updated... I could update it, with another loop, but I didn't so far cause we are not returning them. > So, given a folder that looks like this pre-sort: > [a, b, d, c] and a [a, b] reorder call, does this ensure that c will still follow d? nope, ordering of not passed-in guids is unspecified, retaining it would be more complex (I'm not even sure if it is possible with this implmentation)
Assignee | ||
Comment 6•10 years ago
|
||
I can probably try to retain the original order by setting position to -position rather than -1. I have some tentative queries that seem to be working. let me see.
Assignee | ||
Comment 7•10 years ago
|
||
https://reviewboard.mozilla.org/r/1523/#review1025 > This sounds as if the guid isn't found. The error message should reflect that the pointed item isn't a folder. It could also not be found (!parent || parent.type != this.TYPE_FOLDER) so the message is more generic on purpose. > child.index is NOT updated... I could update it, with another loop, but I didn't so far cause we are not returning them. Moreover child.index is the old index and we need both old and new index for the notification.
Assignee | ||
Comment 8•10 years ago
|
||
https://reviewboard.mozilla.org/r/1523/#review1023
Assignee | ||
Comment 9•10 years ago
|
||
/r/1523 - Bug 1081108 - Implement reorder in Bookmarks.jsm. r=Mano Pull down this commit: hg pull review -r 06226488a19a041b50fa49aff220c460c9c3d2c6
Updated•10 years ago
|
Iteration: 37.2 → 37.3
Updated•9 years ago
|
Attachment #8537495 -
Flags: review?(mano) → review+
Assignee | ||
Comment 11•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/a1977b998946
Flags: in-testsuite+
Target Milestone: --- → mozilla37
https://hg.mozilla.org/mozilla-central/rev/a1977b998946
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 13•9 years ago
|
||
Attachment #8537495 -
Attachment is obsolete: true
Attachment #8618403 -
Flags: review+
Assignee | ||
Comment 14•9 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•