mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-21 11:20:49 +08:00
fix: use c++11 initializer list of std::tuple<>
This commit is contained in:
parent
1c7bb289a9
commit
ab2f2c3e11
@ -1 +1 @@
|
|||||||
4216
|
4217
|
||||||
|
@ -411,10 +411,10 @@ namespace Qv2ray::core::handlers
|
|||||||
{
|
{
|
||||||
if (!connections.contains(id))
|
if (!connections.contains(id))
|
||||||
{
|
{
|
||||||
return make_tuple(0, 0);
|
return { 0, 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
return make_tuple(connections[id].upLinkData, connections[id].downLinkData);
|
return { connections[id].upLinkData, connections[id].downLinkData };
|
||||||
}
|
}
|
||||||
|
|
||||||
QvConnectionHandler::~QvConnectionHandler()
|
QvConnectionHandler::~QvConnectionHandler()
|
||||||
@ -468,14 +468,14 @@ namespace Qv2ray::core::handlers
|
|||||||
if (GetOutboundData(outBoundRoot, &host, &port, &outboundType))
|
if (GetOutboundData(outBoundRoot, &host, &port, &outboundType))
|
||||||
{
|
{
|
||||||
*ok = true;
|
*ok = true;
|
||||||
return make_tuple(outboundType, host, port);
|
return { outboundType, host, port };
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG(MODULE_CORE_HANDLER, "Unknown outbound type: " + outboundType + ", cannot deduce host and port.")
|
LOG(MODULE_CORE_HANDLER, "Unknown outbound type: " + outboundType + ", cannot deduce host and port.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return make_tuple(tr("N/A"), tr("N/A"), 0);
|
return { tr("N/A"), tr("N/A"), 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
void QvConnectionHandler::OnLatencyDataArrived(const QvTCPingResultObject &result)
|
void QvConnectionHandler::OnLatencyDataArrived(const QvTCPingResultObject &result)
|
||||||
@ -531,7 +531,7 @@ namespace Qv2ray::core::handlers
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return make_tuple(groups[id].address, groups[id].lastUpdated, groups[id].updateInterval);
|
return { groups[id].address, groups[id].lastUpdated, groups[id].updateInterval };
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QvConnectionHandler::SetSubscriptionData(const GroupId &id, const QString &address, float updateInterval)
|
bool QvConnectionHandler::SetSubscriptionData(const GroupId &id, const QString &address, float updateInterval)
|
||||||
@ -581,7 +581,7 @@ namespace Qv2ray::core::handlers
|
|||||||
auto [protocol, host, port] = GetConnectionData(conn);
|
auto [protocol, host, port] = GetConnectionData(conn);
|
||||||
if (port != 0)
|
if (port != 0)
|
||||||
{
|
{
|
||||||
typeMap[make_tuple(protocol, host, port)] = conn;
|
typeMap[{ protocol, host, port }] = conn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -27,7 +27,7 @@ QvMessageBusSlotImpl(SubscribeEditor)
|
|||||||
|
|
||||||
tuple<QString, CONFIGROOT> SubscribeEditor::GetSelectedConfig()
|
tuple<QString, CONFIGROOT> SubscribeEditor::GetSelectedConfig()
|
||||||
{
|
{
|
||||||
return make_tuple(ConnectionManager->GetDisplayName(currentConnectionId), ConnectionManager->GetConnectionRoot(currentConnectionId));
|
return { ConnectionManager->GetDisplayName(currentConnectionId), ConnectionManager->GetConnectionRoot(currentConnectionId) };
|
||||||
}
|
}
|
||||||
|
|
||||||
SubscribeEditor::~SubscribeEditor()
|
SubscribeEditor::~SubscribeEditor()
|
||||||
|
@ -39,7 +39,7 @@ class ConnectionItemWidget
|
|||||||
}
|
}
|
||||||
inline const tuple<GroupId, ConnectionId> Identifier() const
|
inline const tuple<GroupId, ConnectionId> Identifier() const
|
||||||
{
|
{
|
||||||
return make_tuple(groupId, connectionId);
|
return { groupId, connectionId };
|
||||||
}
|
}
|
||||||
inline bool IsConnection() const
|
inline bool IsConnection() const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user