From: Christian Dywan Date: Sun, 31 Jan 2010 21:10:24 +0000 (+0100) Subject: Merge ident-string setting into user-agent for old and new WebKit X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f9d726c5553952e025b68a65cc3424cce6ef73e;p=midori Merge ident-string setting into user-agent for old and new WebKit Since the existence of two properties causes confusion among users we merge the two, and actually remove ident-string. --- diff --git a/midori/main.c b/midori/main.c index 57ced9f2..12481b80 100644 --- a/midori/main.c +++ b/midori/main.c @@ -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 diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index ed769fc7..3898ccde 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -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); diff --git a/midori/midori-view.c b/midori/midori-view.c index 2b3635ab..09b9e6b2 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -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 diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index ce5b7a17..c53802e6 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -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); diff --git a/tests/properties.c b/tests/properties.c index 93bf2228..6de616c3 100644 --- a/tests/properties.c +++ b/tests/properties.c @@ -25,7 +25,7 @@ typedef struct static ObjectProperty properties_object_skip[] = { - { "MidoriWebSettings", "ident-string" }, + { "MidoriWebSettings", "user-agent" }, }; static gboolean