aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-01 14:26:22 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-01 14:26:22 +0900
commit46c9d422bc50c3eb4a5012962666e3bf3a0916a1 (patch)
tree44753896969a7ab9a71e65526ea0accb6250ff43 /lib
parent84f44ed93e528bcedf4c4c3bc8e54377854f27d0 (diff)
downloadlibquotient-46c9d422bc50c3eb4a5012962666e3bf3a0916a1.tar.gz
libquotient-46c9d422bc50c3eb4a5012962666e3bf3a0916a1.zip
More cleanup and minor tweaks
Diffstat (limited to 'lib')
-rw-r--r--lib/room.cpp16
-rw-r--r--lib/util.h4
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index 63b5e76d..8e1eb8e8 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -72,7 +72,7 @@ class Room::Private
{
public:
/** Map of user names to users. User names potentially duplicate, hence a multi-hashmap. */
- typedef QMultiHash<QString, User*> members_map_t;
+ using members_map_t = QMultiHash<QString, User*>;
Private(Connection* c, QString id_, JoinState initialJoinState)
: q(nullptr), connection(c), id(move(id_))
@@ -184,8 +184,8 @@ class Room::Private
* @param placement - position and direction of insertion: Older for
* historical messages, Newer for new ones
*/
- Timeline::size_type insertEvents(RoomEventsRange&& events,
- EventsPlacement placement);
+ Timeline::size_type moveEventsToTimeline(RoomEventsRange events,
+ EventsPlacement placement);
/**
* Removes events from the passed container that are already in the timeline
@@ -857,7 +857,7 @@ QList< User* > Room::users() const
QStringList Room::memberNames() const
{
QStringList res;
- for (auto u : d->membersMap)
+ for (auto u : qAsConst(d->membersMap))
res.append( roomMembername(u) );
return res;
@@ -931,8 +931,8 @@ inline auto makeErrorStr(const Event& e, QByteArray msg)
return msg.append("; event dump follows:\n").append(e.originalJson());
}
-Room::Timeline::size_type Room::Private::insertEvents(RoomEventsRange&& events,
- EventsPlacement placement)
+Room::Timeline::size_type Room::Private::moveEventsToTimeline(
+ RoomEventsRange events, EventsPlacement placement)
{
// Historical messages arrive in newest-to-oldest order, so the process for
// them is symmetric to the one for new messages.
@@ -1376,7 +1376,7 @@ void Room::Private::addNewMessageEvents(RoomEvents&& events)
if (!normalEvents.empty())
emit q->aboutToAddNewMessages(normalEvents);
- const auto insertedSize = insertEvents(move(normalEvents), Newer);
+ const auto insertedSize = moveEventsToTimeline(normalEvents, Newer);
const auto from = timeline.cend() - insertedSize;
if (insertedSize > 0)
{
@@ -1426,7 +1426,7 @@ void Room::Private::addHistoricalMessageEvents(RoomEvents&& events)
return;
emit q->aboutToAddHistoricalMessages(normalEvents);
- const auto insertedSize = insertEvents(move(normalEvents), Older);
+ const auto insertedSize = moveEventsToTimeline(normalEvents, Older);
const auto from = timeline.crend() - insertedSize;
qCDebug(MAIN) << "Room" << displayname << "received" << insertedSize
diff --git a/lib/util.h b/lib/util.h
index 28b85a82..fbbe32b2 100644
--- a/lib/util.h
+++ b/lib/util.h
@@ -18,8 +18,8 @@
#pragma once
-#include <QtCore/QMetaEnum>
-#include <QtCore/QDebug>
+//#include <QtCore/QMetaEnum> // We're about to drop REGISTER_ENUM,
+//#include <QtCore/QDebug> // therefore these are commented out
#include <QtCore/QPointer>
#include <functional>