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