static void color_profile_dest_changed (GtkWidget *combo, ProfileDialog *dialog) { GimpColorProfile *dest_profile = NULL; GFile *file; GError *error = NULL; file = gimp_color_profile_combo_box_get_active_file (GIMP_COLOR_PROFILE_COMBO_BOX (combo)); if (file) { dest_profile = gimp_color_profile_new_from_file (file, &error); g_object_unref (file); } else { dest_profile = g_object_ref (dialog->builtin_profile); } if (! dest_profile) { gimp_color_profile_view_set_error (GIMP_COLOR_PROFILE_VIEW (dialog->dest_view), error->message); g_clear_error (&error); } else { gimp_color_profile_view_set_profile (GIMP_COLOR_PROFILE_VIEW (dialog->dest_view), dest_profile); g_object_unref (dest_profile); } }
static void gimp_color_profile_chooser_dialog_update_preview (GimpColorProfileChooserDialog *dialog) { GimpColorProfile profile; gchar *filename; GError *error = NULL; filename = gtk_file_chooser_get_preview_filename (GTK_FILE_CHOOSER (dialog)); if (! filename) { gimp_color_profile_view_set_profile (dialog->priv->profile_view, NULL); return; } profile = gimp_lcms_profile_open_from_file (filename, &error); if (! profile) { gimp_color_profile_view_set_error (dialog->priv->profile_view, error->message); g_clear_error (&error); } else { gimp_color_profile_view_set_profile (dialog->priv->profile_view, profile); cmsCloseProfile (profile); } g_free (filename); }