summary refs log tree commit diff
path: root/src/timeline2/TimelineViewManager.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2019-08-31 22:43:31 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2019-11-23 20:06:14 +0100
commit47fbfd3f44154faf796c0be47dddfcba1b509a12 (patch)
tree0c05744b0828b8d46386a3c3b33293c285c52568 /src/timeline2/TimelineViewManager.h
parentAdd placeholder timeline model (diff)
downloadnheko-47fbfd3f44154faf796c0be47dddfcba1b509a12.tar.xz
Add items to timline
Diffstat (limited to '')
-rw-r--r--src/timeline2/TimelineViewManager.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/timeline2/TimelineViewManager.h b/src/timeline2/TimelineViewManager.h
index 80948148..7f760eac 100644
--- a/src/timeline2/TimelineViewManager.h
+++ b/src/timeline2/TimelineViewManager.h
@@ -7,6 +7,7 @@
 #include <mtx/responses.hpp>
 
 #include "Cache.h"
+#include "Logging.h"
 #include "TimelineModel.h"
 #include "Utils.h"
 
@@ -17,6 +18,10 @@
 class TimelineViewManager : public QObject
 {
         Q_OBJECT
+
+        Q_PROPERTY(
+          TimelineModel *timeline MEMBER timeline_ READ activeTimeline NOTIFY activeTimelineChanged)
+
 public:
         TimelineViewManager(QWidget *parent = 0);
         QWidget *getWidget() const { return container; }
@@ -27,9 +32,16 @@ public:
         void sync(const mtx::responses::Rooms &rooms) {}
         void clearAll() { models.clear(); }
 
+        Q_INVOKABLE TimelineModel *activeTimeline() const
+        {
+                nhlog::ui()->info("aaaa");
+                return timeline_;
+        }
+
 signals:
         void clearRoomMessageCount(QString roomid);
         void updateRoomsLastMessage(const QString &user, const DescInfo &info);
+        void activeTimelineChanged(TimelineModel *timeline);
 
 public slots:
         void updateReadReceipts(const QString &room_id, const std::vector<QString> &event_ids) {}
@@ -70,6 +82,7 @@ public slots:
 private:
         QQuickView *view;
         QWidget *container;
+        TimelineModel *timeline_ = nullptr;
 
         QHash<QString, QSharedPointer<TimelineModel>> models;
 };