mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 21:18:48 +03:00
fix linting
This commit is contained in:
parent
a305c2689c
commit
1be42045ee
5 changed files with 131 additions and 126 deletions
|
@ -308,7 +308,8 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
|
||||||
&ChatPage::setGroupViewState);
|
&ChatPage::setGroupViewState);
|
||||||
|
|
||||||
connect(this, &ChatPage::initializeRoomList, room_list_, &RoomList::initialize);
|
connect(this, &ChatPage::initializeRoomList, room_list_, &RoomList::initialize);
|
||||||
connect(this,
|
connect(
|
||||||
|
this,
|
||||||
&ChatPage::initializeViews,
|
&ChatPage::initializeViews,
|
||||||
view_manager_,
|
view_manager_,
|
||||||
[this](const mtx::responses::Rooms &rooms) { view_manager_->sync(rooms); },
|
[this](const mtx::responses::Rooms &rooms) { view_manager_->sync(rooms); },
|
||||||
|
@ -377,7 +378,8 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
|
||||||
connect(
|
connect(
|
||||||
this, &ChatPage::tryInitialSyncCb, this, &ChatPage::tryInitialSync, Qt::QueuedConnection);
|
this, &ChatPage::tryInitialSyncCb, this, &ChatPage::tryInitialSync, Qt::QueuedConnection);
|
||||||
connect(this, &ChatPage::trySyncCb, this, &ChatPage::trySync, Qt::QueuedConnection);
|
connect(this, &ChatPage::trySyncCb, this, &ChatPage::trySync, Qt::QueuedConnection);
|
||||||
connect(this,
|
connect(
|
||||||
|
this,
|
||||||
&ChatPage::tryDelayedSyncCb,
|
&ChatPage::tryDelayedSyncCb,
|
||||||
this,
|
this,
|
||||||
[this]() { QTimer::singleShot(RETRY_TIMEOUT, this, &ChatPage::trySync); },
|
[this]() { QTimer::singleShot(RETRY_TIMEOUT, this, &ChatPage::trySync); },
|
||||||
|
|
|
@ -45,7 +45,8 @@ CompletionProxyModel::CompletionProxyModel(QAbstractItemModel *model, QObject *p
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(this,
|
connect(
|
||||||
|
this,
|
||||||
&CompletionProxyModel::newSearchString,
|
&CompletionProxyModel::newSearchString,
|
||||||
this,
|
this,
|
||||||
[this](QString s) {
|
[this](QString s) {
|
||||||
|
|
|
@ -39,7 +39,8 @@ EventStore::EventStore(std::string room_id, QObject *)
|
||||||
this->last = range->last;
|
this->last = range->last;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(this,
|
connect(
|
||||||
|
this,
|
||||||
&EventStore::eventFetched,
|
&EventStore::eventFetched,
|
||||||
this,
|
this,
|
||||||
[this](std::string id,
|
[this](std::string id,
|
||||||
|
@ -55,7 +56,8 @@ EventStore::EventStore(std::string room_id, QObject *)
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
connect(this,
|
connect(
|
||||||
|
this,
|
||||||
&EventStore::oldMessagesRetrieved,
|
&EventStore::oldMessagesRetrieved,
|
||||||
this,
|
this,
|
||||||
[this](const mtx::responses::Messages &res) {
|
[this](const mtx::responses::Messages &res) {
|
||||||
|
@ -79,8 +81,7 @@ EventStore::EventStore(std::string room_id, QObject *)
|
||||||
auto range = cache::client()->getTimelineRange(room_id_);
|
auto range = cache::client()->getTimelineRange(room_id_);
|
||||||
|
|
||||||
if (range && range->last - range->first != 0) {
|
if (range && range->last - range->first != 0) {
|
||||||
emit beginInsertRows(
|
emit beginInsertRows(0, int(range->last - range->first));
|
||||||
0, int(range->last - range->first));
|
|
||||||
this->first = range->first;
|
this->first = range->first;
|
||||||
this->last = range->last;
|
this->last = range->last;
|
||||||
emit endInsertRows();
|
emit endInsertRows();
|
||||||
|
@ -156,7 +157,8 @@ EventStore::EventStore(std::string room_id, QObject *)
|
||||||
event->data);
|
event->data);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(this,
|
connect(
|
||||||
|
this,
|
||||||
&EventStore::messageFailed,
|
&EventStore::messageFailed,
|
||||||
this,
|
this,
|
||||||
[this](std::string txn_id) {
|
[this](std::string txn_id) {
|
||||||
|
@ -176,7 +178,8 @@ EventStore::EventStore(std::string room_id, QObject *)
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
connect(this,
|
connect(
|
||||||
|
this,
|
||||||
&EventStore::messageSent,
|
&EventStore::messageSent,
|
||||||
this,
|
this,
|
||||||
[this](std::string txn_id, std::string event_id) {
|
[this](std::string txn_id, std::string event_id) {
|
||||||
|
|
|
@ -209,7 +209,8 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj
|
||||||
, room_id_(room_id)
|
, room_id_(room_id)
|
||||||
, manager_(manager)
|
, manager_(manager)
|
||||||
{
|
{
|
||||||
connect(this,
|
connect(
|
||||||
|
this,
|
||||||
&TimelineModel::redactionFailed,
|
&TimelineModel::redactionFailed,
|
||||||
this,
|
this,
|
||||||
[](const QString &msg) { emit ChatPage::instance()->showNotification(msg); },
|
[](const QString &msg) { emit ChatPage::instance()->showNotification(msg); },
|
||||||
|
@ -222,13 +223,13 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
connect(this, &TimelineModel::addPendingMessageToStore, &events, &EventStore::addPending);
|
connect(this, &TimelineModel::addPendingMessageToStore, &events, &EventStore::addPending);
|
||||||
|
|
||||||
connect(&events,
|
connect(
|
||||||
|
&events,
|
||||||
&EventStore::dataChanged,
|
&EventStore::dataChanged,
|
||||||
this,
|
this,
|
||||||
[this](int from, int to) {
|
[this](int from, int to) {
|
||||||
nhlog::ui()->debug("data changed {} to {}",
|
nhlog::ui()->debug(
|
||||||
events.size() - to - 1,
|
"data changed {} to {}", events.size() - to - 1, events.size() - from - 1);
|
||||||
events.size() - from - 1);
|
|
||||||
emit dataChanged(index(events.size() - to - 1, 0),
|
emit dataChanged(index(events.size() - to - 1, 0),
|
||||||
index(events.size() - from - 1, 0));
|
index(events.size() - from - 1, 0));
|
||||||
},
|
},
|
||||||
|
|
|
@ -32,9 +32,7 @@ SnackBar::SnackBar(QWidget *parent)
|
||||||
offset_anim.setDuration(100);
|
offset_anim.setDuration(100);
|
||||||
offset_anim.setEasingCurve(QEasingCurve::OutCubic);
|
offset_anim.setEasingCurve(QEasingCurve::OutCubic);
|
||||||
|
|
||||||
connect(this, &SnackBar::offsetChanged, this, [this]() mutable {
|
connect(this, &SnackBar::offsetChanged, this, [this]() mutable { repaint(); });
|
||||||
repaint();
|
|
||||||
});
|
|
||||||
connect(
|
connect(
|
||||||
&offset_anim, &QPropertyAnimation::finished, this, [this]() { hideTimer_.start(10000); });
|
&offset_anim, &QPropertyAnimation::finished, this, [this]() { hideTimer_.start(10000); });
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue