Age | Commit message (Collapse) | Author |
|
The original (more complex and comprehensive) solution belongs to
https://oliora.github.io/2015/12/29/pimpl-and-rule-of-zero.html - this
commit only provides a small wrapper for non-copyable Private class
implementations common throughout libQuotient. Unlike the original,
default initialisation is made explicit - you have to pass
ZeroImpl<Private>() instead (and I firmly believe it's a good thing:
normally pointers to Private should not remain nullptr). The reason
ZeroImpl<> is not a template variable is quite simple: unique_ptr is
non-copyable and so cannot be initialised from; while a template
function will initialise the value in-place thanks to copy elision.
|
|
Once visibility kicks in, MSVC changes its ways and tries to instantiate
Private classes wrapped in smart pointers upon their occurence in the
header file - which leads to build breakage because of a missing
destructor. Usually making the outer class destructor out-of-line helps
to fix this (see RoomEvent, for one example).
|
|
This include all (hopefully) classes/structures and functions that have
non-inline definitions, as well as namespaces with Q_NAMESPACE since
those have non-inline (as of Qt 5.15) QMetaObject - for that a new
macro, QUO_NAMESPACE, has been devised to accommodate the lack of
Q_NAMESPACE_EXPORT in Qt before 5.14.
|
|
- QNetworkReply::isSequential() already returns `true`, there's no need
to overload it again.
- Use `Q_SLOTS` instead of `slots` because it's an external library
interface and clients may use other libraries using `slots` identifier;
- Use `emit` instead of `Q_EMIT` because this is a part of internal
implementation and if we ever use a library that has an `emit`
identifier, a massive search-replace will be in order anyway.
- Use `QMetaObject::invokeMethod()` with a queued connection as
a clearer way to achieve the same goal as `QTimer::singleShot(0, ...)`.
|
|
|
|
Allows images to be loaded using the NetworkAccessManager instead of an
ImageProvider
|