From 2a2b3df845ff0f25cfd307bf086b66da70b30659 Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 9 Mar 2020 11:00:48 -0400 Subject: [PATCH] Utils.urlExtension: don't lowercase returned ext --- src/gui/Base/HImage.qml | 3 ++- src/gui/Pages/Chat/Timeline/EventImage.qml | 2 +- src/gui/Pages/Chat/Timeline/EventMediaLoader.qml | 2 +- src/gui/PythonBridge/Privates/EventHandlers.qml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/Base/HImage.qml b/src/gui/Base/HImage.qml index d1b50609..5cb36828 100644 --- a/src/gui/Base/HImage.qml +++ b/src/gui/Base/HImage.qml @@ -14,7 +14,8 @@ Image { property bool broken: false property bool animate: true - property bool animated: utils.urlExtension(image.source) === "gif" + property bool animated: + utils.urlExtension(image.source).toLowerCase() === "gif" property alias showProgressBar: progressBarLoader.active property bool inderterminateProgressBar: false diff --git a/src/gui/Pages/Chat/Timeline/EventImage.qml b/src/gui/Pages/Chat/Timeline/EventImage.qml index 001d49c8..af2d04b7 100644 --- a/src/gui/Pages/Chat/Timeline/EventImage.qml +++ b/src/gui/Pages/Chat/Timeline/EventImage.qml @@ -10,7 +10,7 @@ HMxcImage { horizontalAlignment: Image.AlignLeft animated: loader.singleMediaInfo.media_mime === "image/gif" || - utils.urlExtension(loader.mediaUrl) === "gif" + utils.urlExtension(loader.mediaUrl).toLowerCase() === "gif" thumbnail: ! animated && loader.thumbnailMxc mxc: thumbnail ? (loader.thumbnailMxc || loader.mediaUrl) : diff --git a/src/gui/Pages/Chat/Timeline/EventMediaLoader.qml b/src/gui/Pages/Chat/Timeline/EventMediaLoader.qml index 14c83e23..b702c09d 100644 --- a/src/gui/Pages/Chat/Timeline/EventMediaLoader.qml +++ b/src/gui/Pages/Chat/Timeline/EventMediaLoader.qml @@ -59,7 +59,7 @@ HLoader { return EventDelegate.Media.File // If this is a preview for a link in a normal message - const ext = utils.urlExtension(mediaUrl) + const ext = utils.urlExtension(mediaUrl).toLowerCase() if (imageExtensions.includes(ext)) return EventDelegate.Media.Image if (videoExtensions.includes(ext)) return EventDelegate.Media.Video diff --git a/src/gui/PythonBridge/Privates/EventHandlers.qml b/src/gui/PythonBridge/Privates/EventHandlers.qml index 98aa4b62..391395d5 100644 --- a/src/gui/PythonBridge/Privates/EventHandlers.qml +++ b/src/gui/PythonBridge/Privates/EventHandlers.qml @@ -83,7 +83,7 @@ QtObject { function onModelItemFieldChanged(syncId, oldIndex, newIndex, field, value){ - // print("change", syncId, oldIndex, newIndex, field, value) + print("\u001b[37mchange", syncId, oldIndex, newIndex, field, value, "\u001b[0m") const model = ModelStore.get(syncId) model.setProperty(oldIndex, field, value)