This commit is contained in:
arm64v8a
2022-11-25 22:47:04 +09:00
parent a06c63a66c
commit 383b47e947
5 changed files with 28 additions and 16 deletions

View File

@@ -18,7 +18,12 @@ namespace NekoRay {
void ProfileManager::LoadManager() {
for (auto id: _profiles) {
profiles[id] = LoadProxyEntity(QString("profiles/%1.json").arg(id));
auto ent = LoadProxyEntity(QString("profiles/%1.json").arg(id));
if (ent->bean->version == -114514) { // clear invaild profile
DeleteProfile(id);
continue;
}
profiles[id] = ent;
}
for (auto id: _groups) {
groups[id] = LoadGroup(QString("groups/%1.json").arg(id));
@@ -49,13 +54,8 @@ namespace NekoRay {
ent->load_control_force = true;
ent->fn = jsonPath;
ent->Load();
return ent;
} else {
// 返回一个假的?
ent = NewProxyEntity("socks");
ent->bean->name = "[Load Error]";
return ent;
}
return ent;
}
// 新建的不给 fn 和 id