[geary/mjog/composer-autocomplete-fixes: 2/4] Don't use public addresses setter internally in EmailEntry



commit 30225239c9a5337e8eb0abeb14d120c6cea1dbfd
Author: Michael Gratton <mike vee net>
Date:   Wed Feb 12 13:00:59 2020 +1100

    Don't use public addresses setter internally in EmailEntry
    
    Fixes being unable to enter spaces or other punctuation in half-formed
    email addresses because the public setter was causing the entry's text
    to be reset with the formatted address.

 src/client/composer/composer-email-entry.vala | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/client/composer/composer-email-entry.vala b/src/client/composer/composer-email-entry.vala
index 9502fb9a..977d6222 100644
--- a/src/client/composer/composer-email-entry.vala
+++ b/src/client/composer/composer-email-entry.vala
@@ -58,7 +58,7 @@ public class Composer.EmailEntry : Gtk.Entry {
     }
 
     private void validate_addresses() {
-        bool is_valid = !this.addresses.is_empty;
+        bool is_valid = !this._addresses.is_empty;
         foreach (Geary.RFC822.MailboxAddress address in this.addresses) {
             if (!address.is_valid()) {
                 is_valid = false;
@@ -77,11 +77,11 @@ public class Composer.EmailEntry : Gtk.Entry {
             completion.update_model();
         }
 
-        if (Geary.String.is_empty(text.strip())) {
-            this.addresses = new Geary.RFC822.MailboxAddresses();
+        if (Geary.String.is_empty_or_whitespace(text)) {
+            this._addresses = new Geary.RFC822.MailboxAddresses();
             this.is_valid = false;
         } else {
-            this.addresses =
+            this._addresses =
                 new Geary.RFC822.MailboxAddresses.from_rfc822_string(text);
             this.is_valid = true;
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]