summaryrefslogtreecommitdiff
path: root/src/simple-scan.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-09-04 18:18:13 +0200
committerJörg Frings-Fürst <debian@jff.email>2018-09-04 18:18:13 +0200
commitb2fe70f34ddcec7550630efd5cd9f8ed9c7bada8 (patch)
tree8bb3a861dd93f3e7052d6d12d6a0b98528c7399d /src/simple-scan.vala
parent92a79aacbf96307f4d31f0034f5058415cc34c5c (diff)
parentfeffc9fa14d9edbd4cd924de55020c311607a8ff (diff)
Update upstream source from tag 'upstream/3.30.0'
Update to upstream version '3.30.0' with Debian dir b4810f15e03280de0ce8db7bb4647da6a4db4948
Diffstat (limited to 'src/simple-scan.vala')
-rw-r--r--src/simple-scan.vala15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/simple-scan.vala b/src/simple-scan.vala
index d029cd7..d30aa45 100644
--- a/src/simple-scan.vala
+++ b/src/simple-scan.vala
@@ -35,6 +35,7 @@ public class SimpleScan : Gtk.Application
private AppWindow app;
private Scanner scanner;
private Book book;
+ private Page scanned_page;
public SimpleScan (ScanDevice? device = null)
{
@@ -350,25 +351,24 @@ public class SimpleScan : Gtk.Application
info.width, info.height, info.depth);
/* Add a new page */
- var page = append_page ();
- page.set_page_info (info);
+ scanned_page = append_page ();
+ scanned_page.set_page_info (info);
/* Get ICC color profile */
/* FIXME: The ICC profile could change */
/* FIXME: Don't do a D-bus call for each page, cache color profiles */
- page.color_profile = get_profile_for_device (info.device);
+ scanned_page.color_profile = get_profile_for_device (info.device);
}
private void scanner_line_cb (Scanner scanner, ScanLine line)
{
- var page = book.get_page ((int) book.n_pages - 1);
- page.parse_scan_line (line);
+ scanned_page.parse_scan_line (line);
}
private void scanner_page_done_cb (Scanner scanner)
{
- var page = book.get_page ((int) book.n_pages - 1);
- page.finish ();
+ scanned_page.finish ();
+ scanned_page = null;
}
private void remove_empty_page ()
@@ -386,6 +386,7 @@ public class SimpleScan : Gtk.Application
private void scanner_failed_cb (Scanner scanner, int error_code, string error_string)
{
remove_empty_page ();
+ scanned_page = null;
if (error_code != Sane.Status.CANCELLED)
{
app.show_error_dialog (/* Title of error dialog when scan failed */