[vlc-commits] commit: Qt4: only show "Open containing folder" for file items ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sun Aug 8 22:51:31 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Aug  8 23:50:57 2010 +0300| [fd2943948cb4080b37003cef34a5e84637738a61] | committer: Rémi Denis-Courmont 

Qt4: only show "Open containing folder" for file items

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

 .../gui/qt4/components/playlist/playlist_model.cpp |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 1326b42..4b61009 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -911,6 +911,9 @@ bool PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
         return false;
     }
 
+    input_item_t *p_input = p_item->p_input;
+    vlc_gc_incref( p_input );
+
     i_popup_item = index.isValid() ? p_item->i_id : -1;
     i_popup_parent = index.isValid() ?
         ( p_item->p_parent ? p_item->p_parent->i_id : -1 ) :
@@ -932,8 +935,9 @@ bool PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
                         qtr(I_POP_STREAM), this, SLOT( popupStream() ) );
         menu.addAction( qtr(I_POP_SAVE), this, SLOT( popupSave() ) );
         menu.addAction( QIcon( ":/menu/info" ), qtr(I_POP_INFO), this, SLOT( popupInfo() ) );
-        menu.addAction( QIcon( ":/type/folder-grey" ),
-                        qtr( I_POP_EXPLORE ), this, SLOT( popupExplore() ) );
+        if( !strncasecmp( p_input->psz_uri, "file://", 7 ) )
+            menu.addAction( QIcon( ":/type/folder-grey" ),
+                            qtr( I_POP_EXPLORE ), this, SLOT( popupExplore() ) );
         menu.addSeparator();
     }
     if( canEdit() )
@@ -980,6 +984,8 @@ bool PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
         }
         menu.addMenu( sortingMenu );
     }
+    vlc_gc_decref( p_input );
+
     if( !menu.isEmpty() )
     {
         menu.exec( point ); return true;



More information about the vlc-commits mailing list