summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-04-10 18:17:41 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-04-10 18:17:41 +0300
commitee72d8b7b75ae50bffef439ae9d072f3c0713224 (patch)
treea781d380f116596ec035ae32fb0800c5ec74c1c4 /src
parentUpdate readme (diff)
downloadnheko-ee72d8b7b75ae50bffef439ae9d072f3c0713224.tar.xz
Use QString::simplified instead of regex
Diffstat (limited to 'src')
-rw-r--r--src/HistoryViewItem.cc2
-rw-r--r--src/RoomList.cc4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/HistoryViewItem.cc b/src/HistoryViewItem.cc

index 84890185..99154ea1 100644 --- a/src/HistoryViewItem.cc +++ b/src/HistoryViewItem.cc
@@ -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"); diff --git a/src/RoomList.cc b/src/RoomList.cc
index c56ea9b9..7800b34d 100644 --- a/src/RoomList.cc +++ b/src/RoomList.cc
@@ -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; }