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