Skip to content
Snippets Groups Projects
Commit a4b7966d authored by targetakhil's avatar targetakhil
Browse files

prepend file:// for linux and macos

parent 5614f705
No related branches found
No related tags found
No related merge requests found
Pipeline #882 passed
...@@ -1246,7 +1246,11 @@ TimelineModel::cacheMedia(QString eventId, std::function<void(const QString)> ca ...@@ -1246,7 +1246,11 @@ TimelineModel::cacheMedia(QString eventId, std::function<void(const QString)> ca
QDir().mkpath(filename.path()); QDir().mkpath(filename.path());
if (filename.isReadable()) { if (filename.isReadable()) {
#if defined(Q_OS_WIN)
emit mediaCached(mxcUrl, filename.filePath()); emit mediaCached(mxcUrl, filename.filePath());
#else
emit mediaCached(mxcUrl, "file://" + filename.filePath());
#endif
if (callback) { if (callback) {
callback(filename.filePath()); callback(filename.filePath());
} }
...@@ -1288,7 +1292,11 @@ TimelineModel::cacheMedia(QString eventId, std::function<void(const QString)> ca ...@@ -1288,7 +1292,11 @@ TimelineModel::cacheMedia(QString eventId, std::function<void(const QString)> ca
nhlog::ui()->warn("Error while saving file to: {}", e.what()); nhlog::ui()->warn("Error while saving file to: {}", e.what());
} }
#if defined(Q_OS_WIN)
emit mediaCached(mxcUrl, filename.filePath()); emit mediaCached(mxcUrl, filename.filePath());
#else
emit mediaCached(mxcUrl, "file://" + filename.filePath());
#endif
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment