Hello community, here is the log from the commit of package amarok for openSUSE:Factory checked in at 2013-09-11 11:00:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/amarok (Old) and /work/SRC/openSUSE:Factory/.amarok.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "amarok" Changes: -------- --- /work/SRC/openSUSE:Factory/amarok/amarok.changes 2013-08-22 13:10:59.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.amarok.new/amarok.changes 2013-09-11 11:00:54.000000000 +0200 @@ -1,0 +2,14 @@ +Mon Sep 9 19:23:13 UTC 2013 - [email protected] + +- Added patches from upstream: + 0002-Don-t-allow-adding-Analyzer-applet-when-not-supporte.patch, + 0003-Optimization-Don-t-draw-more-than-necessary.patch, + 0004-Fix-reading-Album-Artist-Compilation-Disc-Number-in-.patch, + 0005-Sync-playlist-search-config-instantly.patch, + 0006-Don-t-suppress-html-tag-like-characters.patch and + 0007-Fix-performance-issue-with-large-podcast-feeds.patch + which resolve kde#323735, kde#324295, kde#324614, kde#283022 and + kde#323119 +- Renamed Don-t-add-the-analyzer-applet-when-Phonon-doesn-t-su.patch + +------------------------------------------------------------------- Old: ---- Don-t-add-the-analyzer-applet-when-Phonon-doesn-t-su.patch New: ---- 0001-Don-t-add-the-analyzer-applet-when-Phonon-doesn-t-su.patch 0002-Don-t-allow-adding-Analyzer-applet-when-not-supporte.patch 0003-Optimization-Don-t-draw-more-than-necessary.patch 0004-Fix-reading-Album-Artist-Compilation-Disc-Number-in-.patch 0005-Sync-playlist-search-config-instantly.patch 0006-Don-t-suppress-html-tag-like-characters.patch 0007-Fix-performance-issue-with-large-podcast-feeds.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ amarok.spec ++++++ --- /var/tmp/diff_new_pack.wZJADa/_old 2013-09-11 11:00:55.000000000 +0200 +++ /var/tmp/diff_new_pack.wZJADa/_new 2013-09-11 11:00:55.000000000 +0200 @@ -32,8 +32,21 @@ Patch2: flac_mimetype_bnc671581.diff # PATCH-FIX-UPSTREAM revert_solid_workaround.diff Patch3: revert_solid_workaround.diff -# PATCH-FIX-UPSTREAM Don-t-add-the-analyzer-applet-when-Phonon-doesn-t-su.patch -- avoids adding the analyzer applet on phonon backends that don't support it (e.g. vlc) -Patch100: Don-t-add-the-analyzer-applet-when-Phonon-doesn-t-su.patch +# PATCH-FIX-UPSTREAM 0001-Don-t-add-the-analyzer-applet-when-Phonon-doesn-t-su.patch -- avoids adding the analyzer applet on phonon backends that don't support it (e.g. vlc) +Patch100: 0001-Don-t-add-the-analyzer-applet-when-Phonon-doesn-t-su.patch +# PATCH-FIX-UPSTREAM 0002-Don-t-allow-adding-Analyzer-applet-when-not-supporte.patch -- Don't allow adding Analyzer applet when not supported. +# Also now shows an error message explaining why it can't be used. +Patch101: 0002-Don-t-allow-adding-Analyzer-applet-when-not-supporte.patch +# PATCH-FIX-UPSTREAM 0003-Optimization-Don-t-draw-more-than-necessary.patch -- optimization for Analyzer applet +Patch102: 0003-Optimization-Don-t-draw-more-than-necessary.patch +# PATCH-FIX-UPSTREAM 0004-Fix-reading-Album-Artist-Compilation-Disc-Number-in-.patch -- fixes reading APE tags (kde#323735) +Patch103: 0004-Fix-reading-Album-Artist-Compilation-Disc-Number-in-.patch +# PATCH-FIX-UPSTREAM 0005-Sync-playlist-search-config-instantly.patch -- kde#324295 +Patch104: 0005-Sync-playlist-search-config-instantly.patch +# PATCH-FIX-UPSTREAM 0006-Don-t-suppress-html-tag-like-characters.patch -- kde#324614 +Patch105: 0006-Don-t-suppress-html-tag-like-characters.patch +# PATCH-FIX-UPSTREAM 0007-Fix-performance-issue-with-large-podcast-feeds.patch -- kde#283022 +Patch106: 0007-Fix-performance-issue-with-large-podcast-feeds.patch # Required for the fdupes macro BuildRequires: fdupes BuildRequires: gdk-pixbuf-devel @@ -88,6 +101,12 @@ %patch2 %patch3 -p1 %patch100 -p1 +%patch101 -p1 +%patch102 -p1 +%patch103 -p1 +%patch104 -p1 +%patch105 -p1 +%patch106 -p1 # Remove build time references so build-compare can do its work FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y') ++++++ 0001-Don-t-add-the-analyzer-applet-when-Phonon-doesn-t-su.patch ++++++ >From e631534993c03244a36ed013c186ad8bf83ca1fd Mon Sep 17 00:00:00 2001 From: Mark Kretschmann <[email protected]> Date: Sun, 18 Aug 2013 12:22:35 +0200 Subject: [PATCH 02/10] Don't add the analyzer applet when Phonon doesn't support it. Stupid... I forgot about that file. BUG: 323632 BACKPORT --- data/amarok_homerc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/amarok_homerc b/data/amarok_homerc index d2da7ed..4a5aa4b 100644 --- a/data/amarok_homerc +++ b/data/amarok_homerc @@ -1,3 +1,3 @@ [Containment 0] firstShowingApplet=0 -plugins=currenttrack,analyzer,wikipedia,lyrics +plugins=currenttrack,wikipedia,lyrics -- 1.8.3.4 ++++++ 0002-Don-t-allow-adding-Analyzer-applet-when-not-supporte.patch ++++++ >From 2b87fb43c550e946acfb47b3c5b217a07fcefa0c Mon Sep 17 00:00:00 2001 From: Mark Kretschmann <[email protected]> Date: Thu, 22 Aug 2013 16:47:30 +0200 Subject: [PATCH 1/1] Don't allow adding Analyzer applet when not supported. Also now shows an error message explaining why it can't be used. BUG: 323119 --- src/EngineController.cpp | 7 +++++++ src/EngineController.h | 5 +++++ src/context/Containment.h | 2 +- src/context/ContextView.cpp | 21 ++------------------- src/context/ContextView.h | 5 ----- .../verticallayout/VerticalToolbarContainment.cpp | 17 +++++++++++++---- .../verticallayout/VerticalToolbarContainment.h | 4 ++-- 7 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/EngineController.cpp b/src/EngineController.cpp index 99adb53..82ca86b 100644 --- a/src/EngineController.cpp +++ b/src/EngineController.cpp @@ -926,6 +926,13 @@ bool EngineController::supportsGainAdjustments() const return m_preamp; } +bool EngineController::supportsAudioDataOutput() const +{ + const Phonon::AudioDataOutput out; + return out.isValid(); +} + + ////////////////////////////////////////////////////////////////////////////////////////// // PRIVATE SLOTS ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/EngineController.h b/src/EngineController.h index c4fae9a..8735a71 100644 --- a/src/EngineController.h +++ b/src/EngineController.h @@ -313,6 +313,11 @@ public slots: */ bool supportsGainAdjustments() const; + /** + * Return true if the current Phonon backend supports visualizations. + */ + bool supportsAudioDataOutput() const; + Q_SIGNALS: /** * Emitted when the playback stops while playing a track. diff --git a/src/context/Containment.h b/src/context/Containment.h index a0f5d7c..9b54b75 100644 --- a/src/context/Containment.h +++ b/src/context/Containment.h @@ -51,7 +51,7 @@ public: public slots: void showApplet( Plasma::Applet* ) {} void moveApplet( Plasma::Applet*, int, int ) {} - virtual Applet* addApplet( const QString& pluginName, const int ) { Q_UNUSED( pluginName ); return 0; } + virtual void addApplet( const QString& pluginName, const int ) = 0; }; } // Context namespace diff --git a/src/context/ContextView.cpp b/src/context/ContextView.cpp index e7eeb49..ce28d8d 100644 --- a/src/context/ContextView.cpp +++ b/src/context/ContextView.cpp @@ -36,6 +36,7 @@ #include "core/support/Amarok.h" #include "core/support/Debug.h" #include "core/meta/Meta.h" +#include "EngineController.h" #include <plasma/dataenginemanager.h> @@ -221,12 +222,8 @@ ContextView::loadConfig() const bool firstTimeWithAnalyzer = Amarok::config( "Context View" ).readEntry( "firstTimeWithAnalyzer", true ); if( firstTimeWithAnalyzer ) { - // Check if the Phonon backend implements all features required by the analyzer - Phonon::AudioDataOutput out; - const bool phononCanHandleAnalyzer = out.isValid(); - QStringList plugins = cg.readEntry( "plugins", QStringList() ); - if( phononCanHandleAnalyzer && !plugins.contains( "analyzer" ) ) + if( EngineController::instance()->supportsAudioDataOutput() && !plugins.contains( "analyzer" ) ) { Amarok::config( "Context View" ).writeEntry( "firstTimeWithAnalyzer", false ); @@ -244,20 +241,6 @@ ContextView::loadConfig() PERF_LOG( "Done loading config" ); } -Plasma::Applet* -ContextView::addApplet( const QString& name, const QStringList& args ) -{ - QVariantList argList; - QStringListIterator i(args); - while( i.hasNext() ) - argList << QVariant( i.next() ); - - if( !containment() ) - contextScene()->addContainment( "amarok_containment_vertical" ); - - return containment()->addApplet( name, argList ); -} - void ContextView::addCollapseAnimation( QAbstractAnimation *anim ) { diff --git a/src/context/ContextView.h b/src/context/ContextView.h index 1593f20..0cd5236 100644 --- a/src/context/ContextView.h +++ b/src/context/ContextView.h @@ -98,11 +98,6 @@ public: public slots: /** - * Add the applet with the given plugin name to the context view. Will add in default position, which is at - * the end of the applet list. - */ - Plasma::Applet* addApplet(const QString& name, const QStringList& args = QStringList()); - /** * Convenience methods to show and hide the applet explorer. */ void hideAppletExplorer(); diff --git a/src/context/containments/verticallayout/VerticalToolbarContainment.cpp b/src/context/containments/verticallayout/VerticalToolbarContainment.cpp index 783d3db..3a9fdc8 100644 --- a/src/context/containments/verticallayout/VerticalToolbarContainment.cpp +++ b/src/context/containments/verticallayout/VerticalToolbarContainment.cpp @@ -19,7 +19,10 @@ #include "VerticalToolbarContainment.h" #include "ContextView.h" +#include "core/interfaces/Logger.h" +#include "core/support/Components.h" #include "core/support/Debug.h" +#include "EngineController.h" #include "PaletteHandler.h" #include "VerticalAppletLayout.h" @@ -136,19 +139,25 @@ Context::VerticalToolbarContainment::updateGeometry() m_applets->refresh(); } -Plasma::Applet* +void Context::VerticalToolbarContainment::addApplet( const QString& pluginName, const int loc ) // SLOT { DEBUG_BLOCK + if( pluginName == "analyzer" && !EngineController::instance()->supportsAudioDataOutput() ) + { + Amarok::Components::logger()->longMessage( i18n( "Error: Visualizations are not supported by your current Phonon backend." ), + Amarok::Logger::Error ) ; + + return; + } + Plasma::Applet* applet = Plasma::Containment::addApplet( pluginName ); Q_ASSERT_X( applet, "addApplet", "FAILED ADDING APPLET TO CONTAINMENT!! NOT FOUND!!" ); m_applets->addApplet( applet, loc ); - applet->setFlag(QGraphicsItem::ItemIsMovable, false); - - return applet; + applet->setFlag( QGraphicsItem::ItemIsMovable, false ); } void diff --git a/src/context/containments/verticallayout/VerticalToolbarContainment.h b/src/context/containments/verticallayout/VerticalToolbarContainment.h index 31f7632..6c933ab 100644 --- a/src/context/containments/verticallayout/VerticalToolbarContainment.h +++ b/src/context/containments/verticallayout/VerticalToolbarContainment.h @@ -48,8 +48,8 @@ class VerticalToolbarContainment : public Containment virtual ContextView *view(); public slots: - Applet* addApplet( const QString& pluginName, const int ); - void appletRemoved( Plasma::Applet* ); + void addApplet( const QString& pluginName, const int ); + void appletRemoved( Plasma::Applet* ); // these slots below are forwarded to the layout void showApplet( Plasma::Applet* ); void moveApplet( Plasma::Applet*, int, int ); -- 1.8.4 ++++++ 0003-Optimization-Don-t-draw-more-than-necessary.patch ++++++ >From 7096e0bae44605b50f3c435308aeb380845c54e8 Mon Sep 17 00:00:00 2001 From: Mark Kretschmann <[email protected]> Date: Mon, 26 Aug 2013 13:27:01 +0200 Subject: [PATCH 1/1] Optimization: Don't draw more than necessary. (cherry picked from commit 8d6e72597fdfd3023ac5287ea19d8b8b3747e5ed) --- src/context/applets/analyzer/BlockAnalyzer.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/context/applets/analyzer/BlockAnalyzer.cpp b/src/context/applets/analyzer/BlockAnalyzer.cpp index 62131ba..e1a0b9b 100644 --- a/src/context/applets/analyzer/BlockAnalyzer.cpp +++ b/src/context/applets/analyzer/BlockAnalyzer.cpp @@ -35,10 +35,7 @@ BlockAnalyzer::BlockAnalyzer( QWidget *parent ) , m_columns( 0 ) //uint , m_rows( 0 ) //uint , m_y( 0 ) //uint - , m_barPixmap( 1, 1 ) //null qpixmaps cause crashes , m_topBarPixmap( BLOCK_WIDTH, BLOCK_HEIGHT ) - , m_scope( MIN_COLUMNS ) //Scope - , m_store( MAX_COLUMNS, 0 ) //vector<uint> , m_fade_bars( FADE_SIZE ) //vector<QPixmap> , m_fade_pos( MAX_COLUMNS, 50 ) //vector<uint> , m_fade_intensity( MAX_COLUMNS, 32 ) //vector<uint> @@ -68,6 +65,7 @@ BlockAnalyzer::resizeEvent( QResizeEvent *e ) m_y = ( height() - ( m_rows * ( BLOCK_HEIGHT + 1 ) ) + 2 ) / 2; m_scope.resize( m_columns ); + m_store.resize( m_columns ); if( m_rows != oldRows ) { @@ -180,10 +178,10 @@ BlockAnalyzer::paintEvent( QPaintEvent* ) // REMEMBER: y is a number from 0 to m_rows, 0 means all blocks are glowing, m_rows means none are p.drawPixmap( x * ( BLOCK_WIDTH + 1 ), y * ( BLOCK_HEIGHT + 1 ) + m_y, *bar(), 0, y * ( BLOCK_HEIGHT + 1 ), -1, -1 ); - } - for( int x = 0; x < m_store.size(); ++x ) + // Draw top pixmaps p.drawPixmap( x * ( BLOCK_WIDTH + 1 ), int( m_store[x] ) * ( BLOCK_HEIGHT + 1 ) + m_y, m_topBarPixmap ); + } } void -- 1.8.4 ++++++ 0004-Fix-reading-Album-Artist-Compilation-Disc-Number-in-.patch ++++++ >From df6d5c3ded956787797c90cc9ecec8b009b1b096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20L=C3=A9on?= <[email protected]> Date: Fri, 30 Aug 2013 18:29:49 +0200 Subject: [PATCH 1/1] Fix reading Album Artist / Compilation / Disc Number in APE tags. Fix reading of Album Artist and Compilation tag in APE tags. Add support for reading Disc Number in APE tags. REVIEW: 112266 BUG: 323735 --- ChangeLog | 2 ++ shared/tag_helpers/APETagHelper.cpp | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/shared/tag_helpers/APETagHelper.cpp b/shared/tag_helpers/APETagHelper.cpp index c628694..ba39a10 100644 --- a/shared/tag_helpers/APETagHelper.cpp +++ b/shared/tag_helpers/APETagHelper.cpp @@ -30,11 +30,11 @@ APETagHelper::APETagHelper( TagLib::Tag *tag, TagLib::APE::Tag *apeTag, Amarok:: : TagHelper( tag, fileType ) , m_tag( apeTag ) { - m_fieldMap.insert( Meta::valAlbumArtist, TagLib::String( "Album Artist" ) ); + m_fieldMap.insert( Meta::valAlbumArtist, TagLib::String( "ALBUM ARTIST" ) ); m_fieldMap.insert( Meta::valBpm, TagLib::String( "BPM" ) ); - m_fieldMap.insert( Meta::valCompilation, TagLib::String( "Compilation" ) ); + m_fieldMap.insert( Meta::valCompilation, TagLib::String( "COMPILATION" ) ); m_fieldMap.insert( Meta::valComposer, TagLib::String( "Composer" ) ); - m_fieldMap.insert( Meta::valDiscNr, TagLib::String( "Disc" ) ); + m_fieldMap.insert( Meta::valDiscNr, TagLib::String( "DISC" ) ); m_fieldMap.insert( Meta::valPlaycount, TagLib::String( "FMPS_PLAYCOUNT" ) ); m_fieldMap.insert( Meta::valRating, TagLib::String( "FMPS_RATING" ) ); m_fieldMap.insert( Meta::valScore, TagLib::String( "FMPS_RATING_AMAROK_SCORE" ) ); @@ -58,6 +58,11 @@ APETagHelper::tags() const data.insert( field, qRound( value.toFloat() * 10.0 ) ); else if( field == Meta::valScore ) data.insert( field, value.toFloat() * 100.0 ); + else if( field == Meta::valDiscNr ) { + int disc; + disc = splitDiscNr( value ).first; + data.insert( field, disc ); + } else data.insert( field, value ); } -- 1.8.4 ++++++ 0005-Sync-playlist-search-config-instantly.patch ++++++ >From e44eedd6c42526d4e4cdc14d1bdf18e6660a46ac Mon Sep 17 00:00:00 2001 From: Mark Kretschmann <[email protected]> Date: Mon, 2 Sep 2013 12:55:42 +0200 Subject: [PATCH 1/1] Sync playlist search config instantly. BUG: 324295 --- src/playlist/ProgressiveSearchWidget.cpp | 11 +++++------ src/playlist/ProgressiveSearchWidget.h | 5 ----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/playlist/ProgressiveSearchWidget.cpp b/src/playlist/ProgressiveSearchWidget.cpp index e608d9f..eaa0e30 100644 --- a/src/playlist/ProgressiveSearchWidget.cpp +++ b/src/playlist/ProgressiveSearchWidget.cpp @@ -147,12 +147,6 @@ ProgressiveSearchWidget::ProgressiveSearchWidget( QWidget * parent ) connect( Amarok::actionCollection()->action( "playlist_clear" ), SIGNAL(triggered()), this, SLOT(slotFilterClear()) ); } - -ProgressiveSearchWidget::~ProgressiveSearchWidget() -{ - Amarok::config( "Playlist Search" ).writeEntry( "ShowOnlyMatches", m_showOnlyMatches ); -} - void ProgressiveSearchWidget::slotFilterChanged( const QString & filter ) { DEBUG_BLOCK @@ -350,6 +344,11 @@ void ProgressiveSearchWidget::slotShowOnlyMatches( bool onlyMatches ) m_showOnlyMatches = onlyMatches; m_nextAction->setVisible( !onlyMatches ); m_previousAction->setVisible( !onlyMatches ); + + KConfigGroup cg = Amarok::config( "Playlist Search" ); + cg.writeEntry( "ShowOnlyMatches", m_showOnlyMatches ); + cg.sync(); + emit( showOnlyMatches( onlyMatches ) ); } diff --git a/src/playlist/ProgressiveSearchWidget.h b/src/playlist/ProgressiveSearchWidget.h index 8e810ba..05d7468 100644 --- a/src/playlist/ProgressiveSearchWidget.h +++ b/src/playlist/ProgressiveSearchWidget.h @@ -52,11 +52,6 @@ public: */ ProgressiveSearchWidget( QWidget * parent ); - /** - * Destructor. - */ - ~ProgressiveSearchWidget(); - QString currentFilter() const { return m_searchEdit->text(); } void focusInputLine(); -- 1.8.4 ++++++ 0006-Don-t-suppress-html-tag-like-characters.patch ++++++ >From 372d77b2fe833d1eb27b35732199dd6e28443de2 Mon Sep 17 00:00:00 2001 From: Mark Kretschmann <[email protected]> Date: Sat, 7 Sep 2013 16:02:52 +0200 Subject: [PATCH 1/1] Don't suppress html tag like characters. Example: "MY<DSMBR" by Linkin Park was shown as "MY". BUG: 324614 --- src/context/widgets/TextScrollingWidget.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/context/widgets/TextScrollingWidget.cpp b/src/context/widgets/TextScrollingWidget.cpp index 6963915..b119a9d 100644 --- a/src/context/widgets/TextScrollingWidget.cpp +++ b/src/context/widgets/TextScrollingWidget.cpp @@ -15,6 +15,7 @@ ****************************************************************************************/ #define DEBUG_PREFIX "TextScrollingWidget" + #include "TextScrollingWidget.h" #include "core/support/Debug.h" @@ -26,7 +27,6 @@ #include <QGraphicsSimpleTextItem> #include <QGraphicsSceneHoverEvent> #include <QPainter> -#include <QTextDocument> #include <QTimer> #include <QPropertyAnimation> @@ -81,22 +81,16 @@ public: void setScrollingText( const QString &str ) { - if( text != str ) - { - doc.setHtml( str ); - text = doc.toPlainText(); - doc.clear(); - } + text = str; } void setText( const QString &str ) { - doc.setHtml( str ); - text = doc.toPlainText(); + text = str; textItem->setText( text ); + if( animation ) animation.data()->stop(); - doc.clear(); } @@ -109,7 +103,6 @@ public: Plasma::FrameSvg *textBackground; // background svg for text QWeakPointer<QPropertyAnimation> animation; // scroll animation QGraphicsSimpleTextItem *textItem; - QTextDocument doc; private: TextScrollingWidget *const q_ptr; -- 1.8.4 ++++++ 0007-Fix-performance-issue-with-large-podcast-feeds.patch ++++++ >From a5b0f2afe1b62de636798b7452e4e3abae86db72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Meerk=C3=B6tter?= <[email protected]> Date: Sun, 8 Sep 2013 19:59:57 +0200 Subject: [PATCH 1/1] Fix performance issue with large podcast feeds. The podcast UI was very slow with channels with a large number of episodes (1000+). The root cause was that SqlPodcastChannel::tracks() was implemented in such a way that it was expensive to call it. Unfortunately it is extensively called by the PlaylistBrower... BUG: 283022 REVIEW: 112417 --- src/browsers/playlistbrowser/PlaylistBrowserModel.cpp | 2 +- src/core-impl/podcasts/sql/SqlPodcastMeta.cpp | 13 +++++++++++-- src/core-impl/podcasts/sql/SqlPodcastMeta.h | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/browsers/playlistbrowser/PlaylistBrowserModel.cpp b/src/browsers/playlistbrowser/PlaylistBrowserModel.cpp index 281694a..32d3d8b 100644 --- a/src/browsers/playlistbrowser/PlaylistBrowserModel.cpp +++ b/src/browsers/playlistbrowser/PlaylistBrowserModel.cpp @@ -308,7 +308,7 @@ PlaylistBrowserModel::rowCount( const QModelIndex &parent ) const else if( !IS_TRACK(parent) ) { Playlists::PlaylistPtr playlist = m_playlists.value( parent.internalId() ); - return playlist->tracks().count(); + return playlist->trackCount(); } return 0; diff --git a/src/core-impl/podcasts/sql/SqlPodcastMeta.cpp b/src/core-impl/podcasts/sql/SqlPodcastMeta.cpp index 20bcaff..08690ea 100644 --- a/src/core-impl/podcasts/sql/SqlPodcastMeta.cpp +++ b/src/core-impl/podcasts/sql/SqlPodcastMeta.cpp @@ -527,6 +527,7 @@ SqlPodcastChannel::SqlPodcastChannel( SqlPodcastProvider *provider, const QStringList &result ) : Podcasts::PodcastChannel() , m_episodesLoaded( false ) + , m_trackCacheIsValid( false ) , m_provider( provider ) { SqlStorage *sqlStorage = CollectionManager::instance()->sqlStorage(); @@ -553,6 +554,7 @@ SqlPodcastChannel::SqlPodcastChannel( Podcasts::SqlPodcastProvider *provider, Podcasts::PodcastChannelPtr channel ) : Podcasts::PodcastChannel() , m_dbId( 0 ) + , m_trackCacheIsValid( false ) , m_provider( provider ) , m_filenameLayout( "%default%" ) { @@ -731,7 +733,7 @@ SqlPodcastChannel::addEpisode( PodcastEpisodePtr episode ) notifyObserversTrackAdded( Meta::TrackPtr::dynamicCast( sqlEpisode ), i ); applyPurge(); - + m_trackCacheIsValid = false; return PodcastEpisodePtr::dynamicCast( sqlEpisode ); } @@ -759,6 +761,7 @@ SqlPodcastChannel::applyPurge() purgeIndex++; } } + m_trackCacheIsValid = false; } } @@ -813,6 +816,7 @@ SqlPodcastChannel::deleteFromDb() sqlEpisode->deleteFromDb(); m_episodes.removeOne( sqlEpisode ); } + m_trackCacheIsValid = false; sqlStorage->query( QString( "DELETE FROM podcastchannels WHERE id = %1;" ).arg( dbId() ) ); @@ -868,12 +872,17 @@ SqlPodcastChannel::loadEpisodes() } m_episodesLoaded = true; + m_trackCacheIsValid = false; } Meta::TrackList Podcasts::SqlPodcastChannel::tracks() { - return Podcasts::SqlPodcastEpisode::toTrackList( m_episodes ); + if ( !m_trackCacheIsValid ) { + m_episodesAsTracksCache = Podcasts::SqlPodcastEpisode::toTrackList( m_episodes ); + m_trackCacheIsValid = true; + } + return m_episodesAsTracksCache; } void diff --git a/src/core-impl/podcasts/sql/SqlPodcastMeta.h b/src/core-impl/podcasts/sql/SqlPodcastMeta.h index 02a18d3..ed346ba 100644 --- a/src/core-impl/podcasts/sql/SqlPodcastMeta.h +++ b/src/core-impl/podcasts/sql/SqlPodcastMeta.h @@ -155,6 +155,8 @@ class SqlPodcastChannel : public Podcasts::PodcastChannel bool m_episodesLoaded; SqlPodcastEpisodeList m_episodes; + bool m_trackCacheIsValid; + Meta::TrackList m_episodesAsTracksCache; SqlPodcastProvider *m_provider; QString m_filenameLayout; //specifies filename layout for episodes }; -- 1.8.4 -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
