View | Details | Raw Unified
Collapse All | Expand All

(-) gnome-vfs-2.20.0.orig/libgnomevfs/gnome-vfs-application-registry.c (-1 / +1 lines)
 Lines 965-971    Link Here 
						       NULL);
						       NULL);
	gnome_registry_dir.system_dir = TRUE;
	gnome_registry_dir.system_dir = TRUE;
	
	
	user_registry_dir.dirname = g_build_filename (g_get_home_dir(),
	user_registry_dir.dirname = g_build_filename (gnome_vfs_get_home_dir(),
						      ".gnome",
						      ".gnome",
						      "application-info",
						      "application-info",
						      NULL);
						      NULL);
(-) gnome-vfs-2.20.0.orig/libgnomevfs/gnome-vfs-init.c (-24 / +2 lines)
 Lines 59-87    Link Here 
static GPrivate * private_is_primary_thread;
static GPrivate * private_is_primary_thread;
static gboolean
ensure_dot_gnome_exists (void)
{
	gboolean retval = TRUE;
	gchar *dirname;
	dirname = g_build_filename (g_get_home_dir (), ".gnome2", NULL);
	if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) {
		if (g_mkdir (dirname, S_IRWXU) != 0) {
			g_warning ("Unable to create ~/.gnome2 directory: %s",
				   g_strerror (errno));
			retval = FALSE;
		}
	} else if (!g_file_test (dirname, G_FILE_TEST_IS_DIR)) {
		g_warning ("Error: ~/.gnome2 must be a directory.");
		retval = FALSE;
	}
	g_free (dirname);
	return retval;
}
static void
static void
gnome_vfs_thread_init (void)
gnome_vfs_thread_init (void)
{
{
 Lines 112-118    Link Here 
	char *bogus_argv[2] = { "dummy", NULL };
	char *bogus_argv[2] = { "dummy", NULL };
	*/
	*/
	
	
	if (!ensure_dot_gnome_exists ()) {
	/* The first call also checks that ~/.gnome2 is writable. */
	if (!gnome_vfs_get_home_dir ()) {
		return FALSE;
		return FALSE;
	}
	}
(-) gnome-vfs-2.20.0.orig/libgnomevfs/gnome-vfs-private-utils.c (+51 lines)
 Lines 1086-1088    Link Here 
}
}
#endif
#endif
static gboolean
ensure_dot_gnome_exists (gchar *home_dir)
{
	gboolean retval = TRUE;
	gchar *dirname;
	dirname = g_build_filename (home_dir, ".gnome2", NULL);
	if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) {
		if (g_mkdir (dirname, S_IRWXU) != 0) {
			g_warning ("Unable to create ~/.gnome2 directory: %s",
				   g_strerror (errno));
			retval = FALSE;
		}
	} else if (!g_file_test (dirname, G_FILE_TEST_IS_DIR)) {
		g_warning ("Error: ~/.gnome2 must be a directory.");
		retval = FALSE;
	}
	g_free (dirname);
	return retval;
}
/**
 * gnome_vfs_get_home_dir:
 *
 * If ~/.gnome2 is writable, return the home directory
 * Otherwise, return the contents of the HOME environment variable
 *
 * Return value: home directory if successful, NULL otherwise.
 * Do not free the value returned.
 */
const gchar *
gnome_vfs_get_home_dir (void)
{
	static gchar *home = NULL;
	if (home == NULL) {
		gchar *tmp = g_get_home_dir ();
		if (ensure_dot_gnome_exists (tmp)) {
			home = g_strdup (tmp);
		} else {
			gchar *tmp2 = g_getenv ("HOME");
			if (!g_str_equal (tmp, tmp2) && ensure_dot_gnome_exists (tmp2)) {
				home = g_strdup (tmp2);
			}
		}
	}
	return home;
}
(-) gnome-vfs-2.20.0.orig/libgnomevfs/gnome-vfs-private-utils.h (+2 lines)
 Lines 124-129    Link Here 
#endif
#endif
const gchar   *gnome_vfs_get_home_dir                     (void);
G_END_DECLS
G_END_DECLS
#endif /* _GNOME_VFS_PRIVATE_UTILS_H */
#endif /* _GNOME_VFS_PRIVATE_UTILS_H */
(-) gnome-vfs-2.20.0.orig/modules/file-method.c (-3 / +3 lines)
 Lines 1536-1542    Link Here 
	GList *p;
	GList *p;
	char *buffer, *escaped_path, *escaped_mount_point;
	char *buffer, *escaped_path, *escaped_mount_point;
	cache_file_parent = append_to_path (g_get_home_dir (), TRASH_ENTRY_CACHE_PARENT);
	cache_file_parent = append_to_path (gnome_vfs_get_home_dir (), TRASH_ENTRY_CACHE_PARENT);
	cache_file_path = append_to_path (cache_file_parent, TRASH_ENTRY_CACHE_NAME);
	cache_file_path = append_to_path (cache_file_parent, TRASH_ENTRY_CACHE_NAME);
	if (mkdir_recursive (cache_file_parent, 0777) != 0) {
	if (mkdir_recursive (cache_file_parent, 0777) != 0) {
 Lines 1675-1681    Link Here 
	cached_trash_directories = NULL;
	cached_trash_directories = NULL;
	/* read in the entries from disk */
	/* read in the entries from disk */
	cache_file_path = g_build_filename (g_get_home_dir (),
	cache_file_path = g_build_filename (gnome_vfs_get_home_dir (),
					    TRASH_ENTRY_CACHE_PARENT,
					    TRASH_ENTRY_CACHE_PARENT,
					    TRASH_ENTRY_CACHE_NAME,
					    TRASH_ENTRY_CACHE_NAME,
					    NULL);
					    NULL);
 Lines 1947-1953    Link Here 
		return GNOME_VFS_ERROR_INVALID_URI;
		return GNOME_VFS_ERROR_INVALID_URI;
	/* We will need the URI and the stat structure for the home directory. */
	/* We will need the URI and the stat structure for the home directory. */
	home_directory = g_get_home_dir ();
	home_directory = gnome_vfs_get_home_dir ();
	if (gnome_vfs_context_check_cancellation (context)) {
	if (gnome_vfs_context_check_cancellation (context)) {
		g_free (full_name_near);
		g_free (full_name_near);