diff options
author | Roland Knall <roland.knall@br-automation.com> | 2017-12-19 10:06:13 +0100 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2017-12-19 09:54:59 +0000 |
commit | 4db038aa28023867dcdae403d79b0a0b5506e991 (patch) | |
tree | 7857204a82933a63c9d9fdeda229dd1bbbf8c491 | |
parent | 0d6eb9631f26176d00d6bef69569d1d2911bd233 (diff) |
Qt: Fix sorting of enabled protocols description
Change-Id: Ifa7b6e61927615c342839b6c2e7d012198a5f939
Reviewed-on: https://code.wireshark.org/review/24892
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
-rw-r--r-- | ui/qt/models/enabled_protocols_model.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ui/qt/models/enabled_protocols_model.cpp b/ui/qt/models/enabled_protocols_model.cpp index c807975dd5..db98dc2a03 100644 --- a/ui/qt/models/enabled_protocols_model.cpp +++ b/ui/qt/models/enabled_protocols_model.cpp @@ -451,7 +451,14 @@ bool EnabledProtocolsProxyModel::lessThan(const QModelIndex &left, const QModelI EnabledProtocolItem* right_item = static_cast<EnabledProtocolItem*>(right.internalPointer()); if ((left_item != NULL) && (right_item != NULL)) { - int compare_ret = left_item->name().compare(right_item->name(), Qt::CaseInsensitive); + + int compare_ret = 0; + + if (left.column() == EnabledProtocolsModel::colProtocol ) + compare_ret = left_item->name().compare(right_item->name(), Qt::CaseInsensitive); + else if ( left.column() == EnabledProtocolsModel::colDescription ) + compare_ret = left_item->description().compare(right_item->description(), Qt::CaseInsensitive); + if (compare_ret < 0) return true; } |