Commit 3d1add6f authored by Stepan Salenikovich's avatar Stepan Salenikovich Committed by Nicolas Jager

Remove file name filters from avatar file chooser

There are a few issues with filtering by the file name extension:
- more than just .jpg and .png are supported; svg images and other
  formats work as well
- on GNU/Linux, the file extension does not dictate the file type;
  you can rename a .svg to .jpg and it will still work correctly
- many file types have multiple extension names, eg: .jpeg or .JPG

There is also no need to filter by the name, because if the file
type is not supported, it will simply  not work if the user tries
selecting it as the avatar image and a simple warning will be
logged.

Change-Id: If7c95b8bbcbf4c45ac02c43a7788d5a7915b2670
Reviewed-by: default avatarNicolas Jäger <nicolas.jager@savoirfairelinux.com>
parent beab3c96
......@@ -371,7 +371,6 @@ choose_picture(AvatarManipulation *self)
{
AvatarManipulationPrivate *priv = AVATAR_MANIPULATION_GET_PRIVATE(self);
GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
GtkFileFilter *filter = gtk_file_filter_new ();
gint res;
auto preview = gtk_image_new();
......@@ -387,11 +386,6 @@ choose_picture(AvatarManipulation *self)
GTK_RESPONSE_ACCEPT,
NULL);
/* add filters */
gtk_file_filter_add_pattern (filter,"*.png");
gtk_file_filter_add_pattern (filter,"*.jpg");
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER(dialog),filter);
/* add an image preview inside the file choose */
gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER(dialog), preview);
g_signal_connect (GTK_FILE_CHOOSER(dialog), "update-preview", G_CALLBACK (update_preview_cb), preview);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment