diff --git a/src/gtk-rig-ctrl.c b/src/gtk-rig-ctrl.c index d04a052..ba88464 100644 --- a/src/gtk-rig-ctrl.c +++ b/src/gtk-rig-ctrl.c @@ -639,7 +639,6 @@ create_conf_widgets (GtkRigCtrl *ctrl) GtkWidget *frame,*table,*label,*timer; GDir *dir = NULL; /* directory handle */ GError *error = NULL; /* error flag and info */ - gchar *cfgdir; gchar *dirname; /* directory name */ gchar **vbuff; const gchar *filename; /* file name */ @@ -662,10 +661,7 @@ create_conf_widgets (GtkRigCtrl *ctrl) "unless you select a secondary device for uplink")); /* open configuration directory */ - cfgdir = get_conf_dir (); - dirname = g_strconcat (cfgdir, G_DIR_SEPARATOR_S, - "hwconf", NULL); - g_free (cfgdir); + dirname = get_hwconf_dir (); dir = g_dir_open (dirname, 0, &error); if (dir) { @@ -2341,17 +2337,13 @@ static gboolean have_conf () { GDir *dir = NULL; /* directory handle */ GError *error = NULL; /* error flag and info */ - gchar *cfgdir; gchar *dirname; /* directory name */ const gchar *filename; /* file name */ gint i = 0; /* open configuration directory */ - cfgdir = get_conf_dir (); - dirname = g_strconcat (cfgdir, G_DIR_SEPARATOR_S, - "hwconf", NULL); - g_free (cfgdir); + dirname = get_hwconf_dir (); dir = g_dir_open (dirname, 0, &error); if (dir) { diff --git a/src/gtk-rot-ctrl.c b/src/gtk-rot-ctrl.c index 61be6f9..b8dc34a 100644 --- a/src/gtk-rot-ctrl.c +++ b/src/gtk-rot-ctrl.c @@ -469,7 +469,6 @@ create_conf_widgets (GtkRotCtrl *ctrl) GtkWidget *frame,*table,*label,*timer,*toler; GDir *dir = NULL; /* directory handle */ GError *error = NULL; /* error flag and info */ - gchar *cfgdir; gchar *dirname; /* directory name */ gchar **vbuff; const gchar *filename; /* file name */ @@ -490,10 +489,7 @@ create_conf_widgets (GtkRotCtrl *ctrl) gtk_widget_set_tooltip_text (ctrl->DevSel, _("Select antenna rotator device")); /* open configuration directory */ - cfgdir = get_conf_dir (); - dirname = g_strconcat (cfgdir, G_DIR_SEPARATOR_S, - "hwconf", NULL); - g_free (cfgdir); + dirname = get_hwconf_dir (); dir = g_dir_open (dirname, 0, &error); if (dir) { @@ -1202,17 +1198,13 @@ static gboolean have_conf () { GDir *dir = NULL; /* directory handle */ GError *error = NULL; /* error flag and info */ - gchar *cfgdir; gchar *dirname; /* directory name */ const gchar *filename; /* file name */ gint i = 0; /* open configuration directory */ - cfgdir = get_conf_dir (); - dirname = g_strconcat (cfgdir, G_DIR_SEPARATOR_S, - "hwconf", NULL); - g_free (cfgdir); + dirname = get_hwconf_dir (); dir = g_dir_open (dirname, 0, &error); if (dir) { diff --git a/src/radio-conf.c b/src/radio-conf.c index a4f7c7b..f91a5b5 100644 --- a/src/radio-conf.c +++ b/src/radio-conf.c @@ -70,9 +70,8 @@ gboolean radio_conf_read (radio_conf_t *conf) return FALSE; } - confdir = get_conf_dir(); + confdir = get_hwconf_dir(); fname = g_strconcat (confdir, G_DIR_SEPARATOR_S, - "hwconf", G_DIR_SEPARATOR_S, conf->name, ".rig", NULL); g_free (confdir); @@ -245,9 +244,8 @@ void radio_conf_save (radio_conf_t *conf) /* convert to text sdata */ data = g_key_file_to_data (cfg, &len, NULL); - confdir = get_conf_dir(); + confdir = get_hwconf_dir(); fname = g_strconcat (confdir, G_DIR_SEPARATOR_S, - "hwconf", G_DIR_SEPARATOR_S, conf->name, ".rig", NULL); g_free (confdir); diff --git a/src/rotor-conf.c b/src/rotor-conf.c index 261dc83..89c8dbd 100644 --- a/src/rotor-conf.c +++ b/src/rotor-conf.c @@ -67,9 +67,8 @@ gboolean rotor_conf_read (rotor_conf_t *conf) return FALSE; } - confdir = get_conf_dir(); + confdir = get_hwconf_dir(); fname = g_strconcat (confdir, G_DIR_SEPARATOR_S, - "hwconf", G_DIR_SEPARATOR_S, conf->name, ".rot", NULL); g_free (confdir); @@ -193,9 +192,8 @@ void rotor_conf_save (rotor_conf_t *conf) /* convert to text sdata */ data = g_key_file_to_data (cfg, &len, NULL); - confdir = get_conf_dir(); + confdir = get_hwconf_dir(); fname = g_strconcat (confdir, G_DIR_SEPARATOR_S, - "hwconf", G_DIR_SEPARATOR_S, conf->name, ".rot", NULL); g_free (confdir); diff --git a/src/sat-pref-rig.c b/src/sat-pref-rig.c index 9e78e06..f21288e 100644 --- a/src/sat-pref-rig.c +++ b/src/sat-pref-rig.c @@ -227,7 +227,6 @@ static GtkTreeModel *create_and_fill_model () GtkTreeIter item; /* new item added to the list store */ GDir *dir = NULL; /* directory handle */ GError *error = NULL; /* error flag and info */ - gchar *cfgdir; gchar *dirname; /* directory name */ gchar **vbuff; const gchar *filename; /* file name */ @@ -247,10 +246,7 @@ static GtkTreeModel *create_and_fill_model () ); /* open configuration directory */ - cfgdir = get_conf_dir (); - dirname = g_strconcat (cfgdir, G_DIR_SEPARATOR_S, - "hwconf", NULL); - g_free (cfgdir); + dirname = get_hwconf_dir (); dir = g_dir_open (dirname, 0, &error); if (dir) { @@ -393,10 +389,7 @@ void sat_pref_rig_ok () /* delete all .rig files */ - buff = get_conf_dir (); - dirname = g_strconcat (buff, G_DIR_SEPARATOR_S, - "hwconf", NULL); - g_free (buff); + dirname = get_hwconf_dir (); dir = g_dir_open (dirname, 0, &error); if (dir) { diff --git a/src/sat-pref-rot.c b/src/sat-pref-rot.c index b9c3d77..6d1d8ed 100644 --- a/src/sat-pref-rot.c +++ b/src/sat-pref-rot.c @@ -195,7 +195,6 @@ static GtkTreeModel *create_and_fill_model () GtkTreeIter item; /* new item added to the list store */ GDir *dir = NULL; /* directory handle */ GError *error = NULL; /* error flag and info */ - gchar *cfgdir; gchar *dirname; /* directory name */ gchar **vbuff; const gchar *filename; /* file name */ @@ -214,10 +213,7 @@ static GtkTreeModel *create_and_fill_model () ); /* open configuration directory */ - cfgdir = get_conf_dir (); - dirname = g_strconcat (cfgdir, G_DIR_SEPARATOR_S, - "hwconf", NULL); - g_free (cfgdir); + dirname = get_hwconf_dir (); dir = g_dir_open (dirname, 0, &error); if (dir) { @@ -357,10 +353,7 @@ void sat_pref_rot_ok () /* delete all .rot files */ - buff = get_conf_dir (); - dirname = g_strconcat (buff, G_DIR_SEPARATOR_S, - "hwconf", NULL); - g_free (buff); + dirname = get_hwconf_dir (); dir = g_dir_open (dirname, 0, &error); if (dir) { diff --git a/src/trsp-conf.c b/src/trsp-conf.c index 3e1b25b..9109fad 100644 --- a/src/trsp-conf.c +++ b/src/trsp-conf.c @@ -51,16 +51,13 @@ GSList *read_transponders (guint catnum) trsp_t *trsp; GKeyFile *cfg = NULL; GError *error = NULL; - gchar *name,*fname,*confdir; + gchar *name,*fname; gchar **groups; gsize numgrp,i; name = g_strdup_printf ("%d.trsp", catnum); - confdir = get_conf_dir(); - fname = g_strconcat (confdir, G_DIR_SEPARATOR_S, - "trsp", G_DIR_SEPARATOR_S, - name, NULL); + fname = trsp_file_name (name); cfg = g_key_file_new (); if (!g_key_file_load_from_file (cfg, fname, G_KEY_FILE_KEEP_COMMENTS, &error)) { @@ -158,7 +155,6 @@ GSList *read_transponders (guint catnum) g_strfreev (groups); g_key_file_free (cfg); g_free (name); - g_free (confdir); g_free (fname);