[simple-scan] Skip virtual devices when detecting scanners
- From: Bartosz <bkosiorek src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [simple-scan] Skip virtual devices when detecting scanners
- Date: Thu, 3 Mar 2022 12:18:13 +0000 (UTC)
commit b907b9fbf5faaabf44d51cb3ea99d4ff25039f4c
Author: Yassine Oudjana <y oudjana protonmail com>
Date: Thu Mar 3 10:32:18 2022 +0400
Skip virtual devices when detecting scanners
Virtual devices are generally not scanners. Skip them to avoid
picking up webcams and other media devices as scanners.
src/scanner.vala | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/src/scanner.vala b/src/scanner.vala
index 809ba6c0..495ee9d0 100644
--- a/src/scanner.vala
+++ b/src/scanner.vala
@@ -367,6 +367,10 @@ public class Scanner : Object
var devices = new List<ScanDevice> ();
for (var i = 0; device_list[i] != null; i++)
{
+ /* Virtual devices tend to not be scanners. Skip them. */
+ if (device_list[i].type == "virtual device")
+ continue;
+
debug ("Device: name=\"%s\" vendor=\"%s\" model=\"%s\" type=\"%s\"",
device_list[i].name, device_list[i].vendor, device_list[i].model, device_list[i].type);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]