Add a collection immediately and show a placeholder + busy indicator in localdocs settings.

This commit is contained in:
Adam Treat
2023-06-03 10:08:59 -04:00
parent 23391d44e0
commit bc624f5389
6 changed files with 24 additions and 8 deletions

View File

@@ -22,6 +22,8 @@ QVariant LocalDocsModel::data(const QModelIndex &index, int role) const
return item.collection;
case FolderPathRole:
return item.folder_path;
case InstalledRole:
return item.installed;
}
return QVariant();
@@ -32,9 +34,17 @@ QHash<int, QByteArray> LocalDocsModel::roleNames() const
QHash<int, QByteArray> roles;
roles[CollectionRole] = "collection";
roles[FolderPathRole] = "folder_path";
roles[InstalledRole] = "installed";
return roles;
}
void LocalDocsModel::addCollectionItem(const CollectionItem &item)
{
beginInsertRows(QModelIndex(), m_collectionList.size(), m_collectionList.size());
m_collectionList.append(item);
endInsertRows();
}
void LocalDocsModel::handleCollectionListUpdated(const QList<CollectionItem> &collectionList)
{
beginResetModel();