[gvfs] Make sure metadata is always returned by query_writable_namespaces()



commit b358ca19acb2063775bb6688d654cc684cda6576
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Wed Sep 16 14:54:39 2009 +0200

    Make sure metadata is always returned by query_writable_namespaces()

 client/gdaemonfile.c |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)
---
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index 8e14929..efc46b4 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -2156,26 +2156,28 @@ g_daemon_file_query_writable_namespaces (GFile                      *file,
   GFileAttributeInfoList *list;
   DBusMessageIter iter;
 
-  reply = do_sync_path_call (file, 
+  reply = do_sync_path_call (file,
 			     G_VFS_DBUS_MOUNT_OP_QUERY_WRITABLE_NAMESPACES,
 			     NULL, NULL,
 			     cancellable, error,
 			     0);
-  if (reply == NULL)
-    return NULL;
+  if (reply)
+    {
+      dbus_message_iter_init (reply, &iter);
+      list = _g_dbus_get_attribute_info_list (&iter, error);
+      dbus_message_unref (reply);
+    }
+  else
+    {
+      list = g_file_attribute_info_list_new ();
+    }
 
-  dbus_message_iter_init (reply, &iter);
-  list = _g_dbus_get_attribute_info_list (&iter, error);
-  
-  dbus_message_unref (reply);
+  g_file_attribute_info_list_add (list,
+				  "metadata",
+				  G_FILE_ATTRIBUTE_TYPE_STRING, /* Also STRINGV, but no way express this ... */
+				  G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE |
+				  G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED);
 
-  if (list)
-    g_file_attribute_info_list_add (list,
-				    "metadata",
-				    G_FILE_ATTRIBUTE_TYPE_STRING, /* Also STRINGV, but no way express this ... */
-				    G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE |
-				    G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED);
-  
   return list;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]