GtkBookmarksManager: Only save if we have data to save

Otherwise we write an empty file, which is lame.
This commit is contained in:
Colin Walters 2013-05-09 16:48:38 -04:00
parent 4f01c0b159
commit 33f6730249

View File

@ -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);
}