Merge pull request #12458 from jagannatharjun/log

Convert the Log widget to use custom View/Model
This commit is contained in:
Mike Tzou
2020-04-17 11:27:35 +08:00
committed by GitHub
14 changed files with 610 additions and 195 deletions

View File

@@ -72,7 +72,7 @@ void Logger::freeInstance()
void Logger::addMessage(const QString &message, const Log::MsgType &type)
{
QWriteLocker locker(&m_lock);
const Log::Msg msg = {m_msgCounter++, QDateTime::currentMSecsSinceEpoch(), type, message.toHtmlEscaped()};
const Log::Msg msg = {m_msgCounter++, QDateTime::currentMSecsSinceEpoch(), type, message};
m_messages.push_back(msg);
locker.unlock();
@@ -82,7 +82,7 @@ void Logger::addMessage(const QString &message, const Log::MsgType &type)
void Logger::addPeer(const QString &ip, const bool blocked, const QString &reason)
{
QWriteLocker locker(&m_lock);
const Log::Peer msg = {m_peerCounter++, QDateTime::currentMSecsSinceEpoch(), ip.toHtmlEscaped(), blocked, reason.toHtmlEscaped()};
const Log::Peer msg = {m_peerCounter++, QDateTime::currentMSecsSinceEpoch(), ip, blocked, reason};
m_peers.push_back(msg);
locker.unlock();