[Xfce4-commits] <postler:master> Recognize 'attach' field in mailto: strings

Christian Dywan noreply at xfce.org
Sat Dec 11 20:08:07 CET 2010


Updating branch refs/heads/master
         to 7d91ed14fb30e527f2e60ff944c4ca6549140fd2 (commit)
       from 8bb0abcceda7c0ed5275b77419dbe7a126dde9dc (commit)

commit 7d91ed14fb30e527f2e60ff944c4ca6549140fd2
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Dec 11 15:14:40 2010 +0100

    Recognize 'attach' field in mailto: strings

 postler/postler-composer.vala |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/postler/postler-composer.vala b/postler/postler-composer.vala
index 8d29f64..573ba3f 100644
--- a/postler/postler-composer.vala
+++ b/postler/postler-composer.vala
@@ -553,6 +553,19 @@ public class Postler.Composer : Gtk.Window {
             entry = entry_copy;
         else if (name == "subject")
             entry = entry_subject;
+        else if (name == "attach") {
+            if (Path.is_absolute (data) && FileUtils.test (data, FileTest.EXISTS)) {
+                insert_attachment (data);
+                return true;
+            }
+            else if (data.has_prefix ("file:///")) {
+                string filename = data.substring (8, -1);
+                if (FileUtils.test (filename, FileTest.EXISTS))
+                    return true;
+            }
+            GLib.warning (_("File %s doesn't exist"), data);
+            return false;
+        }
         else
             return false;
 



More information about the Xfce4-commits mailing list