[Xfce4-commits] <xfce4-weather-plugin:master> Remove unused stuff and re-enable saving rc file.

Harald Judt noreply at xfce.org
Tue Nov 27 16:46:50 CET 2012


Updating branch refs/heads/master
         to 3ecec681c75275c032d1a147ec087ff0f8cffdbf (commit)
       from 16717f41cf8b3b8260c4f9c8d200ddaabf3596e1 (commit)

commit 3ecec681c75275c032d1a147ec087ff0f8cffdbf
Author: Harald Judt <h.judt at gmx.at>
Date:   Tue Nov 27 16:42:04 2012 +0100

    Remove unused stuff and re-enable saving rc file.
    
    It's not yet finished, but usable again.

 configure.ac.in               |    2 +-
 panel-plugin/weather-config.c |   71 -----------------------------------------
 panel-plugin/weather.c        |   16 ++-------
 3 files changed, 5 insertions(+), 84 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index ffd6b5a..5bb6038 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -12,7 +12,7 @@ m4_define([weather_version_major], [0])
 m4_define([weather_version_minor], [8])
 m4_define([weather_version_micro], [2])
 m4_define([weather_version_build], [@REVISION@])
-m4_define([weather_version_tag], [])
+m4_define([weather_version_tag], [git])
 m4_define([weather_version], [weather_version_major().weather_version_minor().weather_version_micro()ifelse(weather_version_tag(), [git], [weather_version_tag()-weather_version_build()], [weather_version_tag()])])
 
 dnl ***************************
diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index 213b46f..e0342fc 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -109,77 +109,6 @@ typedef void (*cb_conf_dialog_function) (xfceweather_dialog *);
 static cb_conf_dialog_function cb_dialog = NULL;
 
 
-void
-apply_options(xfceweather_dialog *dialog)
-{
-#if 0
-    gint option;
-    gboolean hasiter = FALSE;
-    GtkTreeIter iter;
-    gchar *text;
-    GValue value = { 0, };
-    GtkWidget *widget;
-    xfceweather_data *data = (xfceweather_data *) dialog->wd;
-
-    option = gtk_combo_box_get_active(GTK_COMBO_BOX(dialog->combo_unit_system));
-    if (option == IMPERIAL)
-        data->unit_system = IMPERIAL;
-    else
-        data->unit_system = METRIC;
-
-    if (data->lat)
-        g_free(data->lat);
-    if (data->lon)
-        g_free(data->lon);
-    if (data->location_name)
-        g_free(data->location_name);
-
-    data->lat =
-        g_strdup(gtk_entry_get_text(GTK_ENTRY(dialog->txt_lat)));
-    data->lon =
-        g_strdup(gtk_entry_get_text(GTK_ENTRY(dialog->txt_lon)));
-    data->location_name =
-        g_strdup(gtk_entry_get_text(GTK_ENTRY(dialog->text_loc_name)));
-
-    /* force update of astronomical data */
-    memset(&data->last_astro_update, 0, sizeof(data->last_astro_update));
-
-    /* call labels_clear() here */
-    if (data->labels && data->labels->len > 0)
-        g_array_free(data->labels, TRUE);
-
-    data->labels = g_array_new(FALSE, TRUE, sizeof(data_types));
-    for (hasiter =
-             gtk_tree_model_get_iter_first(GTK_TREE_MODEL
-                                           (dialog->model_datatypes),
-                                           &iter);
-         hasiter == TRUE;
-         hasiter =
-             gtk_tree_model_iter_next(GTK_TREE_MODEL(dialog->model_datatypes),
-                                      &iter)) {
-        gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->model_datatypes), &iter,
-                                 1, &value);
-        option = g_value_get_int(&value);
-        g_array_append_val(data->labels, option);
-        g_value_unset(&value);
-    }
-
-    data->forecast_days =
-        (gint) gtk_spin_button_get_value(GTK_SPIN_BUTTON
-                                         (dialog->spin_forecast_days));
-
-    data->animation_transitions =
-        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
-                                     (dialog->chk_animate_transition));
-    gtk_scrollbox_set_animate(GTK_SCROLLBOX(data->scrollbox),
-                              data->animation_transitions);
-
-    if (cb)
-        cb(data);
-#endif
-}
-
-
 static gchar *
 sanitize_location_name(const gchar *location_name)
 {
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 298e144..f31163d 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -772,29 +772,21 @@ xfceweather_dialog_response(GtkWidget *dlg,
             g_warning(_("Unable to open the following url: %s"),
                       PLUGIN_WEBSITE);
     } else {
-        weather_debug("Applying configuration options.");
-#if 0
-        apply_options(dialog);
-#endif
-        weather_dump(weather_dump_plugindata, data);
-
+        /* free stuff used in config dialog */
         gtk_widget_destroy(dlg);
-
         gtk_list_store_clear(dialog->model_datatypes);
-
         for (i = 0; i < dialog->icon_themes->len; i++) {
             theme = g_array_index(dialog->icon_themes, icon_theme*, i);
             icon_theme_free(theme);
             g_array_free(dialog->icon_themes, TRUE);
         }
-
         g_slice_free(xfceweather_dialog, dialog);
 
         xfce_panel_plugin_unblock_menu(data->plugin);
-#if 0
-        xfceweather_write_config(data->plugin, data);
-#endif
 
+        weather_debug("Saving configuration options.");
+        xfceweather_write_config(data->plugin, data);
+        weather_dump(weather_dump_plugindata, data);
     }
 }
 


More information about the Xfce4-commits mailing list