mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
minor refactor
This commit is contained in:
@@ -33,12 +33,12 @@ EditCustom::~EditCustom() {
|
||||
P_SAVE_INT(mapping_port) \
|
||||
P_SAVE_INT(socks_port)
|
||||
|
||||
void EditCustom::onStart(QSharedPointer<NekoRay::ProxyEntity> _ent) {
|
||||
void EditCustom::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
||||
this->ent = _ent;
|
||||
auto bean = this->ent->CustomBean();
|
||||
|
||||
// load known core
|
||||
auto core_map = QString2QJsonObject(NekoRay::dataStore->extraCore->core_map);
|
||||
auto core_map = QString2QJsonObject(NekoGui::dataStore->extraCore->core_map);
|
||||
for (const auto &key: core_map.keys()) {
|
||||
if (key == "naive" || key == "hysteria") continue;
|
||||
ui->core->addItem(key);
|
||||
@@ -102,7 +102,7 @@ void EditCustom::onStart(QSharedPointer<NekoRay::ProxyEntity> _ent) {
|
||||
th << "%server_port% => " + get_edit_text_serverPort();
|
||||
MessageBoxInfo(tr("Preview replace"), th.join("\n"));
|
||||
// EditCustom::onEnd
|
||||
auto tmpEnt = NekoRay::ProfileManager::NewProxyEntity("custom");
|
||||
auto tmpEnt = NekoGui::ProfileManager::NewProxyEntity("custom");
|
||||
auto bean = tmpEnt->CustomBean();
|
||||
SAVE_CUSTOM_BEAN
|
||||
// 补充
|
||||
@@ -110,7 +110,7 @@ void EditCustom::onStart(QSharedPointer<NekoRay::ProxyEntity> _ent) {
|
||||
bean->serverPort = get_edit_text_serverPort().toInt();
|
||||
if (bean->core.isEmpty()) return;
|
||||
//
|
||||
auto result = NekoRay::BuildConfig(tmpEnt, false, false);
|
||||
auto result = NekoGui::BuildConfig(tmpEnt, false, false);
|
||||
if (!result->error.isEmpty()) {
|
||||
MessageBoxInfo(software_name, result->error);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user