Khurshid Alam has proposed merging 
lp:~khurshid-alam/unity-control-center/fix-image-preview into 
lp:unity-control-center.

Commit message:
Fix image preview in GtkFileChooser

g_file_info_get_content_type() returns an internal string, and we were
freeing the file_info we got it from in the next line, so it's a miracle
that the mime_type was ever not garbage.

See https://bugzilla.gnome.org/show_bug.cgi?id=778424

Requested reviews:
  Unity Control Center development team (unity-control-center-team)
Related bugs:
  Bug #1802589 in unity-control-center (Ubuntu): "No image preview when adding 
a custom wallpaper"
  https://bugs.launchpad.net/ubuntu/+source/unity-control-center/+bug/1802589

For more details, see:
https://code.launchpad.net/~khurshid-alam/unity-control-center/fix-image-preview/+merge/359937
-- 
Your team Unity Control Center development team is requested to review the 
proposed merge of lp:~khurshid-alam/unity-control-center/fix-image-preview into 
lp:unity-control-center.
=== modified file 'panels/appearance/cc-appearance-panel.c'
--- panels/appearance/cc-appearance-panel.c	2017-07-18 16:31:27 +0000
+++ panels/appearance/cc-appearance-panel.c	2018-11-30 16:38:02 +0000
@@ -1300,7 +1300,7 @@
       g_object_unref (file);
 
       if (file_info != NULL) {
-	      mime_type = g_file_info_get_content_type (file_info);
+	      mime_type = g_strdup (g_file_info_get_content_type (file_info));
 	      g_object_unref (file_info);
       }
 

=== modified file 'panels/user-accounts/um-photo-dialog.c'
--- panels/user-accounts/um-photo-dialog.c	2014-02-21 15:48:18 +0000
+++ panels/user-accounts/um-photo-dialog.c	2018-11-30 16:38:02 +0000
@@ -178,7 +178,7 @@
                 g_object_unref (file);
 
                 if (file_info != NULL) {
-                        mime_type = g_file_info_get_content_type (file_info);
+                        mime_type = g_strdup (g_file_info_get_content_type (file_info));
                         g_object_unref (file_info);
                 }
 

-- 
ubuntu-desktop mailing list
ubuntu-desktop@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-desktop

Reply via email to