diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2010-06-08 22:02:44 +0200 |
---|---|---|
committer | Arnel A. Borja <arnelborja@src.gnome.org> | 2013-08-31 00:56:44 +0800 |
commit | 8cea03ad3d6127abdcf5c6bd86627986a4e57def (patch) | |
tree | 000bde4c08649c1a8ced6958f948d70d2dca3c29 | |
parent | 840e1c8de10161c888b3d09a56ab770bff71afd7 (diff) | |
download | libmediaart-8cea03ad3d6127abdcf5c6bd86627986a4e57def.tar.gz |
libtracker-miner: properly detect removable media
-rw-r--r-- | src/libtracker-miner/tracker-storage.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/libtracker-miner/tracker-storage.c b/src/libtracker-miner/tracker-storage.c index 47c215d..a7f597f 100644 --- a/src/libtracker-miner/tracker-storage.c +++ b/src/libtracker-miner/tracker-storage.c @@ -480,8 +480,19 @@ mount_add (TrackerStorage *storage, } else { /* Any other removable media will have UUID in the GVolume. * Note that this also may include some partitions in the machine - * which have GVolumes associated to the GMounts */ - is_removable = TRUE; + * which have GVolumes associated to the GMounts. So, we need to + * explicitly check if the drive is media-removable (machine + * partitions won't be media-removable) */ + GDrive *drive; + + drive = g_volume_get_drive (volume); + if (drive) { + is_removable = g_drive_is_media_removable (drive); + g_object_unref (drive); + } else { + /* Note: not sure when this can happen... */ + is_removable = TRUE; + } } g_object_unref (volume); |