[vlc-commits] [Git][videolan/vlc][master] qt: workaround for type conversion to QVector<MLItemId> doesn't occur with Qt 5.12
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Sat Sep 16 22:27:02 UTC 2023
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
23e220ab by Fatih Uzunoglu at 2023-09-16T21:07:54+00:00
qt: workaround for type conversion to QVector<MLItemId> doesn't occur with Qt 5.12
- - - - -
2 changed files:
- modules/gui/qt/medialibrary/medialib.cpp
- modules/gui/qt/medialibrary/medialib.hpp
Changes:
=====================================
modules/gui/qt/medialibrary/medialib.cpp
=====================================
@@ -270,6 +270,24 @@ void MediaLib::reload()
});
}
+void MediaLib::mlInputItem(const QVariantList &variantList, QJSValue callback)
+{
+ if (!callback.isCallable()) // invalid argument
+ {
+ msg_Warn(m_intf, "callback is not callbable");
+ return;
+ }
+
+ QVector<MLItemId> mlIdList;
+ for (const auto& variant : variantList)
+ {
+ assert(variant.canConvert<MLItemId>());
+ mlIdList.push_back(variant.value<MLItemId>());
+ }
+
+ mlInputItem(mlIdList, callback);
+}
+
void MediaLib::mlInputItem(const QVector<MLItemId>& itemIdVector, QJSValue callback)
{
if (!callback.isCallable()) // invalid argument
=====================================
modules/gui/qt/medialibrary/medialib.hpp
=====================================
@@ -74,6 +74,9 @@ public:
Q_INVOKABLE void reload();
Q_INVOKABLE void mlInputItem(const QVector<MLItemId>& itemIdVector, QJSValue callback);
+ // TODO: This is added back due to type conversion does not occur with Qt 5.12.
+ // Remove when possible:
+ Q_INVOKABLE void mlInputItem(const QVariantList& variantList, QJSValue callback);
inline bool idle() const { return m_idle; }
inline int discoveryPending() const { return m_discoveryPending; }
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/23e220abf8303db52ca569f6ad1b8471951bb473
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/23e220abf8303db52ca569f6ad1b8471951bb473
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