[Xfce4-commits] <midori:master> Store 'description' property of a bookmark

Christian Dywan noreply at xfce.org
Fri Jul 23 22:06:09 CEST 2010


Updating branch refs/heads/master
         to 5e250cc70d97d02b4eb397eaffd0c4a02140f0b3 (commit)
       from 1339dc671b9e656e84b53d21cd0d2863e80fe533 (commit)

commit 5e250cc70d97d02b4eb397eaffd0c4a02140f0b3
Author: Alexander Butenko <a.butenka at gmail.com>
Date:   Fri Jul 23 13:57:59 2010 -0400

    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 35c938a..e8ca484 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 f4e7a75..097a470 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 0edac29..128848d 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"));



More information about the Xfce4-commits mailing list