2020-08-11 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in rdcastmanager(1) that caused a segfault when
	attempting to post a log with no events selected.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2020-08-11 11:39:13 -04:00
parent e9a3fcb4d8
commit 3071c056e8
9 changed files with 37 additions and 0 deletions

View File

@@ -20,6 +20,7 @@
#include <QItemSelection>
#include <QItemSelectionModel>
#include <QMessageBox>
#include <QModelIndexList>
#include "logdialog.h"
@@ -85,6 +86,11 @@ int LogDialog::exec(RDLogEvent *log,int *start_line,int *end_line)
void LogDialog::okData()
{
QModelIndexList list=d_log_view->selectionModel()->selectedRows();
if(list.size()==0) {
QMessageBox::information(this,"RDCastManager - "+tr("List Log"),
tr("At least one log event must be selected!"));
return;
}
*d_start_line=list.first().row();
*d_end_line=list.last().row();
d_log_model->clearLogEvent();