[vlc-commits] [Git][videolan/vlc][master] qt: do not use access for resource or local images
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Sun Jan 5 13:36:21 UTC 2025
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
bccd9da4 by Fatih Uzunoglu at 2025-01-05T13:14:28+00:00
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.
- - - - -
2 changed files:
- modules/gui/qt/util/vlcaccess_image_provider.cpp
- modules/gui/qt/util/vlcaccess_image_provider.hpp
Changes:
=====================================
modules/gui/qt/util/vlcaccess_image_provider.cpp
=====================================
@@ -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);
}
=====================================
modules/gui/qt/util/vlcaccess_image_provider.hpp
=====================================
@@ -97,7 +97,7 @@ public:
* @code
*
*/
- Q_INVOKABLE QString uri(QString path);
+ Q_INVOKABLE QString uri(const QString& path, bool excludeLocalFileOrUnknownScheme = true);
};
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bccd9da47d0adb7f14b7d38b208c98dba9031ede
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bccd9da47d0adb7f14b7d38b208c98dba9031ede
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list