From 989243914cad5a2c5ed30cc8555611321ee64a8f Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sun, 14 Aug 2011 03:14:39 +0200 Subject: [PATCH] * Fixed queue not allowing to remove items from it. --- src/audiocontrols.cpp | 6 +++++- src/libtomahawk/playlist/playlistmodel.h | 1 + src/libtomahawk/playlist/trackmodel.h | 4 +--- src/libtomahawk/viewmanager.cpp | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/audiocontrols.cpp b/src/audiocontrols.cpp index 947ba5f0c..3d18c032b 100644 --- a/src/audiocontrols.cpp +++ b/src/audiocontrols.cpp @@ -517,6 +517,7 @@ AudioControls::onTrackClicked() ViewManager::instance()->showCurrentTrack(); } + void AudioControls::dragEnterEvent( QDragEnterEvent* e ) { @@ -524,13 +525,15 @@ AudioControls::dragEnterEvent( QDragEnterEvent* e ) e->acceptProposedAction(); } + void -AudioControls::dragMoveEvent( QDragMoveEvent* e ) +AudioControls::dragMoveEvent( QDragMoveEvent* /* e */ ) { // if ( GlobalActionManager::instance()->acceptsMimeData( e->mimeData() ) ) // e->acceptProposedAction(); } + void AudioControls::dropEvent( QDropEvent* e ) { @@ -544,6 +547,7 @@ AudioControls::dropEvent( QDropEvent* e ) } } + void AudioControls::droppedTracks( QList< query_ptr > tracks ) { diff --git a/src/libtomahawk/playlist/playlistmodel.h b/src/libtomahawk/playlist/playlistmodel.h index 11fc55b2d..63a9b90d1 100644 --- a/src/libtomahawk/playlist/playlistmodel.h +++ b/src/libtomahawk/playlist/playlistmodel.h @@ -74,6 +74,7 @@ public: virtual void removeIndex( const QModelIndex& index, bool moreToCome = false ); bool isTemporary() const; + signals: void repeatModeChanged( Tomahawk::PlaylistInterface::RepeatMode mode ); void shuffleModeChanged( bool enabled ); diff --git a/src/libtomahawk/playlist/trackmodel.h b/src/libtomahawk/playlist/trackmodel.h index db456f00e..6266d41d2 100644 --- a/src/libtomahawk/playlist/trackmodel.h +++ b/src/libtomahawk/playlist/trackmodel.h @@ -62,6 +62,7 @@ public: virtual QModelIndex parent( const QModelIndex& child ) const; virtual bool isReadOnly() const { return m_readOnly; } + virtual void setReadOnly( bool b ) { m_readOnly = b; } virtual QString title() const { return m_title; } virtual void setTitle( const QString& title ) { m_title = title; } @@ -114,9 +115,6 @@ public slots: virtual void setRepeatMode( Tomahawk::PlaylistInterface::RepeatMode /*mode*/ ) {} virtual void setShuffled( bool /*shuffled*/ ) {} -protected: - virtual void setReadOnly( bool b ) { m_readOnly = b; } - private slots: void onPlaybackFinished( const Tomahawk::result_ptr& result ); void onPlaybackStopped(); diff --git a/src/libtomahawk/viewmanager.cpp b/src/libtomahawk/viewmanager.cpp index 6d990ebf3..206dab56e 100644 --- a/src/libtomahawk/viewmanager.cpp +++ b/src/libtomahawk/viewmanager.cpp @@ -89,6 +89,7 @@ ViewManager::ViewManager( QObject* parent ) m_queueView = new QueueView( m_splitter ); m_queueModel = new PlaylistModel( m_queueView ); m_queueView->queue()->setPlaylistModel( m_queueModel ); + m_queueView->queue()->playlistModel()->setReadOnly( false ); AudioEngine::instance()->setQueue( m_queueView->queue()->proxyModel() ); m_splitter->addWidget( m_queueView );