aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}
}