From ee6064b6080b62fbe8473c221cec8c42f11736db Mon Sep 17 00:00:00 2001 From: cosmic-snow <134004613+cosmic-snow@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:06:30 +0200 Subject: [PATCH] Fix LocalDocs file icons in sources display (mixed case) (#2761) Minor, cosmetic fix to the file icon which is shown as a LocalDocs source. A recent commit has allowed the file suffixes to be mixed case, this makes the displayed icon consistent, so that e.g. '.PDF' is uses the right icon, as well. Signed-off-by: Cosmic Snow --- gpt4all-chat/qml/ChatView.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gpt4all-chat/qml/ChatView.qml b/gpt4all-chat/qml/ChatView.qml index e0388efb..2be8d75e 100644 --- a/gpt4all-chat/qml/ChatView.qml +++ b/gpt4all-chat/qml/ChatView.qml @@ -1292,11 +1292,11 @@ Rectangle { sourceSize.height: 24 mipmap: true source: { - if (modelData.file.endsWith(".txt")) + if (modelData.file.toLowerCase().endsWith(".txt")) return "qrc:/gpt4all/icons/file-txt.svg" - else if (modelData.file.endsWith(".pdf")) + else if (modelData.file.toLowerCase().endsWith(".pdf")) return "qrc:/gpt4all/icons/file-pdf.svg" - else if (modelData.file.endsWith(".md")) + else if (modelData.file.toLowerCase().endsWith(".md")) return "qrc:/gpt4all/icons/file-md.svg" else return "qrc:/gpt4all/icons/file.svg"