From a6a3e0048a1251d6660879c05bed23d4c8281ca6 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Mon, 11 Mar 2024 09:33:41 -0400 Subject: [PATCH] Don't erase the settings, but ignore them. Signed-off-by: Adam Treat --- gpt4all-chat/modellist.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gpt4all-chat/modellist.cpp b/gpt4all-chat/modellist.cpp index 718f9212..d373e23e 100644 --- a/gpt4all-chat/modellist.cpp +++ b/gpt4all-chat/modellist.cpp @@ -1560,13 +1560,10 @@ void ModelList::updateModelsFromSettings() if (contains(id)) continue; - // If we can't find the corresponding file, then delete it from settings as this reflects a - // stale model. The file could have been deleted manually by the user for instance. - if (!settings.contains(g + "/filename") || !modelExists(settings.value(g + "/filename").toString())) { - settings.remove(g); - settings.sync(); + // If we can't find the corresponding file, then ignore it as this reflects a stale model. + // The file could have been deleted manually by the user for instance or temporarily renamed. + if (!settings.contains(g + "/filename") || !modelExists(settings.value(g + "/filename").toString())) continue; - } addModel(id);