[vlc-commits] qt: make "FILE_TYPES" un-indexible

Abel Tesfaye git at videolan.org
Wed Aug 21 15:08:37 CEST 2019


vlc | branch: master | Abel Tesfaye <Abeltesfaye45 at gmail.com> | Mon Aug 12 14:33:24 2019 +0300| [86acf758b5a847f8bce709f222c28b84d7d57e65] | committer: Jean-Baptiste Kempf

qt: make "FILE_TYPES" un-indexible

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

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

 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



More information about the vlc-commits mailing list