Closed Bug 376851 Opened 17 years ago Closed 17 years ago

API for sorting a result by an annotation

Categories

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

defect

Tracking

()

RESOLVED FIXED
Firefox 3 alpha4

People

(Reporter: asaf, Assigned: asaf)

References

Details

Attachments

(1 file, 3 obsolete files)

We need an API for setting a manual sorting method for a result, e.g. for sorting a bookmarks result based on the description annotation.
Blocks: 376852
Priority: -- → P2
So this seems like a really complex design to me after trying to use it for the description case (in particular, I had to duplicate the other sorting methods code if there's no description set) :-/ I'm putting this here for future reference only. Maybe a simpler approach would be to provide a generic annotation-based sorting method.
Summary: API for setting a manual sorting method for a result → API for sorting a result by an annotation
Attached patch sort by annotation support - wip (obsolete) — Splinter Review
TODO:
 * add support for other annotation types
 * bump uuids
 * in a follow up, re-sort the result whenever the sorting annotation for a
   an item is changed.
 * in a follow up, notify the view when an annotation for an item is changed.
Attachment #260958 - Attachment is obsolete: true
Attached patch ready for prime time (obsolete) — Splinter Review
Attachment #260970 - Attachment is obsolete: true
Attachment #261053 - Flags: review?(dietrich)
Comment on attachment 261053 [details] [diff] [review]
ready for prime time

the approach seems ok, and thanks for refactoring to simplify the sorting callbacks. however, please have Seth do a second pass on this, as it's a pretty big patch, and i'm not super familiar with some of the apis in use.

as you mentioned on irc, please file follow-ups for query de/serialization and live-update support.

>+/**
>+* XXX: You may only think the two methods below are reliable.

s/only//

>+  // Note we also fall back to the title-sorting route one of the items didn't
>+  // have the annotation set or if both had it set but in a different storage
>+  // type

s/route one/route if one/
Attachment #261053 - Flags: review?(dietrich) → review+
Attachment #261053 - Flags: review?(sspitzer)
Comment on attachment 261053 [details] [diff] [review]
ready for prime time

So Seth is away.
Attachment #261053 - Flags: review?(sspitzer)
Blocks: 376630
Attached patch as checked inSplinter Review
mozilla/toolkit/components/places/public/nsIAnnotationService.idl 1.12
mozilla/toolkit/components/places/public/nsINavHistoryService.idl 1.55
mozilla/toolkit/components/places/src/nsAnnotationService.cpp 1.18
mozilla/toolkit/components/places/src/nsNavHistory.cpp 1.117
mozilla/toolkit/components/places/src/nsNavHistoryQuery.cpp 1.27
mozilla/toolkit/components/places/src/nsNavHistoryQuery.h 1.14
mozilla/toolkit/components/places/src/nsNavHistoryResult.cpp 1.86
mozilla/toolkit/components/places/src/nsNavHistoryResult.h 1.32
Attachment #261053 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
tested?
Flags: in-testsuite?
See blocked bug 376630, I'm working on a full test for sort functionality which includes this sort type too.
test on bug 376630.
Flags: in-testsuite? → 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: