Fix linting issues
This commit is contained in:
parent
579bf23460
commit
d2af827194
@ -159,11 +159,9 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
|
||||
1000,
|
||||
"",
|
||||
"highlight",
|
||||
[this](const mtx::responses::Notifications &res,
|
||||
mtx::http::RequestErr err) {
|
||||
[this](const mtx::responses::Notifications &res, mtx::http::RequestErr err) {
|
||||
if (err) {
|
||||
nhlog::net()->warn(
|
||||
"failed to retrieve notifications: {} ({})",
|
||||
nhlog::net()->warn("failed to retrieve notifications: {} ({})",
|
||||
err->matrix_error.error,
|
||||
static_cast<int>(err->status_code));
|
||||
return;
|
||||
@ -520,7 +518,8 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
|
||||
|
||||
connect(this, &ChatPage::leftRoom, this, &ChatPage::removeRoom);
|
||||
connect(this, &ChatPage::notificationsRetrieved, this, &ChatPage::sendDesktopNotifications);
|
||||
connect(this, &ChatPage::highlightedNotifsRetrieved, this, &ChatPage::showNotificationsDialog);
|
||||
connect(
|
||||
this, &ChatPage::highlightedNotifsRetrieved, this, &ChatPage::showNotificationsDialog);
|
||||
|
||||
connect(communitiesList_,
|
||||
&CommunitiesList::communityChanged,
|
||||
|
@ -90,7 +90,6 @@ signals:
|
||||
void notificationsRetrieved(const mtx::responses::Notifications &);
|
||||
void highlightedNotifsRetrieved(const mtx::responses::Notifications &);
|
||||
|
||||
|
||||
void uploadFailed(const QString &msg);
|
||||
void imageUploaded(const QString &roomid,
|
||||
const QString &filename,
|
||||
@ -209,7 +208,6 @@ private:
|
||||
|
||||
void showNotificationsDialog(const mtx::responses::Notifications &);
|
||||
|
||||
|
||||
QStringList generateTypingUsers(const QString &room_id,
|
||||
const std::vector<std::string> &typing_users);
|
||||
|
||||
|
@ -229,7 +229,8 @@ UserMentionsWidget::paintEvent(QPaintEvent *event)
|
||||
// timestamp.
|
||||
int usernameLimit =
|
||||
std::max(0, width() - 3 * wm.padding - msgStampWidth - wm.iconSize - 20);
|
||||
auto userName = metrics.elidedText("Show Mentioned Messages", Qt::ElideRight, usernameLimit);
|
||||
auto userName =
|
||||
metrics.elidedText("Show Mentioned Messages", Qt::ElideRight, usernameLimit);
|
||||
|
||||
p.setFont(QFont{});
|
||||
p.drawText(QPoint(2 * wm.padding + wm.iconSize, bottom_y), userName);
|
||||
|
@ -38,14 +38,13 @@ UserMentions::UserMentions(QWidget *parent)
|
||||
}
|
||||
|
||||
void
|
||||
UserMentions::pushItem(const QString &event_id, const QString &user_id, const QString &body, const QString &room_id) {
|
||||
TimelineItem *view_item =
|
||||
new TimelineItem(mtx::events::MessageType::Text,
|
||||
user_id,
|
||||
body,
|
||||
true,
|
||||
room_id,
|
||||
scroll_widget_);
|
||||
UserMentions::pushItem(const QString &event_id,
|
||||
const QString &user_id,
|
||||
const QString &body,
|
||||
const QString &room_id)
|
||||
{
|
||||
TimelineItem *view_item = new TimelineItem(
|
||||
mtx::events::MessageType::Text, user_id, body, true, room_id, scroll_widget_);
|
||||
view_item->setEventId(event_id);
|
||||
setUpdatesEnabled(false);
|
||||
view_item->hide();
|
||||
|
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <QScrollArea>
|
||||
#include <QScrollBar>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
namespace dialogs {
|
||||
|
||||
@ -12,15 +12,17 @@ class UserMentions : public QWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
UserMentions(QWidget *parent = nullptr);
|
||||
void pushItem(const QString &event_id, const QString &user_id, const QString &body, const QString &room_id);
|
||||
void pushItem(const QString &event_id,
|
||||
const QString &user_id,
|
||||
const QString &body,
|
||||
const QString &room_id);
|
||||
|
||||
private:
|
||||
QVBoxLayout *top_layout_;
|
||||
QVBoxLayout *scroll_layout_;
|
||||
|
||||
QScrollArea *scroll_area_;
|
||||
QWidget *scroll_widget_;
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user