From 3163b3e1aab713f64de5bc09f36d88050f595ce4 Mon Sep 17 00:00:00 2001 From: arm64v8a <48624112+arm64v8a@users.noreply.github.com> Date: Wed, 30 Nov 2022 10:30:07 +0900 Subject: [PATCH] bug fix --- db/Database.cpp | 6 +++++- fmt/Bean2External.cpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/db/Database.cpp b/db/Database.cpp index b02ef46..e211ea9 100644 --- a/db/Database.cpp +++ b/db/Database.cpp @@ -17,11 +17,12 @@ namespace NekoRay { } void ProfileManager::LoadManager() { + QList invaild_profile_id; for (auto id: _profiles) { auto ent = LoadProxyEntity(QString("profiles/%1.json").arg(id)); if (ent == nullptr || ent->bean == nullptr || ent->bean->version == -114514) { // clear invaild profile - DeleteProfile(id); + invaild_profile_id << id; continue; } profiles[id] = ent; @@ -29,6 +30,9 @@ namespace NekoRay { for (auto id: _groups) { groups[id] = LoadGroup(QString("groups/%1.json").arg(id)); } + for (auto id: invaild_profile_id) { + DeleteProfile(id); + } } void ProfileManager::SaveManager() { diff --git a/fmt/Bean2External.cpp b/fmt/Bean2External.cpp index d260a49..a8b45e6 100644 --- a/fmt/Bean2External.cpp +++ b/fmt/Bean2External.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #define WriteTempFile(fn, data) \ QDir dir; \