[vlc-commits] Qt: MLModel: Move Popup() creation out of the MLModel

Francois Cartegnie git at videolan.org
Thu Jul 19 14:23:23 CEST 2012


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jul 18 21:36:50 2012 +0200| [04806c152c4207648f02daecc4a28e50da31b99c] | committer: Francois Cartegnie

Qt: MLModel: Move Popup() creation out of the MLModel

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

 modules/gui/qt4/components/playlist/ml_model.cpp |   53 ----------------------
 modules/gui/qt4/components/playlist/ml_model.hpp |    1 -
 2 files changed, 54 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/ml_model.cpp b/modules/gui/qt4/components/playlist/ml_model.cpp
index 0b0305a..2e90109 100644
--- a/modules/gui/qt4/components/playlist/ml_model.cpp
+++ b/modules/gui/qt4/components/playlist/ml_model.cpp
@@ -593,59 +593,6 @@ bool MLModel::isCurrentItem( const QModelIndex &index, playLocation where ) cons
     return false;
 }
 
-bool MLModel::popup( const QModelIndex & index, const QPoint &point, const QModelIndexList &selectionlist )
-{
-    QModelIndexList callerAsList;
-    callerAsList << ( index.isValid() ? index : QModelIndex() );
-
-#define ADD_MENU_ENTRY( icon, title, act, data ) \
-    action = menu.addAction( icon, title ); \
-    container.action = act; \
-    container.indexes = data; \
-    action->setData( QVariant::fromValue( container ) )
-
-    /* */
-    QMenu menu;
-    QAction *action;
-    VLCModel::actionsContainerType container;
-
-    if( index.isValid() )
-    {
-        ADD_MENU_ENTRY( QIcon( ":/menu/play" ), qtr(I_POP_PLAY),
-                        container.ACTION_PLAY, callerAsList );
-
-        ADD_MENU_ENTRY( QIcon( ":/menu/stream" ), qtr(I_POP_STREAM),
-                        container.ACTION_STREAM, selectionlist );
-
-        ADD_MENU_ENTRY( QIcon(), qtr(I_POP_SAVE),
-                        container.ACTION_SAVE, selectionlist );
-
-        ADD_MENU_ENTRY( QIcon( ":/menu/info" ), qtr(I_POP_INFO),
-                        container.ACTION_INFO, callerAsList );
-
-        menu.addSeparator();
-    }
-
-
-    QIcon addIcon( ":/buttons/playlist/playlist_add" );
-    menu.addSeparator();
-    //menu.addAction( addIcon, qtr(I_PL_ADDF), THEDP, SLOT( simpleMLAppendDialog()) );
-    //menu.addAction( addIcon, qtr(I_PL_ADDDIR), THEDP, SLOT( MLAppendDir() ) );
-    //menu.addAction( addIcon, qtr(I_OP_ADVOP), THEDP, SLOT( MLAppendDialog() ) );
-
-    if( index.isValid() )
-    {
-        ADD_MENU_ENTRY( QIcon( ":/buttons/playlist/playlist_remove" ), qtr(I_POP_DEL),
-                        container.ACTION_REMOVE, selectionlist );
-        menu.addSeparator();
-    }
-    if( !menu.isEmpty() )
-    {
-        menu.exec( point ); return true;
-    }
-    else return false;
-}
-
 QStringList MLModel::selectedURIs( QModelIndexList *current_selection )
 {
     QStringList list;
diff --git a/modules/gui/qt4/components/playlist/ml_model.hpp b/modules/gui/qt4/components/playlist/ml_model.hpp
index f01ae6a..d6f4476 100644
--- a/modules/gui/qt4/components/playlist/ml_model.hpp
+++ b/modules/gui/qt4/components/playlist/ml_model.hpp
@@ -93,7 +93,6 @@ public:
     void remove( QModelIndex idx );
 
     void clear();
-    virtual bool popup( const QModelIndex & index, const QPoint &point, const QModelIndexList &list );
     void play( const QModelIndex &idx );
     QStringList selectedURIs( QModelIndexList * );
     virtual QString getURI( const QModelIndex &index ) const;



More information about the vlc-commits mailing list