From 1ecab22b4dd12624bfbed731e2cdca95d4969467 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 24 Jun 2011 04:47:50 +0200 Subject: [PATCH] * Added new helper class ContextMenu. Made it easy to support context-menus in the TreeView, too. --- src/libtomahawk/CMakeLists.txt | 2 + src/libtomahawk/contextMenu.cpp | 122 ++++++++++++++++++++ src/libtomahawk/contextMenu.h | 65 +++++++++++ src/libtomahawk/playlist/artistview.cpp | 45 ++++++++ src/libtomahawk/playlist/artistview.h | 6 + src/libtomahawk/playlist/collectionview.cpp | 39 ------- src/libtomahawk/playlist/collectionview.h | 12 -- src/libtomahawk/playlist/playlistview.cpp | 73 +++--------- src/libtomahawk/playlist/playlistview.h | 13 +-- src/libtomahawk/playlist/trackview.cpp | 82 +++++++------ src/libtomahawk/playlist/trackview.h | 8 +- src/libtomahawk/sourceplaylistinterface.cpp | 4 +- 12 files changed, 315 insertions(+), 156 deletions(-) create mode 100644 src/libtomahawk/contextMenu.cpp create mode 100644 src/libtomahawk/contextMenu.h diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index 52ba39e66..c80ed6547 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -31,6 +31,7 @@ set( libSources viewpage.cpp viewmanager.cpp globalactionmanager.cpp + contextMenu.cpp sip/SipPlugin.cpp sip/SipHandler.cpp @@ -194,6 +195,7 @@ set( libHeaders viewpage.h viewmanager.h globalactionmanager.h + contextMenu.h artist.h album.h diff --git a/src/libtomahawk/contextMenu.cpp b/src/libtomahawk/contextMenu.cpp new file mode 100644 index 000000000..29cccd326 --- /dev/null +++ b/src/libtomahawk/contextMenu.cpp @@ -0,0 +1,122 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2010-2011, Christian Muehlhaeuser + * + * Tomahawk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Tomahawk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tomahawk. If not, see . + */ + +#include "contextMenu.h" + +#include + +#include "globalactionmanager.h" +#include "pipeline.h" +#include "playlistview.h" +#include "viewmanager.h" + +using namespace Tomahawk; + + +ContextMenu::ContextMenu( QWidget* parent ) + : QMenu( parent ) +{ + m_sigmap = new QSignalMapper( this ); + connect( m_sigmap, SIGNAL( mapped( int ) ), SLOT( onTriggered( int ) ) ); + + m_supportedActions = ActionPlay | ActionQueue | ActionCopyLink; +} + + +void +ContextMenu::setQueries( const QList& queries ) +{ + clear(); + m_queries.clear(); + m_queries << queries; + + if ( m_supportedActions & ActionPlay ) + m_sigmap->setMapping( addAction( tr( "&Play" ) ), ActionPlay ); + + if ( m_supportedActions & ActionQueue ) + m_sigmap->setMapping( addAction( tr( "Add to &Queue" ) ), ActionQueue ); + + //m_sigmap->setMapping( addAction( tr( "&Add to Playlist" ) ), ActionAddToPlaylist ); + + addSeparator(); + + if ( m_supportedActions & ActionCopyLink ) + m_sigmap->setMapping( addAction( tr( "Copy Track Link" ) ), ActionCopyLink ); + + addSeparator(); + + if ( m_supportedActions & ActionDelete ) + m_sigmap->setMapping( addAction( queries.count() > 1 ? tr( "&Delete Items" ) : tr( "&Delete Item" ) ), ActionDelete ); + + foreach ( QAction* action, actions() ) + { + connect( action, SIGNAL( triggered() ), m_sigmap, SLOT( map() ) ); + } +} + + +void +ContextMenu::setQuery( const Tomahawk::query_ptr& query ) +{ + QList queries; + queries << query; + setQueries( queries ); +} + + +void +ContextMenu::onTriggered( int action ) +{ + switch ( action ) + { + case ActionQueue: + addToQueue(); + break; + + case ActionCopyLink: + copyLink(); + break; + + default: + emit triggered( action ); + } +} + + +void ContextMenu::addToQueue() +{ + foreach ( const query_ptr& query, m_queries ) + { + if ( !query->resolvingFinished() ) + Pipeline::instance()->resolve( query ); + + ViewManager::instance()->queue()->model()->append( query ); + } + + ViewManager::instance()->showQueue(); +} + + +void +ContextMenu::copyLink() +{ + if ( m_queries.count() ) + { + GlobalActionManager::instance()->copyToClipboard( m_queries.first() ); + } +} diff --git a/src/libtomahawk/contextMenu.h b/src/libtomahawk/contextMenu.h new file mode 100644 index 000000000..7153064b5 --- /dev/null +++ b/src/libtomahawk/contextMenu.h @@ -0,0 +1,65 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2010-2011, Christian Muehlhaeuser + * + * Tomahawk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Tomahawk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tomahawk. If not, see . + */ + +#ifndef CONTEXTMENU_H +#define CONTEXTMENU_H + +#include +#include + +#include "typedefs.h" + +#include "dllmacro.h" + +namespace Tomahawk +{ + +class DLLEXPORT ContextMenu : public QMenu +{ +Q_OBJECT + +public: + enum MenuActions + { ActionPlay = 1, ActionQueue = 2, ActionDelete = 4, ActionCopyLink = 8 }; + + explicit ContextMenu( QWidget* parent = 0 ); + + int supportedActions() const { return m_supportedActions; } + void setSupportedActions( int actions ) { m_supportedActions = actions; } + + void setQuery( const Tomahawk::query_ptr& query ); + void setQueries( const QList& queries ); + +signals: + void triggered( int action ); + +private slots: + void onTriggered( int action ); + + void copyLink(); + void addToQueue(); + +private: + QSignalMapper* m_sigmap; + int m_supportedActions; + QList m_queries; +}; + +}; // ns + +#endif diff --git a/src/libtomahawk/playlist/artistview.cpp b/src/libtomahawk/playlist/artistview.cpp index a584d9a91..54f25fbff 100644 --- a/src/libtomahawk/playlist/artistview.cpp +++ b/src/libtomahawk/playlist/artistview.cpp @@ -46,6 +46,7 @@ ArtistView::ArtistView( QWidget* parent ) , m_proxyModel( 0 ) // , m_delegate( 0 ) , m_loadingSpinner( new LoadingSpinner( this ) ) + , m_contextMenu( new ContextMenu( this ) ) , m_showModes( true ) { setAlternatingRowColors( true ); @@ -59,6 +60,7 @@ ArtistView::ArtistView( QWidget* parent ) setAllColumnsShowFocus( true ); setSelectionMode( QAbstractItemView::ExtendedSelection ); setSelectionBehavior( QAbstractItemView::SelectRows ); + setContextMenuPolicy( Qt::CustomContextMenu ); setHeader( m_header ); setProxyModel( new TreeProxyModel( this ) ); @@ -81,6 +83,8 @@ ArtistView::ArtistView( QWidget* parent ) connect( &m_timer, SIGNAL( timeout() ), SLOT( onScrollTimeout() ) ); connect( this, SIGNAL( doubleClicked( QModelIndex ) ), SLOT( onItemActivated( QModelIndex ) ) ); + connect( this, SIGNAL( customContextMenuRequested( const QPoint& ) ), SLOT( onCustomContextMenu( const QPoint& ) ) ); + connect( m_contextMenu, SIGNAL( triggered( int ) ), SLOT( onMenuTriggered( int ) ) ); } @@ -250,6 +254,47 @@ ArtistView::onScrollTimeout() } +void +ArtistView::onCustomContextMenu( const QPoint& pos ) +{ + QModelIndex idx = indexAt( pos ); + idx = idx.sibling( idx.row(), 0 ); + m_contextMenuIndex = idx; + + if ( !idx.isValid() ) + return; + + QList queries; + foreach ( const QModelIndex& index, selectedIndexes() ) + { + if ( index.column() ) + continue; + + TreeModelItem* item = m_proxyModel->itemFromIndex( m_proxyModel->mapToSource( index ) ); + if ( item && !item->result().isNull() ) + queries << item->result()->toQuery(); + } + + m_contextMenu->setQueries( queries ); + m_contextMenu->exec( mapToGlobal( pos ) ); +} + + +void +ArtistView::onMenuTriggered( int action ) +{ + switch ( action ) + { + case ContextMenu::ActionPlay: + onItemActivated( m_contextMenuIndex ); + break; + + default: + break; + } +} + + bool ArtistView::jumpToCurrentTrack() { diff --git a/src/libtomahawk/playlist/artistview.h b/src/libtomahawk/playlist/artistview.h index a32b430a6..c60b863e5 100644 --- a/src/libtomahawk/playlist/artistview.h +++ b/src/libtomahawk/playlist/artistview.h @@ -22,6 +22,7 @@ #include #include +#include "contextMenu.h" #include "treemodel.h" #include "treeproxymodel.h" #include "viewpage.h" @@ -79,6 +80,9 @@ private slots: void onViewChanged(); void onScrollTimeout(); + void onCustomContextMenu( const QPoint& pos ); + void onMenuTriggered( int action ); + private: TreeHeader* m_header; TreeModel* m_model; @@ -86,6 +90,8 @@ private: // PlaylistItemDelegate* m_delegate; LoadingSpinner* m_loadingSpinner; + QModelIndex m_contextMenuIndex; + Tomahawk::ContextMenu* m_contextMenu; bool m_showModes; QTimer m_timer; diff --git a/src/libtomahawk/playlist/collectionview.cpp b/src/libtomahawk/playlist/collectionview.cpp index 55ff115b3..96e8cda41 100644 --- a/src/libtomahawk/playlist/collectionview.cpp +++ b/src/libtomahawk/playlist/collectionview.cpp @@ -38,9 +38,6 @@ CollectionView::CollectionView( QWidget* parent ) setDragDropMode( QAbstractItemView::DragOnly ); setAcceptDrops( false ); - - setContextMenuPolicy( Qt::CustomContextMenu ); - connect( this, SIGNAL( customContextMenuRequested( const QPoint& ) ), SLOT( onCustomContextMenu( const QPoint& ) ) ); } @@ -80,42 +77,6 @@ CollectionView::dragEnterEvent( QDragEnterEvent* event ) } -void -CollectionView::setupMenus() -{ - m_itemMenu.clear(); - - m_playItemAction = m_itemMenu.addAction( tr( "&Play" ) ); - m_addItemsToQueueAction = m_itemMenu.addAction( tr( "Add to &Queue" ) ); - m_itemMenu.addSeparator(); - - foreach( QAction* a, actions() ) - m_itemMenu.addAction( a ); -// m_addItemsToPlaylistAction = m_itemMenu.addAction( tr( "&Add to Playlist" ) ); - - connect( m_playItemAction, SIGNAL( triggered() ), SLOT( playItem() ) ); - connect( m_addItemsToQueueAction, SIGNAL( triggered() ), SLOT( addItemsToQueue() ) ); -// connect( m_addItemsToPlaylistAction, SIGNAL( triggered() ), SLOT( addItemsToPlaylist() ) ); -} - - -void -CollectionView::onCustomContextMenu( const QPoint& pos ) -{ - qDebug() << Q_FUNC_INFO; - setupMenus(); - - QModelIndex idx = indexAt( pos ); - idx = idx.sibling( idx.row(), 0 ); - setContextMenuIndex( idx ); - - if ( !idx.isValid() ) - return; - - m_itemMenu.exec( mapToGlobal( pos ) ); -} - - void CollectionView::onTrackCountChanged( unsigned int tracks ) { diff --git a/src/libtomahawk/playlist/collectionview.h b/src/libtomahawk/playlist/collectionview.h index e19c80d28..a3893b270 100644 --- a/src/libtomahawk/playlist/collectionview.h +++ b/src/libtomahawk/playlist/collectionview.h @@ -19,8 +19,6 @@ #ifndef COLLECTIONVIEW_H #define COLLECTIONVIEW_H -#include - #include "trackproxymodel.h" #include "trackmodel.h" #include "trackview.h" @@ -52,20 +50,10 @@ public: virtual bool jumpToCurrentTrack(); private slots: - void onCustomContextMenu( const QPoint& pos ); void onTrackCountChanged( unsigned int tracks ); protected: virtual void dragEnterEvent( QDragEnterEvent* event ); - -private: - void setupMenus(); - - QMenu m_itemMenu; - - QAction* m_playItemAction; - QAction* m_addItemsToQueueAction; - QAction* m_addItemsToPlaylistAction; }; #endif // COLLECTIONVIEW_H diff --git a/src/libtomahawk/playlist/playlistview.cpp b/src/libtomahawk/playlist/playlistview.cpp index 210558a4b..5a8ce4a9f 100644 --- a/src/libtomahawk/playlist/playlistview.cpp +++ b/src/libtomahawk/playlist/playlistview.cpp @@ -32,16 +32,10 @@ using namespace Tomahawk; PlaylistView::PlaylistView( QWidget* parent ) : TrackView( parent ) , m_model( 0 ) - , m_itemMenu( 0 ) - , m_playItemAction( 0 ) - , m_addItemsToQueueAction( 0 ) - , m_addItemsToPlaylistAction( 0 ) - , m_deleteItemsAction( 0 ) { setProxyModel( new PlaylistProxyModel( this ) ); - setContextMenuPolicy( Qt::CustomContextMenu ); - connect( this, SIGNAL( customContextMenuRequested( const QPoint& ) ), SLOT( onCustomContextMenu( const QPoint& ) ) ); + connect( contextMenu(), SIGNAL( triggered( int ) ), SLOT( onMenuTriggered( int ) ) ); } @@ -81,54 +75,6 @@ PlaylistView::setPlaylistModel( PlaylistModel* model ) } -void -PlaylistView::setupMenus() -{ - m_itemMenu.clear(); - - unsigned int i = 0; - foreach( const QModelIndex& idx, selectedIndexes() ) - if ( idx.column() == 0 ) - i++; - - m_playItemAction = m_itemMenu.addAction( tr( "&Play" ) ); - m_addItemsToQueueAction = m_itemMenu.addAction( tr( "Add to &Queue" ) ); - m_itemMenu.addSeparator(); - - foreach( QAction* a, actions() ) - m_itemMenu.addAction( a ); - -// m_addItemsToPlaylistAction = m_itemMenu.addAction( tr( "&Add to Playlist" ) ); -// m_itemMenu.addSeparator(); - m_deleteItemsAction = m_itemMenu.addAction( i > 1 ? tr( "&Delete Items" ) : tr( "&Delete Item" ) ); - - if ( model() ) - m_deleteItemsAction->setEnabled( !model()->isReadOnly() ); - - connect( m_playItemAction, SIGNAL( triggered() ), SLOT( playItem() ) ); - connect( m_addItemsToQueueAction, SIGNAL( triggered() ), SLOT( addItemsToQueue() ) ); -// connect( m_addItemsToPlaylistAction, SIGNAL( triggered() ), SLOT( addItemsToPlaylist() ) ); - connect( m_deleteItemsAction, SIGNAL( triggered() ), SLOT( deleteItems() ) ); -} - - -void -PlaylistView::onCustomContextMenu( const QPoint& pos ) -{ - qDebug() << Q_FUNC_INFO; - setupMenus(); - - QModelIndex idx = indexAt( pos ); - idx = idx.sibling( idx.row(), 0 ); - setContextMenuIndex( idx ); - - if ( !idx.isValid() ) - return; - - m_itemMenu.exec( mapToGlobal( pos ) ); -} - - void PlaylistView::keyPressEvent( QKeyEvent* event ) { @@ -152,6 +98,7 @@ PlaylistView::deleteItems() proxyModel()->removeIndexes( selectedIndexes() ); } + void PlaylistView::onTrackCountChanged( unsigned int tracks ) { @@ -196,3 +143,19 @@ PlaylistView::isTemporaryPage() const { return ( m_model && m_model->isTemporary() ); } + + +void +PlaylistView::onMenuTriggered( int action ) +{ + switch ( action ) + { + case ContextMenu::ActionDelete: + deleteItems(); + break; + + default: + TrackView::onMenuTriggered( action ); + break; + } +} diff --git a/src/libtomahawk/playlist/playlistview.h b/src/libtomahawk/playlist/playlistview.h index 4bc19650a..945a0d613 100644 --- a/src/libtomahawk/playlist/playlistview.h +++ b/src/libtomahawk/playlist/playlistview.h @@ -19,8 +19,6 @@ #ifndef PLAYLISTVIEW_H #define PLAYLISTVIEW_H -#include - #include "playlist/trackproxymodel.h" #include "playlist/playlistmodel.h" #include "trackview.h" @@ -62,26 +60,19 @@ protected: void keyPressEvent( QKeyEvent* event ); private slots: - void onCustomContextMenu( const QPoint& pos ); void onTrackCountChanged( unsigned int tracks ); + void onMenuTriggered( int action ); void deleteItems(); void onDeleted(); void onChanged(); -private: - void setupMenus(); +private: PlaylistModel* m_model; - QMenu m_itemMenu; QString m_customTitle; QString m_customDescripton; - - QAction* m_playItemAction; - QAction* m_addItemsToQueueAction; - QAction* m_addItemsToPlaylistAction; - QAction* m_deleteItemsAction; }; #endif // PLAYLISTVIEW_H diff --git a/src/libtomahawk/playlist/trackview.cpp b/src/libtomahawk/playlist/trackview.cpp index 3b1f4b5ed..ddd006d54 100644 --- a/src/libtomahawk/playlist/trackview.cpp +++ b/src/libtomahawk/playlist/trackview.cpp @@ -34,7 +34,6 @@ #include "trackmodel.h" #include "trackproxymodel.h" #include "track.h" -#include "globalactionmanager.h" using namespace Tomahawk; @@ -49,6 +48,7 @@ TrackView::TrackView( QWidget* parent ) , m_loadingSpinner( new LoadingSpinner( this ) ) , m_resizing( false ) , m_dragging( false ) + , m_contextMenu( new ContextMenu( this ) ) { setAlternatingRowColors( true ); setSelectionMode( QAbstractItemView::ExtendedSelection ); @@ -67,6 +67,7 @@ TrackView::TrackView( QWidget* parent ) setHeader( m_header ); setSortingEnabled( true ); sortByColumn( -1 ); + setContextMenuPolicy( Qt::CustomContextMenu ); #ifndef Q_WS_WIN QFont f = font(); @@ -79,11 +80,9 @@ TrackView::TrackView( QWidget* parent ) setFont( f ); #endif - QAction* createLinkAction = new QAction( tr( "Copy Track Link" ), this ); - connect( createLinkAction, SIGNAL( triggered( bool ) ), this, SLOT( copyLink() ) ); - addAction( createLinkAction ); - connect( this, SIGNAL( doubleClicked( QModelIndex ) ), SLOT( onItemActivated( QModelIndex ) ) ); + connect( this, SIGNAL( customContextMenuRequested( const QPoint& ) ), SLOT( onCustomContextMenu( const QPoint& ) ) ); + connect( m_contextMenu, SIGNAL( triggered( int ) ), SLOT( onMenuTriggered( int ) ) ); } @@ -200,24 +199,6 @@ TrackView::playItem() } -void -TrackView::addItemsToQueue() -{ - foreach( const QModelIndex& idx, selectedIndexes() ) - { - if ( idx.column() ) - continue; - - TrackModelItem* item = model()->itemFromIndex( proxyModel()->mapToSource( idx ) ); - if ( item && item->query()->numResults() ) - { - ViewManager::instance()->queue()->model()->append( item->query() ); - ViewManager::instance()->showQueue(); - } - } -} - - void TrackView::resizeEvent( QResizeEvent* event ) { @@ -374,17 +355,6 @@ TrackView::onFilterChanged( const QString& ) } -void -TrackView::copyLink() -{ - TrackModelItem* item = model()->itemFromIndex( proxyModel()->mapToSource( contextMenuIndex() ) ); - if ( item && !item->query().isNull() ) - { - GlobalActionManager::instance()->copyToClipboard( item->query() ); - } -} - - void TrackView::startDrag( Qt::DropActions supportedActions ) { @@ -419,3 +389,47 @@ TrackView::startDrag( Qt::DropActions supportedActions ) m_proxyModel->removeIndexes( pindexes ); } } + + +void +TrackView::onCustomContextMenu( const QPoint& pos ) +{ + QModelIndex idx = indexAt( pos ); + idx = idx.sibling( idx.row(), 0 ); + setContextMenuIndex( idx ); + + if ( !idx.isValid() ) + return; + + if ( model() && !model()->isReadOnly() ) + m_contextMenu->setSupportedActions( m_contextMenu->supportedActions() | ContextMenu::ActionDelete ); + + QList queries; + foreach ( const QModelIndex& index, selectedIndexes() ) + { + if ( index.column() ) + continue; + + TrackModelItem* item = proxyModel()->itemFromIndex( proxyModel()->mapToSource( index ) ); + if ( item && !item->query().isNull() ) + queries << item->query(); + } + + m_contextMenu->setQueries( queries ); + m_contextMenu->exec( mapToGlobal( pos ) ); +} + + +void +TrackView::onMenuTriggered( int action ) +{ + switch ( action ) + { + case ContextMenu::ActionPlay: + onItemActivated( m_contextMenuIndex ); + break; + + default: + break; + } +} diff --git a/src/libtomahawk/playlist/trackview.h b/src/libtomahawk/playlist/trackview.h index 05546442e..d2ad0de82 100644 --- a/src/libtomahawk/playlist/trackview.h +++ b/src/libtomahawk/playlist/trackview.h @@ -22,6 +22,7 @@ #include #include +#include "contextMenu.h" #include "playlistitemdelegate.h" #include "dllmacro.h" @@ -53,6 +54,7 @@ explicit TrackView( QWidget* parent = 0 ); PlaylistItemDelegate* delegate() const { return m_delegate; } TrackHeader* header() const { return m_header; } OverlayWidget* overlay() const { return m_overlay; } + Tomahawk::ContextMenu* contextMenu() const { return m_contextMenu; } QModelIndex contextMenuIndex() const { return m_contextMenuIndex; } void setContextMenuIndex( const QModelIndex& idx ) { m_contextMenuIndex = idx; } @@ -61,7 +63,7 @@ public slots: void onItemActivated( const QModelIndex& index ); void playItem(); - void addItemsToQueue(); + void onMenuTriggered( int action ); protected: virtual void resizeEvent( QResizeEvent* event ); @@ -77,10 +79,9 @@ protected: private slots: void onItemResized( const QModelIndex& index ); - void onFilterChanged( const QString& filter ); - void copyLink(); + void onCustomContextMenu( const QPoint& pos ); private: QString m_guid; @@ -96,6 +97,7 @@ private: QRect m_dropRect; QModelIndex m_contextMenuIndex; + Tomahawk::ContextMenu* m_contextMenu; }; #endif // TRACKVIEW_H diff --git a/src/libtomahawk/sourceplaylistinterface.cpp b/src/libtomahawk/sourceplaylistinterface.cpp index a3d794937..c25e53583 100644 --- a/src/libtomahawk/sourceplaylistinterface.cpp +++ b/src/libtomahawk/sourceplaylistinterface.cpp @@ -70,7 +70,7 @@ SourcePlaylistInterface::hasNextItem() { if ( m_source.isNull() || m_source->currentTrack().isNull() || m_source->currentTrack()->results().isEmpty() ) return false; - + return m_gotNextItem; } @@ -109,7 +109,7 @@ SourcePlaylistInterface::resolveResultsAdded( const QList& qDebug() << Q_FUNC_INFO; foreach ( Tomahawk::result_ptr ptr, results ) { - qDebug() << "Found result: " << ptr->track(); +// qDebug() << "Found result:" << ptr->track(); } }