From 028a8db6bac9e0f1f3b56d77d3356888d71d45cd Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Fri, 8 Mar 2024 10:39:55 -0500 Subject: [PATCH] No need to use equals here. Signed-off-by: Adam Treat --- gpt4all-chat/download.cpp | 8 ++++---- gpt4all-chat/modellist.cpp | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gpt4all-chat/download.cpp b/gpt4all-chat/download.cpp index 7e730a7a..442bdebb 100644 --- a/gpt4all-chat/download.cpp +++ b/gpt4all-chat/download.cpp @@ -211,7 +211,7 @@ void Download::removeModel(const QString &modelFile) } if (!shouldRemoveInstalled) { - QVector> data = { + QVector> data { { ModelList::InstalledRole, false }, { ModelList::BytesReceivedRole, 0 }, { ModelList::BytesTotalRole, 0 }, @@ -360,7 +360,7 @@ void Download::handleDownloadProgress(qint64 bytesReceived, qint64 bytesTotal) else speedText = QString::number(static_cast(speed / (1024.0 * 1024.0)), 'f', 2) + " MB/s"; - QVector> data = { + QVector> data { { ModelList::BytesReceivedRole, currentBytesReceived }, { ModelList::BytesTotalRole, bytesTotal }, { ModelList::SpeedRole, speedText }, @@ -468,7 +468,7 @@ void Download::handleModelDownloadFinished() modelReply->deleteLater(); tempFile->deleteLater(); if (!hasRetry(modelFilename)) { - QVector> data = { + QVector> data { { ModelList::DownloadingRole, false }, { ModelList::DownloadErrorRole, errorString } }; @@ -507,7 +507,7 @@ void Download::handleHashAndSaveFinished(bool success, const QString &error, QString modelFilename = modelReply->request().attribute(QNetworkRequest::User).toString(); Network::globalInstance()->sendDownloadFinished(modelFilename, success); - QVector> data = { + QVector> data { { ModelList::CalcHashRole, false }, { ModelList::DownloadingRole, false } }; diff --git a/gpt4all-chat/modellist.cpp b/gpt4all-chat/modellist.cpp index 27580f4d..35334c92 100644 --- a/gpt4all-chat/modellist.cpp +++ b/gpt4all-chat/modellist.cpp @@ -980,7 +980,7 @@ QString ModelList::clone(const ModelInfo &model) const QString id = Network::globalInstance()->generateUniqueId(); addModel(id); - QVector> data = { + QVector> data { { ModelList::InstalledRole, model.installed }, { ModelList::IsCloneRole, true }, { ModelList::NameRole, uniqueModelName(model) }, @@ -1144,7 +1144,7 @@ void ModelList::updateModelsFromDirectory() } for (const QString &id : modelsById) { - QVector> data = { + QVector> data { { InstalledRole, true }, { FilenameRole, filename }, // FIXME: WE should change this to use a consistent filename for online models @@ -1350,7 +1350,7 @@ void ModelList::parseModelsJsonFile(const QByteArray &jsonData, bool save) if (!contains(id)) addModel(id); - QVector> data = { + QVector> data { { ModelList::NameRole, modelName }, { ModelList::FilenameRole, modelFilename }, { ModelList::FilesizeRole, modelFilesize }, @@ -1408,7 +1408,7 @@ void ModelList::parseModelsJsonFile(const QByteArray &jsonData, bool save) changeId(modelFilename, id); if (!contains(id)) addModel(id); - QVector> data = { + QVector> data { { ModelList::NameRole, modelName }, { ModelList::FilenameRole, modelFilename }, { ModelList::FilesizeRole, "minimal" }, @@ -1435,7 +1435,7 @@ void ModelList::parseModelsJsonFile(const QByteArray &jsonData, bool save) changeId(modelFilename, id); if (!contains(id)) addModel(id); - QVector> data = { + QVector> data { { ModelList::NameRole, modelName }, { ModelList::FilenameRole, modelFilename }, { ModelList::FilesizeRole, "minimal" }, @@ -1465,7 +1465,7 @@ void ModelList::parseModelsJsonFile(const QByteArray &jsonData, bool save) changeId(modelFilename, id); if (!contains(id)) addModel(id); - QVector> data = { + QVector> data { { ModelList::NameRole, modelName }, { ModelList::FilenameRole, modelFilename }, { ModelList::FilesizeRole, "minimal" }, @@ -1486,7 +1486,7 @@ void ModelList::parseModelsJsonFile(const QByteArray &jsonData, bool save) void ModelList::updateDiscoveredInstalled(const ModelInfo &info) { - QVector> data = { + QVector> data { { ModelList::InstalledRole, true }, { ModelList::IsDiscoveredRole, true }, { ModelList::NameRole, info.name() }, @@ -1897,7 +1897,7 @@ void ModelList::handleDiscoveryItemFinished() if (!contains(id)) addModel(id); - QVector> data = { + QVector> data { { ModelList::NameRole, modelName }, { ModelList::FilenameRole, modelFilename }, { ModelList::FilesizeRole, modelFilesize },