Skip to content
Snippets Groups Projects
Commit bccd9da4 authored by Fatih Uzunoğlu's avatar Fatih Uzunoğlu Committed by Felix Paul Kühne
Browse files

qt: do not use access for resource or local images

Access was meant to be used for remote images as we stopped
using Qt Network, Qt can not retrieve remote images.

QQuickImage can handle local or resource files better for
its needs. It does not need to use an image provider for
local files.

VLCAccessImage is not good when same images loaded together.
When I add an album to the playlist, even though the items
share the same image (url), they appear to be loaded multiple
times. I assume this has something to do with VLCAccessImage
being an asynchronous provider.

With the default behavior, as long as cache is enabled, the
images are re-used when possible.
parent f033b402
No related branches found
No related tags found
1 merge request!6587qt: do not use access for resource or local images
Pipeline #552011 passed with stage
in 12 minutes and 45 seconds
......@@ -188,8 +188,14 @@ VLCAccessImage::VLCAccessImage(QObject* parent)
: QObject(parent)
{}
QString VLCAccessImage::uri(QString path)
QString VLCAccessImage::uri(const QString& path, const bool excludeLocalFileOrUnknownScheme)
{
if (excludeLocalFileOrUnknownScheme)
{
const QUrl url(path);
if (url.scheme().isEmpty() || url.scheme() == QLatin1String("qrc") || url.scheme() == QLatin1String("file"))
return path;
}
return VLCAccessImageProvider::wrapUri(path);
}
......
......@@ -97,7 +97,7 @@ public:
* @code
*
*/
Q_INVOKABLE QString uri(QString path);
Q_INVOKABLE QString uri(const QString& path, bool excludeLocalFileOrUnknownScheme = true);
};
......
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