[vlc-devel] [PATCH 02/29] qt: make "FILE_TYPES" un-indexible

Abel Tesfaye abeltesfaye45 at gmail.com
Tue Aug 20 12:42:19 CEST 2019


From: Abel Tesfaye <Abeltesfaye45 at gmail.com>

---
 modules/gui/qt/components/mediacenter/mlnetworkmodel.cpp | 8 ++++----
 modules/gui/qt/components/mediacenter/mlnetworkmodel.hpp | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt/components/mediacenter/mlnetworkmodel.cpp b/modules/gui/qt/components/mediacenter/mlnetworkmodel.cpp
index 1d3297450e..70edb5413f 100644
--- a/modules/gui/qt/components/mediacenter/mlnetworkmodel.cpp
+++ b/modules/gui/qt/components/mediacenter/mlnetworkmodel.cpp
@@ -274,7 +274,7 @@ void MLNetworkModel::refreshMediaList( MediaSourcePtr mediaSource,
                     QUrl::fromEncoded(QByteArray(it->psz_uri).append('/')) :
                     QUrl::fromEncoded(it->psz_uri);
 
-        item.canBeIndexed = canBeIndexed( item.mainMrl );
+        item.canBeIndexed = canBeIndexed( item.mainMrl , item.type );
         item.mediaSource = mediaSource;
 
         if ( item.canBeIndexed == true )
@@ -322,8 +322,8 @@ void MLNetworkModel::refreshDeviceList( MediaSourcePtr mediaSource, input_item_n
         item.name = qfu(children[i]->p_item->psz_name);
         item.mrls.push_back( item.mainMrl );
         item.indexed = false;
-        item.canBeIndexed = canBeIndexed( item.mainMrl );
         item.type = TYPE_SHARE;
+        item.canBeIndexed = canBeIndexed( item.mainMrl , item.type );
         item.protocol = item.mainMrl.scheme();
         item.tree = NetworkTreeItem{ mediaSource,
                                      children[i]->p_item,
@@ -393,7 +393,7 @@ void MLNetworkModel::SourceListener::onItemRemoved( vlc_media_tree_t *, input_it
     self->model->onItemRemoved( self->source, children, count );
 }
 
-bool MLNetworkModel::canBeIndexed(const QUrl& url)
+bool MLNetworkModel::canBeIndexed(const QUrl& url , ItemType itemType )
 {
-    return url.scheme() == "smb" || url.scheme() == "ftp";
+    return itemType != TYPE_FILE && (url.scheme() == "smb" || url.scheme() == "ftp");
 }
diff --git a/modules/gui/qt/components/mediacenter/mlnetworkmodel.hpp b/modules/gui/qt/components/mediacenter/mlnetworkmodel.hpp
index 4f4ee185b1..d09b5b9ece 100644
--- a/modules/gui/qt/components/mediacenter/mlnetworkmodel.hpp
+++ b/modules/gui/qt/components/mediacenter/mlnetworkmodel.hpp
@@ -132,7 +132,7 @@ private:
     void refreshMediaList(MediaSourcePtr s, input_item_node_t* const children[], size_t count , bool clear);
     void refreshDeviceList(MediaSourcePtr mediaSource, input_item_node_t* const children[], size_t count , bool clear);
 
-    static bool canBeIndexed(const QUrl& url );
+    static bool canBeIndexed(const QUrl& url , ItemType itemType );
 
 private:
     struct SourceListener
-- 
2.21.0



More information about the vlc-devel mailing list