From 84a47cc251ccf55b0f9ac6d5923b843784d678c8 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 5 Sep 2013 12:06:29 +0200 Subject: [PATCH] * Don't access playlist data before it's loaded in ShortLinkHelper::shortLink(). --- src/libtomahawk/utils/ShortLinkHelper.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libtomahawk/utils/ShortLinkHelper.cpp b/src/libtomahawk/utils/ShortLinkHelper.cpp index f0870af97..503133807 100644 --- a/src/libtomahawk/utils/ShortLinkHelper.cpp +++ b/src/libtomahawk/utils/ShortLinkHelper.cpp @@ -55,6 +55,17 @@ ShortLinkHelper::shortLink( const Tomahawk::playlist_ptr& pl ) return; } + if ( !pl->loaded() ) + { + pl->loadRevision(); + } + if ( pl->busy() || !pl->loaded() ) + { + NewClosure( pl.data(), SIGNAL( revisionLoaded( Tomahawk::PlaylistRevision ) ), + this, SLOT( shortLink( Tomahawk::playlist_ptr ) ), pl ); + return; + } + QVariantMap m; m[ "title" ] = pl->title(); m[ "creator" ] = pl->author().isNull() ? "" : pl->author()->friendlyName();