diff --git a/src/gtk/mimetype.cpp b/src/gtk/mimetype.cpp index 7edd7bded0..33b5797516 100644 --- a/src/gtk/mimetype.cpp +++ b/src/gtk/mimetype.cpp @@ -21,19 +21,19 @@ wxString wxGTKMimeTypesManagerImpl::GetIconFromMimeType(const wxString& mime) { + wxString icon; wxGtkString type(g_content_type_from_mime_type(mime.utf8_str())); wxGtkObject gicon(g_content_type_get_icon(type)); if ( !gicon ) - return wxString(); + return icon; GtkIconTheme *theme(gtk_icon_theme_get_default()); if ( !theme ) - return wxString(); + return icon; // Notice that we can't use wxGtkObject here because a special function - // needs to be used for freeing this object in GTK+ 2. We should switch to - // using wxGtkObject when support for GTK+ 2 is dropped. + // needs to be used for freeing this object prior to GTK+ 3.8. GtkIconInfo* const giconinfo = gtk_icon_theme_lookup_by_gicon ( theme, @@ -42,16 +42,13 @@ wxString wxGTKMimeTypesManagerImpl::GetIconFromMimeType(const wxString& mime) GTK_ICON_LOOKUP_NO_SVG ); - wxString icon; if ( giconinfo ) { icon = wxString::FromUTF8(gtk_icon_info_get_filename(giconinfo)); -#ifdef __WXGTK3__ - g_object_unref(giconinfo); -#else + wxGCC_WARNING_SUPPRESS(deprecated-declarations) gtk_icon_info_free(giconinfo); -#endif + wxGCC_WARNING_RESTORE() } return icon;