138
139
gchar* parent_id;
140
141
parent_id = g_strdup_printf ("%" G_GINT64_FORMAT, parentid);
141
if (!(root_array = midori_array_query_recursive (array, "*", "parentid = %q", parent_id, FALSE)))
142
if (!(root_array = midori_bookmarks_db_query_recursive (array, "*", "parentid = %q", parent_id, FALSE)))
143
144
g_free (parent_id);
169
171
KatzeArray* array;
171
173
if (keyword && *keyword)
172
array = midori_array_query_recursive (bookmarks->array,
173
"id, parentid, title, uri, desc, app, toolbar, pos_panel, pos_bar", "title LIKE '%%%q%%'", keyword, FALSE);
174
array = midori_bookmarks_db_query_recursive (bookmarks->bookmarks_db,
175
"id, parentid, title, uri, desc, app, toolbar, pos_panel, pos_bar", "title LIKE '%%%q%%'", keyword, FALSE);
176
178
if (parentid > 0)
178
180
gchar* parent_id = g_strdup_printf ("%" G_GINT64_FORMAT, parentid);
179
array = midori_array_query_recursive (bookmarks->array,
180
"id, parentid, title, uri, desc, app, toolbar, pos_panel, pos_bar", "parentid = %q", parent_id, FALSE);
181
array = midori_bookmarks_db_query_recursive (bookmarks->bookmarks_db,
182
"id, parentid, title, uri, desc, app, toolbar, pos_panel, pos_bar", "parentid = %q", parent_id, FALSE);
182
184
g_free (parent_id);
185
array = midori_array_query_recursive (bookmarks->array,
186
"id, parentid, title, uri, desc, app, toolbar, pos_panel, pos_bar", "parentid IS NULL", NULL, FALSE);
187
array = midori_bookmarks_db_query_recursive (bookmarks->bookmarks_db,
188
"id, parentid, title, uri, desc, app, toolbar, pos_panel, pos_bar", "parentid IS NULL", NULL, FALSE);
188
190
return array ? array : katze_array_new (KATZE_TYPE_ITEM);
277
katze_array_remove_item (bookmarks->array, item);
278
279
katze_item_set_meta_integer (item, "parentid", parentid);
279
katze_array_add_item (bookmarks->array, item);
281
midori_bookmarks_db_update_item (bookmarks->bookmarks_db, item);
281
283
g_object_unref (item);
417
419
if (KATZE_ITEM_IS_FOLDER (item))
419
gint child_folders_count = midori_array_count_recursive (bookmarks->array,
421
gint child_folders_count = midori_bookmarks_db_count_recursive (bookmarks->bookmarks_db,
420
422
"uri = ''", NULL, item, FALSE);
421
gint child_bookmarks_count = midori_array_count_recursive (bookmarks->array,
423
gint child_bookmarks_count = midori_bookmarks_db_count_recursive (bookmarks->bookmarks_db,
422
424
"uri <> ''", NULL, item, FALSE);
423
425
gchar* child_folders_str = midori_bookmarks_statusbar_subfolders_str (child_folders_count);
424
426
gchar* child_bookmarks_str = midori_bookmarks_statusbar_bookmarks_str (child_bookmarks_count);
454
gint child_folders_count = midori_array_count_recursive (bookmarks->array,
456
gint child_folders_count = midori_bookmarks_db_count_recursive (bookmarks->bookmarks_db,
455
457
"uri = ''", NULL, NULL, FALSE);
456
gint child_bookmarks_count = midori_array_count_recursive (bookmarks->array,
458
gint child_bookmarks_count = midori_bookmarks_db_count_recursive (bookmarks->bookmarks_db,
457
459
"uri <> ''", NULL, NULL, FALSE);
458
460
gchar* child_folders_str = midori_bookmarks_statusbar_subfolders_str (child_folders_count);
459
461
gchar* child_bookmarks_str = midori_bookmarks_statusbar_bookmarks_str (child_bookmarks_count);
500
502
/* Manually remove the iter and block clearing the treeview */
501
503
gtk_tree_store_remove (GTK_TREE_STORE (model), &iter);
502
g_signal_handlers_block_by_func (bookmarks->array,
504
g_signal_handlers_block_by_func (bookmarks->bookmarks_db,
503
505
midori_bookmarks_remove_item_cb, bookmarks);
504
katze_array_remove_item (bookmarks->array, item);
505
g_signal_handlers_unblock_by_func (bookmarks->array,
506
midori_bookmarks_db_remove_item (bookmarks->bookmarks_db, item);
507
g_signal_handlers_unblock_by_func (bookmarks->bookmarks_db,
506
508
midori_bookmarks_remove_item_cb, bookmarks);
507
509
g_object_unref (item);
585
587
GtkTreeModel* model;
587
589
model = gtk_tree_view_get_model (GTK_TREE_VIEW (bookmarks->treeview));
588
if (bookmarks->array)
590
if (bookmarks->bookmarks_db)
590
g_object_unref (bookmarks->array);
592
g_object_unref (bookmarks->bookmarks_db);
591
593
gtk_tree_store_clear (GTK_TREE_STORE (model));
593
595
katze_assign (bookmarks->app, app);
597
599
g_object_ref (app);
598
bookmarks->array = katze_object_get_object (app, "bookmarks");
600
bookmarks->bookmarks_db = katze_object_get_object (app, "bookmarks");
599
601
midori_bookmarks_read_from_db_to_model (bookmarks, GTK_TREE_STORE (model), NULL, 0, NULL);
600
g_signal_connect_after (bookmarks->array, "add-item",
601
G_CALLBACK (midori_bookmarks_add_item_cb), bookmarks);
602
g_signal_connect (bookmarks->array, "remove-item",
603
G_CALLBACK (midori_bookmarks_remove_item_cb), bookmarks);
604
g_signal_connect (bookmarks->array, "update",
605
G_CALLBACK (midori_bookmarks_update_cb), bookmarks);
602
g_signal_connect_after (bookmarks->bookmarks_db, "add-item",
603
G_CALLBACK (midori_bookmarks_add_item_cb), bookmarks);
604
g_signal_connect (bookmarks->bookmarks_db, "remove-item",
605
G_CALLBACK (midori_bookmarks_remove_item_cb), bookmarks);
606
g_signal_connect (bookmarks->bookmarks_db, "update",
607
G_CALLBACK (midori_bookmarks_update_cb), bookmarks);
606
608
g_signal_connect_after (model, "row-changed",
607
G_CALLBACK (midori_bookmarks_row_changed_cb),
609
G_CALLBACK (midori_bookmarks_row_changed_cb),
835
837
menu = gtk_menu_new ();
836
838
if (KATZE_ITEM_IS_FOLDER (item))
838
gint child_bookmarks_count = midori_array_count_recursive (bookmarks->array,
840
gint child_bookmarks_count = midori_bookmarks_db_count_recursive (bookmarks->bookmarks_db,
839
841
"uri <> ''", NULL, item, FALSE);
841
843
midori_bookmarks_popup_item (menu,