Fix accessing the root folder for setting the library type

This commit is contained in:
luisangelsm
2025-12-14 10:17:32 +01:00
parent 3fb02c6fda
commit 8c7916eb0c
3 changed files with 47 additions and 18 deletions

View File

@ -76,6 +76,7 @@ public:
QStringList getSubfoldersNames(const QModelIndex &mi);
FolderModel *getSubfoldersModel(const QModelIndex &mi); // it creates a model that contains just the direct subfolders
Folder getRootFolder();
Folder getFolder(const QModelIndex &mi);
QModelIndex getIndexFromFolderId(qulonglong folderId, const QModelIndex &parent = QModelIndex());
QModelIndex getIndexFromFolder(const Folder &folder, const QModelIndex &parent = QModelIndex());
@ -133,6 +134,8 @@ private:
// parent contains the current data in the model (parentModelIndex is its index), updated contains fresh info loaded from the DB,
void takeUpdatedChildrenInfo(FolderItem *parent, const QModelIndex &parentModelIndex, FolderItem *updated);
Folder folderFromItem(FolderItem *item);
FolderItem *rootItem; // items tree
QMap<unsigned long long int, FolderItem *> items; // items lookup