Store 'description' property of a bookmark

This commit is contained in:
Alexander Butenko 2010-07-23 13:57:59 -04:00 committed by Christian Dywan
parent 1339dc671b
commit 5e250cc70d
3 changed files with 13 additions and 6 deletions

View file

@ -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 ();
}

View file

@ -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));

View file

@ -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"));