summaryrefslogtreecommitdiffstats
path: root/common/modelresult.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-15 06:59:06 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-15 07:12:13 +0200
commit77115bab30aa789f9af9fe49006e8747488f8a4c (patch)
tree5a370c6f25fdce3396d8172b509306f8f501d34f /common/modelresult.h
parentbb70bdcd0eaf72ffc304536267a66c5de5eaf2e9 (diff)
downloadsink-77115bab30aa789f9af9fe49006e8747488f8a4c.tar.gz
sink-77115bab30aa789f9af9fe49006e8747488f8a4c.zip
Moved thread-boundary crossing to the model.
That way we avoid any unnecessary queuing for the sync API, and enable fine-tuning in the model code at a later stage.
Diffstat (limited to 'common/modelresult.h')
-rw-r--r--common/modelresult.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/common/modelresult.h b/common/modelresult.h
index 0f0c06a..64431da 100644
--- a/common/modelresult.h
+++ b/common/modelresult.h
@@ -54,15 +54,14 @@ public:
54 bool canFetchMore(const QModelIndex &parent) const; 54 bool canFetchMore(const QModelIndex &parent) const;
55 void fetchMore(const QModelIndex &parent); 55 void fetchMore(const QModelIndex &parent);
56 56
57 void setFetcher(const std::function<void(const Ptr &parent)> &fetcher);
58
59private:
57 void add(const Ptr &value); 60 void add(const Ptr &value);
58 void modify(const Ptr &value); 61 void modify(const Ptr &value);
59 void remove(const Ptr &value); 62 void remove(const Ptr &value);
60
61 void setFetcher(const std::function<void(const Ptr &parent)> &fetcher);
62
63 bool childrenFetched(const QModelIndex &) const; 63 bool childrenFetched(const QModelIndex &) const;
64 64
65private:
66 qint64 parentId(const Ptr &value); 65 qint64 parentId(const Ptr &value);
67 QModelIndex createIndexFromId(const qint64 &id) const; 66 QModelIndex createIndexFromId(const qint64 &id) const;
68 void fetchEntities(const QModelIndex &parent); 67 void fetchEntities(const QModelIndex &parent);