[Xfce4-commits] <xfce4-weather-plugin:master> Remove anything proxy-related that is not used anymore.

Harald Judt noreply at xfce.org
Tue Nov 20 20:18:15 CET 2012


Updating branch refs/heads/master
         to 7af6d45f4a83c46b58a1c88645742978ff67620a (commit)
       from 85d9c7f0eab8f1c39a8cdd43bcaf82262779d80f (commit)

commit 7af6d45f4a83c46b58a1c88645742978ff67620a
Author: Harald Judt <h.judt at gmx.at>
Date:   Tue Nov 20 20:08:54 2012 +0100

    Remove anything proxy-related that is not used anymore.

 panel-plugin/weather-debug.c |   11 ------
 panel-plugin/weather.c       |   78 ------------------------------------------
 panel-plugin/weather.h       |   12 ------
 3 files changed, 0 insertions(+), 101 deletions(-)

diff --git a/panel-plugin/weather-debug.c b/panel-plugin/weather-debug.c
index 686e6bf..06c9cf1 100644
--- a/panel-plugin/weather-debug.c
+++ b/panel-plugin/weather-debug.c
@@ -356,12 +356,6 @@ weather_dump_plugindata(const xfceweather_data *data)
                            "  unit system: %d\n"
                            "  night time: %s\n"
                            "  --------------------------------------------\n"
-                           "  proxy from env: %s\n"
-                           "  proxy host: %s\n"
-                           "  proxy port: %d\n"
-                           "  saved proxy host: %s\n"
-                           "  saved proxy port: %d\n"
-                           "  --------------------------------------------\n"
                            "  animation transitions: %s\n"
                            "  forecast days: %d\n"
                            "  --------------------------------------------",
@@ -377,11 +371,6 @@ weather_dump_plugindata(const xfceweather_data *data)
                            data->location_name,
                            data->unit_system,
                            YESNO(data->night_time),
-                           YESNO(data->proxy_fromenv),
-                           data->proxy_host,
-                           data->proxy_port,
-                           data->saved_proxy_host,
-                           data->saved_proxy_port,
                            YESNO(data->animation_transitions),
                            data->forecast_days);
     g_free(last_astro_update);
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 7721eab..ed248da 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -58,49 +58,6 @@
 gboolean debug_mode = FALSE;
 
 
-gboolean
-check_envproxy(gchar **proxy_host,
-               gint *proxy_port)
-{
-    gchar *env_proxy = NULL, *tmp, **split;
-
-    env_proxy = getenv("HTTP_PROXY");
-    if (!env_proxy)
-        env_proxy = getenv("http_proxy");
-
-    if (!env_proxy)
-        return FALSE;
-
-    tmp = strstr(env_proxy, "://");
-
-    if (tmp && strlen(tmp) >= 3)
-        env_proxy = tmp + 3;
-    else
-        return FALSE;
-
-    /* we don't support username:password so return */
-    tmp = strchr(env_proxy, '@');
-    if (tmp)
-        return FALSE;
-
-    split = g_strsplit(env_proxy, ":", 2);
-
-    if (!split[0])
-        return FALSE;
-    else if (!split[1]) {
-        g_strfreev(split);
-        return FALSE;
-    }
-
-    *proxy_host = g_strdup(split[0]);
-    *proxy_port = (int) strtol(split[1], NULL, 0);
-
-    g_strfreev(split);
-
-    return TRUE;
-}
-
-
 static const gchar *
 get_label_size(const xfceweather_data *data)
 {
@@ -551,28 +508,6 @@ xfceweather_read_config(XfcePanelPlugin *plugin,
 
     data->unit_system = xfce_rc_read_int_entry(rc, "unit_system", METRIC);
 
-    if (data->proxy_host) {
-        g_free(data->proxy_host);
-        data->proxy_host = NULL;
-    }
-    if (data->saved_proxy_host) {
-        g_free(data->saved_proxy_host);
-        data->saved_proxy_host = NULL;
-    }
-    value = xfce_rc_read_entry(rc, "proxy_host", NULL);
-    if (value && *value)
-        data->saved_proxy_host = g_strdup(value);
-
-    data->saved_proxy_port = xfce_rc_read_int_entry(rc, "proxy_port", 0);
-
-    data->proxy_fromenv = xfce_rc_read_bool_entry(rc, "proxy_fromenv", FALSE);
-    if (data->proxy_fromenv)
-        check_envproxy(&data->proxy_host, &data->proxy_port);
-    else {
-        data->proxy_host = g_strdup(data->saved_proxy_host);
-        data->proxy_port = data->saved_proxy_port;
-    }
-
     val = xfce_rc_read_int_entry(rc, "forecast_days", DEFAULT_FORECAST_DAYS);
     data->forecast_days =
         (val > 0 && val <= MAX_FORECAST_DAYS) ? val : DEFAULT_FORECAST_DAYS;
@@ -634,13 +569,6 @@ xfceweather_write_config(XfcePanelPlugin *plugin,
     if (data->location_name)
         xfce_rc_write_entry(rc, "loc_name", data->location_name);
 
-    xfce_rc_write_bool_entry(rc, "proxy_fromenv", data->proxy_fromenv);
-
-    if (data->proxy_host) {
-        xfce_rc_write_entry(rc, "proxy_host", data->proxy_host);
-        xfce_rc_write_int_entry(rc, "proxy_port", data->proxy_port);
-    }
-
     xfce_rc_write_int_entry(rc, "forecast_days", data->forecast_days);
 
     xfce_rc_write_bool_entry(rc, "animation_transitions",
@@ -979,10 +907,6 @@ xfceweather_create_control(XfcePanelPlugin *plugin)
     data->location_name = NULL;
     data->unit_system = METRIC;
     data->weatherdata = NULL;
-    data->proxy_host = NULL;
-    data->proxy_port = 0;
-    data->saved_proxy_host = NULL;
-    data->saved_proxy_port = 0;
     data->animation_transitions = FALSE;
     data->forecast_days = DEFAULT_FORECAST_DAYS;
 
@@ -1090,8 +1014,6 @@ xfceweather_free(XfcePanelPlugin *plugin,
     g_free(data->lat);
     g_free(data->lon);
     g_free(data->location_name);
-    g_free(data->proxy_host);
-    g_free(data->saved_proxy_host);
 
     /* free array */
     g_array_free(data->labels, TRUE);
diff --git a/panel-plugin/weather.h b/panel-plugin/weather.h
index 0031ff1..76b3c48 100644
--- a/panel-plugin/weather.h
+++ b/panel-plugin/weather.h
@@ -63,14 +63,6 @@ typedef struct {
     xml_astro *astrodata;
     gboolean night_time;
 
-    gchar *proxy_host;
-    gint proxy_port;
-    gboolean proxy_fromenv;
-
-    /* used for storing the configured but not active proxy settings */
-    gchar *saved_proxy_host;
-    gint saved_proxy_port;
-
     gboolean animation_transitions;
     gint forecast_days;
 } xfceweather_data;
@@ -78,10 +70,6 @@ typedef struct {
 
 extern gboolean debug_mode;
 
-
-gboolean check_envproxy(gchar **proxy_host,
-                        gint *proxy_port);
-
 G_END_DECLS
 
 #endif


More information about the Xfce4-commits mailing list