feat: Pagination/virtualization (fetchMore) for EmailListModel
- EmailListModel: QAbstractListModel with canFetchMore/fetchMore * Batch loading (default 50 emails per fetch) * Total count query for scrollbar * TotalCountChanged signal * Paginated DB queries: findAllPaginated, findByFolderIdPaginated * Count queries: countAll, countByFolderId - MailItemDao: new paginated methods * findAllPaginated(offset, limit, filters...) * findByFolderIdPaginated(folderId, offset, limit, filters...) * countAll(filters...), countByFolderId(folderId, filters...) - MailListView: scroll-triggered fetchMore * Connects verticalScrollBar valueChanged on both TreeView and ListView * Triggers fetchMore at 90% scroll threshold * onRowsInserted updates EmailTreeModel when new emails arrive * Works in both normal (tree) and compact (list) views
This commit is contained in:
@@ -33,4 +33,8 @@ public:
|
||||
static bool replaceAttachments(qint64 mailItemId, const QVector<StoredAttachmentRecord>& attachments);
|
||||
static QVector<StoredAttachmentRecord> attachmentsForMail(qint64 mailItemId);
|
||||
static int countUnreadByFolderId(int folderId);
|
||||
static int countAll(const QString& searchFilter, bool unreadOnly, bool flaggedOnly, bool hasAttachments);
|
||||
static int countByFolderId(int folderId, const QString& searchFilter, bool unreadOnly, bool flaggedOnly, bool hasAttachments);
|
||||
static QVector<MailItem> findAllPaginated(int offset, int limit, const QString& searchFilter, bool unreadOnly, bool flaggedOnly, bool hasAttachments);
|
||||
static QVector<MailItem> findByFolderIdPaginated(int folderId, int offset, int limit, const QString& searchFilter, bool unreadOnly, bool flaggedOnly, bool hasAttachments);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user