aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/models
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-02-25 00:19:43 +0100
committerAnders Broman <a.broman58@gmail.com>2018-02-27 09:08:43 +0000
commit5cbc09e937a9827219938165a6920079737a643e (patch)
tree42ec4da31b3ea84e0f786ae7861eb523620b47a7 /ui/qt/models
parent15c261e94b888b0ae4e6122fb11fba2219c932fa (diff)
Qt: accept hexadecimal input in Decode As dialog
The usb.product dissector table displays vendor+product values as hexadecimal, ensure that these are not parsed as zero. While at it, clarify the meaning of the model contents. Ideally the model should store numeric selectors as integers rather than strings, but that requires more work. Change-Id: I3bb17ad0d0a03c8813ded4ea6890dbc2aedd738d Reviewed-on: https://code.wireshark.org/review/26087 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/models')
-rw-r--r--ui/qt/models/decode_as_model.cpp2
-rw-r--r--ui/qt/models/decode_as_model.h10
2 files changed, 6 insertions, 6 deletions
diff --git a/ui/qt/models/decode_as_model.cpp b/ui/qt/models/decode_as_model.cpp
index 59e077c80e..7e049cc1ba 100644
--- a/ui/qt/models/decode_as_model.cpp
+++ b/ui/qt/models/decode_as_model.cpp
@@ -259,7 +259,7 @@ bool DecodeAsModel::setData(const QModelIndex &cur_index, const QVariant &value,
if (IS_FT_STRING(selector_type)) {
item->selectorString_ = value.toString();
} else if (IS_FT_UINT(selector_type)) {
- item->selectorUint_ = value.toUInt();
+ item->selectorUint_ = value.toString().toUInt(Q_NULLPTR, 0);
}
}
break;
diff --git a/ui/qt/models/decode_as_model.h b/ui/qt/models/decode_as_model.h
index 1c37cfddb5..c7f5dceca6 100644
--- a/ui/qt/models/decode_as_model.h
+++ b/ui/qt/models/decode_as_model.h
@@ -49,11 +49,11 @@ public:
DecodeAsModel(QObject *parent, capture_file *cf = NULL);
enum DecodeAsColumn {
- colTable = 0,
- colSelector,
- colType,
- colDefault, // aka "initial"
- colProtocol, // aka "current"
+ colTable = 0, // aka "Field" (or dissector table like "TCP Port")
+ colSelector, // the actual table value (e.g., port number 80)
+ colType, // field type (e.g. "Integer, base 16")
+ colDefault, // aka "initial" protocol chosen by Wireshark
+ colProtocol, // aka "current" protocol selected by user
colDecodeAsMax //not used
};