[devhelp: 14/36] book-manager: book updates treated as delete+create



commit bad9de1dc614dbf74d8acc0369bce93c94dd0f2c
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Dec 2 23:23:08 2010 +0100

    book-manager: book updates treated as delete+create

 src/dh-book-manager.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/dh-book-manager.c b/src/dh-book-manager.c
index 78cccda..a30b83b 100644
--- a/src/dh-book-manager.c
+++ b/src/dh-book-manager.c
@@ -495,9 +495,15 @@ static void
 book_manager_book_updated_cb (DhBook   *book,
                               gpointer  user_data)
 {
-        g_debug ("Updating book '%s' in the book manager list",
-                 dh_book_get_title (book));
-        /* TODO */
+        DhBookManager *book_manager = user_data;
+        gchar         *book_path;
+
+        /* When we update a book, we need to delete it and then
+         * create it again. */
+        book_path = g_strdup (dh_book_get_path (book));
+        book_manager_book_deleted_cb (book, book_manager);
+        book_manager_add_from_filepath (book_manager, book_path);
+        g_free (book_path);
 }
 
 static GSList *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]