mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-03 20:57:52 +02:00
* Fixed deleteing multiple playlist items via context menu.
This commit is contained in:
@@ -298,7 +298,7 @@ Connection::setId( const QString& id )
|
|||||||
void
|
void
|
||||||
Connection::readyRead()
|
Connection::readyRead()
|
||||||
{
|
{
|
||||||
qDebug() << "readyRead, bytesavail:" << m_sock->bytesAvailable();
|
// qDebug() << "readyRead, bytesavail:" << m_sock->bytesAvailable();
|
||||||
|
|
||||||
if( m_msg.isNull() )
|
if( m_msg.isNull() )
|
||||||
{
|
{
|
||||||
|
@@ -43,15 +43,15 @@ PlaylistView::setupMenus()
|
|||||||
m_itemMenu.addSeparator();
|
m_itemMenu.addSeparator();
|
||||||
m_addItemsToPlaylistAction = m_itemMenu.addAction( tr( "&Add to Playlist" ) );
|
m_addItemsToPlaylistAction = m_itemMenu.addAction( tr( "&Add to Playlist" ) );
|
||||||
m_itemMenu.addSeparator();
|
m_itemMenu.addSeparator();
|
||||||
m_deleteItemAction = m_itemMenu.addAction( tr( "&Delete Item" ) );
|
m_deleteItemsAction = m_itemMenu.addAction( tr( "&Delete Item" ) );
|
||||||
|
|
||||||
if ( model() )
|
if ( model() )
|
||||||
m_deleteItemAction->setEnabled( !model()->isReadOnly() );
|
m_deleteItemsAction->setEnabled( !model()->isReadOnly() );
|
||||||
|
|
||||||
connect( m_playItemAction, SIGNAL( triggered() ), SLOT( playItem() ) );
|
connect( m_playItemAction, SIGNAL( triggered() ), SLOT( playItem() ) );
|
||||||
connect( m_addItemsToQueueAction, SIGNAL( triggered() ), SLOT( addItemsToQueue() ) );
|
connect( m_addItemsToQueueAction, SIGNAL( triggered() ), SLOT( addItemsToQueue() ) );
|
||||||
connect( m_addItemsToPlaylistAction, SIGNAL( triggered() ), SLOT( addItemsToPlaylist() ) );
|
connect( m_addItemsToPlaylistAction, SIGNAL( triggered() ), SLOT( addItemsToPlaylist() ) );
|
||||||
connect( m_deleteItemAction, SIGNAL( triggered() ), SLOT( deleteItem() ) );
|
connect( m_deleteItemsAction, SIGNAL( triggered() ), SLOT( deleteItems() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ PlaylistView::addItemsToPlaylist()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlaylistView::deleteItem()
|
PlaylistView::deleteItems()
|
||||||
{
|
{
|
||||||
proxyModel()->removeIndex( contextMenuIndex() );
|
proxyModel()->removeIndexes( selectedIndexes() );
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,7 @@ private slots:
|
|||||||
void onCustomContextMenu( const QPoint& pos );
|
void onCustomContextMenu( const QPoint& pos );
|
||||||
|
|
||||||
void addItemsToPlaylist();
|
void addItemsToPlaylist();
|
||||||
void deleteItem();
|
void deleteItems();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupMenus();
|
void setupMenus();
|
||||||
@@ -33,7 +33,7 @@ private:
|
|||||||
QAction* m_playItemAction;
|
QAction* m_playItemAction;
|
||||||
QAction* m_addItemsToQueueAction;
|
QAction* m_addItemsToQueueAction;
|
||||||
QAction* m_addItemsToPlaylistAction;
|
QAction* m_addItemsToPlaylistAction;
|
||||||
QAction* m_deleteItemAction;
|
QAction* m_deleteItemsAction;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PLAYLISTVIEW_H
|
#endif // PLAYLISTVIEW_H
|
||||||
|
Reference in New Issue
Block a user