Files
RedisDesktopManager/src/app/events.cpp
T
Igor Malinovskiy 57fe2e6829 Improve keymodels (#4362)
* Improve key models
* Regression fixes
* Update tests
2019-04-10 01:15:10 +03:00

17 lines
605 B
C++

#include "events.h"
void Events::registerLoggerForConnection(RedisClient::Connection& c) {
auto self = sharedFromThis().toWeakRef();
QObject::connect(
&c, &RedisClient::Connection::log, this, [self](const QString& info) {
if (!self) return;
emit self.toStrongRef()->log(QString("Connection: %1").arg(info));
}, Qt::QueuedConnection);
QObject::connect(
&c, &RedisClient::Connection::error, this, [self](const QString& error) {
if (!self) return;
emit self.toStrongRef()->log(QString("Connection: %1").arg(error));
}, Qt::QueuedConnection);
}