diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2019-05-14 19:24:13 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-05-27 17:43:12 +0000 |
commit | 001ba40e19fa71d05fbac9c059309df40801e89c (patch) | |
tree | ca27523115ba2209848cf6e79d7e706b5dfcdce7 /src/corelib/global/qlogging.h | |
parent | a8162e1f59f2823bffddb0ee660829561b9b5090 (diff) |
QMessageLogContext: rename and improve copy()
The "copy" name led me to mis-believe that it was a workaround
to the class being non-copiable, and was missing copying a
data member.
This is instead deliberate; so rename the function to
"copyContextFrom", documenting that version won't be copied.
The function is still private API, so actually make it private;
QMessageLogContext already befriended the only user.
Finally, make it return *this (so that it can be chained,
if necessary) and noexcept.
Change-Id: I3deb3c8edc863a88ac0c37467b144ec2e20db5ca
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qlogging.h')
-rw-r--r-- | src/corelib/global/qlogging.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h index 8f39780112..14c5d66bcd 100644 --- a/src/corelib/global/qlogging.h +++ b/src/corelib/global/qlogging.h @@ -68,8 +68,6 @@ public: Q_DECL_CONSTEXPR QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName) : version(2), line(lineNumber), file(fileName), function(functionName), category(categoryName) {} - void copy(const QMessageLogContext &logContext); - int version; int line; const char *file; @@ -77,6 +75,8 @@ public: const char *category; private: + QMessageLogContext ©ContextFrom(const QMessageLogContext &logContext) noexcept; + friend class QMessageLogger; friend class QDebug; }; |