Fix shadowsocks edit

This commit is contained in:
Nova 2025-11-27 18:15:44 +03:30
parent 808c060a25
commit c2238d3c2c

View File

@ -19,11 +19,8 @@ void EditShadowSocks::onStart(std::shared_ptr<Configs::ProxyEntity> _ent) {
ui->method->setCurrentText(outbound->method); ui->method->setCurrentText(outbound->method);
ui->uot->setCurrentIndex(outbound->uot); ui->uot->setCurrentIndex(outbound->uot);
ui->password->setText(outbound->password); ui->password->setText(outbound->password);
auto ssPlugin = outbound->plugin.split(";"); ui->plugin->setCurrentText(outbound->plugin);
if (!ssPlugin.empty()) { ui->plugin_opts->setText(outbound->plugin_opts);
ui->plugin->setCurrentText(ssPlugin[0]);
ui->plugin_opts->setText(SubStrAfter(outbound->plugin, ";"));
}
} }
bool EditShadowSocks::onEnd() { bool EditShadowSocks::onEnd() {
@ -33,9 +30,7 @@ bool EditShadowSocks::onEnd() {
outbound->password = ui->password->text(); outbound->password = ui->password->text();
outbound->uot = ui->uot->currentIndex(); outbound->uot = ui->uot->currentIndex();
outbound->plugin = ui->plugin->currentText(); outbound->plugin = ui->plugin->currentText();
if (!outbound->plugin.isEmpty()) { outbound->plugin_opts = ui->plugin_opts->text();
outbound->plugin += ";" + ui->plugin_opts->text();
}
return true; return true;
} }