mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 03:00:46 +03:00
Use QString::simplified instead of regex
This commit is contained in:
parent
ac6189099d
commit
ee72d8b7b7
2 changed files with 3 additions and 3 deletions
|
@ -28,7 +28,7 @@ HistoryViewItem::HistoryViewItem(const Event &event, bool with_sender, const QSt
|
|||
if (with_sender)
|
||||
sender = event.sender().split(":")[0].split("@")[1];
|
||||
|
||||
auto body = event.content().value("body").toString();
|
||||
auto body = event.content().value("body").toString().simplified();
|
||||
|
||||
auto timestamp = QDateTime::fromMSecsSinceEpoch(event.timestamp());
|
||||
auto local_time = timestamp.toString("HH:mm");
|
||||
|
|
|
@ -67,8 +67,8 @@ RoomInfo RoomList::extractRoomInfo(const State &room_state)
|
|||
}
|
||||
|
||||
// Sanitize info for print.
|
||||
info.setTopic(info.topic().replace(QRegularExpression("[\\s\\n\\r]+"), " "));
|
||||
info.setName(info.name().replace(QRegularExpression("[\\s\\n\\r]+"), " "));
|
||||
info.setTopic(info.topic().simplified());
|
||||
info.setName(info.name().simplified());
|
||||
|
||||
return info;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue