Remove FolderModel and QModelIndex dependencies from LibraryCreator

This commit is contained in:
luisangelsm
2026-02-20 08:53:01 +01:00
parent 3eaacaf6a7
commit 549f2a259a
3 changed files with 11 additions and 13 deletions

View File

@ -707,7 +707,9 @@ void LibraryWindow::createConnections()
connect(libraryCreator, &LibraryCreator::finished, this, &LibraryWindow::showRootWidget);
connect(libraryCreator, &LibraryCreator::updated, this, &LibraryWindow::reloadCurrentLibrary);
connect(libraryCreator, &LibraryCreator::created, this, &LibraryWindow::openLastCreated);
connect(libraryCreator, &LibraryCreator::updatedCurrentFolder, this, &LibraryWindow::reloadAfterCopyMove);
connect(libraryCreator, &LibraryCreator::updatedCurrentFolder, this, [this](qulonglong folderId) {
reloadAfterCopyMove(foldersModel->getIndexFromFolderId(folderId));
});
connect(libraryCreator, &LibraryCreator::comicAdded, importWidget, &ImportWidget::newComic);
// libraryCreator errors
connect(libraryCreator, &LibraryCreator::failedCreatingDB, this, &LibraryWindow::manageCreatingError);
@ -1078,7 +1080,7 @@ void LibraryWindow::updateFolder(const QModelIndex &miFolder)
QString currentLibrary = selectedLibrary->currentText();
QString path = QDir::cleanPath(libraries.getPath(currentLibrary));
_lastAdded = currentLibrary;
libraryCreator->updateFolder(path, LibraryPaths::libraryDataPath(path), QDir::cleanPath(currentPath() + foldersModel->getFolderPath(miFolder)), miFolder);
libraryCreator->updateFolder(path, LibraryPaths::libraryDataPath(path), QDir::cleanPath(currentPath() + foldersModel->getFolderPath(miFolder)), miFolder.data(FolderModel::IdRole).toULongLong());
libraryCreator->start();
}