aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2022-09-07 22:55:34 -0400
committerJohn Thacker <johnthacker@gmail.com>2022-09-08 03:55:43 +0000
commit33fe76612abd37a3f1339e5a3327dcf2016a9a47 (patch)
tree70b43098b711b2fefaca1442b628d358dc622e22
parente25f0508aa9c56b4d1cac8d4e03e8ee614f6dfc3 (diff)
Qt: Don't use obsolete signal in DCE-RPC/ONC-RPC SRT
QComboBox::currentIndexChanged(QString) has been marked obsolete for a while and finally removed in Qt 6 in favor of currentIndexChanged(int) and currentTextChanged(const QString) Use QComboBox::currentTextChanged(const QString) instead. Also do a little bit of checking to see if the return value of dcerpc_get_proto_sub_dissector is NULL. Fix #18319.
-rw-r--r--ui/qt/rpc_service_response_time_dialog.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/ui/qt/rpc_service_response_time_dialog.cpp b/ui/qt/rpc_service_response_time_dialog.cpp
index 29e5ab31fc..7c7f70b377 100644
--- a/ui/qt/rpc_service_response_time_dialog.cpp
+++ b/ui/qt/rpc_service_response_time_dialog.cpp
@@ -126,16 +126,16 @@ RpcServiceResponseTimeDialog::RpcServiceResponseTimeDialog(QWidget &parent, Capt
// full-height list to the left of the stats tree instead.
QStringList programs = dce_name_to_uuid_key_.keys();
std::sort(programs.begin(), programs.end(), qStringCaseLessThan);
- connect(program_combo_, SIGNAL(currentIndexChanged(QString)),
- this, SLOT(dceRpcProgramChanged(QString)));
+ connect(program_combo_, SIGNAL(currentTextChanged(const QString)),
+ this, SLOT(dceRpcProgramChanged(const QString)));
program_combo_->addItems(programs);
} else {
setWindowSubtitle(tr("ONC-RPC Service Response Times"));
g_hash_table_foreach(rpc_progs, onc_rpc_add_program, this);
QStringList programs = onc_name_to_program_.keys();
std::sort(programs.begin(), programs.end(), qStringCaseLessThan);
- connect(program_combo_, SIGNAL(currentIndexChanged(QString)),
- this, SLOT(oncRpcProgramChanged(QString)));
+ connect(program_combo_, SIGNAL(currentTextChanged(const QString)),
+ this, SLOT(oncRpcProgramChanged(const QString)));
program_combo_->addItems(programs);
}
}
@@ -382,12 +382,15 @@ void RpcServiceResponseTimeDialog::provideParameterData()
if (!dce_name_to_uuid_key_.contains(program_name)) return;
guid_key *dkey = dce_name_to_uuid_key_[program_name];
+ guint16 version = (guint16) version_combo_->itemData(version_combo_->currentIndex()).toUInt();
+ dcerpc_sub_dissector *procs = dcerpc_get_proto_sub_dissector(&(dkey->guid), version);
+ if (!procs) return;
+
dcerpcstat_tap_data_t *dtap_data = g_new0(dcerpcstat_tap_data_t, 1);
dtap_data->uuid = dkey->guid;
- dtap_data->ver = (guint16) version_combo_->itemData(version_combo_->currentIndex()).toUInt();
+ dtap_data->ver = version;
dtap_data->prog = dcerpc_get_proto_name(&dtap_data->uuid, dtap_data->ver);
- dcerpc_sub_dissector *procs = dcerpc_get_proto_sub_dissector(&(dkey->guid), dtap_data->ver);
for (int i = 0; procs[i].name; i++) {
if (procs[i].num > max_procs) max_procs = procs[i].num;
}