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 <cosmic-snow@mailfence.com>
This commit is contained in:
cosmic-snow 2024-07-28 16:06:30 +02:00 committed by GitHub
parent f3734e5de8
commit ee6064b608
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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"