Rename to something more descriptive.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
Adam Treat 2024-07-19 13:00:34 -04:00
parent fbc9e24f23
commit ec4559022f
4 changed files with 13 additions and 13 deletions

View File

@ -526,7 +526,7 @@ QString ModelList::incompleteDownloadPath(const QString &modelFile)
return MySettings::globalInstance()->modelPath() + "incomplete-" + modelFile;
}
const QList<ModelInfo> ModelList::userDefaultModelList() const
const QList<ModelInfo> 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<QPair<int, QVariant>
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);
}

View File

@ -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<ModelInfo> userDefaultModelList READ userDefaultModelList NOTIFY userDefaultModelListChanged)
Q_PROPERTY(QList<ModelInfo> 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<ModelInfo> userDefaultModelList() const;
const QList<ModelInfo> 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();

View File

@ -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()
}
}

View File

@ -97,7 +97,7 @@ void Server::start()
if (!MySettings::globalInstance()->serverChat())
return QHttpServerResponse(QHttpServerResponder::StatusCode::Unauthorized);
const QList<ModelInfo> modelList = ModelList::globalInstance()->userDefaultModelList();
const QList<ModelInfo> 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<ModelInfo> modelList = ModelList::globalInstance()->userDefaultModelList();
const QList<ModelInfo> 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<ModelInfo> modelList = ModelList::globalInstance()->userDefaultModelList();
const QList<ModelInfo> modelList = ModelList::globalInstance()->selectableModelList();
for (const ModelInfo &info : modelList) {
Q_ASSERT(info.installed);
if (!info.installed)