diff options
author | Michael Mann <mmann78@netscape.net> | 2015-02-02 19:58:29 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-02-03 13:03:32 +0000 |
commit | b63599762468e4cf1783419a5556377604d344bb (patch) | |
tree | f77790ecea3d83e6552dcd68420ab5035d8adede /ui/qt/qt_ui_utils.cpp | |
parent | e9429732ff91cbbbaead63b643870da91ef415bd (diff) |
Convert val_to_str_ext -> val_to_str_ext_wmem for calls that don't have valid packet scope (GUI).
val_to_str_ext now officially uses wmem_packet_scope().
Removed const from val_to_str[_ext]_wmem return value since it's not really constant.
Created utility functions in qt_ui_utils.h to help with the new memory management for its GUI.
Change-Id: Idf2ce4a4ce78d628b2269ad23a3a48fbfc9c077c
Reviewed-on: https://code.wireshark.org/review/6926
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt/qt_ui_utils.cpp')
-rw-r--r-- | ui/qt/qt_ui_utils.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ui/qt/qt_ui_utils.cpp b/ui/qt/qt_ui_utils.cpp index 7c7b5a1d38..7e34706536 100644 --- a/ui/qt/qt_ui_utils.cpp +++ b/ui/qt/qt_ui_utils.cpp @@ -77,6 +77,26 @@ const QString address_to_display_qstring(const _address *address) return address_qstr; } +const QString val_to_qstring(const guint32 val, const value_string *vs, const char *fmt) +{ + QString val_qstr = QString(); + gchar* gchar_p = val_to_str_wmem(NULL, val, vs, fmt); + val_qstr = gchar_p; + wmem_free(NULL, gchar_p); + + return val_qstr; +} + +const QString val_ext_to_qstring(const guint32 val, value_string_ext *vse, const char *fmt) +{ + QString val_qstr = QString(); + gchar* gchar_p = val_to_str_ext_wmem(NULL, val, vse, fmt); + val_qstr = gchar_p; + wmem_free(NULL, gchar_p); + + return val_qstr; +} + void smooth_font_size(QFont &font) { QFontDatabase fdb; #if QT_VERSION < QT_VERSION_CHECK(4, 8, 0) |