mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 00:33:09 -07:00
Use C++11 uniform initialization
This commit is contained in:
parent
bad588a749
commit
7f300b757f
4 changed files with 86 additions and 79 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue