| 516 | } |
| 517 | |
| 518 | void ScreenshotsPage::openedImpl() |
| 519 | { |
| 520 | if(!m_valid) |
| 521 | { |
| 522 | m_valid = FS::ensureFolderPathExists(m_folder); |
| 523 | } |
| 524 | if (m_valid) |
| 525 | { |
| 526 | QString path = QDir(m_folder).absolutePath(); |
| 527 | auto idx = m_model->setRootPath(path); |
| 528 | if(idx.isValid()) |
| 529 | { |
| 530 | ui->listView->setModel(m_filterModel.get()); |
| 531 | connect(ui->listView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &ScreenshotsPage::onCurrentSelectionChanged); |
| 532 | onCurrentSelectionChanged(ui->listView->selectionModel()->selection()); // set initial button enable states |
| 533 | ui->listView->setRootIndex(m_filterModel->mapFromSource(idx)); |
| 534 | } |
| 535 | else |
| 536 | { |
| 537 | ui->listView->setModel(nullptr); |
| 538 | } |
| 539 | } |
| 540 | } |
| 541 | |
| 542 | #include "ScreenshotsPage.moc" |
nothing calls this directly
no test coverage detected