summaryrefslogtreecommitdiff
path: root/gvfs
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2009-10-04 16:30:10 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2009-10-04 16:30:10 +0200
commit7baf84f22bcf68f0c4a14a5ff404119aafe2666a (patch)
tree260be56a2da98ab48a2cc6d7ddbb36b4adbe3074 /gvfs
parent88ce42250dc9cd1b69eb734b88226a5bd408c4d5 (diff)
downloadtuxcmd-modules-0.6.66.tar.xz
Consolidate VFS memory managementv0.6.66
Diffstat (limited to 'gvfs')
-rw-r--r--gvfs/gvfs.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/gvfs/gvfs.c b/gvfs/gvfs.c
index 0e9204a..1fb0230 100644
--- a/gvfs/gvfs.c
+++ b/gvfs/gvfs.c
@@ -339,29 +339,30 @@ VFSVersion ()
return cVFSVersion;
}
-struct TVFSInfo
+struct TVFSInfo *
VFSGetInfo ()
{
- struct TVFSInfo module_info;
+ struct TVFSInfo *module_info = g_malloc0 (sizeof (struct TVFSInfo));
+
+ module_info->ID = g_strdup ("gvfs_plugin");
+ module_info->Name = g_strdup ("GVFS plugin");
+ module_info->About = g_strdup_printf ("version %s, build date: %s", VERSION, BUILD_DATE);
+ module_info->Copyright = g_strdup ("Copyright (C) 2008-2009 Tomáš Bžatek");
- module_info.ID = "gvfs_plugin";
- module_info.Name = "GVFS plugin";
- module_info.About = g_strdup_printf ("version %s, build date: %s", VERSION, BUILD_DATE);
- module_info.Copyright = "Copyright (C) 2008-2009 Tomáš Bžatek";
return module_info;
}
char *
VFSGetExts ()
{
- return "";
+ return NULL;
}
char *
VFSGetServices ()
{
/* FIXME: retrieve list of supported backends from gvfs subsystem */
- return "http;https;ftp;sftp;smb;network";
+ return g_strdup ("http;https;ftp;sftp;smb;network");
}
char *
@@ -463,8 +464,10 @@ VFSGetPath (struct TVFSGlobs *globs)
if (root == NULL)
return NULL;
path = g_file_get_relative_path (root, globs->file);
- if (path == NULL)
+ if (path == NULL) {
+ g_object_unref (root);
return NULL;
+ }
if (! g_path_is_absolute (path))
s = g_strdup_printf ("/%s", path);
else
@@ -481,9 +484,8 @@ VFSGetPath (struct TVFSGlobs *globs)
char *
VFSGetPathURI (struct TVFSGlobs *globs)
{
- if (globs->file) {
+ if (globs->file)
return g_file_get_uri (globs->file);
- }
else
return NULL;
}