Fix bug with install of online models.

This commit is contained in:
Adam Treat 2024-01-22 14:15:13 -05:00
parent 26acdebafa
commit 27912f6e1a

View File

@ -185,7 +185,10 @@ void Download::installModel(const QString &modelFile, const QString &apiKey)
QTextStream stream(&file); QTextStream stream(&file);
stream << apiKey; stream << apiKey;
file.close(); file.close();
ModelList::globalInstance()->updateModelsFromDirectory();
} }
ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::InstalledRole, true);
} }
void Download::removeModel(const QString &modelFile) void Download::removeModel(const QString &modelFile)
@ -202,6 +205,7 @@ void Download::removeModel(const QString &modelFile)
file.remove(); file.remove();
} }
ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::InstalledRole, false);
ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::BytesReceivedRole, 0); ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::BytesReceivedRole, 0);
ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::BytesTotalRole, 0); ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::BytesTotalRole, 0);
ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::TimestampRole, 0); ModelList::globalInstance()->updateDataByFilename(modelFile, ModelList::TimestampRole, 0);