Updating branch refs/heads/master
         to f4e04a26ed2fdb9bbaf0a47528d926c4ab274d65 (commit)
       from 46ad662913d5ff3b03aeeb1ddae83fb92cd60d48 (commit)

commit f4e04a26ed2fdb9bbaf0a47528d926c4ab274d65
Author: Stefan Ott <[email protected]>
Date:   Fri May 20 05:09:32 2011 +0200

    Dropped the ability to import old (< 0.4.0) configuration files

 NEWS                       |    1 +
 panel-plugin/xfce4-radio.c |   68 +-------------------------------------------
 2 files changed, 2 insertions(+), 67 deletions(-)

diff --git a/NEWS b/NEWS
index 21c3341..adc9d18 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ v0.5.1 (UNRELEASED):
 =====================
  * You can now have a (more) graphical representation of the signal strength
    instead of the abused progress bar
+ * Dropped the ability to import old (< 0.4.0) configuration files
  * Small improvements to the tooltip
 
 v0.5.0 (19 May 2011):
diff --git a/panel-plugin/xfce4-radio.c b/panel-plugin/xfce4-radio.c
index 513d314..c7dd16b 100644
--- a/panel-plugin/xfce4-radio.c
+++ b/panel-plugin/xfce4-radio.c
@@ -1495,72 +1495,6 @@ write_config(radio_gui *data, gboolean save_presets)
 }
 
 static void
-import_old_config(XfcePanelPlugin *plugin, radio_gui *data)
-{
-       const char *value;
-       char *file;
-       XfceRc *rc;
-
-       // Abort if there's nothing to be imported
-       if (!(file = xfce_panel_plugin_lookup_rc_file(plugin)))
-               return;
-
-       DBG("Importing data from old conig file %s", file);
-
-       rc = xfce_rc_simple_open(file, TRUE);
-       g_free(file);
-
-       if (!rc)
-               return;
-
-       xfce_rc_set_group(rc, "radio plugin");
-
-       data->freq = xfce_rc_read_int_entry(rc, "frq", FREQ_INIT);
-       data->scroll = xfce_rc_read_int_entry(rc, "scroll", CHANGE_FREQ);
-       data->show_signal = xfce_rc_read_bool_entry(rc, "show_signal", TRUE);
-
-       if ((value = xfce_rc_read_entry(rc, "dev", NULL)) && *value)
-               strncpy(data->device, value, MAX_DEVICE_NAME_LENGTH);
-       if ((value = xfce_rc_read_entry(rc, "startup_cmd", NULL)) && *value)
-               strncpy(data->startup_command, value, MAX_COMMAND_LENGTH);
-       if ((value = xfce_rc_read_entry(rc, "shutdown_cmd", NULL)) && *value)
-               strncpy(data->shutdown_command, value, MAX_COMMAND_LENGTH);
-
-       GtkTreeIter iter;
-       GtkListStore *presets = data->presets;
-
-       gchar** entries = xfce_rc_get_entries(rc, "presets");
-       if (entries != NULL)
-       {
-               gchar **entry;
-               entry = entries;
-
-               xfce_rc_set_group(rc, "presets");
-
-               while (*entry)
-               {
-                       if ((value = xfce_rc_read_entry(rc, *entry, NULL))
-                                                               && *value)
-                       {
-                               gint vfreq = atoi(*entry);
-                               const gchar *vname = value;
-
-                               DBG("freq=%d, name=%s", vfreq, vname);
-
-                               gtk_list_store_append(presets, &iter);
-                               gtk_list_store_set(presets, &iter, 0, vname,
-                                                               1, vfreq, -1);
-                       }
-                       entry++;
-               }
-       }
-       g_strfreev(entries);
-       xfce_rc_close(rc);
-
-       write_config(data, TRUE);
-}
-
-static void
 read_config(XfcePanelPlugin *plugin, radio_gui *data)
 {
        const char *value;
@@ -1604,8 +1538,8 @@ read_config(XfcePanelPlugin *plugin, radio_gui *data)
        gchar** freqs = xfce_rc_get_entries(rc, PRESET_FREQS);
 
        if (names == NULL || freqs == NULL) {
-               import_old_config(plugin, data);
                xfce_rc_close(rc);
+               update_label(data);
                return;
        }
        gchar **ename = names;
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to