Use an empty string to pass the test in set_app_info.
authorEmmanuele Bassi <ebassi@cvs.gnome.org>
Fri, 9 Jun 2006 18:09:22 +0000 (18:09 +0000)
committerEmmanuele Bassi <ebassi@src.gnome.org>
Fri, 9 Jun 2006 18:09:22 +0000 (18:09 +0000)
2006-06-09  Emmanuele Bassi  <ebassi@cvs.gnome.org>

* glib/gbookmarkfile.c (g_bookmark_file_remove_application): Use
an empty string to pass the test in set_app_info.

(g_bookmark_file_move_item): Remove the old item from the
look up table; return success in case of empty target.

ChangeLog
ChangeLog.pre-2-12
glib/gbookmarkfile.c

index b331530..861bde1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-06-09  Emmanuele Bassi  <ebassi@cvs.gnome.org>
+
+       * glib/gbookmarkfile.c (g_bookmark_file_remove_application): Use
+       an empty string to pass the test in set_app_info.
+
+       (g_bookmark_file_move_item): Remove the old item from the
+       look up table; return success in case of empty target.
+
 2006-06-08  Tor Lillqvist  <tml@novell.com>
 
        * glib/gunicollate.c (msc_strxfrm_wrapper): Workaround for bug in
index b331530..861bde1 100644 (file)
@@ -1,3 +1,11 @@
+2006-06-09  Emmanuele Bassi  <ebassi@cvs.gnome.org>
+
+       * glib/gbookmarkfile.c (g_bookmark_file_remove_application): Use
+       an empty string to pass the test in set_app_info.
+
+       (g_bookmark_file_move_item): Remove the old item from the
+       look up table; return success in case of empty target.
+
 2006-06-08  Tor Lillqvist  <tml@novell.com>
 
        * glib/gunicollate.c (msc_strxfrm_wrapper): Workaround for bug in
index 8385518..889937f 100644 (file)
@@ -3084,7 +3084,7 @@ g_bookmark_file_remove_application (GBookmarkFile  *bookmark,
   set_error = NULL;
   retval = g_bookmark_file_set_app_info (bookmark, uri,
                                         name,
-                                        NULL,
+                                        "",
                                         0,
                                         (time_t) -1,
                                         &set_error);
@@ -3509,7 +3509,7 @@ g_bookmark_file_move_item (GBookmarkFile  *bookmark,
   
   g_return_val_if_fail (bookmark != NULL, FALSE);
   g_return_val_if_fail (old_uri != NULL, FALSE);
-  
+
   item = g_bookmark_file_lookup_item (bookmark, old_uri);
   if (!item)
     {
@@ -3533,11 +3533,15 @@ g_bookmark_file_move_item (GBookmarkFile  *bookmark,
               return FALSE;
             }
         }
+
+      g_hash_table_steal (bookmark->items_by_uri, item->uri);
       
       g_free (item->uri);
       item->uri = g_strdup (new_uri);
       item->modified = time (NULL);
-      
+
+      g_hash_table_replace (bookmark->items_by_uri, item->uri, item);
+
       return TRUE;
     }
   else
@@ -3550,9 +3554,9 @@ g_bookmark_file_move_item (GBookmarkFile  *bookmark,
           
           return FALSE;
         }
+
+      return TRUE;
     }
-  
-  return FALSE;
 }
 
 /**