[Xfce4-commits] <thunar:xfce-4.8> Fix crash when opening a mountable drive with no media.

Jannis Pohlmann noreply at xfce.org
Sat Feb 19 16:08:02 CET 2011


Updating branch refs/heads/xfce-4.8
         to 61c04e0407e2e9db1ab8f2d2a7fe9adc4edde716 (commit)
       from 90ef6879c6518500f2abbdf3e13eec5b9e3adcc6 (commit)

commit 61c04e0407e2e9db1ab8f2d2a7fe9adc4edde716
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Sat Feb 19 16:06:27 2011 +0100

    Fix crash when opening a mountable drive with no media.
    
    Error spotted, reported and solved by Ambroz Bizjak.

 NEWS                 |    2 ++
 thunar/thunar-file.c |   24 +++++++++++++-----------
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/NEWS b/NEWS
index 534081c..9b21960 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@
 =====
 - Fix crash when trying to thumbnail a file with unknown content type.
 - Fix properties dialog crash with files with unknown content type.
+- Fix crash when opening a mountable drive with no media (bug #7308).
+  Reported and solved by Ambroz Bizjak.
 
 1.2.1
 =====
diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index 1281841..1767f10 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -702,14 +702,15 @@ thunar_file_load (ThunarFile   *file,
                   GCancellable *cancellable,
                   GError      **error)
 {
-  GKeyFile *key_file;
-  GError   *err = NULL;
-  GFile    *thumbnail_dir;
-  gchar    *base_name;
-  gchar    *md5_hash;
-  gchar    *p;
-  gchar    *thumbnail_dir_path;
-  gchar    *uri = NULL;
+  const gchar *target_uri;
+  GKeyFile    *key_file;
+  GError      *err = NULL;
+  GFile       *thumbnail_dir;
+  gchar       *base_name;
+  gchar       *md5_hash;
+  gchar       *p;
+  gchar       *thumbnail_dir_path;
+  gchar       *uri = NULL;
 
   _thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE);
   _thunar_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@@ -750,9 +751,10 @@ thunar_file_load (ThunarFile   *file,
     {
       if (g_file_info_get_file_type (file->info) == G_FILE_TYPE_MOUNTABLE)
         {
-          file->is_mounted = 
-            !g_file_info_get_attribute_boolean (file->info,
-                                                G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT);
+          target_uri = 
+            g_file_info_get_attribute_string (file->info,
+                                              G_FILE_ATTRIBUTE_STANDARD_TARGET_URI);
+          file->is_mounted = (target_uri != NULL);
         }
     }
   else



More information about the Xfce4-commits mailing list