search-locations-dialog: Reuse new function

This commit is contained in:
Corey Berla 2024-02-05 10:17:58 -08:00 committed by Matthijs Velsink
parent 56d6fd7c2f
commit 0268ad08cd

View file

@ -480,27 +480,10 @@ switch_tracker_get_mapping (GValue *value,
{
Place *place = user_data;
g_autofree const gchar **locations = NULL;
GFile *location;
gint idx;
gboolean found;
const gchar *path;
found = FALSE;
locations = g_variant_get_strv (variant, NULL);
for (idx = 0; locations[idx] != NULL; idx++)
{
path = path_from_tracker_dir (locations[idx]);
if (path == NULL)
continue;
location = g_file_new_for_path (path);
found = g_file_equal (location, place->location);
g_object_unref (location);
if (found)
break;
}
found = location_in_path_strv (place->location, locations);
g_value_set_boolean (value, found);
return TRUE;