mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Install drag handler on osx for playlist infobar as well
This commit is contained in:
@@ -177,27 +177,31 @@ CollectionFlatModel::onTracksAdded( const QList<Tomahawk::query_ptr>& tracks )
|
|||||||
void
|
void
|
||||||
CollectionFlatModel::processTracksToAdd()
|
CollectionFlatModel::processTracksToAdd()
|
||||||
{
|
{
|
||||||
int chunkSize = 5000;
|
int chunkSize = 500000;
|
||||||
int maxc = qMin( chunkSize, m_tracksToAdd.count() );
|
int maxc = qMin( chunkSize, m_tracksToAdd.count() );
|
||||||
int c = rowCount( QModelIndex() );
|
int c = rowCount( QModelIndex() );
|
||||||
|
|
||||||
emit beginInsertRows( QModelIndex(), c, c + maxc - 1 );
|
//emit beginInsertRows( QModelIndex(), c, c + maxc - 1 );
|
||||||
|
beginResetModel();
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
PlItem* plitem;
|
PlItem* plitem;
|
||||||
foreach( const query_ptr& query, m_tracksToAdd )
|
QList< Tomahawk::query_ptr >::iterator iter = m_tracksToAdd.begin();
|
||||||
|
|
||||||
|
for( int i = 0; i < maxc; ++i )
|
||||||
{
|
{
|
||||||
plitem = new PlItem( query, m_rootItem );
|
|
||||||
|
plitem = new PlItem( *iter, m_rootItem );
|
||||||
plitem->index = createIndex( m_rootItem->children.count() - 1, 0, plitem );
|
plitem->index = createIndex( m_rootItem->children.count() - 1, 0, plitem );
|
||||||
|
|
||||||
connect( plitem, SIGNAL( dataChanged() ), SLOT( onDataChanged() ) );
|
connect( plitem, SIGNAL( dataChanged() ), SLOT( onDataChanged() ) );
|
||||||
|
|
||||||
m_tracksToAdd.removeFirst();
|
++iter;
|
||||||
if ( ++i % chunkSize == 0 )
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
emit endInsertRows();
|
m_tracksToAdd.erase( m_tracksToAdd.begin(), iter );
|
||||||
|
|
||||||
|
endResetModel();
|
||||||
|
//emit endInsertRows();
|
||||||
qDebug() << Q_FUNC_INFO << rowCount( QModelIndex() );
|
qDebug() << Q_FUNC_INFO << rowCount( QModelIndex() );
|
||||||
|
|
||||||
if ( m_tracksToAdd.count() )
|
if ( m_tracksToAdd.count() )
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
#include "albummodel.h"
|
#include "albummodel.h"
|
||||||
#include "sourcelist.h"
|
#include "sourcelist.h"
|
||||||
#include "tomahawksettings.h"
|
#include "tomahawksettings.h"
|
||||||
|
#include "utils/widgetdragfilter.h"
|
||||||
|
|
||||||
#include "dynamic/widgets/DynamicWidget.h"
|
#include "dynamic/widgets/DynamicWidget.h"
|
||||||
|
|
||||||
@@ -57,6 +58,8 @@ PlaylistManager::PlaylistManager( QObject* parent )
|
|||||||
m_infobar = new InfoBar();
|
m_infobar = new InfoBar();
|
||||||
m_stack = new QStackedWidget();
|
m_stack = new QStackedWidget();
|
||||||
|
|
||||||
|
m_infobar->installEventFilter( new WidgetDragFilter( m_infobar ) );
|
||||||
|
|
||||||
QFrame* line = new QFrame();
|
QFrame* line = new QFrame();
|
||||||
line->setFrameStyle( QFrame::HLine );
|
line->setFrameStyle( QFrame::HLine );
|
||||||
line->setStyleSheet( "border: 1px solid gray;" );
|
line->setStyleSheet( "border: 1px solid gray;" );
|
||||||
|
Reference in New Issue
Block a user