]> spindle.queued.net Git - midori/commitdiff
Merge ident-string setting into user-agent for old and new WebKit
authorChristian Dywan <christian@twotoasts.de>
Sun, 31 Jan 2010 21:10:24 +0000 (22:10 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sun, 31 Jan 2010 21:10:24 +0000 (22:10 +0100)
Since the existence of two properties causes confusion among users
we merge the two, and actually remove ident-string.

midori/main.c
midori/midori-preferences.c
midori/midori-view.c
midori/midori-websettings.c
tests/properties.c

index 57ced9f294b3bd824a89d8bc9aebfdfd0b9d60fc..12481b80b4213259dd5dc67c3cb91200c63b3858 100644 (file)
@@ -980,7 +980,7 @@ soup_session_settings_notify_ident_string_cb (MidoriWebSettings* settings,
                                               GParamSpec*        pspec,
                                               SoupSession*       session)
 {
-    gchar* ident_string = katze_object_get_string (settings, "ident-string");
+    gchar* ident_string = katze_object_get_string (settings, "user-agent");
     g_object_set (session, "user-agent", ident_string, NULL);
     g_free (ident_string);
 }
@@ -1044,7 +1044,7 @@ midori_soup_session_prepare (SoupSession*       session,
 
     #if !WEBKIT_CHECK_VERSION (1, 1, 11)
     soup_session_settings_notify_ident_string_cb (settings, NULL, session);
-    g_signal_connect (settings, "notify::ident-string",
+    g_signal_connect (settings, "notify::user-agent",
         G_CALLBACK (soup_session_settings_notify_ident_string_cb), session);
     #endif
 
index ed769fc72737f553db8d6c8ef6297849654953eb..3898ccdeff7bf87318e4a1a03f61138b9f1c2034 100644 (file)
@@ -493,7 +493,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     #endif
     label = katze_property_label (settings, "identify-as");
     INDENTED_ADD (label);
-    button = katze_property_proxy (settings, "identify-as", "custom-ident-string");
+    button = katze_property_proxy (settings, "identify-as", "custom-user-agent");
     SPANNED_ADD (button);
     label = katze_property_label (settings, "preferred-languages");
     INDENTED_ADD (label);
index 2b3635abfe790756e42e2b6d8e14852931ba71f5..09b9e6b23393bcaefe2392f0170e15188f3091e1 100644 (file)
@@ -3225,7 +3225,7 @@ midori_view_set_uri (MidoriView*  view,
             {
                 gchar** argument_vector = sokoke_get_argv (NULL);
                 gchar* command_line = g_strjoinv (" ", argument_vector);
-                gchar* ident = katze_object_get_string (view->settings, "ident-string");
+                gchar* ident = katze_object_get_string (view->settings, "user-agent");
                 #if defined (G_OS_WIN32)
                 gchar* sys_name = g_strdup ("Windows");
                 #else
index ce5b7a174ec9ecd7c5146d3dd01d52dd3151c361..c53802e67b19b5ec5cf34a165738023c71df5a02 100644 (file)
@@ -173,7 +173,7 @@ enum
     PROP_HTTP_PROXY,
     PROP_AUTO_DETECT_PROXY,
     PROP_IDENTIFY_AS,
-    PROP_IDENT_STRING,
+    PROP_USER_AGENT,
     PROP_PREFERRED_LANGUAGES,
 
     PROP_CLEAR_PRIVATE_DATA
@@ -1063,16 +1063,16 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
                                      G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
     /**
-    * MidoriWebSettings:ident-string:
-    *
-    * The browser identification string.
-    *
-    * Since: 0.1.2
-    */
+     * MidoriWebSettings:user-agent:
+     *
+     * The browser identification string.
+     *
+     * Since: 0.2.3
+     */
     g_object_class_install_property (gobject_class,
-                                     PROP_IDENT_STRING,
+                                     PROP_USER_AGENT,
                                      g_param_spec_string (
-                                     "ident-string",
+                                     "user-agent",
                                      _("Identification string"),
                                      _("The application identification string"),
                                      NULL,
@@ -1511,16 +1511,17 @@ midori_web_settings_set_property (GObject*      object,
             katze_assign (web_settings->ident_string, string);
             #if WEBKIT_CHECK_VERSION (1, 1, 11)
             g_object_set (web_settings, "user-agent", string, NULL);
+            #else
+            g_object_notify (object, "user-agent");
             #endif
-            g_object_notify (object, "ident-string");
         }
         break;
-    case PROP_IDENT_STRING:
+    case PROP_USER_AGENT:
         if (web_settings->identify_as == MIDORI_IDENT_CUSTOM)
         {
             katze_assign (web_settings->ident_string, g_value_dup_string (value));
             #if WEBKIT_CHECK_VERSION (1, 1, 11)
-            g_object_set (web_settings, "user-agent", web_settings->ident_string, NULL);
+            g_object_set (web_settings, "WebKitWebSettings::user-agent", web_settings->ident_string, NULL);
             #endif
         }
         break;
@@ -1750,7 +1751,7 @@ midori_web_settings_get_property (GObject*    object,
     case PROP_IDENTIFY_AS:
         g_value_set_enum (value, web_settings->identify_as);
         break;
-    case PROP_IDENT_STRING:
+    case PROP_USER_AGENT:
         if (!g_strcmp0 (web_settings->ident_string, ""))
         {
             gchar* string = generate_ident_string (web_settings->identify_as);
index 93bf222885ed2ba60b2e84c0784d549d74b16240..6de616c3b8d06208b670e15ef9c20fb64f6095d5 100644 (file)
@@ -25,7 +25,7 @@ typedef struct
 
 static ObjectProperty properties_object_skip[] =
 {
-    { "MidoriWebSettings", "ident-string" },
+    { "MidoriWebSettings", "user-agent" },
 };
 
 static gboolean