~midori/midori/trunk

« back to all changes in this revision

Viewing changes to midori/midori-browser.c

  • Committer: André Auzi
  • Date: 2013-08-05 12:50:34 UTC
  • mto: This revision was merged to the branch mainline in revision 6388.
  • Revision ID: aauzi@free.fr-20130805125034-tyywj27asg4egh3b
prepare to KatzeItem derivation for update-item signals
as a result, all db operations are centralized in midori-bookmarks-db 

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include "midori-privatedata.h"
27
27
#include "midori-core.h"
28
28
#include "midori-privatedata.h"
 
29
#include "midori-bookmarks-db.h"
29
30
#include "katze-cellrenderercomboboxtext.h"
30
31
 
31
32
#include "marshal.h"
165
166
                             GParamSpec* pspec);
166
167
 
167
168
void
168
 
midori_bookmarks_import_array (KatzeArray*    bookmarks,
169
 
                               KatzeArray* array,
170
 
                               gint64      parentid);
171
 
 
172
 
gboolean
173
 
midori_bookmarks_update_item_db (sqlite3*   db,
174
 
                                 KatzeItem* item);
175
 
 
176
 
void
177
169
midori_browser_open_bookmark (MidoriBrowser* browser,
178
170
                              KatzeItem*     item);
179
171
 
1101
1093
    GtkWidget* check_toolbar;
1102
1094
    GtkWidget* check_app;
1103
1095
    gboolean return_status = FALSE;
1104
 
    sqlite3* db = g_object_get_data (G_OBJECT (browser->bookmarks), "db");
1105
 
    if (!db)
1106
 
        return FALSE;
1107
1096
 
1108
1097
    if (is_folder)
1109
1098
        title = new_bookmark ? _("New Folder") : _("Edit Folder");
1234
1223
            katze_array_add_item (browser->bookmarks, bookmark);
1235
1224
        else
1236
1225
        {
1237
 
            midori_bookmarks_update_item_db (db, bookmark);
 
1226
            midori_array_update_item (browser->bookmarks, bookmark);
1238
1227
            midori_browser_update_history (bookmark, "bookmark", "modify");
1239
1228
 
1240
1229
            if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_toolbar)))
3241
3230
    else
3242
3231
        condition = "parentid = %q";
3243
3232
 
3244
 
    bookmarks = midori_array_query (browser->bookmarks,
3245
 
        "id, title, parentid, uri, app, pos_panel, pos_bar", condition, id);
 
3233
    bookmarks = midori_array_query_recursive  (browser->bookmarks,
 
3234
                                                 "id, title, parentid, uri, app, pos_panel, pos_bar", condition, id, FALSE);
3246
3235
    if (!bookmarks)
3247
3236
        return FALSE;
3248
3237
 
7049
7038
    gtk_toolbar_insert (GTK_TOOLBAR (browser->bookmarkbar),
7050
7039
                        gtk_separator_tool_item_new (), -1);
7051
7040
 
7052
 
    array = midori_array_query (browser->bookmarks,
7053
 
        "id, parentid, title, uri, desc, app, toolbar, pos_panel, pos_bar", "toolbar = 1", NULL);
 
7041
    array = midori_array_query_recursive  (browser->bookmarks,
 
7042
                                             "id, parentid, title, uri, desc, app, toolbar, pos_panel, pos_bar", "toolbar = 1", NULL, FALSE);
7054
7043
    if (!array)
7055
7044
    {
7056
7045
        _action_set_sensitive (browser, "BookmarkAdd", FALSE);