summaryrefslogtreecommitdiff
path: root/debian/patches/10-set_supported_flags.patch
blob: d086e78571c718a204ac678c307802b72c10268e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Origin:
 http://bazaar.launchpad.net/~robert-ancell/simple-scan/trunk/revision/394
Bug: https://bugs.launchpad.net/566759
Applied-Upstream: commit: 394
Description: Set "duplex" and "batch-scan" flags if supported by driver.
---
 src/scanner.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- simple-scan.orig/src/scanner.c
+++ simple-scan/src/scanner.c
@@ -1054,6 +1054,14 @@ do_get_option (Scanner *scanner)
             break;
         }
     }
+    else if (strcmp (option->name, "duplex") == 0) {
+        if (option->type == SANE_TYPE_BOOL)
+            set_bool_option (scanner->priv->handle, option, option_index, job->type == SCAN_ADF_BOTH, NULL);
+    }
+    else if (strcmp (option->name, "batch-scan") == 0) {
+        if (option->type == SANE_TYPE_BOOL)
+            set_bool_option (scanner->priv->handle, option, option_index, job->type != SCAN_SINGLE, NULL);
+    }
     else if (strcmp (option->name, SANE_NAME_BIT_DEPTH) == 0) {
         if (job->depth > 0)
             set_int_option (scanner->priv->handle, option, option_index, job->depth, NULL);