search-locations-dialog: Allow multiple XDG folders to same location
Now that each place has stores an array of possible paths, use the
stored paths to compare against the tracker locations rather than
the single (possibly incorrect) stored location. This allows for
multiple xdg folders (with different paths) pointing to a single
location.
Rather than recreating the path using the stored location, store the
Place's path(s). With the exception of xdg directories, this doesn't
change the behavior of paths. But for xdg directories, we can have
a single location that points to multiple paths. This commit does not
cause any change in behavior.
search-locations-dialog: Stop using destroyed GFile
While iterating through the possible locations, we can potentially
keep destroyed GFiles in the hashtable because of the calls to
g_hash_table_insert instead of g_hash_table_replace. The
place owns the reference to the file and upon inserting a duplicate
place the place is freed (releasing the reference to the GFile).
This usually won't happen because in most cases we check for an
existing place, but during the iteration for xdg we don't check
and if two xdg directories point to the same location, we will
end up in this situtation.
Replace all calls for insert with replace to address this issue
and prevent possible future issues.