Closed Bug 755796 Opened 12 years ago Closed 12 years ago

Contacts API: multiple sorting fields

Categories

(Core :: DOM: Device Interfaces, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: gwagner, Assigned: gwagner)

Details

Attachments

(1 file, 2 obsolete files)

We currently only sort by either first or family name. If 2 entries have the same familyName for example we want to continue sorting based on the first name.
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → anygregor
Attached patch patch (obsolete) — Splinter Review
Attachment #624514 - Attachment is obsolete: true
Attachment #624516 - Flags: review?(fabrice)
Attached patch patchSplinter Review
There was a bug in the first version. Entries can be undefined.
Attachment #624516 - Attachment is obsolete: true
Attachment #624516 - Flags: review?(fabrice)
Attachment #625799 - Flags: review?(fabrice)
Comment on attachment 625799 [details] [diff] [review]
patch

Review of attachment 625799 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with comments addressed

::: dom/contacts/fallback/ContactService.jsm
@@ +89,5 @@
> +      }
> +
> +      if (sortByNameSet) {
> +        result = x.localeCompare(y);
> +      }

nit: add blank line

@@ +106,1 @@
>        return msg.findOptions.sortOrder == 'ascending' ? result : -result;

Do a |let sortOrder = msg.findOptions.sortOrder| like for sortBy and reuse it.
Attachment #625799 - Flags: review?(fabrice) → review+
https://hg.mozilla.org/mozilla-central/rev/d529197a47f0
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: