summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2012-10-12 10:47:33 +0200
committerAlexander Larsson <alexl@redhat.com>2012-10-12 10:49:10 +0200
commitb906a5ef2d395c59908d7aa954589e249a22993a (patch)
tree5a0f85968437aa220d02e10af0778fc72233c83c /monitor
parent684a4961315012d577140cf07c4ad7b55b9d9618 (diff)
downloadgvfs-b906a5ef2d395c59908d7aa954589e249a22993a.tar.gz
Allow specifying the dir for .monitor files
This will also be used for the test suite
Diffstat (limited to 'monitor')
-rw-r--r--monitor/proxy/gproxyvolumemonitor.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/monitor/proxy/gproxyvolumemonitor.c b/monitor/proxy/gproxyvolumemonitor.c
index 37fc7885..7ee616e8 100644
--- a/monitor/proxy/gproxyvolumemonitor.c
+++ b/monitor/proxy/gproxyvolumemonitor.c
@@ -1457,6 +1457,7 @@ g_proxy_volume_monitor_register (GIOModule *module)
{
GDir *dir;
GError *error;
+ const char *monitors_dir;
/* first register the abstract base type... */
g_proxy_volume_monitor_register_type (G_TYPE_MODULE (module));
@@ -1472,11 +1473,15 @@ g_proxy_volume_monitor_register (GIOModule *module)
* - and if so the priority
*/
+ monitors_dir = g_getenv ("GVFS_MONITOR_DIR");
+ if (monitors_dir == NULL || *monitors_dir == 0)
+ monitors_dir = REMOTE_VOLUME_MONITORS_DIR;
+
error = NULL;
- dir = g_dir_open (REMOTE_VOLUME_MONITORS_DIR, 0, &error);
+ dir = g_dir_open (monitors_dir, 0, &error);
if (dir == NULL)
{
- g_warning ("cannot open directory " REMOTE_VOLUME_MONITORS_DIR ": %s", error->message);
+ g_warning ("cannot open directory %s: %s", monitors_dir, error->message);
g_error_free (error);
}
else
@@ -1500,7 +1505,7 @@ g_proxy_volume_monitor_register (GIOModule *module)
if (!g_str_has_suffix (name, ".monitor"))
goto cont;
- path = g_build_filename (REMOTE_VOLUME_MONITORS_DIR, name, NULL);
+ path = g_build_filename (monitors_dir, name, NULL);
key_file = g_key_file_new ();
error = NULL;