diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-23 11:57:58 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-12-10 10:28:56 +0000 |
commit | 1f2734b82b77fc8a959fdca8f3372cf09f65edd8 (patch) | |
tree | 489783aeee5f9ab405b1f43cff364e31456504f2 /src/plugins/platforms/xcb/qxcbconnection.h | |
parent | 4c29eba2484319541e0b2863b0dc1e7081228ec2 (diff) |
Xcb: Fix debugging code
We need to pass the correct connection and we need a specialization for
reply pointers. Also, there is not much of a point in first creating
a QString from a QByteArray, only to retrieve a QByteArray again.
Change-Id: Ia1bb5655f6229638e3bd2339acadeffc80561b9e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 3c82170679..cf50076f98 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -626,7 +626,11 @@ private: QMutex m_callLogMutex; void log(const char *file, int line, int sequence); template <typename cookie_t> - friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line); + friend cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, + const char *file, int line); + template <typename reply_t> + friend reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, + const char *file, int line); #endif WindowMapper m_mapper; @@ -689,11 +693,19 @@ private: #ifdef Q_XCB_DEBUG template <typename cookie_t> -cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, int line) +cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, + int line) { connection->log(file, line, cookie.sequence); return cookie; } + +template <typename reply_t> +reply_t *q_xcb_call_template(reply_t *reply, QXcbConnection *connection, const char *file, int line) +{ + connection->log(file, line, reply->sequence); + return reply; +} #define Q_XCB_CALL(x) q_xcb_call_template(x, connection(), __FILE__, __LINE__) #define Q_XCB_CALL2(x, connection) q_xcb_call_template(x, connection, __FILE__, __LINE__) #define Q_XCB_NOOP(c) q_xcb_call_template(xcb_no_operation(c->xcb_connection()), c, __FILE__, __LINE__); |