user-accounts: Do not show legacy face images
Legacy face images should not be shown in avatar chooser, so let's filter all symlinks to the legacy files out. Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/5
This commit is contained in:
parent
6e4d75eaaf
commit
93f8920ae5
1 changed files with 14 additions and 0 deletions
|
@ -376,6 +376,8 @@ setup_photo_popup (UmPhotoDialog *um)
|
|||
GFile *file, *dir;
|
||||
GFileInfo *info;
|
||||
GFileEnumerator *enumerator;
|
||||
GFileType type;
|
||||
const gchar *target;
|
||||
const gchar * const * dirs;
|
||||
guint i;
|
||||
gboolean added_faces;
|
||||
|
@ -413,6 +415,18 @@ setup_photo_popup (UmPhotoDialog *um)
|
|||
while ((info = g_file_enumerator_next_file (enumerator, NULL, NULL)) != NULL) {
|
||||
added_faces = TRUE;
|
||||
|
||||
type = g_file_info_get_file_type (info);
|
||||
if (type != G_FILE_TYPE_REGULAR &&
|
||||
type != G_FILE_TYPE_SYMBOLIC_LINK) {
|
||||
g_object_unref (info);
|
||||
continue;
|
||||
}
|
||||
|
||||
target = g_file_info_get_symlink_target (info);
|
||||
if (target != NULL && g_str_has_prefix (target , "legacy/")) {
|
||||
g_object_unref (info);
|
||||
continue;
|
||||
}
|
||||
|
||||
file = g_file_get_child (dir, g_file_info_get_name (info));
|
||||
g_list_store_append (um->faces, file);
|
||||
|
|
Loading…
Add table
Reference in a new issue