mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-09-16 00:42:15 +02:00
Compare commits
12 Commits
linkparser
...
scriptolle
Author | SHA1 | Date | |
---|---|---|---|
|
27924c81fd | ||
|
c93302c563 | ||
|
1192c668b0 | ||
|
53b27d0ea1 | ||
|
9ebe155313 | ||
|
ddf030037e | ||
|
5d950bd139 | ||
|
eab1ccee74 | ||
|
1025e77d3e | ||
|
53de4319b6 | ||
|
4eee01d8bf | ||
|
5bd69fe09c |
@@ -307,11 +307,10 @@ else()
|
||||
message(STATUS "${CMAKE_CXX_COMPILER} does not support C++11, please use a
|
||||
different compiler")
|
||||
endif()
|
||||
if(LIBCPP_FOUND AND APPLE)
|
||||
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR APPLE) AND LIBCPP_FOUND)
|
||||
tomahawk_add_cxx_flags( "-stdlib=libc++" )
|
||||
endif()
|
||||
|
||||
|
||||
macro_optional_find_package(Echonest 2.3.0)
|
||||
macro_log_feature(ECHONEST_FOUND "Echonest" "Qt library for communicating with The Echo Nest" "http://projects.kde.org/libechonest" TRUE "" "libechonest 2.3.0 is needed for dynamic playlists and the infosystem")
|
||||
|
||||
|
@@ -636,7 +636,7 @@ Pipeline::checkQIDState( const Tomahawk::query_ptr& query )
|
||||
Q_D( Pipeline );
|
||||
QMutexLocker lock( &d->mut );
|
||||
|
||||
tDebug() << Q_FUNC_INFO << " " << query->id() << " " << d->qidsState.count( query->id() );
|
||||
tDebug() << Q_FUNC_INFO << query->id() << d->qidsState.count( query->id() );
|
||||
|
||||
if ( d->qidsState.contains( query->id() ) )
|
||||
{
|
||||
|
@@ -119,8 +119,9 @@ int
|
||||
PlayableModel::columnCount( const QModelIndex& parent ) const
|
||||
{
|
||||
Q_UNUSED( parent );
|
||||
Q_D( const PlayableModel );
|
||||
|
||||
return 13;
|
||||
return d->header.length();
|
||||
}
|
||||
|
||||
|
||||
@@ -444,14 +445,21 @@ PlayableModel::flags( const QModelIndex& index ) const
|
||||
|
||||
if ( index.isValid() )
|
||||
{
|
||||
Qt::ItemFlags returnFlags = defaultFlags;
|
||||
if ( index.column() == 0 )
|
||||
{
|
||||
return Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | defaultFlags;
|
||||
returnFlags |= Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
|
||||
}
|
||||
else if ( index.column() == PlayableModel::Download )
|
||||
{
|
||||
return Qt::ItemIsEditable | defaultFlags;
|
||||
returnFlags |= Qt::ItemIsEditable | defaultFlags;
|
||||
}
|
||||
|
||||
if ( areAllColumnsEditable() ) {
|
||||
returnFlags |= Qt::ItemIsEditable;
|
||||
}
|
||||
|
||||
return returnFlags;
|
||||
}
|
||||
|
||||
return Qt::ItemIsDropEnabled | defaultFlags;
|
||||
@@ -1171,6 +1179,22 @@ PlayableModel::setIcon( const QPixmap& pixmap )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlayableModel::setAllColumnsEditable( bool editable )
|
||||
{
|
||||
Q_D( PlayableModel );
|
||||
d->areAllColumnsEditable = editable;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
PlayableModel::areAllColumnsEditable() const
|
||||
{
|
||||
Q_D( const PlayableModel );
|
||||
return d->areAllColumnsEditable;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
PlayableModel::trackCount() const
|
||||
{
|
||||
|
@@ -96,6 +96,11 @@ public:
|
||||
virtual QPixmap icon() const;
|
||||
virtual void setIcon( const QPixmap& pixmap );
|
||||
|
||||
|
||||
// HACK: we need to set column 0 editable for DropDownButton in TrackView
|
||||
void setAllColumnsEditable( bool editable );
|
||||
bool areAllColumnsEditable() const;
|
||||
|
||||
virtual int trackCount() const;
|
||||
virtual int itemCount() const;
|
||||
|
||||
|
@@ -38,6 +38,7 @@ public:
|
||||
, rootItem( new PlayableItem( 0 ) )
|
||||
, readOnly( true )
|
||||
, loading( _loading )
|
||||
, areAllColumnsEditable( false )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -58,6 +59,7 @@ private:
|
||||
QStringList header;
|
||||
|
||||
bool loading;
|
||||
bool areAllColumnsEditable;
|
||||
};
|
||||
|
||||
#endif // PLAYABLEMODEL_P_H
|
||||
|
@@ -607,25 +607,7 @@ PlayableProxyModel::columnCount( const QModelIndex& parent ) const
|
||||
{
|
||||
Q_UNUSED( parent );
|
||||
|
||||
switch ( m_style )
|
||||
{
|
||||
case SingleColumn:
|
||||
return 1;
|
||||
break;
|
||||
|
||||
case Collection:
|
||||
return 10;
|
||||
break;
|
||||
|
||||
case Locker:
|
||||
return 11;
|
||||
break;
|
||||
|
||||
case Detailed:
|
||||
default:
|
||||
return 12;
|
||||
break;
|
||||
}
|
||||
return m_headerStyle[ m_style ].length();
|
||||
}
|
||||
|
||||
|
||||
@@ -733,6 +715,13 @@ PlayableProxyModel::setFilter( const QString& pattern )
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
PlayableProxyModel::mapSourceColumnToColumn( PlayableModel::Columns column )
|
||||
{
|
||||
return m_headerStyle[ m_style ].indexOf( column );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlayableProxyModel::setCurrentIndex( const QModelIndex& index )
|
||||
{
|
||||
|
@@ -98,6 +98,8 @@ public:
|
||||
virtual void setFilter( const QString& pattern );
|
||||
virtual void updateDetailedInfo( const QModelIndex& index );
|
||||
|
||||
int mapSourceColumnToColumn( PlayableModel::Columns column );
|
||||
|
||||
signals:
|
||||
void filterChanged( const QString& filter );
|
||||
|
||||
|
@@ -885,7 +885,9 @@ PlaylistItemDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, con
|
||||
}
|
||||
else if ( m_view->proxyModel()->style() == PlayableProxyModel::Locker && index.column() == PlayableModel::Download )
|
||||
{
|
||||
m_model->sourceModel()->setAllColumnsEditable( true );
|
||||
m_view->edit( index );
|
||||
m_model->sourceModel()->setAllColumnsEditable( false );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -45,6 +45,9 @@
|
||||
#include <QScrollBar>
|
||||
#include <QDrag>
|
||||
|
||||
// HACK
|
||||
#include <QTableView>
|
||||
|
||||
#define SCROLL_TIMEOUT 280
|
||||
|
||||
using namespace Tomahawk;
|
||||
@@ -83,6 +86,13 @@ TrackView::TrackView( QWidget* parent )
|
||||
setEditTriggers( NoEditTriggers );
|
||||
|
||||
setHeader( m_header );
|
||||
|
||||
// HACK: enable moving of first column: QTBUG-33974 / https://github.com/qtproject/qtbase/commit/e0fc088c0c8bc61dbcaf5928b24986cd61a22777
|
||||
QTableView unused;
|
||||
unused.setVerticalHeader( header() );
|
||||
header()->setParent( this );
|
||||
unused.setVerticalHeader( new QHeaderView( Qt::Horizontal, &unused ) );
|
||||
|
||||
setSortingEnabled( true );
|
||||
sortByColumn( -1 );
|
||||
setContextMenuPolicy( Qt::CustomContextMenu );
|
||||
|
@@ -28,6 +28,8 @@
|
||||
#include "utils/Logger.h"
|
||||
#include "../Result.h"
|
||||
|
||||
#include <QtConcurrentRun>
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
ScriptCommand_AllTracks::ScriptCommand_AllTracks( const Tomahawk::collection_ptr& collection,
|
||||
@@ -117,20 +119,22 @@ ScriptCommand_AllTracks::onTracksJobDone( const QVariantMap& result )
|
||||
QSharedPointer< ScriptCollection > collection = m_collection.objectCast< ScriptCollection >();
|
||||
Q_ASSERT( !collection.isNull() );
|
||||
|
||||
QList< Tomahawk::result_ptr > t = collection->scriptAccount()->parseResultVariantList( result[ "tracks" ].toList() );
|
||||
|
||||
|
||||
QList< Tomahawk::query_ptr > queries;
|
||||
foreach ( const Tomahawk::result_ptr& result, t )
|
||||
QtConcurrent::run( [] ( ScriptCommand_AllTracks* t, ScriptJob* job, const QVariantMap& result, const QSharedPointer< ScriptCollection >& collection )
|
||||
{
|
||||
result->setResolvedByCollection( m_collection );
|
||||
queries.append( result->toQuery() );
|
||||
}
|
||||
QList< Tomahawk::result_ptr > results = collection->scriptAccount()->parseResultVariantList( result[ "tracks" ].toList() );
|
||||
|
||||
tDebug() << Q_FUNC_INFO << "about to push" << queries.count() << "tracks";
|
||||
QList< Tomahawk::query_ptr > queries;
|
||||
foreach ( const Tomahawk::result_ptr& result, results )
|
||||
{
|
||||
result->setResolvedByCollection( collection );
|
||||
queries.append( result->toQuery() );
|
||||
}
|
||||
|
||||
emit tracks( queries );
|
||||
emit done();
|
||||
tDebug() << Q_FUNC_INFO << "about to push" << queries.count() << "tracks";
|
||||
|
||||
job->deleteLater();
|
||||
emit t->tracks( queries );
|
||||
emit t->done();
|
||||
|
||||
job->deleteLater();
|
||||
}, this, job, result, collection );
|
||||
}
|
||||
|
@@ -121,7 +121,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
|
||||
ui->biography->setObjectName( "biography" );
|
||||
ui->biography->setContentsMargins( 0, 0, 0, 0 );
|
||||
ui->biography->page()->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
|
||||
ui->biography->page()->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
|
||||
ui->biography->page()->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAsNeeded );
|
||||
ui->biography->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
|
||||
ui->biography->installEventFilter( this );
|
||||
|
||||
|
@@ -62,6 +62,8 @@ CollectionViewPage::CollectionViewPage( const Tomahawk::collection_ptr& collecti
|
||||
|
||||
m_columnView->proxyModel()->setStyle( PlayableProxyModel::SingleColumn );
|
||||
|
||||
|
||||
PlayableProxyModel* trackViewProxyModel = m_trackView->proxyModel();
|
||||
if ( collection->backendType() == Collection::ScriptCollectionType )
|
||||
{
|
||||
m_trackView->proxyModel()->setStyle( PlayableProxyModel::Locker );
|
||||
@@ -70,6 +72,12 @@ CollectionViewPage::CollectionViewPage( const Tomahawk::collection_ptr& collecti
|
||||
{
|
||||
m_trackView->proxyModel()->setStyle( PlayableProxyModel::Collection );
|
||||
}
|
||||
// mapSourceColumnToColumn depends on the just set PlayableProxyModel::PlayableItemStyle
|
||||
m_trackView->setColumnHidden( trackViewProxyModel->mapSourceColumnToColumn( PlayableModel::Composer ), true );
|
||||
m_trackView->setColumnHidden( trackViewProxyModel->mapSourceColumnToColumn( PlayableModel::Origin ), true );
|
||||
m_trackView->setColumnHidden( trackViewProxyModel->mapSourceColumnToColumn( PlayableModel::Score ), true );
|
||||
m_trackView->setColumnHidden( trackViewProxyModel->mapSourceColumnToColumn( PlayableModel::Bitrate ), true );
|
||||
|
||||
|
||||
m_trackView->setGuid( QString( "trackview/flat" ) );
|
||||
|
||||
|
@@ -85,7 +85,7 @@ ImageButton::paintEvent( QPaintEvent* event )
|
||||
p.setClipRect( event->rect() );
|
||||
|
||||
QIcon::Mode mode = isDown()
|
||||
? QIcon::Active
|
||||
? QIcon::Selected
|
||||
: QIcon::Normal;
|
||||
|
||||
QIcon::State state = isChecked()
|
||||
|
Reference in New Issue
Block a user