Skip to content

Commit

Permalink
Don't create ~/Templates if it does not exist on start.
Browse files Browse the repository at this point in the history
Note that will require restart of application after creation of ~/Templates to
be used by the application.
  • Loading branch information
LStranger committed Apr 24, 2014
1 parent eab5e75 commit 58b3c73
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/base/fm-templates.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,12 +802,16 @@ void _fm_templates_init(void)
dir->user_dir = TRUE;
gfile = fm_path_to_gfile(dir->path);
if(!g_file_query_exists(gfile, NULL))
/* create it if it doesn't exist -- ignore errors */
g_file_make_directory(gfile, NULL, NULL);
{
g_warning("The directory '%s' doesn't exist, ignoring it",
dir_name ? dir_name : "~/Templates");
goto _skip_templates_dir;
}
if (dir->path == fm_path_get_home() || dir->path == fm_path_get_root())
{
/* $HOME or / are invalid templates paths so just ignore */
g_warning("XDG_TEMPLATES_DIR is set to invalid path, ignoring it");
_skip_templates_dir:
dir->files = NULL;
dir->monitor = NULL;
}
Expand Down

0 comments on commit 58b3c73

Please sign in to comment.