summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2012-03-15 21:35:22 +0100
committerAlexander Larsson <alexl@redhat.com>2012-03-15 21:35:22 +0100
commit09dfd003a4825eb8667ba521fae64f12bd551bce (patch)
tree9609664d7debcff9d15404c9442e01cfe1b06fe4
parentbbb61d820ea319b6468e6b78c0b2f007c0338881 (diff)
downloadgvfs-09dfd003a4825eb8667ba521fae64f12bd551bce.tar.gz
Keep using ~/.gvfs as fallback
If runtime dir is not specifically set we don't fall back to ~/.cache/gvfs, as that unnecessarily invalidates all existing documentation and scripts using ~/.gvfs. However, if it is set, we still use it.
-rw-r--r--client/gdaemonvfs.c6
-rw-r--r--daemon/main.c6
-rw-r--r--daemon/mount.c6
3 files changed, 15 insertions, 3 deletions
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index bb75da51..e62da9b8 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -325,7 +325,11 @@ g_daemon_vfs_init (GDaemonVfs *vfs)
vfs->wrapped_vfs = g_vfs_get_local ();
- file = g_build_filename (g_get_user_runtime_dir(), "gvfs", NULL);
+ /* Use the old .gvfs location as fallback, not .cache/gvfs */
+ if (g_get_user_runtime_dir() == g_get_user_cache_dir ())
+ file = g_build_filename (g_get_home_dir(), ".gvfs", NULL);
+ else
+ file = g_build_filename (g_get_user_runtime_dir(), "gvfs", NULL);
vfs->fuse_root = g_vfs_get_file_for_path (vfs->wrapped_vfs, file);
g_free (file);
diff --git a/daemon/main.c b/daemon/main.c
index d83aaedc..7fd689ca 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -106,7 +106,11 @@ main (int argc, char *argv[])
char *fuse_path;
char *argv2[4];
- fuse_path = g_build_filename (g_get_user_runtime_dir (), "gvfs", NULL);
+ /* Use the old .gvfs location as fallback, not .cache/gvfs */
+ if (g_get_user_runtime_dir() == g_get_user_cache_dir ())
+ fuse_path = g_build_filename (g_get_home_dir(), ".gvfs", NULL);
+ else
+ fuse_path = g_build_filename (g_get_user_runtime_dir (), "gvfs", NULL);
if (!g_file_test (fuse_path, G_FILE_TEST_EXISTS))
g_mkdir (fuse_path, 0700);
diff --git a/daemon/mount.c b/daemon/mount.c
index c2b7f8f3..40d9aeae 100644
--- a/daemon/mount.c
+++ b/daemon/mount.c
@@ -735,7 +735,11 @@ register_mount (DBusConnection *connection,
/* Keep in sync with fuse daemon */
fs_name = g_uri_escape_string (mount->stable_name, "+@#$., ", TRUE);
- mount->fuse_mountpoint = g_build_filename (g_get_user_runtime_dir(), "gvfs", fs_name, NULL);
+ /* Use the old .gvfs location as fallback, not .cache/gvfs */
+ if (g_get_user_runtime_dir() == g_get_user_cache_dir ())
+ mount->fuse_mountpoint = g_build_filename (g_get_home_dir(), ".gvfs", fs_name, NULL);
+ else
+ mount->fuse_mountpoint = g_build_filename (g_get_user_runtime_dir(), "gvfs", fs_name, NULL);
}
mounts = g_list_prepend (mounts, mount);