aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2015-06-14 19:12:46 +0200
committerJavier <dev.git@javispedro.com>2015-06-14 19:12:46 +0200
commit695a146f6e1e923b599ea140f934cbe97b483858 (patch)
tree58c65d9165cf8253c08a879764b3bcbdc3517570
parent8f96d8d5edc98fc1b7cacd02f3219e1a2f0fcab7 (diff)
downloadscribiu-695a146f6e1e923b599ea140f934cbe97b483858.tar.gz
scribiu-695a146f6e1e923b599ea140f934cbe97b483858.zip
fix issue with hot unplug of smartpen
-rw-r--r--smartpenmanager.cc5
1 files changed, 4 insertions, 1 deletions
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);
}
}