Commit 3d7a2d78 authored by Emmanuele Bassi's avatar Emmanuele Bassi Committed by Matthias Clasen

Ensure that XDG_DATA_HOME is created before using it

The recently-used.xbel storage for recently used files is located inside
the $XDG_DATA_HOME directory; there's no actual guarantee that the
directory has been created already, even though it's very highly
probable on any modern distribution. We should create it, along with its
intermediate parents, before constructing the file monitor that we use
to get change notifications.
parent 0ddb5023
......@@ -539,6 +539,18 @@ gtk_recent_manager_monitor_changed (GFileMonitor *monitor,
static gchar *
get_default_filename (void)
if (g_mkdir_with_parents (g_get_user_data_dir (), 0755) == -1)
int saved_errno = errno;
g_critical ("Unable to create user data directory '%s' for storing "
"the recently used files list: %s",
g_get_user_data_dir (),
g_strerror (saved_errno));
return NULL;
return g_build_filename (g_get_user_data_dir (),
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