mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 13:50:12 +08:00
Use relative path when extra core is located in the nekoray directory (#415)
This commit is contained in:
parent
3e18042c24
commit
8b9350bd43
@ -432,12 +432,12 @@ namespace NekoGui {
|
|||||||
if (status->ent->type == "extracore")
|
if (status->ent->type == "extracore")
|
||||||
{
|
{
|
||||||
auto bean = status->ent->ExtraCoreBean();
|
auto bean = status->ent->ExtraCoreBean();
|
||||||
status->result->extraCoreData->path = bean->extraCorePath;
|
status->result->extraCoreData->path = QFileInfo(bean->extraCorePath).canonicalFilePath();
|
||||||
status->result->extraCoreData->args = bean->extraCoreArgs;
|
status->result->extraCoreData->args = bean->extraCoreArgs;
|
||||||
status->result->extraCoreData->config = bean->extraCoreConf;
|
status->result->extraCoreData->config = bean->extraCoreConf;
|
||||||
status->result->extraCoreData->configDir = GetBasePath();
|
status->result->extraCoreData->configDir = GetBasePath();
|
||||||
status->result->extraCoreData->noLog = bean->noLogs;
|
status->result->extraCoreData->noLog = bean->noLogs;
|
||||||
routeChain->Rules << RouteRule::get_processPath_direct_rule(bean->extraCorePath);
|
routeChain->Rules << RouteRule::get_processPath_direct_rule(status->result->extraCoreData->path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Direct domains
|
// Direct domains
|
||||||
|
|||||||
@ -34,6 +34,10 @@ void EditExtraCore::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!QDir::current().relativeFilePath(f).startsWith("../../"))
|
||||||
|
{
|
||||||
|
f = QDir::current().relativeFilePath(f);
|
||||||
|
}
|
||||||
if (NekoGui::profileManager->AddExtraCorePath(f)) ui->path_combo->addItem(f);
|
if (NekoGui::profileManager->AddExtraCorePath(f)) ui->path_combo->addItem(f);
|
||||||
ui->path_combo->setCurrentText(f);
|
ui->path_combo->setCurrentText(f);
|
||||||
ui->path_combo->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
ui->path_combo->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user