[vlc-commits] qt: remove unnecessary invokeMethod call
Prince Gupta
git at videolan.org
Tue Apr 6 13:12:01 UTC 2021
vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Mon Mar 1 21:39:42 2021 +0530| [4a133bff68913793bf12b1a0693f2757e4905146] | committer: Pierre Lamot
qt: remove unnecessary invokeMethod call
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4a133bff68913793bf12b1a0693f2757e4905146
---
modules/gui/qt/medialibrary/mlurlmodel.cpp | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/modules/gui/qt/medialibrary/mlurlmodel.cpp b/modules/gui/qt/medialibrary/mlurlmodel.cpp
index b0ad992554..b32f05ba88 100644
--- a/modules/gui/qt/medialibrary/mlurlmodel.cpp
+++ b/modules/gui/qt/medialibrary/mlurlmodel.cpp
@@ -58,18 +58,14 @@ QHash<int, QByteArray> MLUrlModel::roleNames() const
void MLUrlModel::addAndPlay( const QString &url )
{
- QMetaObject::invokeMethod( this
- , [this, url]() {
- ml_unique_ptr<vlc_ml_media_t> s{vlc_ml_get_media_by_mrl( m_ml, qtu( url ))};
- if (!s) {
- s.reset(vlc_ml_new_stream( m_ml, qtu( url ) ));
- }
- if (!s)
- return;
- MLItemId itemId( s->i_id, VLC_ML_PARENT_UNKNOWN );
- m_mediaLib->addAndPlay(itemId);
- emit resetRequested();
- });
+ ml_unique_ptr<vlc_ml_media_t> s{vlc_ml_get_media_by_mrl( m_ml, qtu( url ))};
+ if (!s)
+ s.reset(vlc_ml_new_stream( m_ml, qtu( url ) ));
+ if (!s)
+ return;
+ MLItemId itemId( s->i_id, VLC_ML_PARENT_UNKNOWN );
+ m_mediaLib->addAndPlay(itemId);
+ emit resetRequested();
}
vlc_ml_sorting_criteria_t MLUrlModel::roleToCriteria(int role) const
More information about the vlc-commits
mailing list