summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2021-02-18 12:52:51 +0100
committerJörg Frings-Fürst <debian@jff.email>2021-02-18 12:52:51 +0100
commitc2bb4f98199d9054f82b538ff44f895a8399bb28 (patch)
tree604832b3cffdf20b13a5b1a09434e9a806cf3674 /src
parentee6f7618785519daa986955db561166cc58a3633 (diff)
parentefe8a90877a031270375c1f2c0f1823560d85100 (diff)
Update upstream source from tag 'upstream/3.38.2'
Update to upstream version '3.38.2' with Debian dir 5d358ce57d6e648c73e62c3d682682995cae0bf7
Diffstat (limited to 'src')
-rw-r--r--src/preferences-dialog.vala2
-rw-r--r--src/scanner.vala26
-rw-r--r--src/simple-scan.vala2
3 files changed, 19 insertions, 11 deletions
diff --git a/src/preferences-dialog.vala b/src/preferences-dialog.vala
index 06dca75..a0fb9e9 100644
--- a/src/preferences-dialog.vala
+++ b/src/preferences-dialog.vala
@@ -276,7 +276,7 @@ private class PreferencesDialog : Gtk.Dialog
combo.add_attribute (renderer, "text", 1);
var model = combo.model as Gtk.ListStore;
- int[] scan_resolutions = {75, 150, 300, 600, 1200, 2400};
+ int[] scan_resolutions = {75, 150, 200, 300, 600, 1200, 2400};
foreach (var dpi in scan_resolutions)
{
string label;
diff --git a/src/scanner.vala b/src/scanner.vala
index becb9fa..237e1eb 100644
--- a/src/scanner.vala
+++ b/src/scanner.vala
@@ -662,10 +662,12 @@ public class Scanner : Object
switch (option.constraint_type)
{
case Sane.ConstraintType.RANGE:
- if (option.type == Sane.ValueType.FIXED)
- s += " min=%f, max=%f, quant=%d".printf (Sane.UNFIX (option.range.min), Sane.UNFIX (option.range.max), (int) option.range.quant);
- else
- s += " min=%d, max=%d, quant=%d".printf ((int) option.range.min, (int) option.range.max, (int) option.range.quant);
+ if (option.range != null) {
+ if (option.type == Sane.ValueType.FIXED)
+ s += " min=%f, max=%f, quant=%d".printf (Sane.UNFIX (option.range.min), Sane.UNFIX (option.range.max), (int) option.range.quant);
+ else
+ s += " min=%d, max=%d, quant=%d".printf ((int) option.range.min, (int) option.range.max, (int) option.range.quant);
+ }
break;
case Sane.ConstraintType.WORD_LIST:
s += " values=[";
@@ -682,11 +684,13 @@ public class Scanner : Object
break;
case Sane.ConstraintType.STRING_LIST:
s += " values=[";
- for (var i = 0; option.string_list[i] != null; i++)
- {
- if (i != 0)
- s += ", ";
- s += "\"%s\"".printf (option.string_list[i]);
+ if (option.string_list != null) {
+ for (var i = 0; option.string_list[i] != null; i++)
+ {
+ if (i != 0)
+ s += ", ";
+ s += "\"%s\"".printf (option.string_list[i]);
+ }
}
s += "]";
break;
@@ -1422,6 +1426,10 @@ public class Scanner : Object
if (status == Sane.Status.NO_DOCS)
{
do_complete_document ();
+ if (page_number == 0)
+ fail_scan (status,
+ /* Error displayed when no documents at the start of scanning */
+ _("Document feeder empty"));
return;
}
diff --git a/src/simple-scan.vala b/src/simple-scan.vala
index 3f495e5..84d8a8c 100644
--- a/src/simple-scan.vala
+++ b/src/simple-scan.vala
@@ -1773,7 +1773,7 @@ public class SimpleScan : Gtk.Application
* but will not work on KDE, LXDE, XFCE, ... */
inhibit_cookie = inhibit (app, Gtk.ApplicationInhibitFlags.IDLE, reason);
- if (!is_inhibited (Gtk.ApplicationInhibitFlags.IDLE))
+ if (inhibit_cookie == 0)
{
/* If the previous method didn't work, try the one
* provided by Freedesktop. It should work with KDE,