Clean up settings properly for removed models and also when user manually deletes.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
Adam Treat
2024-03-09 10:03:31 -05:00
committed by AT
parent 0cc5a80656
commit f36a2874eb
3 changed files with 20 additions and 20 deletions

View File

@@ -203,6 +203,7 @@ void Download::removeModel(const QString &modelFile)
QFile file(filePath);
if (file.exists()) {
const ModelInfo info = ModelList::globalInstance()->modelInfoByFilename(modelFile);
MySettings::globalInstance()->eraseModel(info);
shouldRemoveInstalled = info.installed && !info.isClone() && (info.isDiscovered() || info.description() == "" /*indicates sideloaded*/);
if (shouldRemoveInstalled)
ModelList::globalInstance()->removeInstalled(info);