]> git.sesse.net Git - vlc/commitdiff
qt4: you don't need to sort on invalid index
authorIlkka Ollakka <ileoo@videolan.org>
Tue, 18 Aug 2009 13:15:28 +0000 (16:15 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Tue, 18 Aug 2009 13:15:55 +0000 (16:15 +0300)
modules/gui/qt4/components/playlist/playlist_model.cpp

index 557e54dc01a3bf5bc9acccb3794d93dcb17b5c87..f95a1ac966d38615c1aef528a9c57e458a39342e 100644 (file)
@@ -977,14 +977,14 @@ void PLModel::popup( QModelIndex & index, QPoint &point, QModelIndexList list )
             menu->addAction( qtr(I_POP_SAVE), this, SLOT( popupSave() ) );
             menu->addSeparator();
             menu->addAction( qtr(I_POP_INFO), this, SLOT( popupInfo() ) );
+            if( node )
+            {
+                menu->addSeparator();
+                menu->addAction( qtr(I_POP_SORT), this, SLOT( popupSort() ) );
+            }
         }
-        if( node )
-        {
-            if( index.isValid() ) menu->addSeparator();
-            menu->addAction( qtr(I_POP_SORT), this, SLOT( popupSort() ) );
-            if( tree )
+        if( node && tree )
                 menu->addAction( qtr(I_POP_ADD), this, SLOT( popupAddNode() ) );
-        }
         if( index.isValid() )
         {
             menu->addSeparator();