mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 17:43:59 +02:00
Load automatic playlists and stations in Newest Stations and Playlists list...
This commit is contained in:
@@ -121,6 +121,24 @@ DynamicPlaylist::setMode( int mode )
|
|||||||
m_generator->setMode( (GeneratorMode)mode );
|
m_generator->setMode( (GeneratorMode)mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dynplaylist_ptr
|
||||||
|
DynamicPlaylist::load( const QString& guid )
|
||||||
|
{
|
||||||
|
dynplaylist_ptr p;
|
||||||
|
|
||||||
|
foreach( const Tomahawk::source_ptr& source, SourceList::instance()->sources() )
|
||||||
|
{
|
||||||
|
p = source->collection()->autoPlaylist( guid );
|
||||||
|
if ( p.isNull() )
|
||||||
|
p = source->collection()->station( guid );
|
||||||
|
|
||||||
|
if( !p.isNull() )
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
dynplaylist_ptr
|
dynplaylist_ptr
|
||||||
DynamicPlaylist::create( const Tomahawk::source_ptr& author,
|
DynamicPlaylist::create( const Tomahawk::source_ptr& author,
|
||||||
|
@@ -91,6 +91,8 @@ class DLLEXPORT DynamicPlaylist : public Playlist
|
|||||||
public:
|
public:
|
||||||
virtual ~DynamicPlaylist();
|
virtual ~DynamicPlaylist();
|
||||||
|
|
||||||
|
static Tomahawk::dynplaylist_ptr load( const QString& guid );
|
||||||
|
|
||||||
/// Generate an empty dynamic playlist with default generator
|
/// Generate an empty dynamic playlist with default generator
|
||||||
static Tomahawk::dynplaylist_ptr create( const source_ptr& author,
|
static Tomahawk::dynplaylist_ptr create( const source_ptr& author,
|
||||||
const QString& guid,
|
const QString& guid,
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
|
||||||
Copyright (C) 2011 Leo Franchi <leo.franchi@kdab.com>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,10 +19,11 @@
|
|||||||
|
|
||||||
#include "welcomeplaylistmodel.h"
|
#include "welcomeplaylistmodel.h"
|
||||||
|
|
||||||
#include <tomahawksettings.h>
|
#include "tomahawksettings.h"
|
||||||
#include <audio/audioengine.h>
|
#include "audio/audioengine.h"
|
||||||
#include <sourcelist.h>
|
#include "sourcelist.h"
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
|
#include "dynamic/DynamicPlaylist.h"
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
@@ -63,6 +63,8 @@ WelcomePlaylistModel::loadFromSettings()
|
|||||||
playlist_ptr pl = m_cached.value( playlist_guids[i], playlist_ptr() );
|
playlist_ptr pl = m_cached.value( playlist_guids[i], playlist_ptr() );
|
||||||
if( pl.isNull() )
|
if( pl.isNull() )
|
||||||
pl = Tomahawk::Playlist::load( playlist_guids[i] );
|
pl = Tomahawk::Playlist::load( playlist_guids[i] );
|
||||||
|
if( pl.isNull() )
|
||||||
|
pl = Tomahawk::DynamicPlaylist::load( playlist_guids[i] );
|
||||||
|
|
||||||
if ( !pl.isNull() ) {
|
if ( !pl.isNull() ) {
|
||||||
m_recplaylists << pl;
|
m_recplaylists << pl;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
|
||||||
Copyright (C) 2011 Leo Franchi <leo.franchi@kdab.com>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
Reference in New Issue
Block a user