diff --git a/client/deviceswidget.cpp b/client/deviceswidget.cpp index 7f84a2c..64bbbfe 100644 --- a/client/deviceswidget.cpp +++ b/client/deviceswidget.cpp @@ -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) { diff --git a/client/portswindow.cpp b/client/portswindow.cpp index 51e4152..551e438 100644 --- a/client/portswindow.cpp +++ b/client/portswindow.cpp @@ -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