From de9aa6f1fd1eac2c5ff236dd8f8f1377051bcc02 Mon Sep 17 00:00:00 2001
From: Christian Muehlhaeuser <muesli@gmail.com>
Date: Wed, 14 Nov 2012 02:20:09 +0100
Subject: [PATCH] * Emit changed() signal when setting a new playlist title,
 description or icon.

---
 src/libtomahawk/playlist/PlayableModel.cpp | 24 ++++++++++++++++++++++
 src/libtomahawk/playlist/PlayableModel.h   |  8 +++++---
 2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/src/libtomahawk/playlist/PlayableModel.cpp b/src/libtomahawk/playlist/PlayableModel.cpp
index ebb1c8283..b752dfd75 100644
--- a/src/libtomahawk/playlist/PlayableModel.cpp
+++ b/src/libtomahawk/playlist/PlayableModel.cpp
@@ -820,3 +820,27 @@ PlayableModel::insertQueries( const QList< Tomahawk::query_ptr >& queries, int r
 {
     insertInternal( queries, row );
 }
+
+
+void
+PlayableModel::setTitle( const QString& title )
+{
+    m_title = title;
+    emit changed();
+}
+
+
+void
+PlayableModel::setDescription( const QString& description )
+{
+    m_description = description;
+    emit changed();
+}
+
+
+void
+PlayableModel::setIcon( const QPixmap& pixmap )
+{
+    m_icon = pixmap;
+    emit changed();
+}
diff --git a/src/libtomahawk/playlist/PlayableModel.h b/src/libtomahawk/playlist/PlayableModel.h
index 9eb3388d0..e276b07dd 100644
--- a/src/libtomahawk/playlist/PlayableModel.h
+++ b/src/libtomahawk/playlist/PlayableModel.h
@@ -67,11 +67,11 @@ public:
     virtual bool isLoading() const { return m_loading; }
 
     virtual QString title() const { return m_title; }
-    virtual void setTitle( const QString& title ) { m_title = title; }
+    virtual void setTitle( const QString& title );
     virtual QString description() const { return m_description; }
-    virtual void setDescription( const QString& description ) { m_description = description; }
+    virtual void setDescription( const QString& description );
     virtual QPixmap icon() const { return m_icon; }
-    virtual void setIcon( const QPixmap& pixmap ) { m_icon = pixmap; }
+    virtual void setIcon( const QPixmap& pixmap );
 
     virtual int trackCount() const { return rowCount( QModelIndex() ); }
     virtual int itemCount() const { return rowCount( QModelIndex() ); }
@@ -117,6 +117,8 @@ signals:
     void loadingStarted();
     void loadingFinished();
 
+    void changed();
+
 public slots:
     virtual void setCurrentItem( const QModelIndex& index );