]> git.sesse.net Git - vlc/commitdiff
Qt: remove unused code
authorJakob Leben <jleben@videolan.org>
Mon, 25 Jan 2010 13:39:55 +0000 (14:39 +0100)
committerJakob Leben <jleben@videolan.org>
Mon, 25 Jan 2010 13:48:20 +0000 (14:48 +0100)
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.hpp

index ea8ae94ca9f89be0bd782bc791d2be1ebf1485e0..d406a22c035aaf65db91fefe6fd72cb4a294818d 100644 (file)
@@ -83,9 +83,6 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
     treeView->setDropIndicatorShown( true );
     treeView->setContextMenuPolicy( Qt::CustomContextMenu );
 
-    //treeView->installEventFilter( this );
-    //<jleben> I guess we don't need that
-
     /* Saved Settings */
     getSettings()->beginGroup("Playlist");
     if( getSettings()->contains( "headerStateV2" ) )
@@ -240,13 +237,6 @@ void StandardPLPanel::search( const QString& searchText )
     model->search( searchText );
 }
 
-void StandardPLPanel::doPopup( QModelIndex index, QPoint point )
-{
-    QItemSelectionModel *selection = treeView->selectionModel();
-    QModelIndexList list = selection->selectedIndexes();
-    model->popup( index, point, list );
-}
-
 /* Set the root of the new Playlist */
 /* This activated by the selector selection */
 void StandardPLPanel::setRoot( playlist_item_t *p_item )
@@ -320,7 +310,6 @@ void StandardPLPanel::toggleView()
         {
             iconView = new PlIconView( model, this );
             layout->addWidget( iconView, 1, 0, 1, -1 );
-            //iconView->installEventFilter( this );
             iconView->setContextMenuPolicy( Qt::CustomContextMenu );
             CONNECT( iconView, customContextMenuRequested( const QPoint & ),
                      this, playlistPopup( const QPoint & ) );
@@ -335,46 +324,6 @@ void StandardPLPanel::toggleView()
     }
 }
 
-bool StandardPLPanel::eventFilter( QObject *obj, QEvent *event )
-{
-    QAbstractItemView *aView = qobject_cast<QAbstractItemView *>(obj);
-    if( !aView ) return false;
-
-    switch( event->type() )
-    {
-        case QEvent::MouseButtonPress:
-            {
-                QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
-                if( mouseEvent->button() & Qt::RightButton )
-                {
-                    QModelIndex index = aView->indexAt(
-                            QPoint( mouseEvent->x(), mouseEvent->y() ) );
-                    doPopup( index, QCursor::pos() );
-                    return true;
-                }
-                else if( mouseEvent->button() & Qt::LeftButton )
-                {
-                    if( !aView->indexAt( QPoint( mouseEvent->x(),
-                                                mouseEvent->y() ) ).isValid() )
-                        aView->clearSelection();
-                }
-                // aView->mousePressEvent( mouseEvent );
-            }
-            return true;
-        case QEvent::MouseButtonRelease:
-            {
-                QMouseEvent *mouseEvent2 = static_cast<QMouseEvent *>(event);
-                if( mouseEvent2->button() & Qt::RightButton )
-                    return false; /* Do NOT forward to QTreeView!! */
-                // aView->mouseReleaseEvent( mouseEvent );
-                return true;
-            }
-        default:
-            return false;
-    }
-    return true;
-}
-
 void StandardPLPanel::wheelEvent( QWheelEvent *e )
 {
     // Accept this event in order to prevent unwanted volume up/down changes
index 0f59996fae5e9219c66d96f10162ad333a6e90f5..ee273e3f5c46624c882c251e12fba0781fb9cf76 100644 (file)
@@ -60,8 +60,6 @@ protected:
     virtual void keyPressEvent( QKeyEvent *e );
     virtual void wheelEvent( QWheelEvent *e );
 
-    bool eventFilter(QObject *obj, QEvent *event);
-
     PLModel *model;
 private:
     intf_thread_t *p_intf;
@@ -77,7 +75,6 @@ private:
     int currentRootId;
     QSignalMapper *selectColumnsSigMapper;
 
-    void doPopup( QModelIndex index, QPoint point );
 public slots:
     void removeItem( int );
     virtual void setRoot( playlist_item_t * );