diff options
author | targetakhil <targetakhil@gmail.com> | 2021-03-15 09:03:06 +0530 |
---|---|---|
committer | targetakhil <targetakhil@gmail.com> | 2021-03-15 09:03:06 +0530 |
commit | a4b7966d21d40061bb02674d05d01bc443f4a7ab (patch) | |
tree | 1303ade6cc968d8934dcf4379d77d85c1b2cd1b1 /src/timeline | |
parent | Add faq section (diff) | |
download | nheko-a4b7966d21d40061bb02674d05d01bc443f4a7ab.tar.xz |
prepend file:// for linux and macos
Diffstat (limited to 'src/timeline')
-rw-r--r-- | src/timeline/TimelineModel.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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<void(const QString)> 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<void(const QString)> 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 }); } |