From a4b7966d21d40061bb02674d05d01bc443f4a7ab Mon Sep 17 00:00:00 2001 From: targetakhil Date: Mon, 15 Mar 2021 09:03:06 +0530 Subject: [PATCH] prepend file:// for linux and macos --- src/timeline/TimelineModel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index ddec7287..6134262e 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -1246,7 +1246,11 @@ TimelineModel::cacheMedia(QString eventId, std::function ca QDir().mkpath(filename.path()); if (filename.isReadable()) { +#if defined(Q_OS_WIN) emit mediaCached(mxcUrl, filename.filePath()); +#else + emit mediaCached(mxcUrl, "file://" + filename.filePath()); +#endif if (callback) { callback(filename.filePath()); } @@ -1288,7 +1292,11 @@ TimelineModel::cacheMedia(QString eventId, std::function ca nhlog::ui()->warn("Error while saving file to: {}", e.what()); } +#if defined(Q_OS_WIN) emit mediaCached(mxcUrl, filename.filePath()); +#else + emit mediaCached(mxcUrl, "file://" + filename.filePath()); +#endif }); }