mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Lint + clazy
This commit is contained in:
parent
4eaba191de
commit
44cf096111
3 changed files with 7 additions and 8 deletions
|
@ -2115,7 +2115,7 @@ TimelineModel::handleIgnoredUser(const QString &id, const std::optional<QString>
|
||||||
{
|
{
|
||||||
if (err) {
|
if (err) {
|
||||||
MainWindow::instance()->showNotification(
|
MainWindow::instance()->showNotification(
|
||||||
tr("Failed to ignore \"%1\": %2").arg(id).arg(*err));
|
tr("Failed to ignore \"%1\": %2").arg(id, *err));
|
||||||
} else {
|
} else {
|
||||||
this->clearTimeline();
|
this->clearTimeline();
|
||||||
}
|
}
|
||||||
|
|
|
@ -565,7 +565,9 @@ TimelineViewManager::fixImageRendering(QQuickTextDocument *t, QQuickItem *i)
|
||||||
|
|
||||||
using IgnoredUsers = mtx::events::EphemeralEvent<mtx::events::account_data::IgnoredUsers>;
|
using IgnoredUsers = mtx::events::EphemeralEvent<mtx::events::account_data::IgnoredUsers>;
|
||||||
|
|
||||||
static QVector<QString> convertIgnoredToQt(const IgnoredUsers &ev) {
|
static QVector<QString>
|
||||||
|
convertIgnoredToQt(const IgnoredUsers &ev)
|
||||||
|
{
|
||||||
QVector<QString> users;
|
QVector<QString> users;
|
||||||
for (const mtx::events::account_data::IgnoredUser &user : ev.content.users) {
|
for (const mtx::events::account_data::IgnoredUser &user : ev.content.users) {
|
||||||
users.push_back(QString::fromStdString(user.id));
|
users.push_back(QString::fromStdString(user.id));
|
||||||
|
@ -586,14 +588,14 @@ TimelineViewManager::getIgnoredUsers()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TimelineViewManager::processIgnoredUsers(const mtx::responses::AccountData &data)
|
TimelineViewManager::processIgnoredUsers(const mtx::responses::AccountData &data)
|
||||||
{
|
{
|
||||||
for (const mtx::events::collections::RoomAccountDataEvents::variant &ev : data.events) {
|
for (const mtx::events::collections::RoomAccountDataEvents::variant &ev : data.events) {
|
||||||
if (!std::holds_alternative<IgnoredUsers>(ev)) {
|
if (!std::holds_alternative<IgnoredUsers>(ev)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const auto &ignoredEv = std::get<IgnoredUsers>(ev);
|
const auto &ignoredEv = std::get<IgnoredUsers>(ev);
|
||||||
|
|
||||||
emit this->ignoredUsersChanged(convertIgnoredToQt(ignoredEv));
|
emit this->ignoredUsersChanged(convertIgnoredToQt(ignoredEv));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,10 +63,7 @@ public:
|
||||||
return instance_;
|
return instance_;
|
||||||
}
|
}
|
||||||
|
|
||||||
static TimelineViewManager *instance()
|
static TimelineViewManager *instance() { return TimelineViewManager::instance_; }
|
||||||
{
|
|
||||||
return TimelineViewManager::instance_;
|
|
||||||
}
|
|
||||||
|
|
||||||
QVector<QString> getIgnoredUsers();
|
QVector<QString> getIgnoredUsers();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue