| 16 | } |
| 17 | |
| 18 | void DevicePathView::insertRow() |
| 19 | { |
| 20 | if(readonly) |
| 21 | return; |
| 22 | |
| 23 | auto index = currentIndex(); |
| 24 | dialog->setReadOnly(readonly); |
| 25 | dialog->setFilePath(nullptr); |
| 26 | if(dialog->exec() == QDialog::Accepted) |
| 27 | { |
| 28 | auto row = index.row(); |
| 29 | const auto file_path = dialog->toFilePath(); |
| 30 | if(!model()->insertRow(row + 1)) |
| 31 | return; |
| 32 | |
| 33 | QVariant _data; |
| 34 | _data.setValue(&file_path); |
| 35 | index = model()->index(row + 1, 0); |
| 36 | if(model()->setData(index, _data)) |
| 37 | setCurrentIndex(index); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | void DevicePathView::editCurrentRow() |
| 42 | { |
nothing calls this directly
no test coverage detected