Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/volumestoolbar.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-07-28 11:50:27 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-07-28 11:50:27 (GMT)
commitd08dc38f0021c2f285517dd3b622d529b605326d (patch)
treec41e4de1b4d6a4d14fa8962c0369db4d925be15c /volumestoolbar.py
parent341530a80df8062caf3bd9bc9e06bd2d8103b18b (diff)
Ignore non removable devices.
Diffstat (limited to 'volumestoolbar.py')
-rw-r--r--volumestoolbar.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/volumestoolbar.py b/volumestoolbar.py
index fdd6845..0065ad3 100644
--- a/volumestoolbar.py
+++ b/volumestoolbar.py
@@ -35,6 +35,11 @@ HAL_MANAGER_IFACE = 'org.freedesktop.Hal.Manager'
HAL_DEVICE_IFACE = 'org.freedesktop.Hal.Device'
HAL_VOLUME_IFACE = 'org.freedesktop.Hal.Device.Volume'
+# FIXME
+# We are duplicating DBUS calls too much, and
+# mixing HAL calls with the UI code is ugly.
+# We should split the model out to Volume/VolumeManager.
+
class VolumesToolbar(gtk.Toolbar):
__gtype_name__ = 'VolumesToolbar'
@@ -117,6 +122,14 @@ class VolumesToolbar(gtk.Toolbar):
if device.GetProperty('volume.mount_point') == '/':
return
+ storage_udi = device.GetProperty('block.storage_device')
+ obj = bus.get_object(HAL_SERVICE_NAME, storage_udi)
+ storage_device = dbus.Interface(obj, HAL_DEVICE_IFACE)
+
+ # Ignore not removable storage.
+ if not storage_device.GetProperty('storage.removable'):
+ return
+
logging.debug('VolumeToolbar._mount_hal_device: %r' % udi)
# listen to mount/unmount