Merge lp:~gue5t/midori/open-in-tabs into lp:midori

Proposed by gue5t gue5t
Status: Merged
Approved by: gue5t gue5t
Approved revision: 6658
Merged at revision: 6685
Proposed branch: lp:~gue5t/midori/open-in-tabs
Merge into: lp:midori
Diff against target: 55 lines (+10/-3)
2 files modified
midori/midori-browser.c (+7/-2)
panels/midori-bookmarks.c (+3/-1)
To merge this branch: bzr merge lp:~gue5t/midori/open-in-tabs
Reviewer Review Type Date Requested Status
André Auzi Approve
Midori Devs Pending
Review via email: mp+214880@code.launchpad.net

Commit message

Fix "open all in tabs" for bookmarks

Description of the change

Currently "open all in folder" does not work for bookmarks in the sidepanel, menubar, or bookmarks toolbar. The sidepanel is broken because it opens all bookmarks in the folder *containing* the folder on which the action is performed, while the other two are operating on KatzeArrays which do not have their children loaded. This fixes both the midori-browser.c and bookmarks panel implementations so all three ways to access the feature work.

To post a comment you must log in.
Revision history for this message
André Auzi (aauzi) wrote :

The code is correct and works fine.

Nevertheless, katze-arrayaction implements the update_folder signal that may be used to avoid future code duplication if another folder submenu action is added in the popup menu and unnecessary database read as long as the menu is up to date.

This can be investigated and cleaned up later though.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-browser.c'
2--- midori/midori-browser.c 2014-04-06 17:00:38 +0000
3+++ midori/midori-browser.c 2014-04-09 06:26:08 +0000
4@@ -4192,8 +4192,12 @@
5 if (KATZE_IS_ARRAY (item))
6 {
7 KatzeItem* child;
8-
9- KATZE_ARRAY_FOREACH_ITEM (child, KATZE_ARRAY (item))
10+ KatzeArray* array;
11+
12+ array = midori_bookmarks_db_query_recursive (browser->bookmarks,
13+ "*", "parentid = %q", katze_item_get_meta_string (item, "id"), FALSE);
14+
15+ KATZE_ARRAY_FOREACH_ITEM (child, KATZE_ARRAY (array))
16 {
17 if ((uri = katze_item_get_uri (child)) && *uri)
18 {
19@@ -4201,6 +4205,7 @@
20 midori_browser_set_current_tab_smartly (browser, view);
21 }
22 }
23+ g_object_unref (G_OBJECT (array));
24 }
25 else
26 {
27
28=== modified file 'panels/midori-bookmarks.c'
29--- panels/midori-bookmarks.c 2014-01-24 23:04:05 +0000
30+++ panels/midori-bookmarks.c 2014-04-09 06:26:08 +0000
31@@ -243,6 +243,7 @@
32 gtk_tree_store_remove (model, &child);
33 else
34 g_object_unref (item);
35+ g_object_unref (G_OBJECT (array));
36 }
37
38 static gboolean
39@@ -1021,7 +1022,7 @@
40 KatzeArray* array;
41
42 array = midori_bookmarks_read_from_db (bookmarks,
43- katze_item_get_meta_integer (item, "parentid"), NULL);
44+ katze_item_get_meta_integer (item, "id"), NULL);
45
46 g_return_if_fail (KATZE_IS_ARRAY (array));
47 KATZE_ARRAY_FOREACH_ITEM (child, array)
48@@ -1033,6 +1034,7 @@
49 midori_browser_set_current_tab_smartly (browser, view);
50 }
51 }
52+ g_object_unref (G_OBJECT (array));
53 }
54 else if ((uri = katze_item_get_uri (item)) && *uri)
55 {

Subscribers

People subscribed via source and target branches

to all changes: