mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 10:50:23 +08:00
add: added GetData from NodeDispatcher
This commit is contained in:
parent
f4e5bd2f65
commit
35aac17c7e
@ -1 +1 @@
|
|||||||
5844
|
5845
|
||||||
|
@ -218,8 +218,11 @@ void RouteEditor::OnDispatcherEditChainRequested(const QString &id)
|
|||||||
CONFIGROOT RouteEditor::OpenEditor()
|
CONFIGROOT RouteEditor::OpenEditor()
|
||||||
{
|
{
|
||||||
auto result = this->exec();
|
auto result = this->exec();
|
||||||
|
if (result == QDialog::Accepted)
|
||||||
|
return original;
|
||||||
|
|
||||||
|
const auto &[in, rule, out] = nodeDispatcher->GetData();
|
||||||
|
|
||||||
auto x = nodeDispatcher->GetFullConfig();
|
|
||||||
// if (rules.isEmpty())
|
// if (rules.isEmpty())
|
||||||
// {
|
// {
|
||||||
// // Prevent empty rule list causing mis-detection of config type to
|
// // Prevent empty rule list causing mis-detection of config type to
|
||||||
|
@ -16,9 +16,15 @@ NodeDispatcher::~NodeDispatcher()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIGROOT NodeDispatcher::GetFullConfig() const
|
std::tuple<QList<INBOUND>, QList<RuleObject>, QList<OutboundObjectMeta>> NodeDispatcher::GetData() const
|
||||||
{
|
{
|
||||||
return CONFIGROOT{};
|
QList<INBOUND> _inbounds;
|
||||||
|
QList<RuleObject> _rules;
|
||||||
|
QList<OutboundObjectMeta> _outbounds;
|
||||||
|
for (const auto &val : inbounds) _inbounds << *val;
|
||||||
|
for (const auto &val : rules) _rules << *val;
|
||||||
|
for (const auto &val : outbounds) _outbounds << *val;
|
||||||
|
return std::make_tuple(_inbounds, _rules, _outbounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeDispatcher::LoadFullConfig(const CONFIGROOT &root)
|
void NodeDispatcher::LoadFullConfig(const CONFIGROOT &root)
|
||||||
|
@ -20,7 +20,7 @@ class NodeDispatcher
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CONFIGROOT GetFullConfig() const;
|
std::tuple<QList<INBOUND>, QList<RuleObject>, QList<OutboundObjectMeta>> GetData() const;
|
||||||
void LoadFullConfig(const CONFIGROOT &);
|
void LoadFullConfig(const CONFIGROOT &);
|
||||||
[[nodiscard]] QString CreateInbound(INBOUND);
|
[[nodiscard]] QString CreateInbound(INBOUND);
|
||||||
[[nodiscard]] QString CreateOutbound(OutboundObjectMeta);
|
[[nodiscard]] QString CreateOutbound(OutboundObjectMeta);
|
||||||
|
Loading…
Reference in New Issue
Block a user