From ce4447024641c0ee793539d79a6d9be7a34a000b Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 13 Feb 2026 06:26:11 +0100 Subject: Drop libsocialcache files in MastodonPostsModel --- .../eventsview-plugin-mastodon/mastodonpostsmodel.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.h') diff --git a/eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.h b/eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.h index 565b2bb..e30437d 100644 --- a/eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.h +++ b/eventsview-plugins/eventsview-plugin-mastodon/mastodonpostsmodel.h @@ -19,14 +19,15 @@ #ifndef MASTODONPOSTSMODEL_H #define MASTODONPOSTSMODEL_H -#include "abstractsocialcachemodel.h" +#include "mastodonpostsdatabase.h" +#include +#include -class MastodonPostsModelPrivate; - -class MastodonPostsModel: public AbstractSocialCacheModel +class MastodonPostsModel: public QAbstractListModel { Q_OBJECT Q_PROPERTY(QVariantList accountIdFilter READ accountIdFilter WRITE setAccountIdFilter NOTIFY accountIdFilterChanged) + Q_PROPERTY(int count READ rowCount NOTIFY countChanged) public: enum MastodonPostsRole { @@ -52,21 +53,27 @@ public: }; explicit MastodonPostsModel(QObject *parent = 0); - QHash roleNames() const; + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + QVariant data(const QModelIndex &index, int role) const override; + QHash roleNames() const override; QVariantList accountIdFilter() const; void setAccountIdFilter(const QVariantList &accountIds); - void refresh(); + Q_INVOKABLE void refresh(); signals: void accountIdFilterChanged(); + void countChanged(); private slots: void postsChanged(); private: - Q_DECLARE_PRIVATE(MastodonPostsModel) + typedef QMap RowData; + QList m_data; + MastodonPostsDatabase m_database; }; #endif // MASTODONPOSTSMODEL_H -- cgit v1.2.3