InputBar: run clang-format

This commit is contained in:
Marcus Hoffmann 2021-12-03 01:54:43 +01:00
parent a9d8059fb2
commit a01bc14db6
2 changed files with 29 additions and 27 deletions

View file

@ -170,7 +170,10 @@ InputBar::setText(const QString& newText)
emit textChanged(newText); emit textChanged(newText);
} }
void void
InputBar::updateState(int selectionStart_, int selectionEnd_, int cursorPosition_, const QString& text_) InputBar::updateState(int selectionStart_,
int selectionEnd_,
int cursorPosition_,
const QString &text_)
{ {
if (text_.isEmpty()) if (text_.isEmpty())
stopTyping(); stopTyping();
@ -591,13 +594,13 @@ InputBar::command(const QString& command, QString args)
.toStdString(); .toStdString();
member.membership = mtx::events::state::Membership::Join; member.membership = mtx::events::state::Membership::Join;
http::client()->send_state_event(room->roomId().toStdString(), http::client()->send_state_event(
room->roomId().toStdString(),
http::client()->user_id().to_string(), http::client()->user_id().to_string(),
member, member,
[](const mtx::responses::EventId &, mtx::http::RequestErr err) { [](const mtx::responses::EventId &, mtx::http::RequestErr err) {
if (err) if (err)
nhlog::net()->error( nhlog::net()->error("Failed to set room displayname: {}",
"Failed to set room displayname: {}",
err->matrix_error.error); err->matrix_error.error);
}); });
} else if (command == "shrug") { } else if (command == "shrug") {
@ -652,8 +655,7 @@ InputBar::command(const QString& command, QString args)
void void
InputBar::showPreview(const QMimeData &source, const QString &path, const QStringList &formats) InputBar::showPreview(const QMimeData &source, const QString &path, const QStringList &formats)
{ {
auto *previewDialog_ = auto *previewDialog_ = new dialogs::PreviewUploadOverlay(ChatPage::instance());
new dialogs::PreviewUploadOverlay(ChatPage::instance());
previewDialog_->setAttribute(Qt::WA_DeleteOnClose); previewDialog_->setAttribute(Qt::WA_DeleteOnClose);
// Force SVG to _not_ be handled as an image, but as raw data // Force SVG to _not_ be handled as an image, but as raw data