user-accounts: Fix button sensitivity in photo dialogue
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. https://bugzilla.gnome.org/show_bug.cgi?id=778424
This commit is contained in:
parent
d2fc99a6d7
commit
5c5d608730
1 changed files with 3 additions and 2 deletions
|
@ -157,7 +157,7 @@ update_preview (GtkFileChooser *chooser,
|
|||
|
||||
if (uri) {
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
const gchar *mime_type = NULL;
|
||||
char *mime_type = NULL;
|
||||
GFile *file;
|
||||
GFileInfo *file_info;
|
||||
GtkWidget *preview;
|
||||
|
@ -173,7 +173,7 @@ update_preview (GtkFileChooser *chooser,
|
|||
|
||||
if (file_info != NULL &&
|
||||
g_file_info_get_file_type (file_info) != G_FILE_TYPE_DIRECTORY) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -181,6 +181,7 @@ update_preview (GtkFileChooser *chooser,
|
|||
pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (thumb_factory,
|
||||
uri,
|
||||
mime_type);
|
||||
g_free (mime_type);
|
||||
}
|
||||
|
||||
gtk_dialog_set_response_sensitive (GTK_DIALOG (chooser),
|
||||
|
|
Loading…
Add table
Reference in a new issue