Rename initialize to sync, since it does the same thing

This commit is contained in:
Nicolas Werner 2019-09-29 11:28:55 +02:00
parent e2d733a01a
commit 0d3c9390c6
3 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -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_; }