aboutsummaryrefslogtreecommitdiff
path: root/util.h
AgeCommit message (Collapse)Author
2017-10-20CleanupKitsune Ral
2017-10-13Pass universal references in Connection::callApi<>; fixed a typo in util.hKitsune Ral
So that even uncopyable types could be used for parameters; also fixed a typo in util.h that prevented dispatch() from using with multiple argument functions.
2017-08-28Use -pedantic with compilers that support itKitsune Ral
2017-05-22Dispatch<>: Allow nullptr for a function; special-case GCC 4.8Kitsune Ral
2017-05-22util.h: lookup() uses forwarding refs; added Dispatch/dispatch and REGISTER_ENUMKitsune Ral
The Dispatch<> template and dispatch(), a facility function for it, simplify dispatching to functions that have different signatures that still can be converted to the same std::function<> type. The case in point is in event.cpp; Event::fromJson calls make() that always returns the type we need; however, once we have several possible base types (Event, RoomEvent, StateEvent), we'd have to either write a specific make() incarnation for each of them, or mess with function return type conversions. Dispatch<> helps to keep the code clean. REGISTER_ENUM is a cross-Qt versions approach to dumping enumeration values to qDebug() and the likes.
2017-05-13Refactored logging enhancementsKitsune Ral
logging.h/logging.cpp is now a full-fledged pair for all things logging. Two more categories added, EPHEMERAL and SYNCJOB, that control logging for ephemeral events and SyncJob, respectively (in particular, switching off EPHEMERAL greatly reduces the logspam about moving read markers and how many users have read up to which event).
2017-04-30Port to categorized loggingElvis Angelaccio
This greatly reduces the noise made by quaternion. To enable full logging, export the following variable: QT_LOGGING_RULES="libqmatrixclient.*.debug=true"
2017-03-25Simplified formatJson definitionKitsune Ral
Fixed the "formatJson unused" warning with that.
2017-03-16Fixed warnings about a static lambda defined but unusedKitsune Ral
2017-03-09Fixed building with VS2013Kitsune Ral
2017-02-28Renamed logging_util.h to util.h and moved (improved) Owning<> and lookup() ↵Kitsune Ral
there Because these fall outside of SyncJob and Event context, respectively. In addition, Owning<> has gained a move assignment operator (because we have a move constructor) and assign() convenience method to take ownership over an existing container; also, Owning<>::release() is done the right way now (the previous version was copying the return value to a new container instead of releasing the old container).