aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-08-22 21:37:42 +0200
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-08-22 21:37:42 +0200
commit744592ee490858c464bba216cf19161aaf30d786 (patch)
tree5ac8ddb80fa8c27d0a8ff9e1e6ae4a41f03c4853
parent812e460f2159556ad00ab838d58b349fa3542047 (diff)
downloadlibquotient-744592ee490858c464bba216cf19161aaf30d786.tar.gz
libquotient-744592ee490858c464bba216cf19161aaf30d786.zip
Cleanup and some extra comments
-rw-r--r--lib/qt_connection_util.h2
-rw-r--r--lib/room.cpp4
-rw-r--r--lib/user.cpp1
-rw-r--r--lib/util.h6
4 files changed, 8 insertions, 5 deletions
diff --git a/lib/qt_connection_util.h b/lib/qt_connection_util.h
index 04dc6b27..699735d4 100644
--- a/lib/qt_connection_util.h
+++ b/lib/qt_connection_util.h
@@ -46,7 +46,7 @@ namespace _impl {
// arguments are always copied (at best - COWed) to the context of
// the slot. Therefore the slot decorator receives const ArgTs&...
// rather than ArgTs&&...
- // TODO: std::bind_front() instead of lambda.
+ // TODO (C++20): std::bind_front() instead of lambda.
c = QObject::connect(sender, signal, context,
[pc = std::move(pc),
decoratedSlot = std::move(decoratedSlot)](const ArgTs&... args) {
diff --git a/lib/room.cpp b/lib/room.cpp
index 1e3eb603..0a4e041b 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -2311,7 +2311,7 @@ Room::Changes Room::Private::addNewMessageEvents(RoomEvents&& events)
}
}
- qCDebug(STATE) << "Room" << q->objectName() << "received"
+ qCDebug(MESSAGES) << "Room" << q->objectName() << "received"
<< totalInserted << "new events; the last event is now"
<< timeline.back();
@@ -2326,7 +2326,7 @@ Room::Changes Room::Private::addNewMessageEvents(RoomEvents&& events)
if (q->readMarker(firstWriter) != timeline.crend()) {
roomChanges |=
promoteReadMarker(firstWriter, rev_iter_t(from) - 1);
- qCDebug(STATE)
+ qCDebug(MESSAGES)
<< "Auto-promoted read marker for" << senderId
<< "to" << *q->readMarker(firstWriter);
}
diff --git a/lib/user.cpp b/lib/user.cpp
index 673947ff..3c61bfd6 100644
--- a/lib/user.cpp
+++ b/lib/user.cpp
@@ -132,7 +132,6 @@ void User::updateName(const QString& newName, const Room* r)
const auto& oldName =
std::exchange(d->defaultName, newName);
emit nameChanged(d->defaultName, oldName, nullptr);
-
}
void User::updateName(const QString&, const QString&, const Room*) {}
void User::updateAvatarUrl(const QUrl&, const QUrl&, const Room*) {}
diff --git a/lib/util.h b/lib/util.h
index 943ff8db..8c92df74 100644
--- a/lib/util.h
+++ b/lib/util.h
@@ -200,6 +200,10 @@ using fn_arg_t =
// TODO: get rid of it as soon as Apple Clang gets proper deduction guides
// for std::function<>
+// ...or consider using QtPrivate magic used by QObject::connect()
+// since wrap_in_function() is actually made for qt_connection_util.h
+// ...for inspiration, also check a possible std::not_fn implementation at
+// https://en.cppreference.com/w/cpp/utility/functional/not_fn
template <typename FnT>
inline auto wrap_in_function(FnT&& f)
{
@@ -217,7 +221,7 @@ inline auto operator"" _ls(const char* s, std::size_t size)
*/
template <typename ArrayT>
class Range {
- // Looking forward to C++23 ranges
+ // Looking forward to C++20 ranges
using iterator = typename ArrayT::iterator;
using const_iterator = typename ArrayT::const_iterator;
using size_type = typename ArrayT::size_type;