| 49 | } |
| 50 | |
| 51 | void YACReaderNavigationController::loadFolderInfo(const QModelIndex &modelIndex) |
| 52 | { |
| 53 | // Get FolderItem |
| 54 | qulonglong folderId = folderModelIndexToID(modelIndex); |
| 55 | |
| 56 | // check comics in folder with id = folderId |
| 57 | libraryWindow->comicsModel->setupFolderModelData(folderId, libraryWindow->foldersModel->getDatabase()); |
| 58 | |
| 59 | // configure views |
| 60 | if (libraryWindow->comicsModel->rowCount() > 0) { |
| 61 | // updateView |
| 62 | contentViewsManager->comicsView->setModel(libraryWindow->comicsModel); |
| 63 | contentViewsManager->showComicsView(); |
| 64 | libraryWindow->disableComicsActions(false); |
| 65 | } else if (libraryWindow->foldersModel->rowCount(modelIndex) > 0 || !modelIndex.isValid()) { |
| 66 | // folder has subfolders (or is root), show folder content view |
| 67 | loadEmptyFolderInfo(modelIndex); |
| 68 | contentViewsManager->showFolderContentView(); |
| 69 | libraryWindow->disableComicsActions(true); |
| 70 | } else { |
| 71 | // folder has no comics and no subfolders |
| 72 | contentViewsManager->showEmptyFolderWidget(); |
| 73 | libraryWindow->disableComicsActions(true); |
| 74 | } |
| 75 | |
| 76 | // libraryWindow->updateFoldersViewConextMenu(modelIndex); |
| 77 | |
| 78 | // if a folder is selected, listsView selection must be cleared |
| 79 | libraryWindow->listsView->clearSelection(); |
| 80 | } |
| 81 | |
| 82 | void YACReaderNavigationController::loadListInfo(const QModelIndex &modelIndex) |
| 83 | { |
no test coverage detected