[simple-scan] Tidy up recent refactoring
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [simple-scan] Tidy up recent refactoring
- Date: Wed, 24 May 2017 02:13:23 +0000 (UTC)
commit f96236c2a51b1f5678c7754a16be3585c1bb7b69
Author: Robert Ancell <robert ancell canonical com>
Date: Wed May 24 14:11:48 2017 +1200
Tidy up recent refactoring
src/app-window.vala | 20 ++++++++------------
1 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/src/app-window.vala b/src/app-window.vala
index 663fd61..d05e6c2 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -1156,33 +1156,29 @@ public class AppWindow : Gtk.ApplicationWindow
email_document ();
}
-
private void email_document ()
{
show_progress_dialog ();
- string type = (document_hint == "text") ? "pdf" : "jpeg";
- string command_line = null;
- string path;
- bool file_exist = true;
+ var type = (document_hint == "text") ? "pdf" : "jpeg";
+ string? command_line = null;
+ var file_exist = true;
File file = null;
-
do
{
-
- /* get temporary filename */
+ /* Get temporary filename */
file_exist = false;
- path = get_temporary_filename (/* base filename of images attached to email */
- _("scan"), type);
+ var path = get_temporary_filename (/* Base filename of images attached to email */
+ _("scan"), type);
file = File.new_for_path (path);
command_line = "xdg-email";
if (type == "pdf")
{
- /* prepare command line */
+ /* Prepare command line */
command_line += " --attach %s".printf (path);
}
- else /* (type == "jpeg") */
+ else
{
/* make sure files doesn't exist and prepare command line */
for (var i = 0; i < book.n_pages; i++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]