From 5e250cc70d97d02b4eb397eaffd0c4a02140f0b3 Mon Sep 17 00:00:00 2001 From: Alexander Butenko Date: Fri, 23 Jul 2010 13:57:59 -0400 Subject: [PATCH] Store 'description' property of a bookmark --- midori/midori-array.c | 6 ++++++ midori/midori-browser.c | 4 ++-- panels/midori-bookmarks.c | 9 +++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/midori/midori-array.c b/midori/midori-array.c index 35c938a9..e8ca484b 100644 --- a/midori/midori-array.c +++ b/midori/midori-array.c @@ -796,6 +796,12 @@ katze_item_set_value_from_column (sqlite3_stmt* stmt, folder = sqlite3_column_text (stmt, column); katze_item_set_meta_string (item, name, (gchar*)folder); } + else if (g_str_equal (name, "desc")) + { + const unsigned char* text; + text = sqlite3_column_text (stmt, column); + katze_item_set_text (item, (gchar*)text); + } else g_warn_if_reached (); } diff --git a/midori/midori-browser.c b/midori/midori-browser.c index f4e7a75f..097a470f 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -6372,7 +6372,7 @@ midori_bookmarkbar_populate (MidoriBrowser* browser) if (!db) return; - sqlcmd = "SELECT uri, title, app, folder, toolbar FROM bookmarks WHERE " + sqlcmd = "SELECT uri, title, desc, app, folder, toolbar FROM bookmarks WHERE " " toolbar = 1 ORDER BY uri ASC"; array = katze_array_from_sqlite (db, sqlcmd); @@ -6392,7 +6392,7 @@ midori_bookmarkbar_populate (MidoriBrowser* browser) KatzeArray* subfolder; gchar* subsqlcmd; - subsqlcmd = g_strdup_printf ("SELECT uri, title, app FROM bookmarks WHERE " + subsqlcmd = g_strdup_printf ("SELECT uri, title, desc, app FROM bookmarks WHERE " " folder = '%s' and uri != ''", katze_item_get_name (item)); subfolder = katze_array_from_sqlite (db, subsqlcmd); katze_item_set_name (KATZE_ITEM (subfolder), katze_item_get_name (item)); diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c index 0edac295..128848d8 100644 --- a/panels/midori-bookmarks.c +++ b/panels/midori-bookmarks.c @@ -157,7 +157,7 @@ midori_bookmarks_read_from_db (MidoriBookmarks* bookmarks, if (keyword && *keyword) { gchar* filterstr; - sqlcmd = "SELECT uri, title, app, toolbar, folder from bookmarks where " + sqlcmd = "SELECT uri, title, desc, app, toolbar, folder from bookmarks where " " title like ? ORDER BY uri DESC"; result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL); filterstr = g_strdup_printf ("%%%s%%", keyword); @@ -168,7 +168,7 @@ midori_bookmarks_read_from_db (MidoriBookmarks* bookmarks, { if (!folder) folder = ""; - sqlcmd = "SELECT uri, title, app, toolbar, folder from bookmarks where " + sqlcmd = "SELECT uri, title, desc, app, toolbar, folder from bookmarks where " " folder = ? ORDER BY uri DESC"; result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL); sqlite3_bind_text (statement, 1, g_strdup (folder), -1, g_free); @@ -232,10 +232,11 @@ midori_bookmarks_insert_item_db (sqlite3* db, parent = g_strdup (""); sqlcmd = sqlite3_mprintf ( - "INSERT into bookmarks (uri, title, folder, toolbar, app) values" - " ('%q', '%q', '%q', %d, %d)", + "INSERT into bookmarks (uri, title, desc, folder, toolbar, app) values" + " ('%q', '%q', '%q', '%q', %d, %d)", uri, katze_item_get_name (item), + katze_item_get_text (item), parent, katze_item_get_meta_boolean (item, "toolbar"), katze_item_get_meta_boolean (item, "app"));