Index: radio.c =================================================================== --- radio.c (revision 2) +++ radio.c (working copy) @@ -422,13 +422,15 @@ } static XfceRc * -get_config_file_write_handle (radio_gui *data) +get_config_rc () { - XfcePanelPlugin *plugin = data->plugin; char *file; XfceRc *rc; - if (!(file = xfce_panel_plugin_save_location (plugin, TRUE))) + //take data from a clearly defined place RADIO_CONFIG + file = xfce_resource_save_location (XFCE_RESOURCE_CONFIG, RADIO_CONFIG, TRUE); + + if (G_UNLIKELY (!file)) return NULL; rc = xfce_rc_simple_open (file, FALSE); @@ -446,7 +448,7 @@ preset = pop_preset (find_preset_by_freq (data->freq, data), data); XfceRc *rc; - if ((rc = get_config_file_write_handle (data))) { + if (rc = get_config_rc ()) { char buf[6]; sprintf(buf, "%d", preset->freq); @@ -954,7 +956,7 @@ write_config (XfcePanelPlugin *plugin, radio_gui *data) { XfceRc *rc; - if ((rc = get_config_file_write_handle (data))) { + if (rc = get_config_rc ()) { xfce_rc_set_group (rc, "radio plugin"); xfce_rc_write_entry (rc, "dev", data->device); @@ -989,15 +991,9 @@ char *file; XfceRc *rc; - if (!(file = xfce_panel_plugin_lookup_rc_file (plugin))) + if (!(rc = get_config_rc ())) return; - 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); @@ -1029,7 +1025,6 @@ radio_preset *preset = malloc (sizeof (radio_preset)); preset->next = NULL; - g_free (preset->name); preset->name = g_strdup(value); preset->freq = atoi (*entry); append_to_presets (preset, data); @@ -1038,6 +1033,7 @@ } } g_strfreev (entries); + xfce_rc_close (rc); } static void Index: radio.h =================================================================== --- radio.h (revision 2) +++ radio.h (working copy) @@ -42,6 +42,8 @@ #define BORDER 8 +const char RADIO_CONFIG[] = "xfce4/panel/radio.rc"; + typedef enum { CHANGE_FREQ, CHANGE_PRESET