From 01bf3a381879190fcd0797647d3c23c777c66253 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Thu, 13 Oct 2011 08:28:22 -0400 Subject: [PATCH] Initialize to 0 in *all* constructors --- src/libtomahawk/playlist.cpp | 7 ++++--- src/libtomahawk/playlist/PlaylistUpdaterInterface.cpp | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libtomahawk/playlist.cpp b/src/libtomahawk/playlist.cpp index 61fa3097a..a2193aff6 100644 --- a/src/libtomahawk/playlist.cpp +++ b/src/libtomahawk/playlist.cpp @@ -93,6 +93,7 @@ PlaylistEntry::setLastSource( source_ptr s ) Playlist::Playlist( const source_ptr& author ) : m_source( author ) , m_lastmodified( 0 ) + , m_updater( 0 ) { } @@ -252,12 +253,12 @@ void Playlist::reportDeleted( const Tomahawk::playlist_ptr& self ) { Q_ASSERT( self.data() == this ); - m_deleted = true; - m_source->collection()->deletePlaylist( self ); - if ( m_updater ) m_updater->remove(); + m_deleted = true; + m_source->collection()->deletePlaylist( self ); + emit deleted( self ); } diff --git a/src/libtomahawk/playlist/PlaylistUpdaterInterface.cpp b/src/libtomahawk/playlist/PlaylistUpdaterInterface.cpp index 2a43b950b..ac0da13da 100644 --- a/src/libtomahawk/playlist/PlaylistUpdaterInterface.cpp +++ b/src/libtomahawk/playlist/PlaylistUpdaterInterface.cpp @@ -83,6 +83,9 @@ PlaylistUpdaterInterface::doSave() void PlaylistUpdaterInterface::remove() { + if ( m_playlist.isNull() ) + return; + TomahawkSettings* s = TomahawkSettings::instance(); const QString key = QString( "playlistupdaters/%1" ).arg( m_playlist->guid() ); removeFromSettings( key );