diff options
-rw-r--r-- | epan/filesystem.c | 10 | ||||
-rw-r--r-- | epan/filesystem.h | 6 | ||||
-rw-r--r-- | gtk/main.c | 7 | ||||
-rw-r--r-- | gtk/main.h | 3 | ||||
-rw-r--r-- | gtk/profile_dlg.c | 4 |
5 files changed, 16 insertions, 14 deletions
diff --git a/epan/filesystem.c b/epan/filesystem.c index e9ca4fc509..13995f2aed 100644 --- a/epan/filesystem.c +++ b/epan/filesystem.c @@ -804,7 +804,11 @@ set_profile_name(const gchar *profilename) const char * get_profile_name(void) { - return persconfprofile; + if (persconfprofile) { + return persconfprofile; + } else { + return DEFAULT_PROFILE; + } } /* @@ -1098,7 +1102,7 @@ create_persconffile_profile(const char *profilename, char **pf_dir_path_return) int create_persconffile_dir(char **pf_dir_path_return) { - return create_persconffile_profile(get_profile_name(), pf_dir_path_return); + return create_persconffile_profile(persconfprofile, pf_dir_path_return); } /* @@ -1240,7 +1244,7 @@ get_persconffile_path(const char *filename, gboolean from_profile, gboolean for_ if (from_profile) { path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", - get_persconffile_dir(get_profile_name()), filename); + get_persconffile_dir(persconfprofile), filename); } else { path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_persconffile_dir(NULL), filename); diff --git a/epan/filesystem.h b/epan/filesystem.h index 9a762c18fc..42bf4f8906 100644 --- a/epan/filesystem.h +++ b/epan/filesystem.h @@ -26,6 +26,12 @@ #define FILESYSTEM_H /* + * Default profile name. + */ +#define DEFAULT_PROFILE "Default" + + +/* * Get the pathname of the directory from which the executable came, * and save it for future use. Returns NULL on success, and a * g_mallocated string containing an error on failure. diff --git a/gtk/main.c b/gtk/main.c index 18c12956ce..bbf3b971f4 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1042,7 +1042,6 @@ void packets_bar_update(void) */ void profile_bar_update(void) { - const char *profile_name; if (profile_bar) { /* remove old status */ if(profile_str) { @@ -1050,11 +1049,7 @@ void profile_bar_update(void) gtk_statusbar_pop(GTK_STATUSBAR(profile_bar), profile_ctx); } - profile_name = get_profile_name (); - if (!profile_name) { - profile_name = DEFAULT_PROFILE; - } - profile_str = g_strdup_printf (" Profile: %s", profile_name); + profile_str = g_strdup_printf (" Profile: %s", get_profile_name ()); gtk_statusbar_push(GTK_STATUSBAR(profile_bar), profile_ctx, profile_str); } diff --git a/gtk/main.h b/gtk/main.h index acb6ca1bd1..180b4e8c18 100644 --- a/gtk/main.h +++ b/gtk/main.h @@ -347,9 +347,6 @@ extern void prefs_to_capture_opts(void); /** Change configuration profile */ extern void change_configuration_profile(const gchar *profile_name); -#define DEFAULT_PROFILE "Default" - - extern GtkWidget *pkt_scrollw; #endif /* __MAIN_H__ */ diff --git a/gtk/profile_dlg.c b/gtk/profile_dlg.c index a84a53dbe8..811343e225 100644 --- a/gtk/profile_dlg.c +++ b/gtk/profile_dlg.c @@ -172,7 +172,7 @@ fill_list(GtkWidget *main_w) fl_entry = add_to_profile_list(DEFAULT_PROFILE, DEFAULT_PROFILE, PROF_STAT_DEFAULT); gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, DEFAULT_PROFILE, 1, fl_entry, -1); - if (profile_name == NULL || strlen(profile_name) == 0) { + if (strcmp (profile_name, DEFAULT_PROFILE)==0) { l_select = g_memdup(&iter, sizeof(iter)); } @@ -189,7 +189,7 @@ fill_list(GtkWidget *main_w) gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, profile->name, 1, fl_entry, -1); - if (profile_name && profile->name) { + if (profile->name) { if (strcmp(profile_name, profile->name) == 0) { /* * XXX - We're assuming that we can just copy a GtkTreeIter |