[vlc-commits] qt: fix device removal in MLNetworkDeviceModel

Pierre Lamot git at videolan.org
Fri Jan 10 15:06:09 CET 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Nov 27 13:10:49 2019 +0100| [f4c2acccfb57792384bf0c8d03d8a1fa35385960] | committer: Jean-Baptiste Kempf

qt: fix device removal in MLNetworkDeviceModel

  device uri was added with a trailling / but the comparison
  for removal was done without it

  the trailling / is no longer required

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f4c2acccfb57792384bf0c8d03d8a1fa35385960
---

 modules/gui/qt/network/networkdevicemodel.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/network/networkdevicemodel.cpp b/modules/gui/qt/network/networkdevicemodel.cpp
index 21d6c50ab5..7ee9029c81 100644
--- a/modules/gui/qt/network/networkdevicemodel.cpp
+++ b/modules/gui/qt/network/networkdevicemodel.cpp
@@ -239,7 +239,7 @@ void NetworkDeviceModel::onItemRemoved( MediaSourcePtr,
             }
             auto mrlIt = std::find_if( begin( (*it).mrls ), end( (*it).mrls),
                                        [itemUri]( const QUrl& mrl ) {
-                return mrl == itemUri;
+                return mrl.matches(itemUri, QUrl::StripTrailingSlash);
             });
             input_item_Release( p_item );
             if ( mrlIt == end( (*it).mrls ) )
@@ -270,7 +270,7 @@ void NetworkDeviceModel::refreshDeviceList( MediaSourcePtr mediaSource, input_it
     for ( auto i = 0u; i < count; ++i )
     {
         Item item;
-        item.mainMrl = QUrl::fromEncoded( QByteArray{ children[i]->p_item->psz_uri }.append( '/' ) );
+        item.mainMrl = QUrl::fromEncoded( children[i]->p_item->psz_uri );
         item.name = qfu(children[i]->p_item->psz_name);
         item.mrls.push_back( item.mainMrl );
         item.type = static_cast<ItemType>( children[i]->p_item->i_type );



More information about the vlc-commits mailing list