[epiphany] embed-prefs: Always append to user agent in app mode



commit 420080936a93b92fc2a0ebee5c1ab2fa09ceea1c
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri Jun 3 19:02:17 2016 -0500

    embed-prefs: Always append to user agent in app mode
    
    Append (WebappShell) even to a custom user agent set with GSettings.

 embed/ephy-embed-prefs.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/embed/ephy-embed-prefs.c b/embed/ephy-embed-prefs.c
index 0c8c574..175abf7 100644
--- a/embed/ephy-embed-prefs.c
+++ b/embed/ephy-embed-prefs.c
@@ -186,25 +186,23 @@ webkit_pref_callback_user_agent (GSettings  *settings,
   EphyEmbedShell *shell = ephy_embed_shell_get_default ();
   char *value;
   char *user_agent;
-  const char *internal_user_agent;
+  const char *base_user_agent;
 
   value = g_settings_get_string (settings, key);
-  if (value != NULL && value[0] != '\0') {
-    webkit_settings_set_user_agent (webkit_settings, value);
-    g_free (value);
-    return;
-  }
-  g_free (value);
-
-  internal_user_agent = webkit_pref_get_internal_user_agent ();
+  if (value != NULL && value[0] != '\0')
+    base_user_agent = value;
+  else
+    base_user_agent = webkit_pref_get_internal_user_agent ();
 
   if (ephy_embed_shell_get_mode (shell) == EPHY_EMBED_SHELL_MODE_APPLICATION)
-    user_agent = g_strdup_printf ("%s (WebappShell)", internal_user_agent);
+    user_agent = g_strdup_printf ("%s (WebappShell)", base_user_agent);
   else
-    user_agent = g_strdup (internal_user_agent);
+    user_agent = g_strdup (base_user_agent);
 
   webkit_settings_set_user_agent (webkit_settings, user_agent);
+
   g_free (user_agent);
+  g_free (value);
 }
 
 static gdouble


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