[geary/wip/774603-configurable-gravatar-uri: 2/2] Make avatar loading URL configurable via a GSetting



commit 06e99cbf5691bf6b918db53f363182dd393fbc8b
Author: Michael Gratton <mike vee net>
Date:   Sun Oct 7 13:56:11 2018 +1100

    Make avatar loading URL configurable via a GSetting
    
    This lets users switch to using Libravatar, or disable remote avatar
    loading completely if desired.

 desktop/org.gnome.Geary.gschema.xml      |  6 +++
 po/POTFILES.in                           |  1 -
 src/client/application/geary-config.vala |  5 +++
 src/client/meson.build                   |  1 -
 src/client/util/util-gravatar.vala       | 64 --------------------------------
 5 files changed, 11 insertions(+), 66 deletions(-)
---
diff --git a/desktop/org.gnome.Geary.gschema.xml b/desktop/org.gnome.Geary.gschema.xml
index 5f50ff7b..a501ed74 100644
--- a/desktop/org.gnome.Geary.gschema.xml
+++ b/desktop/org.gnome.Geary.gschema.xml
@@ -135,6 +135,12 @@
         <description>The last recorded size of the detached composer window.</description>
     </key>
 
+    <key name="avatar-url" type="s">
+        <default>"https://secure.gravatar.com/avatar";</default>
+        <summary>Base URL to look up contact avatars</summary>
+        <description>A Gravatar or Libravatar compatible URL, set to the empty string to 
disable.</description>
+    </key>
+
     <key name="migrated-config" type="b">
         <default>false</default>
         <summary>Whether we migrated the old settings</summary>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e23b079a..367b87ea 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -93,7 +93,6 @@ src/client/util/util-date.vala
 src/client/util/util-email.vala
 src/client/util/util-files.vala
 src/client/util/util-gio.vala
-src/client/util/util-gravatar.vala
 src/client/util/util-gtk.vala
 src/client/util/util-international.vala
 src/client/util/util-migrate.vala
diff --git a/src/client/application/geary-config.vala b/src/client/application/geary-config.vala
index 639fec7a..6b8f9e65 100644
--- a/src/client/application/geary-config.vala
+++ b/src/client/application/geary-config.vala
@@ -31,6 +31,7 @@ public class Configuration {
     public const string SEARCH_STRATEGY_KEY = "search-strategy";
     public const string CONVERSATION_VIEWER_ZOOM_KEY = "conversation-viewer-zoom";
     public const string COMPOSER_WINDOW_SIZE_KEY = "composer-window-size";
+    public const string AVATAR_URL = "avatar-url";
 
 
     public enum DesktopEnvironment {
@@ -189,6 +190,10 @@ public class Configuration {
         }
     }
 
+    public string avatar_url {
+        owned get { return settings.get_string(AVATAR_URL); }
+    }
+
     // Creates a configuration object.
     public Configuration(string schema_id) {
         // Start GSettings.
diff --git a/src/client/meson.build b/src/client/meson.build
index ba97b8e3..6f8a75d2 100644
--- a/src/client/meson.build
+++ b/src/client/meson.build
@@ -97,7 +97,6 @@ geary_client_vala_sources = files(
   'util/util-email.vala',
   'util/util-files.vala',
   'util/util-gio.vala',
-  'util/util-gravatar.vala',
   'util/util-gtk.vala',
   'util/util-international.vala',
   'util/util-migrate.vala',


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