Changeset View
Changeset View
Standalone View
Standalone View
src/browsers/CollectionTreeItemModelBase.cpp
Show All 28 Lines | |||||
29 | #include "core/collections/QueryMaker.h" | 29 | #include "core/collections/QueryMaker.h" | ||
30 | #include "core/meta/TrackEditor.h" | 30 | #include "core/meta/TrackEditor.h" | ||
31 | #include "core/meta/support/MetaConstants.h" | 31 | #include "core/meta/support/MetaConstants.h" | ||
32 | #include "core/support/Amarok.h" | 32 | #include "core/support/Amarok.h" | ||
33 | #include "core/support/Debug.h" | 33 | #include "core/support/Debug.h" | ||
34 | #include "core-impl/collections/support/TextualQueryFilter.h" | 34 | #include "core-impl/collections/support/TextualQueryFilter.h" | ||
35 | #include "widgets/PrettyTreeRoles.h" | 35 | #include "widgets/PrettyTreeRoles.h" | ||
36 | 36 | | |||
37 | #include <KGlobalSettings> | 37 | #include <KLocalizedString> | ||
38 | #include <QIcon> | | |||
39 | #include <KIconLoader> | | |||
40 | #include <KLocale> | | |||
41 | #include <KStandardDirs> | | |||
42 | 38 | | |||
43 | #include <QApplication> | 39 | #include <QApplication> | ||
44 | #include <QStyle> | 40 | #include <QIcon> | ||
45 | #include <QPixmap> | 41 | #include <QPixmap> | ||
42 | #include <QStandardPaths> | ||||
43 | #include <QStyle> | ||||
46 | #include <QTimeLine> | 44 | #include <QTimeLine> | ||
47 | #include <QTimer> | 45 | #include <QTimer> | ||
48 | 46 | | |||
49 | using namespace Meta; | 47 | using namespace Meta; | ||
50 | 48 | | |||
51 | 49 | | |||
52 | inline uint qHash( const Meta::DataPtr &data ) | 50 | inline uint qHash( const Meta::DataPtr &data ) | ||
53 | { | 51 | { | ||
54 | return qHash( data.data() ); | 52 | return qHash( data.data() ); | ||
55 | } | 53 | } | ||
56 | 54 | | |||
57 | /** | 55 | /** | ||
58 | * This set determines which collection browser levels should have shown Various Artists | 56 | * This set determines which collection browser levels should have shown Various Artists | ||
59 | * item under them. AlbumArtist is certain, (Track)Artist is questionable. | 57 | * item under them. AlbumArtist is certain, (Track)Artist is questionable. | ||
60 | */ | 58 | */ | ||
61 | static const QSet<CategoryId::CatMenuId> variousArtistCategories = | 59 | static const QSet<CategoryId::CatMenuId> variousArtistCategories = | ||
62 | QSet<CategoryId::CatMenuId>() << CategoryId::AlbumArtist; | 60 | QSet<CategoryId::CatMenuId>() << CategoryId::AlbumArtist; | ||
63 | 61 | | |||
64 | CollectionTreeItemModelBase::CollectionTreeItemModelBase( ) | 62 | CollectionTreeItemModelBase::CollectionTreeItemModelBase( ) | ||
65 | : QAbstractItemModel() | 63 | : QAbstractItemModel() | ||
66 | , m_rootItem( 0 ) | 64 | , m_rootItem( 0 ) | ||
67 | , m_animFrame( 0 ) | 65 | , m_animFrame( 0 ) | ||
68 | , m_loading1( QPixmap( KStandardDirs::locate("data", "amarok/images/loading1.png" ) ) ) | 66 | , m_loading1( QPixmap( QStandardPaths::locate( QStandardPaths::GenericDataLocation, "amarok/images/loading1.png" ) ) ) | ||
69 | , m_loading2( QPixmap( KStandardDirs::locate("data", "amarok/images/loading2.png" ) ) ) | 67 | , m_loading2( QPixmap( QStandardPaths::locate( QStandardPaths::GenericDataLocation, "amarok/images/loading2.png" ) ) ) | ||
70 | , m_currentAnimPixmap( m_loading1 ) | 68 | , m_currentAnimPixmap( m_loading1 ) | ||
71 | , m_autoExpand( false ) | 69 | , m_autoExpand( false ) | ||
72 | { | 70 | { | ||
73 | m_timeLine = new QTimeLine( 10000, this ); | 71 | m_timeLine = new QTimeLine( 10000, this ); | ||
74 | m_timeLine->setFrameRange( 0, 20 ); | 72 | m_timeLine->setFrameRange( 0, 20 ); | ||
75 | m_timeLine->setLoopCount ( 0 ); | 73 | m_timeLine->setLoopCount ( 0 ); | ||
76 | connect( m_timeLine, &QTimeLine::frameChanged, this, &CollectionTreeItemModelBase::loadingAnimationTick ); | 74 | connect( m_timeLine, &QTimeLine::frameChanged, this, &CollectionTreeItemModelBase::loadingAnimationTick ); | ||
77 | } | 75 | } | ||
▲ Show 20 Lines • Show All 496 Lines • ▼ Show 20 Line(s) | 569 | { | |||
574 | 572 | | |||
575 | m_levelType = levelType; | 573 | m_levelType = levelType; | ||
576 | updateHeaderText(); | 574 | updateHeaderText(); | ||
577 | m_expandedItems.clear(); | 575 | m_expandedItems.clear(); | ||
578 | m_expandedSpecialNodes.clear(); | 576 | m_expandedSpecialNodes.clear(); | ||
579 | m_runningQueries.clear(); | 577 | m_runningQueries.clear(); | ||
580 | m_childQueries.clear(); | 578 | m_childQueries.clear(); | ||
581 | m_compilationQueries.clear(); | 579 | m_compilationQueries.clear(); | ||
582 | #pragma message("KF5Port: 1 line here") | 580 | filterChildren(); | ||
583 | //filterChildren(); | | |||
584 | } | 581 | } | ||
585 | 582 | | |||
586 | Collections::QueryMaker::QueryType | 583 | Collections::QueryMaker::QueryType | ||
587 | CollectionTreeItemModelBase::mapCategoryToQueryType( int levelType ) const | 584 | CollectionTreeItemModelBase::mapCategoryToQueryType( int levelType ) const | ||
588 | { | 585 | { | ||
589 | Collections::QueryMaker::QueryType type; | 586 | Collections::QueryMaker::QueryType type; | ||
590 | switch( levelType ) | 587 | switch( levelType ) | ||
591 | { | 588 | { | ||
▲ Show 20 Lines • Show All 626 Lines • Show Last 20 Lines |