mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
bug fix
This commit is contained in:
parent
11e8f66d88
commit
3163b3e1aa
@ -17,11 +17,12 @@ namespace NekoRay {
|
||||
}
|
||||
|
||||
void ProfileManager::LoadManager() {
|
||||
QList<int> 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() {
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QUrl>
|
||||
|
||||
#define WriteTempFile(fn, data) \
|
||||
QDir dir; \
|
||||
|
||||
Loading…
Reference in New Issue
Block a user