mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-28 13:11:24 +08:00
bug fix
This commit is contained in:
parent
11e8f66d88
commit
3163b3e1aa
@ -17,11 +17,12 @@ namespace NekoRay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ProfileManager::LoadManager() {
|
void ProfileManager::LoadManager() {
|
||||||
|
QList<int> invaild_profile_id;
|
||||||
for (auto id: _profiles) {
|
for (auto id: _profiles) {
|
||||||
auto ent = LoadProxyEntity(QString("profiles/%1.json").arg(id));
|
auto ent = LoadProxyEntity(QString("profiles/%1.json").arg(id));
|
||||||
if (ent == nullptr || ent->bean == nullptr || ent->bean->version == -114514) {
|
if (ent == nullptr || ent->bean == nullptr || ent->bean->version == -114514) {
|
||||||
// clear invaild profile
|
// clear invaild profile
|
||||||
DeleteProfile(id);
|
invaild_profile_id << id;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
profiles[id] = ent;
|
profiles[id] = ent;
|
||||||
@ -29,6 +30,9 @@ namespace NekoRay {
|
|||||||
for (auto id: _groups) {
|
for (auto id: _groups) {
|
||||||
groups[id] = LoadGroup(QString("groups/%1.json").arg(id));
|
groups[id] = LoadGroup(QString("groups/%1.json").arg(id));
|
||||||
}
|
}
|
||||||
|
for (auto id: invaild_profile_id) {
|
||||||
|
DeleteProfile(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileManager::SaveManager() {
|
void ProfileManager::SaveManager() {
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
#define WriteTempFile(fn, data) \
|
#define WriteTempFile(fn, data) \
|
||||||
QDir dir; \
|
QDir dir; \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user