static gboolean gwy_app_file_chooser_open_filter(const GtkFileFilterInfo *filter_info, G_GNUC_UNUSED gpointer userdata) { const gchar *name; gint score; name = gwy_file_detect_with_score(filter_info->filename, FALSE, GWY_FILE_OPERATION_LOAD, &score); /* To filter out `fallback' importers like rawfile */ return name != NULL && score >= 5; }
static gboolean gwy_app_file_chooser_open_filter(const GtkFileFilterInfo *filter_info, gpointer userdata) { GwyAppFileChooser *chooser; const gchar *name; gint score; chooser = GWY_APP_FILE_CHOOSER(userdata); if (chooser->filetype && *chooser->filetype) return gwy_file_func_run_detect(chooser->filetype, filter_info->filename, FALSE); name = gwy_file_detect_with_score(filter_info->filename, FALSE, GWY_FILE_OPERATION_LOAD, &score); /* To filter out `fallback' importers like rawfile */ return name != NULL && score >= 5; }