[gtk+] GtkBookmarksManager: Only save if we have data to save
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkBookmarksManager: Only save if we have data to save
- Date: Thu, 9 May 2013 21:08:12 +0000 (UTC)
commit 33f67302494a5f769ad1b49302acdefa45ef3aee
Author: Colin Walters <walters verbum org>
Date: Thu May 9 16:48:38 2013 -0400
GtkBookmarksManager: Only save if we have data to save
Otherwise we write an empty file, which is lame.
gtk/gtkbookmarksmanager.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkbookmarksmanager.c b/gtk/gtkbookmarksmanager.c
index e475ea0..c7eb026 100644
--- a/gtk/gtkbookmarksmanager.c
+++ b/gtk/gtkbookmarksmanager.c
@@ -221,7 +221,8 @@ _gtk_bookmarks_manager_new (GtkBookmarksChangedFunc changed_func, gpointer chang
/* Read the legacy one and write it to the new one */
legacy_bookmarks_file = get_legacy_bookmarks_file ();
manager->bookmarks = read_bookmarks (legacy_bookmarks_file);
- save_bookmarks (bookmarks_file, manager->bookmarks);
+ if (manager->bookmarks)
+ save_bookmarks (bookmarks_file, manager->bookmarks);
g_object_unref (legacy_bookmarks_file);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]