Commit b4d114b9 authored by John Sullivan's avatar John Sullivan

Create directory for bookmarks if necessary.

parent d9326fa4
1999-12-30 John Sullivan <sullivan@eazel.com>
* src/nautilus_bookmarklist.c: (nautilus_bookmarklist_get_file_path):
Create directory that contains bookmarks file if it's not already
there. Saving bookmarks would have failed (silently) for anyone
who didn't already have a ~/.gnomad directory without this change.
1999-12-30 John Sullivan <sullivan@eazel.com>
Made NautilusBookmark use gchar * instead of GString
......
......@@ -47,6 +47,8 @@ static void nautilus_bookmarklist_save_file (NautilusBookmarklist *bookmar
static GtkObjectClass *parent_class = NULL;
static guint bookmarklist_signals[LAST_SIGNAL] = { 0 };
const unsigned default_gnomad_directory_mode = 0755;
/* GtkObject methods. */
......@@ -246,12 +248,15 @@ nautilus_bookmarklist_get_file_path (NautilusBookmarklist *bookmarks)
static gchar *file_path = NULL;
if (file_path == NULL)
{
/* FIXME: directory shouldn't be hardwired here;
* file name is debatable.
*/
file_path = g_strconcat(g_get_home_dir(),
G_DIR_SEPARATOR_S,
".gnomad",
file_path = g_strconcat(g_get_home_dir(), G_DIR_SEPARATOR_S, ".gnomad", NULL);
/* FIXME: make and use covers for these file-manipulation routines */
if (access(file_path, R_OK) != 0)
{
mkdir(file_path, default_gnomad_directory_mode);
}
file_path = g_strconcat(file_path,
G_DIR_SEPARATOR_S,
"bookmarks.xml",
NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment