aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/models/dissector_tables_model.cpp
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2018-02-11 09:09:10 -0500
committerMichael Mann <mmann78@netscape.net>2018-02-11 16:56:07 +0000
commit04df34909f02013c36bc1e9ab33a52b34f374f80 (patch)
treec091a4e5cba0020bf119d371d2bb03f89b242217 /ui/qt/models/dissector_tables_model.cpp
parente438cf2e89e3336d0d882b86ffb54872ec478e34 (diff)
ModelHelperTreeItem: Rename appendChild -> prependChild
The function was actually calling QList<QVariant>.prepend underneath and some users of the class may need "append" to mean "append". prepend() is faster, but current users are sorting all lists anyway. Change-Id: I65cb02f4a2d1960cc2c49034963b191156789cc9 Reviewed-on: https://code.wireshark.org/review/25730 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt/models/dissector_tables_model.cpp')
-rw-r--r--ui/qt/models/dissector_tables_model.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/ui/qt/models/dissector_tables_model.cpp b/ui/qt/models/dissector_tables_model.cpp
index 9b7ac681bc..5eb0bed17e 100644
--- a/ui/qt/models/dissector_tables_model.cpp
+++ b/ui/qt/models/dissector_tables_model.cpp
@@ -196,7 +196,7 @@ static void gatherProtocolDecodes(const char *, ftenum_t selector_type, gpointer
case FT_UINT24:
case FT_UINT32:
ti = new IntegerTablesItem(GPOINTER_TO_UINT(key), proto_name, pdl_ptr);
- pdl_ptr->appendChild(ti);
+ pdl_ptr->prependChild(ti);
break;
case FT_STRING:
@@ -204,12 +204,12 @@ static void gatherProtocolDecodes(const char *, ftenum_t selector_type, gpointer
case FT_UINT_STRING:
case FT_STRINGZPAD:
ti = new DissectorTablesItem((const char *)key, proto_name, pdl_ptr);
- pdl_ptr->appendChild(ti);
+ pdl_ptr->prependChild(ti);
break;
case FT_BYTES:
ti = new DissectorTablesItem(dissector_handle_get_dissector_name(handle), proto_name, pdl_ptr);
- pdl_ptr->appendChild(ti);
+ pdl_ptr->prependChild(ti);
break;
default:
@@ -239,18 +239,18 @@ static void gatherTableNames(const char *short_name, const char *table_name, gpo
case FT_UINT24:
case FT_UINT32:
dt_ti = new DissectorTablesItem(table_name, short_name, tables->integer_table);
- tables->integer_table->appendChild(dt_ti);
+ tables->integer_table->prependChild(dt_ti);
break;
case FT_STRING:
case FT_STRINGZ:
case FT_UINT_STRING:
case FT_STRINGZPAD:
dt_ti = new DissectorTablesItem(table_name, short_name, tables->string_table);
- tables->string_table->appendChild(dt_ti);
+ tables->string_table->prependChild(dt_ti);
break;
case FT_BYTES:
dt_ti = new DissectorTablesItem(table_name, short_name, tables->custom_table);
- tables->custom_table->appendChild(dt_ti);
+ tables->custom_table->prependChild(dt_ti);
break;
default:
// Assert?
@@ -268,7 +268,7 @@ static void gatherHeurProtocolDecodes(const char *, struct heur_dtbl_entry *dtbl
if (dtbl_entry->protocol) {
DissectorTablesItem *heur = new DissectorTablesItem(proto_get_protocol_long_name(dtbl_entry->protocol), proto_get_protocol_short_name(dtbl_entry->protocol), hdl_ptr);
- hdl_ptr->appendChild(heur);
+ hdl_ptr->prependChild(heur);
}
}
@@ -279,7 +279,7 @@ static void gatherHeurTableNames(const char *table_name, heur_dissector_list *li
return;
DissectorTablesItem *heur = new DissectorTablesItem(table_name, QString(""), table);
- table->appendChild(heur);
+ table->prependChild(heur);
if (list) {
heur_dissector_table_foreach(table_name, gatherHeurProtocolDecodes, heur);
@@ -293,16 +293,16 @@ void DissectorTablesModel::populate()
struct tables_root tables;
tables.custom_table = new DissectorTablesItem(tr(CUSTOM_TABLE_NAME), QString(""), root_);
- root_->appendChild(tables.custom_table);
+ root_->prependChild(tables.custom_table);
tables.integer_table = new DissectorTablesItem(tr(INTEGER_TABLE_NAME), QString(""), root_);
- root_->appendChild(tables.integer_table);
+ root_->prependChild(tables.integer_table);
tables.string_table = new DissectorTablesItem(tr(STRING_TABLE_NAME), QString(""), root_);
- root_->appendChild(tables.string_table);
+ root_->prependChild(tables.string_table);
dissector_all_tables_foreach_table(gatherTableNames, &tables, NULL);
DissectorTablesItem* heuristic_table = new DissectorTablesItem(tr(HEURISTIC_TABLE_NAME), QString(""), root_);
- root_->appendChild(heuristic_table);
+ root_->prependChild(heuristic_table);
dissector_all_heur_tables_foreach_table(gatherHeurTableNames, heuristic_table, NULL);