Commit f568dd4d authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

workaround for bug #167973: if no valid home directory exists, use the

2005-02-21  Sven Neumann  <sven@gimp.org>

	* libgimpthumb/gimpthumb-utils.c (gimp_thumb_init): workaround for
	bug #167973: if no valid home directory exists, use the folder for
	temporary files to store thumbnails.
parent 981a3620
2005-02-21 Sven Neumann <sven@gimp.org>
* libgimpthumb/gimpthumb-utils.c (gimp_thumb_init): workaround for
bug #167973: if no valid home directory exists, use the folder for
temporary files to store thumbnails.
2005-02-21 Michael Natterer <mitch@gimp.org>
* app/actions/context-actions.c
......
......@@ -106,9 +106,30 @@ gimp_thumb_init (const gchar *creator,
if (gimp_thumb_initialized)
gimp_thumb_exit ();
thumb_dir = (thumb_basedir ?
g_strdup (thumb_basedir) :
g_build_filename (g_get_home_dir(), ".thumbnails", NULL));
if (thumb_basedir)
{
thumb_dir = g_strdup (thumb_basedir);
}
else
{
const gchar *home_dir = g_get_home_dir ();
if (home_dir && g_file_test (home_dir, G_FILE_TEST_IS_DIR))
{
thumb_dir = g_build_filename (home_dir, ".thumbnails", NULL);
}
else
{
gchar *name = g_filename_display_name (g_get_tmp_dir ());
g_message (_("Cannot determine a valid home directory.\n"
"Thumbnails will be stored in the folder for "
"temporary files (%s) instead."), name);
g_free (name);
thumb_dir = g_build_filename (g_get_tmp_dir (), ".thumbnails", NULL);
}
}
enum_class = g_type_class_ref (GIMP_TYPE_THUMB_SIZE);
......
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