aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-08-05 10:20:17 +0100
committerConor Curran <conor.curran@canonical.com>2011-08-05 10:20:17 +0100
commit7ccf396039ca441059913c9caa407d4662ed7b19 (patch)
tree3f7654e1321f095cb43f9683fa372edec0aede51
parent8cf9d6a47573502d4f32b002129c81a3026447f0 (diff)
downloadayatana-indicator-session-7ccf396039ca441059913c9caa407d4662ed7b19.tar.gz
ayatana-indicator-session-7ccf396039ca441059913c9caa407d4662ed7b19.tar.bz2
ayatana-indicator-session-7ccf396039ca441059913c9caa407d4662ed7b19.zip
cater for scsi type 3 and 6 devices
-rw-r--r--src/udev-mgr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/udev-mgr.c b/src/udev-mgr.c
index df491aa..cbb7dcb 100644
--- a/src/udev-mgr.c
+++ b/src/udev-mgr.c
@@ -277,6 +277,24 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self,
GUdevDevice* device,
UdevMgrDeviceAction action)
{
+ const gchar* type = NULL;
+ type = g_udev_device_get_property (device, "TYPE");
+ // apparently anything thats type 3 and SCSI is a Scanner
+ if (g_strcmp0 (type, "6") == 0){
+ gchar* random_scanner_name = g_strdup_printf("%p--scanner", self);
+ g_hash_table_insert (self->scanners_present,
+ g_strdup(random_scanner_name),
+ g_strdup("Scanner"));
+ g_free (random_scanner_name);
+ udev_mgr_update_menuitems (self);
+ return;
+ }
+
+ // We only care about type 3 for the special cases below
+ if (g_strcmp0 (type, "3") != 0){
+ return;
+ }
+
const gchar* vendor = NULL;
vendor = g_udev_device_get_property (device, "VENDOR");