Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Ports
caja
caja-gtk3-bookmarks.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File caja-gtk3-bookmarks.patch of Package caja
--- a/src/caja-bookmark-list.c +++ b/src/caja-bookmark-list.c @@ -115,7 +115,7 @@ new_bookmark_from_uri (const char *uri, const char *label) } static GFile * -caja_bookmark_list_get_file (void) +caja_bookmark_list_get_legacy_file (void) { char *filename; GFile *file; @@ -130,6 +130,23 @@ caja_bookmark_list_get_file (void) return file; } +static GFile * +caja_bookmark_list_get_file (void) +{ + char *filename; + GFile *file; + + filename = g_build_filename (g_get_user_config_dir (), + "gtk-3.0", + "bookmarks", + NULL); + file = g_file_new_for_path (filename); + + g_free (filename); + + return file; +} + /* Initialization. */ static void @@ -559,6 +576,9 @@ load_file_async (CajaBookmarkList *self, GFile *file; file = caja_bookmark_list_get_file (); + if (!g_file_query_exists (file, NULL)) { + file = caja_bookmark_list_get_legacy_file (); + } /* Wipe out old list. */ clear (self); @@ -606,6 +626,8 @@ save_file_async (CajaBookmarkList *bookmarks, GFile *file; GList *l; GString *bookmark_string; + GFile *parent; + char *path; /* temporarily disable bookmark file monitoring when writing file */ if (bookmarks->monitor != NULL) @@ -645,6 +667,13 @@ save_file_async (CajaBookmarkList *bookmarks, /* keep the bookmark list alive */ g_object_ref (bookmarks); + + parent = g_file_get_parent (file); + path = g_file_get_path (parent); + g_mkdir_with_parents (path, 0700); + g_free (path); + g_object_unref (parent); + g_file_replace_contents_async (file, bookmark_string->str, bookmark_string->len, NULL, FALSE, 0, NULL, callback,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor