[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/multimedia/amarok
From:       Soren Harward <stharward () gmail ! com>
Date:       2008-10-02 20:11:56
Message-ID: 1222978316.091004.17111.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 867108 by stharward:

Reverting r864385 and r864910

Event handling and item selection of the GraphicsView are still pretty
badly frakked up, but at least they aren't worse than they were before.
I'm working on a fix for this for beta3.

CCBUG: 167881
CCMAIL: nhnfreespirit@gmail.com

 M  +0 -1      ChangeLog  
 M  +7 -0      src/playlist/PlaylistGraphicsItem.cpp  
 M  +2 -0      src/playlist/PlaylistGraphicsItem.h  
 M  +0 -4      src/playlist/PlaylistGraphicsScene.cpp  
 M  +9 -21     src/playlist/PlaylistGraphicsView.cpp  


--- trunk/extragear/multimedia/amarok/ChangeLog #867107:867108
@@ -128,7 +128,6 @@
     * You can add directories from the Play and Add Media menus. (BR 166549)
     * Allow statistics to be written out when we move to the next track, not
       just when playback stops.
-    * Right-clicking on playlist doesn't wipe out selection. (BR 167861)
 
 
 VERSION 2.0-beta1
--- trunk/extragear/multimedia/amarok/src/playlist/PlaylistGraphicsItem.cpp \
#867107:867108 @@ -490,6 +490,13 @@
 }
 
 void
+Playlist::GraphicsItem::editTrackInformation()
+{
+    TagDialog *dialog = new TagDialog( m_items->track, The::playlistView() );
+    dialog->show();
+}
+
+void
 Playlist::GraphicsItem::mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event )
 {
     if( m_items )
--- trunk/extragear/multimedia/amarok/src/playlist/PlaylistGraphicsItem.h \
#867107:867108 @@ -71,6 +71,8 @@
             void unsetImage();
             void dataChanged();
 
+            void editTrackInformation();
+
             int groupMode() const { return m_groupMode; }
 
             void paletteChange();
--- trunk/extragear/multimedia/amarok/src/playlist/PlaylistGraphicsScene.cpp \
#867107:867108 @@ -48,10 +48,6 @@
 
     QGraphicsScene::mousePressEvent( event );
 
-    // right and middle mouse button actions are handled in \
                PlaylistGraphicsView::mouseReleaseEvent
-    if (event->button() != Qt::LeftButton)
-        return;
-
     if( clickedItems.isEmpty() )
         return;
 
--- trunk/extragear/multimedia/amarok/src/playlist/PlaylistGraphicsView.cpp \
#867107:867108 @@ -20,8 +20,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  **************************************************************************/
 
-#define DEBUG_PREFIX "Playlist::GraphicsView"
-
 #include "PlaylistGraphicsView.h"
 
 #include "Amarok.h"
@@ -35,7 +33,6 @@
 #include "PlaylistViewCommon.h"
 #include "SvgTinter.h"
 #include "WidgetBackgroundPainter.h"
-#include "dialogs/TagDialog.h"
 #include "meta/CurrentTrackActionsCapability.h"
 
 #include <KAction>
@@ -52,6 +49,7 @@
 
 #include <typeinfo>
 
+
 Playlist::GraphicsView *Playlist::GraphicsView::s_instance = 0;
 
 Playlist::GraphicsView::GraphicsView( QWidget *parent )
@@ -107,7 +105,6 @@
 void
 Playlist::GraphicsView::contextMenuEvent( QContextMenuEvent *event )
 {
-    DEBUG_BLOCK
     QPointF sceneClickPos = mapToScene( event->pos() );
     QGraphicsItem *topItem = scene()->itemAt( sceneClickPos );
     if( !topItem )
@@ -127,7 +124,7 @@
     QPointF itemClickPos = item->mapFromScene( sceneClickPos );
     int row = m_tracks.indexOf( static_cast<Playlist::GraphicsItem*>(item) );
     const QModelIndex index = The::playlistModel()->index( row, 0 );
-    ViewCommon::trackMenu(this, &index, event->globalPos(), item->groupMode() < \
Playlist::Body && item->imageLocation().contains( itemClickPos )); +    \
ViewCommon::trackMenu(this, &index ,event->globalPos(), item->groupMode() < \
Playlist::Body && item->imageLocation().contains( itemClickPos ));  }
 
 void
@@ -160,23 +157,12 @@
 void
 Playlist::GraphicsView::editTrackInformation()
 {
-    DEBUG_BLOCK
-    QList<QGraphicsItem*> selection = scene()->selectedItems();
-
-    if( selection.isEmpty() )
-        return; // our job here is done.
-
-    Meta::TrackList selected;
-    foreach (QGraphicsItem* item, selection) {
-        Playlist::GraphicsItem* pli = dynamic_cast<Playlist::GraphicsItem*>(item);
-        if (pli) {
-            selected.append(pli->internalTrack());
-            debug() << pli->internalTrack()->prettyName() << "will be edited";
-        }
+    if( !m_contextMenuItem )
+    {
+        return;
     }
-    debug() << "total of" << selected.size() << "tracks to edit";
-    TagDialog *dialog = new TagDialog(selected, The::playlistView());
-    dialog->show();
+    m_contextMenuItem->editTrackInformation();
+    m_contextMenuItem = 0;
 }
 
 void
@@ -298,6 +284,8 @@
 void
 Playlist::GraphicsView::mouseReleaseEvent( QMouseEvent* event )
 {
+    DEBUG_BLOCK
+
     if( event->button() == Qt::MidButton )
     {
         QList<KUrl> urls;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic