diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2019-09-29 11:28:55 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2019-11-23 20:06:15 +0100 |
commit | 0d3c9390c67d4f0fefdfa192009291ff024ecce8 (patch) | |
tree | db57a978fc73a004b3f6e3057fbcc517d7f3bde6 /src | |
parent | e2d733a01a1c936d22ec6c67b2f3b57ac0afdabb (diff) |
Rename initialize to sync, since it does the same thing
Diffstat (limited to 'src')
-rw-r--r-- | src/ChatPage.cpp | 4 | ||||
-rw-r--r-- | src/timeline2/TimelineViewManager.cpp | 3 | ||||
-rw-r--r-- | src/timeline2/TimelineViewManager.h | 3 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index 594a41c2..e5d4c9be 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -566,7 +566,7 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent) connect(this, &ChatPage::initializeViews, view_manager_, - [this](const mtx::responses::Rooms &rooms) { view_manager_->initialize(rooms); }); + [this](const mtx::responses::Rooms &rooms) { view_manager_->sync(rooms); }); connect(this, &ChatPage::initializeEmptyViews, view_manager_, @@ -582,7 +582,7 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent) nhlog::db()->error("failed to retrieve invites: {}", e.what()); } - view_manager_->initialize(rooms); + view_manager_->sync(rooms); removeLeftRooms(rooms.leave); bool hasNotifications = false; diff --git a/src/timeline2/TimelineViewManager.cpp b/src/timeline2/TimelineViewManager.cpp index eed0682d..4ec089fa 100644 --- a/src/timeline2/TimelineViewManager.cpp +++ b/src/timeline2/TimelineViewManager.cpp @@ -27,9 +27,10 @@ TimelineViewManager::TimelineViewManager(QWidget *parent) } void -TimelineViewManager::initialize(const mtx::responses::Rooms &rooms) +TimelineViewManager::sync(const mtx::responses::Rooms &rooms) { for (auto it = rooms.join.cbegin(); it != rooms.join.cend(); ++it) { + // addRoom will only add the room, if it doesn't exist addRoom(QString::fromStdString(it->first)); models.value(QString::fromStdString(it->first))->addEvents(it->second.timeline); } diff --git a/src/timeline2/TimelineViewManager.h b/src/timeline2/TimelineViewManager.h index 687ae24e..9fcbc2f8 100644 --- a/src/timeline2/TimelineViewManager.h +++ b/src/timeline2/TimelineViewManager.h @@ -28,10 +28,9 @@ public: TimelineViewManager(QWidget *parent = 0); QWidget *getWidget() const { return container; } - void initialize(const mtx::responses::Rooms &rooms); + void sync(const mtx::responses::Rooms &rooms); void addRoom(const QString &room_id); - void sync(const mtx::responses::Rooms &rooms) {} void clearAll() { models.clear(); } Q_INVOKABLE TimelineModel *activeTimeline() const { return timeline_; } |