From 55d8896ab9270f5cdef3122f6582a00ff0110276 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Sun, 17 Feb 2013 17:39:06 +0100 Subject: [PATCH] Added description support to Collection, and fixed header text. --- src/libtomahawk/collection/Collection.cpp | 7 +++++++ src/libtomahawk/collection/Collection.h | 1 + src/libtomahawk/playlist/TreeModel.cpp | 1 + src/libtomahawk/resolvers/ScriptCollection.cpp | 11 +++-------- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/libtomahawk/collection/Collection.cpp b/src/libtomahawk/collection/Collection.cpp index 61d93e3bf..2409661e5 100644 --- a/src/libtomahawk/collection/Collection.cpp +++ b/src/libtomahawk/collection/Collection.cpp @@ -64,6 +64,13 @@ Collection::prettyName() const } +QString +Collection::description() const +{ + return QString(); +} + + QString Collection::itemName() const { diff --git a/src/libtomahawk/collection/Collection.h b/src/libtomahawk/collection/Collection.h index dc5cae784..8759fc421 100644 --- a/src/libtomahawk/collection/Collection.h +++ b/src/libtomahawk/collection/Collection.h @@ -62,6 +62,7 @@ public: virtual QString name() const; virtual QString prettyName() const; + virtual QString description() const; virtual QString itemName() const; virtual BackendType backendType() const { return NullCollectionType; } virtual QIcon icon() const; diff --git a/src/libtomahawk/playlist/TreeModel.cpp b/src/libtomahawk/playlist/TreeModel.cpp index 56f6ba7ae..59b421c37 100644 --- a/src/libtomahawk/playlist/TreeModel.cpp +++ b/src/libtomahawk/playlist/TreeModel.cpp @@ -263,6 +263,7 @@ TreeModel::addCollection( const collection_ptr& collection ) setIcon( collection->bigIcon() ); setTitle( collection->prettyName() ); + setDescription( collection->description() ); } diff --git a/src/libtomahawk/resolvers/ScriptCollection.cpp b/src/libtomahawk/resolvers/ScriptCollection.cpp index 5b2418c4a..bcf798602 100644 --- a/src/libtomahawk/resolvers/ScriptCollection.cpp +++ b/src/libtomahawk/resolvers/ScriptCollection.cpp @@ -54,14 +54,9 @@ ScriptCollection::~ScriptCollection() QString ScriptCollection::prettyName() const { - if ( source()->isLocal() ) - return tr( "My %1 Collection", - "Name of a collection based on a resolver, e.g. My Subsonic Collection" ) - .arg( m_resolver->name() ); - return tr( "%1 Collection of %2", - "Name of a collection based on a resolver, e.g. Subsonic Collection of Some Dude" ) - .arg( m_resolver->name() ) - .arg( source()->friendlyName() ); + return tr( "%1 Collection", + "Name of a collection based on a resolver, e.g. Subsonic Collection" ) + .arg( m_resolver->name() ); }