diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2021-09-21 10:38:05 +0200 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-09-21 18:20:34 +0000 |
commit | 533d8594991bbe283b6310ae38c701b802a112e7 (patch) | |
tree | 03eca932230df5334e68764f65296a079464b9d6 /wsutil/filesystem.c | |
parent | 0c735dcf0ab33a9d870ff751118806a9a0521a5f (diff) |
Qt: Register import_hexdump.json as a profile file
Profile files which is only used in Qt is not automatically registered
during startup and must be explicit registered.
Add profile_register_persconffile() to handle this registration.
Diffstat (limited to 'wsutil/filesystem.c')
-rw-r--r-- | wsutil/filesystem.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index 40f7e105cb..355ce74353 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -1218,6 +1218,15 @@ profile_store_persconffiles(gboolean store) do_store_persconffiles = store; } +void +profile_register_persconffile(const char *filename) +{ + if (do_store_persconffiles && !g_hash_table_lookup (profile_files, filename)) { + /* Store filenames so we know which filenames belongs to a configuration profile */ + g_hash_table_insert (profile_files, g_strdup(filename), g_strdup(filename)); + } +} + /* * Get the directory in which personal configuration files reside. * @@ -1846,12 +1855,10 @@ get_persconffile_path(const char *filename, gboolean from_profile) { char *path, *dir = NULL; - if (do_store_persconffiles && from_profile && !g_hash_table_lookup (profile_files, filename)) { + if (from_profile) { /* Store filenames so we know which filenames belongs to a configuration profile */ - g_hash_table_insert (profile_files, g_strdup(filename), g_strdup(filename)); - } + profile_register_persconffile(filename); - if (from_profile) { dir = get_persconffile_dir(persconfprofile); } else { dir = get_persconffile_dir(NULL); |