summaryrefslogtreecommitdiff
path: root/epan/uat.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2011-10-09 09:55:14 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2011-10-09 09:55:14 +0000
commit4938502ee0b93fd703cb8649a706456a11457388 (patch)
tree5f562cba38e325e55e3087e63b9fad402d99a8d8 /epan/uat.c
parente0c689dc0362faeb7bcd5b5b78d3b5988ecf8d34 (diff)
downloadwireshark-4938502ee0b93fd703cb8649a706456a11457388.tar.gz
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
Diffstat (limited to 'epan/uat.c')
-rw-r--r--epan/uat.c13
1 files changed, 7 insertions, 6 deletions
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;
}