diff options
Diffstat (limited to 'adapters/qt.h')
-rw-r--r-- | adapters/qt.h | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/adapters/qt.h b/adapters/qt.h index a75cf31..de8d191 100644 --- a/adapters/qt.h +++ b/adapters/qt.h @@ -9,73 +9,73 @@ * */ -#ifndef __HIREDIS_QT_H__ -#define __HIREDIS_QT_H__ +#ifndef __HIREDICT_QT_H__ +#define __HIREDICT_QT_H__ #include <QSocketNotifier> #include "../async.h" -static void RedisQtAddRead(void *); -static void RedisQtDelRead(void *); -static void RedisQtAddWrite(void *); -static void RedisQtDelWrite(void *); -static void RedisQtCleanup(void *); +static void RedictQtAddRead(void *); +static void RedictQtDelRead(void *); +static void RedictQtAddWrite(void *); +static void RedictQtDelWrite(void *); +static void RedictQtCleanup(void *); -class RedisQtAdapter : public QObject { +class RedictQtAdapter : public QObject { Q_OBJECT friend - void RedisQtAddRead(void * adapter) { - RedisQtAdapter * a = static_cast<RedisQtAdapter *>(adapter); + void RedictQtAddRead(void * adapter) { + RedictQtAdapter * a = static_cast<RedictQtAdapter *>(adapter); a->addRead(); } friend - void RedisQtDelRead(void * adapter) { - RedisQtAdapter * a = static_cast<RedisQtAdapter *>(adapter); + void RedictQtDelRead(void * adapter) { + RedictQtAdapter * a = static_cast<RedictQtAdapter *>(adapter); a->delRead(); } friend - void RedisQtAddWrite(void * adapter) { - RedisQtAdapter * a = static_cast<RedisQtAdapter *>(adapter); + void RedictQtAddWrite(void * adapter) { + RedictQtAdapter * a = static_cast<RedictQtAdapter *>(adapter); a->addWrite(); } friend - void RedisQtDelWrite(void * adapter) { - RedisQtAdapter * a = static_cast<RedisQtAdapter *>(adapter); + void RedictQtDelWrite(void * adapter) { + RedictQtAdapter * a = static_cast<RedictQtAdapter *>(adapter); a->delWrite(); } friend - void RedisQtCleanup(void * adapter) { - RedisQtAdapter * a = static_cast<RedisQtAdapter *>(adapter); + void RedictQtCleanup(void * adapter) { + RedictQtAdapter * a = static_cast<RedictQtAdapter *>(adapter); a->cleanup(); } public: - RedisQtAdapter(QObject * parent = 0) + RedictQtAdapter(QObject * parent = 0) : QObject(parent), m_ctx(0), m_read(0), m_write(0) { } - ~RedisQtAdapter() { + ~RedictQtAdapter() { if (m_ctx != 0) { m_ctx->ev.data = NULL; } } - int setContext(redisAsyncContext * ac) { + int setContext(redictAsyncContext * ac) { if (ac->ev.data != NULL) { - return REDIS_ERR; + return REDICT_ERR; } m_ctx = ac; m_ctx->ev.data = this; - m_ctx->ev.addRead = RedisQtAddRead; - m_ctx->ev.delRead = RedisQtDelRead; - m_ctx->ev.addWrite = RedisQtAddWrite; - m_ctx->ev.delWrite = RedisQtDelWrite; - m_ctx->ev.cleanup = RedisQtCleanup; - return REDIS_OK; + m_ctx->ev.addRead = RedictQtAddRead; + m_ctx->ev.delRead = RedictQtDelRead; + m_ctx->ev.addWrite = RedictQtAddWrite; + m_ctx->ev.delWrite = RedictQtDelWrite; + m_ctx->ev.cleanup = RedictQtCleanup; + return REDICT_OK; } private: @@ -109,13 +109,13 @@ class RedisQtAdapter : public QObject { } private slots: - void read() { redisAsyncHandleRead(m_ctx); } - void write() { redisAsyncHandleWrite(m_ctx); } + void read() { redictAsyncHandleRead(m_ctx); } + void write() { redictAsyncHandleWrite(m_ctx); } private: - redisAsyncContext * m_ctx; + redictAsyncContext * m_ctx; QSocketNotifier * m_read; QSocketNotifier * m_write; }; -#endif /* !__HIREDIS_QT_H__ */ +#endif /* !__HIREDICT_QT_H__ */ |