Add new entry at end if nothing selected in stream/devGrp list

This commit is contained in:
Srivats P 2017-09-14 21:01:56 +05:30
parent cca2e94bb3
commit 3aa44343f0
2 changed files with 6 additions and 6 deletions

View File

@ -170,13 +170,13 @@ void DevicesWidget::on_deviceInfo_toggled(bool checked)
void DevicesWidget::on_actionNewDeviceGroup_triggered()
{
// In case nothing is selected, insert 1 row at the top
int row = 0, count = 1;
QItemSelection selection = deviceGroupList->selectionModel()->selection();
if (!portGroups_)
return;
// In case nothing is selected, insert 1 row at the end
int row = portGroups_->getDeviceGroupModel()->rowCount(), count = 1;
QItemSelection selection = deviceGroupList->selectionModel()->selection();
// In case we have a single range selected; insert as many rows as
// in the singe selected range before the top of the selected range
if (selection.size() == 1) {

View File

@ -769,8 +769,8 @@ void PortsWindow::on_actionNew_Stream_triggered()
{
qDebug("New Stream Action");
// In case nothing is selected, insert 1 row at the top
int row = 0, count = 1;
// In case nothing is selected, insert 1 row at the end
int row = plm->getStreamModel()->rowCount(), count = 1;
// In case we have a single range selected; insert as many rows as
// in the singe selected range before the top of the selected range