Closed Bug 755816 Opened 12 years ago Closed 12 years ago

Index default bookmarks from 0, not from 1

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 15

People

(Reporter: rnewman, Assigned: rnewman)

Details

Attachments

(1 file)

private void createDefaultBookmarks(SQLiteDatabase db, String pattern) {

...
            int pos = 1;
            for (int i = 0; i < fields.length; i++) {

...


Sync then comes along and repositions them all to 0-indexed, like its other folders.

Can we change that to start at 0?
(In reply to Richard Newman [:rnewman] from comment #0)

> Can we change that to start at 0?

Sounds reasonable to me. Wes, any reason why we didn't do that in the first place?
Attachment #624443 - Flags: review?(wjohnston)
Is pos 0 a special index?
(In reply to Mark Finkle (:mfinkle) from comment #3)
> Is pos 0 a special index?

This is just the POSITION column in the DB. It's only used by Sync.
We use it for sort order in the bookmarks list:

    static final String DEFAULT_BOOKMARKS_SORT_ORDER = Bookmarks.TYPE
            + " ASC, " + Bookmarks.POSITION + " ASC, " + Bookmarks._ID
            + " ASC";
Comment on attachment 624443 [details] [diff] [review]
Trivial patch. v1

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

I'm guessing this is vestigial or something, but since I can't remember why I did it and the patch works fine locally, I'm good with it.
Attachment #624443 - Flags: review?(wjohnston) → review+
Thanks for testing, Wes!
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/e664ca7c3bab
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → Firefox 15
I just noticed that there's a follow-up for this for special folders, too:

             createOrUpdateSpecialFolder(db, Bookmarks.TOOLBAR_FOLDER_GUID,
                 R.string.bookmarks_folder_toolbar, 1);
             createOrUpdateSpecialFolder(db, Bookmarks.MENU_FOLDER_GUID,
                 R.string.bookmarks_folder_menu, 2);
             createOrUpdateSpecialFolder(db, Bookmarks.TAGS_FOLDER_GUID,
                 R.string.bookmarks_folder_tags, 3);
             createOrUpdateSpecialFolder(db, Bookmarks.UNFILED_FOLDER_GUID,
                 R.string.bookmarks_folder_unfiled, 4);
+            createOrUpdateSpecialFolder(db, Bookmarks.READING_LIST_FOLDER_GUID,
+                R.string.bookmarks_folder_reading_list, 5);
(In reply to Richard Newman [:rnewman] from comment #9)
> I just noticed that there's a follow-up for this for special folders, too:

Bah, 'cept I missed the two lines above it. Disregard!
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: