[gnome-control-center/gnome-3-2] info: continue on filesystem query info



commit 82391d32512da1fe626ae32323be969e6022aa03
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Sep 20 10:49:03 2011 -0400

    info: continue on filesystem query info
    
    When calculating the total size of all filesystems, failure to query a
    single filesystem results in the iteration being cancelled and a
    "Calculating..." message being left on the UI.  Instead, just ignore the
    filesystem that failed and move on to the next.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=654563

 panels/info/cc-info-panel.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/panels/info/cc-info-panel.c b/panels/info/cc-info-panel.c
index af80bac..035a5d8 100644
--- a/panels/info/cc-info-panel.c
+++ b/panels/info/cc-info-panel.c
@@ -568,19 +568,20 @@ query_done (GFile        *file,
 
   self->priv->cancellable = NULL;
   info = g_file_query_filesystem_info_finish (file, res, &error);
-  if (info == NULL)
+  if (info != NULL)
+    {
+      self->priv->total_bytes += g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE);
+      g_object_unref (info);
+    }
+  else
     {
       char *path;
       path = g_file_get_path (file);
       g_warning ("Failed to get filesystem free space for '%s': %s", path, error->message);
       g_free (path);
       g_error_free (error);
-      return;
     }
 
-  self->priv->total_bytes += g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE);
-  g_object_unref (info);
-
   /* And onto the next element */
   get_primary_disc_info_start (self);
 }



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