Skip to content
Snippets Groups Projects
Commit 70a43016 authored by Lionel Le Folgoc's avatar Lionel Le Folgoc Committed by Nick Schermer
Browse files

Don't add duplicates of devices (bug #9440).

On some setups the volume-added singal is emitted after the
devices have been added, resulting in devices appear twice
in the sidepane.
parent 6e4f1c2d
No related branches found
No related tags found
No related merge requests found
......@@ -476,6 +476,14 @@ thunar_device_monitor_volume_added (GVolumeMonitor *volume_monitor,
_thunar_return_if_fail (monitor->volume_monitor == volume_monitor);
_thunar_return_if_fail (G_IS_VOLUME (volume));
/* check that the volume is not in the internal list already */
if (g_list_find (monitor->hidden_volumes, volume) != NULL)
return;
/* nor in the list of visible volumes */
if (g_hash_table_lookup (monitor->devices, volume) != NULL)
return;
/* add to internal list */
monitor->hidden_volumes = g_list_prepend (monitor->hidden_volumes, g_object_ref (volume));
......@@ -621,6 +629,10 @@ thunar_device_monitor_mount_added (GVolumeMonitor *volume_monitor,
_thunar_return_if_fail (monitor->volume_monitor == volume_monitor);
_thunar_return_if_fail (G_IS_MOUNT (mount));
/* check if the mount is not already known */
if (g_hash_table_lookup (monitor->devices, mount) != NULL)
return;
/* never handle shadowed mounts */
if (g_mount_is_shadowed (mount))
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment