minor refactor

This commit is contained in:
arm64v8a
2023-05-22 11:07:14 +09:00
parent 1b050dd3fb
commit c5122b77e4
98 changed files with 1173 additions and 1142 deletions

View File

@@ -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;