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
=== modified file 'midori/midori-browser.c'
--- midori/midori-browser.c 2014-04-06 17:00:38 +0000
+++ midori/midori-browser.c 2014-04-09 06:26:08 +0000
@@ -4192,8 +4192,12 @@
4192 if (KATZE_IS_ARRAY (item))4192 if (KATZE_IS_ARRAY (item))
4193 {4193 {
4194 KatzeItem* child;4194 KatzeItem* child;
41954195 KatzeArray* array;
4196 KATZE_ARRAY_FOREACH_ITEM (child, KATZE_ARRAY (item))4196
4197 array = midori_bookmarks_db_query_recursive (browser->bookmarks,
4198 "*", "parentid = %q", katze_item_get_meta_string (item, "id"), FALSE);
4199
4200 KATZE_ARRAY_FOREACH_ITEM (child, KATZE_ARRAY (array))
4197 {4201 {
4198 if ((uri = katze_item_get_uri (child)) && *uri)4202 if ((uri = katze_item_get_uri (child)) && *uri)
4199 {4203 {
@@ -4201,6 +4205,7 @@
4201 midori_browser_set_current_tab_smartly (browser, view);4205 midori_browser_set_current_tab_smartly (browser, view);
4202 }4206 }
4203 }4207 }
4208 g_object_unref (G_OBJECT (array));
4204 }4209 }
4205 else4210 else
4206 {4211 {
42074212
=== modified file 'panels/midori-bookmarks.c'
--- panels/midori-bookmarks.c 2014-01-24 23:04:05 +0000
+++ panels/midori-bookmarks.c 2014-04-09 06:26:08 +0000
@@ -243,6 +243,7 @@
243 gtk_tree_store_remove (model, &child);243 gtk_tree_store_remove (model, &child);
244 else244 else
245 g_object_unref (item);245 g_object_unref (item);
246 g_object_unref (G_OBJECT (array));
246}247}
247248
248static gboolean249static gboolean
@@ -1021,7 +1022,7 @@
1021 KatzeArray* array;1022 KatzeArray* array;
10221023
1023 array = midori_bookmarks_read_from_db (bookmarks,1024 array = midori_bookmarks_read_from_db (bookmarks,
1024 katze_item_get_meta_integer (item, "parentid"), NULL);1025 katze_item_get_meta_integer (item, "id"), NULL);
10251026
1026 g_return_if_fail (KATZE_IS_ARRAY (array));1027 g_return_if_fail (KATZE_IS_ARRAY (array));
1027 KATZE_ARRAY_FOREACH_ITEM (child, array)1028 KATZE_ARRAY_FOREACH_ITEM (child, array)
@@ -1033,6 +1034,7 @@
1033 midori_browser_set_current_tab_smartly (browser, view);1034 midori_browser_set_current_tab_smartly (browser, view);
1034 }1035 }
1035 }1036 }
1037 g_object_unref (G_OBJECT (array));
1036 }1038 }
1037 else if ((uri = katze_item_get_uri (item)) && *uri)1039 else if ((uri = katze_item_get_uri (item)) && *uri)
1038 {1040 {

Subscribers

People subscribed via source and target branches

to all changes: