[Xfce4-commits] <midori:master> Handle NULL desc in midori_bookmarks_insert_item_db

Christian Dywan noreply at xfce.org
Thu Feb 17 20:20:03 CET 2011


Updating branch refs/heads/master
         to 74549eff9d65c9c435949adc11b695cb88d4280d (commit)
       from 2c4015ab9407175565e62a2f991e9487e8cebfd1 (commit)

commit 74549eff9d65c9c435949adc11b695cb88d4280d
Author: Paweł Forysiuk <tuxator at o2.pl>
Date:   Thu Feb 17 20:18:18 2011 +0100

    Handle NULL desc in midori_bookmarks_insert_item_db

 panels/midori-bookmarks.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c
index b66c542..801c5fd 100644
--- a/panels/midori-bookmarks.c
+++ b/panels/midori-bookmarks.c
@@ -243,6 +243,7 @@ midori_bookmarks_insert_item_db (sqlite3*     db,
     KatzeItem* old_parent;
     gchar* parent;
     gchar* uri;
+    gchar* desc;
 
     /* Bookmarks must have a name, import may produce invalid items */
     g_return_if_fail (katze_item_get_name (item));
@@ -252,6 +253,11 @@ midori_bookmarks_insert_item_db (sqlite3*     db,
     else
         uri = g_strdup ("");
 
+    if (katze_item_get_text (item))
+        desc = g_strdup (katze_item_get_text (item));
+    else
+        desc = g_strdup ("");
+
     /* Use folder, otherwise fallback to parent folder */
     old_parent = katze_item_get_parent (item);
     if (folder && *folder)
@@ -266,7 +272,7 @@ midori_bookmarks_insert_item_db (sqlite3*     db,
             " ('%q', '%q', '%q', '%q', %d, %d)",
             uri,
             katze_item_get_name (item),
-            katze_item_get_text (item),
+            desc,
             parent,
             katze_item_get_meta_boolean (item, "toolbar"),
             katze_item_get_meta_boolean (item, "app"));
@@ -279,6 +285,7 @@ midori_bookmarks_insert_item_db (sqlite3*     db,
 
     g_free (uri);
     g_free (parent);
+    g_free (desc);
     sqlite3_free (sqlcmd);
 }
 



More information about the Xfce4-commits mailing list