bookmarks: database structure 2

Bug #1017492 reported by Olli
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Midori Web Browser
In Progress
Undecided
Unassigned

Bug Description

bug 836707 introduced a new database structure for the bookmarks.

now we change the sorting stuff as follows:
pfor’s idea was that the bookmarks on the bookmarkbar are *only* sorted by the user (no alphabetic, only drag&drop) and if the user pops out an folder on the bar, the containing bookmarks are sorted by the same criterion as the bookmarks in the bookmarks panel.
in the panel the user can choose the sort criterion and if he uses “custom”, he can drag&drop them around.

so we have a value “pos” which is the custom sorting position and which is folder-specific. and for the bar we have “pos_bar” which is global for all bookmarks marked for the bar.

Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :

* renamed “pos_panel” in “pos”
* changed “pos_bar“-triggers

tags: added: database
Revision history for this message
Cris Dywan (kalikiana) wrote :

As of the latest discussions about separating bookmark types into distinct folders, such as bookmarks, toolbar and speed dial - this probably needs re-considering. Bookmarks won't appear in multiple places with different order.

Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :

This patch introduces the new database structe with separating bookmark types into distinct folders, such as bookmarks, toolbar and speed dial.

It is not a final patch but a base for further discussion and implementation.

Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :

* keep speeddial button in new bookmark dialog
* extract import transaction

Cris Dywan (kalikiana)
Changed in midori:
status: New → In Progress
Revision history for this message
Cris Dywan (kalikiana) wrote :

Maybe the folder listing from midori_bookmark_folder_button_new could be moved to something like _get_toplevel_folders so the panel can display the same list. Translations could be consistently handled there. We should probably have a static const gchar*[] with N_ to make sure we have strings for all of them.

How about string constants or defines for the toplevel folders? To avoid confusing breakage due to typos.

Migration should eventually include speed dial, and speed dial would read from the database - but let's do this in a separate patch, to keep review iterations fast.

Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :

* defines for toplevel folders
* labels (translations) for toplevel folders
* new: midori_bookmarks_get_toplevel_folders()
Returns the toplevel folders (=places) with id and label (=translation)
* new: midori_bookmarks_ensure_toplevel_folders()
Ensures that the toplevel folders are present (needed to add new toplevel folders later)

Revision history for this message
Cris Dywan (kalikiana) wrote :

After applying my bookmarks are gone and I see several instances of

** (midori4:16138): WARNING **: midori_array_query returned NULL)

Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :

Sorry for not enough testing.
Should be fixed now.

Also did a few other improvements.

Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :

The foreign_keys pragma has to be set on every database connection.

Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :

Just fixed %d with G_GINT64_FORMAT.

Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :

I corrected a few things and it doesn’t create the speeddial place for now, cause it is not yet needed in the database.
Here is the (final) patch.

Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :

One thing to mention: delete your bookmarks_v2.db, please.

Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :

This patch introduces _v3.db for the new database structure and can convert from _v2.db and from _v1.db to the new one.

Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :
Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :

Formatting and adjusting to current git by pfor.

Revision history for this message
Cris Dywan (kalikiana) wrote :

todo: DND eats folder contents
changed: merged sql statement defines

Revision history for this message
Olli (coderkun-deactivatedaccount) wrote :

– fixed DND-eating
– shows places in bookmark panel

– after DND, bookmarks show up twice until reopen the folder. as far as i investigated this could only be solved through own DND functions, so this is another issue
– bookmarkbar doesn’t get updated on DND in the panel’s bookmarkbar place

Cody Garver (codygarver)
Changed in midori:
milestone: none → 0.5.1
Revision history for this message
André Auzi (aauzi) wrote :

I faced the two issues your mention in my trials.

FWIW, in fix of Bug #894143 "Unable to select multiple bookmarks for moving/deleting" I developed own DND functions.

For the DND issue, I did not implement the fix in the DND functions but in the midori_bookmarks_row_expanded_cb...
In fact, I replaced it by a midori_bookmarks_test_expand_row_cb where I cleanup the folders child's list, where GtkTreeView basic implementation of DND move can add childs, before doing the populate from database.

I choose this design to let it be compatible with the GtkTreeStore I actually derived from to implement multiple selection DND.

For the bookmarkbar reflexion of DND manipulations I implemented an "update-item" signal in the KatzeArray object.

A first step of this design is available in the patch I proposed for Bug #1179200 "Bookmark folder tree collapsed on bookmarks update"

Cris Dywan (kalikiana)
Changed in midori:
milestone: 0.5.3 → 0.5.4
Cris Dywan (kalikiana)
Changed in midori:
milestone: 0.5.4 → 0.5.5
Cris Dywan (kalikiana)
Changed in midori:
milestone: 0.5.5-freeze → 0.5.6
Cris Dywan (kalikiana)
Changed in midori:
milestone: 0.5.6 → 0.5.7
Cris Dywan (kalikiana)
Changed in midori:
milestone: 0.5.7 → garage
To post a comment you must log in.