[Xfce4-commits] <midori:master> Fix empty bookmarks in menu/button

Christian Dywan noreply at xfce.org
Thu Jan 10 23:20:02 CET 2013


Updating branch refs/heads/master
         to 01124b1f1076f4f96ff46dfb4cd5b7168659e0c0 (commit)
       from 09e13eb30f0feab253108df4efaf99da981d72fd (commit)

commit 01124b1f1076f4f96ff46dfb4cd5b7168659e0c0
Author: Paweł Forysiuk <tuxator at o2.pl>
Date:   Sat Jan 5 02:03:27 2013 +0100

    Fix empty bookmarks in menu/button
    
    Fixes: https://bugs.launchpad.net/midori/+bug/1091327

 midori/midori-browser.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index d615022..33471c3 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -2993,14 +2993,20 @@ _action_bookmarks_populate_folder (GtkAction*     action,
 {
     KatzeArray* bookmarks;
     const gchar* id = katze_item_get_meta_string (KATZE_ITEM (folder), "id");
+    gchar* condition;
+
     if (browser->bookmarks == NULL)
         return FALSE;
-    else if (id == NULL && !(bookmarks = midori_array_query (browser->bookmarks,
-        "id, title, parentid, uri, app, pos_panel, pos_bar", "parentid is NULL", NULL)))
-            return FALSE;
-    else if (!(bookmarks = midori_array_query (browser->bookmarks,
-        "id, title, parentid, uri, app, pos_panel, pos_bar", "parentid = %q", id)))
-            return FALSE;
+
+    if (id == NULL)
+        condition = "parentid is NULL";
+    else
+        condition = "parentid = %q";
+
+    bookmarks = midori_array_query (browser->bookmarks,
+        "id, title, parentid, uri, app, pos_panel, pos_bar", condition, id);
+    if (!bookmarks)
+        return FALSE;
 
     /* Clear items from dummy array here */
     gtk_container_foreach (GTK_CONTAINER (menu),


More information about the Xfce4-commits mailing list