Remove the proxy hack, it's not reliable at all

This commit is contained in:
Christian Dywan 2008-10-06 00:27:25 +02:00
parent ba6386850e
commit a13f8b64b3
2 changed files with 4 additions and 19 deletions

View file

@ -77,7 +77,6 @@ struct _MidoriView
gboolean middle_click_opens_selection; gboolean middle_click_opens_selection;
gboolean open_tabs_in_the_background; gboolean open_tabs_in_the_background;
gboolean close_buttons_on_tabs; gboolean close_buttons_on_tabs;
gchar* http_proxy;
GtkWidget* menu_item; GtkWidget* menu_item;
GtkWidget* tab_label; GtkWidget* tab_label;
@ -908,11 +907,6 @@ receive_command (MidoriView* view,
{ {
view->open_tabs_in_the_background = atoi (&command[8]); view->open_tabs_in_the_background = atoi (&command[8]);
} }
else if (!strncmp (command, "proxy ", 6))
{
katze_assign (view->http_proxy, g_strdup (&command[6]));
g_setenv ("http_proxy", view->http_proxy ? view->http_proxy : "", TRUE);
}
else if (g_str_has_prefix (command, "**")) else if (g_str_has_prefix (command, "**"))
g_print ("%s\n", command); g_print ("%s\n", command);
else else
@ -1643,7 +1637,6 @@ midori_view_init (MidoriView* view)
view->download_manager = NULL; view->download_manager = NULL;
view->default_font_family = NULL; view->default_font_family = NULL;
view->default_encoding = NULL; view->default_encoding = NULL;
view->http_proxy = NULL;
g_object_connect (view, g_object_connect (view,
"signal::notify::uri", "signal::notify::uri",
@ -1895,7 +1888,6 @@ _midori_view_update_settings (MidoriView* view)
"close-buttons-on-tabs", &view->close_buttons_on_tabs, "close-buttons-on-tabs", &view->close_buttons_on_tabs,
"middle-click-opens-selection", &view->middle_click_opens_selection, "middle-click-opens-selection", &view->middle_click_opens_selection,
"open-tabs-in-the-background", &view->open_tabs_in_the_background, "open-tabs-in-the-background", &view->open_tabs_in_the_background,
"http-proxy", &view->http_proxy,
NULL); NULL);
if (midori_view_is_socket (view)) if (midori_view_is_socket (view))
@ -1915,7 +1907,6 @@ _midori_view_update_settings (MidoriView* view)
int_to_str (view->middle_click_opens_selection)); int_to_str (view->middle_click_opens_selection));
send_command (view, "tabsbkg", send_command (view, "tabsbkg",
int_to_str (view->open_tabs_in_the_background)); int_to_str (view->open_tabs_in_the_background));
send_command (view, "proxy", view->http_proxy);
} }
} }
@ -2017,12 +2008,6 @@ midori_view_settings_notify_cb (MidoriWebSettings* settings,
send_command (view, "tabsbkg", send_command (view, "tabsbkg",
int_to_str (view->open_tabs_in_the_background)); int_to_str (view->open_tabs_in_the_background));
} }
else if (name == g_intern_string ("http-proxy"))
{
katze_assign (view->http_proxy, g_value_dup_string (&value));
if (midori_view_is_socket (view))
send_command (view, "proxy", view->http_proxy);
}
g_value_unset (&value); g_value_unset (&value);
} }

View file

@ -582,8 +582,8 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
"http-proxy", "http-proxy",
_("HTTP Proxy"), _("HTTP Proxy"),
_("The proxy used for HTTP connections"), _("The proxy used for HTTP connections"),
g_getenv ("http_proxy"), NULL,
flags)); G_PARAM_READABLE));
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_CACHE_SIZE, PROP_CACHE_SIZE,
@ -622,6 +622,8 @@ notify_default_encoding_cb (GObject* object,
static void static void
midori_web_settings_init (MidoriWebSettings* web_settings) midori_web_settings_init (MidoriWebSettings* web_settings)
{ {
web_settings->http_proxy = NULL;
g_signal_connect (web_settings, "notify::default-encoding", g_signal_connect (web_settings, "notify::default-encoding",
G_CALLBACK (notify_default_encoding_cb), NULL); G_CALLBACK (notify_default_encoding_cb), NULL);
} }
@ -779,7 +781,6 @@ midori_web_settings_set_property (GObject* object,
case PROP_HTTP_PROXY: case PROP_HTTP_PROXY:
katze_assign (web_settings->http_proxy, g_value_dup_string (value)); katze_assign (web_settings->http_proxy, g_value_dup_string (value));
g_setenv ("http_proxy", web_settings->http_proxy ? web_settings->http_proxy : "", TRUE);
break; break;
case PROP_CACHE_SIZE: case PROP_CACHE_SIZE:
web_settings->cache_size = g_value_get_int (value); web_settings->cache_size = g_value_get_int (value);
@ -988,7 +989,6 @@ midori_web_settings_copy (MidoriWebSettings* web_settings)
"remember-last-form-inputs", web_settings->remember_last_form_inputs, "remember-last-form-inputs", web_settings->remember_last_form_inputs,
"remember-last-downloaded-files", web_settings->remember_last_downloaded_files, "remember-last-downloaded-files", web_settings->remember_last_downloaded_files,
"http-proxy", web_settings->http_proxy,
"cache-size", web_settings->cache_size, "cache-size", web_settings->cache_size,
NULL); NULL);