aboutsummaryrefslogtreecommitdiff
path: root/src/udev-mgr.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-09-27 16:55:41 -0500
committerTed Gould <ted@gould.cx>2011-09-27 16:55:41 -0500
commit1e3f1b724bfbb1283b482ddd11db1ee417e4eeb3 (patch)
tree831776c7d01e111e88cd7767aa3cfc3d9d1f93f6 /src/udev-mgr.c
parenta316c5aac1ea8928f5da7cc916d534ea6eb7ab5e (diff)
parent18f3158453229388605760aa8e738a9adb65109b (diff)
downloadayatana-indicator-session-1e3f1b724bfbb1283b482ddd11db1ee417e4eeb3.tar.gz
ayatana-indicator-session-1e3f1b724bfbb1283b482ddd11db1ee417e4eeb3.tar.bz2
ayatana-indicator-session-1e3f1b724bfbb1283b482ddd11db1ee417e4eeb3.zip
Update to ubuntu-desktop version
Diffstat (limited to 'src/udev-mgr.c')
-rw-r--r--src/udev-mgr.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/udev-mgr.c b/src/udev-mgr.c
index edc2262..5f197d6 100644
--- a/src/udev-mgr.c
+++ b/src/udev-mgr.c
@@ -226,7 +226,11 @@ udev_mgr_handle_webcam (UdevMgr* self,
vendor = g_udev_device_get_property (device, "ID_VENDOR_ID");
product = g_udev_device_get_property (device, "ID_MODEL_ID");
-
+
+ if (!vendor || !product) {
+ return;
+ }
+
if (action == REMOVE){
if (g_hash_table_lookup (self->webcams_present, product) == NULL){
g_warning ("Got a remove event on a webcam device but we don't have that device in our webcam cache");
@@ -316,18 +320,23 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self,
{
const gchar* type = NULL;
type = g_udev_device_get_property (device, "TYPE");
- // apparently anything thats type 3 and SCSI is a Scanner
+
+ if (!type) {
+ return;
+ }
+
+ // apparently anything thats type 6 and SCSI is a Scanner
if (g_strcmp0 (type, "6") == 0 && action == ADD){
const gchar* manufacturer = NULL;
manufacturer = g_udev_device_get_property (device, "ID_VENDOR");
if (manufacturer != NULL){
- gchar * label = format_device_name(self, manufacturer, _("Scanner"), _("%s Scanner"));
+ gchar * label = format_device_name(self, manufacturer, _("Scanner"), _("%s Scanner"));
dbusmenu_menuitem_property_set (self->scanner_item,
DBUSMENU_MENUITEM_PROP_LABEL,
label);
- g_free(label);
+ g_free(label);
}
gchar* random_scanner_name = g_strdup_printf("%p--scanner", self);