From 4938502ee0b93fd703cb8649a706456a11457388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Sun, 9 Oct 2011 09:55:14 +0000 Subject: Added a button to refresh a UAT from the system defaults (if existing). Added a button to clear the list. Added tooltip to some buttons. Removed unused clist code. svn path=/trunk/; revision=39319 --- epan/uat.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'epan/uat.c') diff --git a/epan/uat.c b/epan/uat.c index 645503b691..1b16705b39 100644 --- a/epan/uat.c +++ b/epan/uat.c @@ -97,6 +97,7 @@ uat_t* uat_new(const char* name, uat->user_data = g_array_new(FALSE,FALSE,(guint)uat->record_size); uat->changed = FALSE; uat->loaded = FALSE; + uat->from_global = FALSE; uat->rep = NULL; uat->free_rep = NULL; uat->help = help; @@ -166,21 +167,21 @@ void uat_remove_record_idx(uat_t* uat, guint idx) { /* The returned filename was g_malloc()'d so the caller must free it */ gchar* uat_get_actual_filename(uat_t* uat, gboolean for_writing) { + gchar *pers_fname = NULL; - gchar* pers_fname = get_persconffile_path(uat->filename, uat->from_profile, for_writing); + if (! uat->from_global) { + pers_fname = get_persconffile_path(uat->filename, uat->from_profile, for_writing); + } - if (! for_writing ) { + if ((! for_writing ) && (! file_exists(pers_fname) )) { gchar* data_fname = get_datafile_path(uat->filename); - if ((! file_exists(pers_fname) ) && file_exists(data_fname)) { + if (file_exists(data_fname)) { g_free(pers_fname); return data_fname; } g_free(data_fname); - } - - if ((! file_exists(pers_fname) ) && (! for_writing ) ) { g_free(pers_fname); return NULL; } -- cgit v1.2.1