mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-07-19 01:36:37 +00:00
mysettings: eraseModel only needs an id
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
d0158d2013
commit
9ec0f92f67
@ -340,7 +340,7 @@ void Download::removeModel(const QString &modelFile)
|
||||
QFile file(filePath);
|
||||
if (file.exists()) {
|
||||
const ModelInfo info = ModelList::globalInstance()->modelInfoByFilename(modelFile);
|
||||
MySettings::globalInstance()->eraseModel(info);
|
||||
MySettings::globalInstance()->eraseModel(info.id());
|
||||
shouldRemoveInstalled = info.installed && !info.isClone() && (info.isDiscovered() || info.isCompatibleApi || info.description() == "" /*indicates sideloaded*/);
|
||||
if (shouldRemoveInstalled)
|
||||
ModelList::globalInstance()->removeInstalled(info);
|
||||
|
@ -1157,7 +1157,7 @@ void ModelList::removeInternal(const ModelInfo &model)
|
||||
}
|
||||
endRemoveRows();
|
||||
emit selectableModelListChanged();
|
||||
MySettings::globalInstance()->eraseModel(model);
|
||||
MySettings::globalInstance()->eraseModel(model.id());
|
||||
}
|
||||
|
||||
QString ModelList::uniqueModelName(const ModelInfo &model) const
|
||||
|
@ -226,9 +226,9 @@ void MySettings::restoreLocalDocsDefaults()
|
||||
setLocalDocsEmbedDevice(basicDefaults.value("localdocs/embedDevice").toString());
|
||||
}
|
||||
|
||||
void MySettings::eraseModel(const ModelInfo &info)
|
||||
void MySettings::eraseModel(QStringView id)
|
||||
{
|
||||
m_settings.remove(u"model-%1"_s.arg(info.id()));
|
||||
m_settings.remove(u"model-%1"_s.arg(id));
|
||||
}
|
||||
|
||||
QString MySettings::modelName(const ModelInfo &info) const
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <QSettings>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QStringView>
|
||||
#include <QTranslator>
|
||||
#include <QVector>
|
||||
|
||||
@ -83,7 +84,7 @@ public:
|
||||
Q_INVOKABLE void restoreLocalDocsDefaults();
|
||||
|
||||
// Model/Character settings
|
||||
void eraseModel(const ModelInfo &info);
|
||||
void eraseModel(QStringView id);
|
||||
QString modelName(const ModelInfo &info) const;
|
||||
Q_INVOKABLE void setModelName(const ModelInfo &info, const QString &name, bool force = false);
|
||||
QString modelFilename(const ModelInfo &info) const;
|
||||
|
Loading…
Reference in New Issue
Block a user