mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Use C++11 uniform initialization
This commit is contained in:
@@ -78,12 +78,13 @@ void LogController::mainAction()
|
||||
|| (msg.type == Log::WARNING && isWarning)
|
||||
|| (msg.type == Log::CRITICAL && isCritical)))
|
||||
continue;
|
||||
QVariantMap map;
|
||||
map[KEY_LOG_ID] = msg.id;
|
||||
map[KEY_LOG_TIMESTAMP] = msg.timestamp;
|
||||
map[KEY_LOG_MSG_TYPE] = msg.type;
|
||||
map[KEY_LOG_MSG_MESSAGE] = msg.message;
|
||||
msgList.append(map);
|
||||
|
||||
msgList.append(QVariantMap {
|
||||
{KEY_LOG_ID, msg.id},
|
||||
{KEY_LOG_TIMESTAMP, msg.timestamp},
|
||||
{KEY_LOG_MSG_TYPE, msg.type},
|
||||
{KEY_LOG_MSG_MESSAGE, msg.message}
|
||||
});
|
||||
}
|
||||
|
||||
setResult(QJsonArray::fromVariantList(msgList));
|
||||
@@ -112,13 +113,13 @@ void LogController::peersAction()
|
||||
QVariantList peerList;
|
||||
|
||||
for (const Log::Peer &peer : asConst(logger->getPeers(lastKnownId))) {
|
||||
QVariantMap map;
|
||||
map[KEY_LOG_ID] = peer.id;
|
||||
map[KEY_LOG_TIMESTAMP] = peer.timestamp;
|
||||
map[KEY_LOG_PEER_IP] = peer.ip;
|
||||
map[KEY_LOG_PEER_BLOCKED] = peer.blocked;
|
||||
map[KEY_LOG_PEER_REASON] = peer.reason;
|
||||
peerList.append(map);
|
||||
peerList.append(QVariantMap {
|
||||
{KEY_LOG_ID, peer.id},
|
||||
{KEY_LOG_TIMESTAMP, peer.timestamp},
|
||||
{KEY_LOG_PEER_IP, peer.ip},
|
||||
{KEY_LOG_PEER_BLOCKED, peer.blocked},
|
||||
{KEY_LOG_PEER_REASON, peer.reason}
|
||||
});
|
||||
}
|
||||
|
||||
setResult(QJsonArray::fromVariantList(peerList));
|
||||
|
||||
Reference in New Issue
Block a user