Age | Commit message (Collapse) | Author |
|
Q_GADGET is generally used to enable two things outside of QObject:
Q_PROPERTY/Q_INVOKABLE and Q_ENUM/Q_FLAG. While the latter can be used
in its own right in QML, the former requires Q_GADGET instances to be
passed to QML by value, which is not really possible with
uncopyable/unassignable classes. Bottom line is that Q_PROPERTY in
anything derived from Quotient::Event is not viable, making Q_GADGET
macro useless unless there's a Q_ENUM/Q_FLAG (as is the case with
RoomMessageEvent, e.g.).
|
|
[skip ci]
|
|
By default enum class values are logged along with the qualifier; this
may or may not be desirable in a given setting. For JoinState(s) and
Membership(Mask) operator<< was overloaded to implicitly suppress
qualification; however, this is both overly sweeping and uses Qt's
internal API for the backend.
Instead, a new QDebug manipulator, terse(), is introduced, that does
the same as those operator<< overloads but on a per-invocation basis.
This makes it slightly more verbose to log enums but makes the QDebug
reconfiguration explicit and doesn't require to produce new overloads
every time a new enum ends up in logs. And it's built entirely on
the published Qt API, reusing the QDebugManip framework that Quotient
already has.
Also: operator<<(QDebug, QDebugManip) has been moved out of
the namespace to fix lookup issues when there's no prior
`using namespace Quotient`.
|
|
A handy macro that introduces an enumerator with a respective
Q_DECL_DEPRECATED_X recommending the substitution.
|
|
See also https://bugreports.qt.io/browse/QTBUG-82295.
|
|
|
|
|
|
Turned out it was broken, and I was looking the other way.
|
|
Without this, it compiles on Linux but on macOS and Windows.
|
|
A previous incarnation, make_array, existed in basejob.cpp before.
The new direction taken by C++20 is to either deduce the array (but
the used Apple standard library doesn't have deduction guides yet) or
to use to_array() that converts a C array to std::array. This latter
option is taken here, with to_array() defined in quotient_common.h
until we move over to C++20.
|
|
Instead of being defined independently, JoinState now uses values from
the Membership enumeration (former MemberEventContent::MembershipType)
that was moved to quotient_common.h for that purpose. Both enumerations
gained a Q_FLAG_NS decoration and operator<< overrides that strip
"Quotient::" prefix when dumping member/join state values to the log -
obviating toCString(JoinState) along the way. Quotient::MembershipType
alias is deprecated from now.
|
|
After going through all the files and the history of commits on them
it was clear that some copyright statements are obsolete (the code has
been overwritten since) and some are missing. This commit tries best to
remedy that, along with adding SPDX tags where they were still not used.
Also, a minimal SPDX convention is documented for further contributions.
Closes #426.
|
|
|
|
|
|
|
|
The two main cases for this header file are:
* namespace QMatrixClient = Quotient should occur exactly once,
to respect ODR.
* Q_NAMESPACE for namespace Quotient (to enable Q_ENUM_NS, particularly)
must be defined exactly once, for the same reason.
|