From 3c6f48bd4c108becab36e7f757871a5467269063 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Sun, 1 Aug 2010 12:00:50 +0000 Subject: [PATCH] Ignore mounted samba shares and CDs from the GIO lister --- src/devices/giolister.cpp | 8 ++++++++ src/devices/giolister.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/devices/giolister.cpp b/src/devices/giolister.cpp index 9fe2ffb4f..d0f54d94a 100644 --- a/src/devices/giolister.cpp +++ b/src/devices/giolister.cpp @@ -27,6 +27,12 @@ QString GioLister::MountInfo::unique_id() const { return QString("Gio/%1/%2/%3").arg(uuid, filesystem_type).arg(filesystem_size); } +bool GioLister::MountInfo::is_suitable() const { + return filesystem_type != "udf" && + filesystem_type != "smb" && + filesystem_type != "cifs"; +} + GioLister::GioLister() : monitor_(NULL) { @@ -133,6 +139,8 @@ void GioLister::MountRemovedCallback(GVolumeMonitor*, GMount* m, gpointer d) { void GioLister::MountAdded(GMount *mount) { MountInfo info = ReadMountInfo(mount); + if (!info.is_suitable()) + return; { QMutexLocker l(&mutex_); diff --git a/src/devices/giolister.h b/src/devices/giolister.h index ddc0f6e9d..5f2b16278 100644 --- a/src/devices/giolister.h +++ b/src/devices/giolister.h @@ -54,6 +54,7 @@ private: MountInfo() : filesystem_size(0), filesystem_free(0) {} QString unique_id() const; + bool is_suitable() const; GMount* mount; QString unix_device;