MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / openedImpl

Method openedImpl

launcher/ui/pages/instance/ScreenshotsPage.cpp:518–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516}
517
518void 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"

Callers

nothing calls this directly

Calls 6

ensureFolderPathExistsFunction · 0.85
mapFromSourceMethod · 0.80
QDirClass · 0.50
isValidMethod · 0.45
setModelMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected