From 695a146f6e1e923b599ea140f934cbe97b483858 Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 14 Jun 2015 19:12:46 +0200 Subject: fix issue with hot unplug of smartpen --- smartpenmanager.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/smartpenmanager.cc b/smartpenmanager.cc index f35786a..1750589 100644 --- a/smartpenmanager.cc +++ b/smartpenmanager.cc @@ -77,7 +77,10 @@ void SmartpenManager::handleMonitorActivity() qDebug() << "udev activity"; udev_device *dev = udev_monitor_receive_device(_monitor); if (dev) { - processDevice(dev); + const char *action = udev_device_get_action(dev); + if (action && strcmp(action, "add") == 0) { + processDevice(dev); + } udev_device_unref(dev); } } -- cgit v1.2.3