diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2018-09-04 20:33:17 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2018-09-04 20:33:17 +0200 |
commit | 46c7d1c8d370e549c23ad8425c2a0ab516f5d787 (patch) | |
tree | d2aafe2273d9c6c67d9138f5fb63bd53d125a21d /src/simple-scan.vala | |
parent | 92a79aacbf96307f4d31f0034f5058415cc34c5c (diff) | |
parent | e2ede7c4bc7accffd3d1526bf98121654e24bbae (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/simple-scan.vala')
-rw-r--r-- | src/simple-scan.vala | 15 |
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 */ |