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.
This commit is contained in:
Christian Dywan 2010-01-31 22:10:24 +01:00
parent c181b45db9
commit 4f9d726c55
5 changed files with 19 additions and 18 deletions

View file

@ -980,7 +980,7 @@ soup_session_settings_notify_ident_string_cb (MidoriWebSettings* settings,
GParamSpec* pspec, GParamSpec* pspec,
SoupSession* session) 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_object_set (session, "user-agent", ident_string, NULL);
g_free (ident_string); g_free (ident_string);
} }
@ -1044,7 +1044,7 @@ midori_soup_session_prepare (SoupSession* session,
#if !WEBKIT_CHECK_VERSION (1, 1, 11) #if !WEBKIT_CHECK_VERSION (1, 1, 11)
soup_session_settings_notify_ident_string_cb (settings, NULL, session); 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); G_CALLBACK (soup_session_settings_notify_ident_string_cb), session);
#endif #endif

View file

@ -493,7 +493,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
#endif #endif
label = katze_property_label (settings, "identify-as"); label = katze_property_label (settings, "identify-as");
INDENTED_ADD (label); 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); SPANNED_ADD (button);
label = katze_property_label (settings, "preferred-languages"); label = katze_property_label (settings, "preferred-languages");
INDENTED_ADD (label); INDENTED_ADD (label);

View file

@ -3225,7 +3225,7 @@ midori_view_set_uri (MidoriView* view,
{ {
gchar** argument_vector = sokoke_get_argv (NULL); gchar** argument_vector = sokoke_get_argv (NULL);
gchar* command_line = g_strjoinv (" ", argument_vector); 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) #if defined (G_OS_WIN32)
gchar* sys_name = g_strdup ("Windows"); gchar* sys_name = g_strdup ("Windows");
#else #else

View file

@ -173,7 +173,7 @@ enum
PROP_HTTP_PROXY, PROP_HTTP_PROXY,
PROP_AUTO_DETECT_PROXY, PROP_AUTO_DETECT_PROXY,
PROP_IDENTIFY_AS, PROP_IDENTIFY_AS,
PROP_IDENT_STRING, PROP_USER_AGENT,
PROP_PREFERRED_LANGUAGES, PROP_PREFERRED_LANGUAGES,
PROP_CLEAR_PRIVATE_DATA PROP_CLEAR_PRIVATE_DATA
@ -1063,16 +1063,16 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/** /**
* MidoriWebSettings:ident-string: * MidoriWebSettings:user-agent:
* *
* The browser identification string. * The browser identification string.
* *
* Since: 0.1.2 * Since: 0.2.3
*/ */
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_IDENT_STRING, PROP_USER_AGENT,
g_param_spec_string ( g_param_spec_string (
"ident-string", "user-agent",
_("Identification string"), _("Identification string"),
_("The application identification string"), _("The application identification string"),
NULL, NULL,
@ -1511,16 +1511,17 @@ midori_web_settings_set_property (GObject* object,
katze_assign (web_settings->ident_string, string); katze_assign (web_settings->ident_string, string);
#if WEBKIT_CHECK_VERSION (1, 1, 11) #if WEBKIT_CHECK_VERSION (1, 1, 11)
g_object_set (web_settings, "user-agent", string, NULL); g_object_set (web_settings, "user-agent", string, NULL);
#else
g_object_notify (object, "user-agent");
#endif #endif
g_object_notify (object, "ident-string");
} }
break; break;
case PROP_IDENT_STRING: case PROP_USER_AGENT:
if (web_settings->identify_as == MIDORI_IDENT_CUSTOM) if (web_settings->identify_as == MIDORI_IDENT_CUSTOM)
{ {
katze_assign (web_settings->ident_string, g_value_dup_string (value)); katze_assign (web_settings->ident_string, g_value_dup_string (value));
#if WEBKIT_CHECK_VERSION (1, 1, 11) #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 #endif
} }
break; break;
@ -1750,7 +1751,7 @@ midori_web_settings_get_property (GObject* object,
case PROP_IDENTIFY_AS: case PROP_IDENTIFY_AS:
g_value_set_enum (value, web_settings->identify_as); g_value_set_enum (value, web_settings->identify_as);
break; break;
case PROP_IDENT_STRING: case PROP_USER_AGENT:
if (!g_strcmp0 (web_settings->ident_string, "")) if (!g_strcmp0 (web_settings->ident_string, ""))
{ {
gchar* string = generate_ident_string (web_settings->identify_as); gchar* string = generate_ident_string (web_settings->identify_as);

View file

@ -25,7 +25,7 @@ typedef struct
static ObjectProperty properties_object_skip[] = static ObjectProperty properties_object_skip[] =
{ {
{ "MidoriWebSettings", "ident-string" }, { "MidoriWebSettings", "user-agent" },
}; };
static gboolean static gboolean