diff --git a/gpt4all-chat/modellist.cpp b/gpt4all-chat/modellist.cpp index b6939db8..4333b99c 100644 --- a/gpt4all-chat/modellist.cpp +++ b/gpt4all-chat/modellist.cpp @@ -526,7 +526,7 @@ QString ModelList::incompleteDownloadPath(const QString &modelFile) return MySettings::globalInstance()->modelPath() + "incomplete-" + modelFile; } -const QList ModelList::userDefaultModelList() const +const QList ModelList::selectableModelList() const { // FIXME: This needs to be kept in sync with m_selectableModels so should probably be merged QMutexLocker locker(&m_mutex); @@ -653,7 +653,7 @@ void ModelList::addModel(const QString &id) m_mutex.unlock(); endInsertRows(); - emit userDefaultModelListChanged(); + emit selectableModelListChanged(); } void ModelList::changeId(const QString &oldId, const QString &newId) @@ -1001,7 +1001,7 @@ void ModelList::updateData(const QString &id, const QVector m_installedModels->invalidate(); m_downloadableModels->invalidate(); - emit userDefaultModelListChanged(); + emit selectableModelListChanged(); } void ModelList::resortModel() @@ -1141,7 +1141,7 @@ void ModelList::removeInternal(const ModelInfo &model) delete info; } endRemoveRows(); - emit userDefaultModelListChanged(); + emit selectableModelListChanged(); MySettings::globalInstance()->eraseModel(model); } diff --git a/gpt4all-chat/modellist.h b/gpt4all-chat/modellist.h index 19801a97..88c00e70 100644 --- a/gpt4all-chat/modellist.h +++ b/gpt4all-chat/modellist.h @@ -265,7 +265,7 @@ class ModelList : public QAbstractListModel Q_PROPERTY(InstalledModels* installedModels READ installedModels NOTIFY installedModelsChanged) Q_PROPERTY(InstalledModels* selectableModels READ selectableModels NOTIFY selectableModelsChanged) Q_PROPERTY(DownloadableModels* downloadableModels READ downloadableModels NOTIFY downloadableModelsChanged) - Q_PROPERTY(QList userDefaultModelList READ userDefaultModelList NOTIFY userDefaultModelListChanged) + Q_PROPERTY(QList selectableModelList READ selectableModelList NOTIFY selectableModelListChanged) Q_PROPERTY(bool asyncModelRequestOngoing READ asyncModelRequestOngoing NOTIFY asyncModelRequestOngoingChanged) Q_PROPERTY(int discoverLimit READ discoverLimit WRITE setDiscoverLimit NOTIFY discoverLimitChanged) Q_PROPERTY(int discoverSortDirection READ discoverSortDirection WRITE setDiscoverSortDirection NOTIFY discoverSortDirectionChanged) @@ -408,7 +408,7 @@ public: void addModel(const QString &id); void changeId(const QString &oldId, const QString &newId); - const QList userDefaultModelList() const; + const QList selectableModelList() const; InstalledModels *installedModels() const { return m_installedModels; } InstalledModels *selectableModels() const { return m_selectableModels; } @@ -451,7 +451,7 @@ Q_SIGNALS: void installedModelsChanged(); void selectableModelsChanged(); void downloadableModelsChanged(); - void userDefaultModelListChanged(); + void selectableModelListChanged(); void asyncModelRequestOngoingChanged(); void discoverLimitChanged(); void discoverSortDirectionChanged(); diff --git a/gpt4all-chat/qml/ApplicationSettings.qml b/gpt4all-chat/qml/ApplicationSettings.qml index 131dfcc5..118d9f49 100644 --- a/gpt4all-chat/qml/ApplicationSettings.qml +++ b/gpt4all-chat/qml/ApplicationSettings.qml @@ -287,8 +287,8 @@ MySettingsTab { function rebuildModel() { defaultModelBoxModel.clear(); defaultModelBoxModel.append({"text": qsTr("Application default")}); - for (var i = 0; i < ModelList.userDefaultModelList.length; ++i) - defaultModelBoxModel.append({"text": ModelList.userDefaultModelList[i].name}); + for (var i = 0; i < ModelList.selectableModelList.length; ++i) + defaultModelBoxModel.append({"text": ModelList.selectableModelList[i].name}); defaultModelBox.updateModel(); } function updateModel() { @@ -315,7 +315,7 @@ MySettingsTab { } Connections { target: ModelList - function onUserDefaultModelListChanged() { + function onSelectableModelListChanged() { defaultModelBox.rebuildModel() } } diff --git a/gpt4all-chat/server.cpp b/gpt4all-chat/server.cpp index 505c7f96..c8485d93 100644 --- a/gpt4all-chat/server.cpp +++ b/gpt4all-chat/server.cpp @@ -97,7 +97,7 @@ void Server::start() if (!MySettings::globalInstance()->serverChat()) return QHttpServerResponse(QHttpServerResponder::StatusCode::Unauthorized); - const QList modelList = ModelList::globalInstance()->userDefaultModelList(); + const QList modelList = ModelList::globalInstance()->selectableModelList(); QJsonObject root; root.insert("object", "list"); QJsonArray data; @@ -117,7 +117,7 @@ void Server::start() if (!MySettings::globalInstance()->serverChat()) return QHttpServerResponse(QHttpServerResponder::StatusCode::Unauthorized); - const QList modelList = ModelList::globalInstance()->userDefaultModelList(); + const QList modelList = ModelList::globalInstance()->selectableModelList(); QJsonObject object; for (const ModelInfo &info : modelList) { Q_ASSERT(info.installed); @@ -234,7 +234,7 @@ QHttpServerResponse Server::handleCompletionRequest(const QHttpServerRequest &re const QString modelRequested = body["model"].toString(); ModelInfo modelInfo = ModelList::globalInstance()->defaultModelInfo(); - const QList modelList = ModelList::globalInstance()->userDefaultModelList(); + const QList modelList = ModelList::globalInstance()->selectableModelList(); for (const ModelInfo &info : modelList) { Q_ASSERT(info.installed); if (!info.installed)