From 30692a2dfc32569bfee73373815a50bc5a5f97c5 Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Wed, 3 Jul 2024 18:38:44 -0400 Subject: [PATCH] modellist: work around filtered item models getting out of sync (#2545) This fixes an issue with the "Clone" button producing a page of blank settings. Signed-off-by: Jared Van Bortel --- gpt4all-chat/modellist.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gpt4all-chat/modellist.cpp b/gpt4all-chat/modellist.cpp index ed8cd63c..3312c82d 100644 --- a/gpt4all-chat/modellist.cpp +++ b/gpt4all-chat/modellist.cpp @@ -980,6 +980,12 @@ void ModelList::updateData(const QString &id, const QVector } } emit dataChanged(createIndex(index, 0), createIndex(index, 0)); + + // FIXME(jared): for some reason these don't update correctly when the source model changes, so we explicitly invalidate them + m_selectableModels->invalidate(); + m_installedModels->invalidate(); + m_downloadableModels->invalidate(); + emit userDefaultModelListChanged(); }