]> spindle.queued.net Git - midori/commitdiff
Fix for folders in bookmarksbar
authorAlexander Butenko <a.butenka@gmail.com>
Thu, 1 Jul 2010 19:42:54 +0000 (15:42 -0400)
committerChristian Dywan <christian@twotoasts.de>
Thu, 1 Jul 2010 21:37:14 +0000 (23:37 +0200)
midori/midori-browser.c

index 5bbba4e9520152c0add990c6b5891f323c731ce5..99488a9583cc05e1e1b605598dfa6ef281b9f39a 100644 (file)
@@ -6531,7 +6531,20 @@ midori_bookmarkbar_populate (MidoriBrowser* browser)
 
     while ((item = katze_array_get_nth_item (KATZE_ARRAY (array), i)))
     {
-        midori_bookmarkbar_insert_item (browser->bookmarkbar, item);
+        if (KATZE_ITEM_IS_BOOKMARK (item))
+            midori_bookmarkbar_insert_item (browser->bookmarkbar, item);
+        else
+        {
+            KatzeArray* subfolder;
+            gchar* subsqlcmd;
+
+            subsqlcmd = g_strdup_printf ("SELECT uri, title, app FROM bookmarks WHERE "
+                                         " folder = '%s'", katze_item_get_name (item));
+            subfolder = katze_array_from_sqlite (db, sqlcmd);
+            katze_item_set_name (KATZE_ITEM (subfolder), katze_item_get_name (item));
+            midori_bookmarkbar_insert_item (browser->bookmarkbar, KATZE_ITEM (subfolder));
+            g_free (subsqlcmd);
+        }
         i++;
     }
     _action_set_sensitive (browser, "BookmarkAdd", TRUE);