mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-22 16:59:58 +01:00
Merge branch 'master' of git://github.com/tomahawk-player/tomahawk
This commit is contained in:
commit
819fc4881e
@ -22,8 +22,7 @@
|
||||
|
||||
#include "sourcelist.h"
|
||||
#include "viewmanager.h"
|
||||
|
||||
#define MAGIC_BOOKMARK_GUID "_bookmarkplaylist"
|
||||
#include <tomahawksettings.h>
|
||||
|
||||
LocalCollection::LocalCollection( const Tomahawk::source_ptr& source, QObject* parent )
|
||||
: DatabaseCollection( source, parent )
|
||||
@ -34,18 +33,23 @@ LocalCollection::LocalCollection( const Tomahawk::source_ptr& source, QObject* p
|
||||
Tomahawk::playlist_ptr
|
||||
LocalCollection::bookmarksPlaylist()
|
||||
{
|
||||
return playlist( MAGIC_BOOKMARK_GUID );
|
||||
if( TomahawkSettings::instance()->bookmarkPlaylist().isEmpty() )
|
||||
return Tomahawk::playlist_ptr();
|
||||
|
||||
return playlist( TomahawkSettings::instance()->bookmarkPlaylist() );
|
||||
}
|
||||
|
||||
void
|
||||
LocalCollection::createBookmarksPlaylist()
|
||||
{
|
||||
if( bookmarksPlaylist().isNull() ) {
|
||||
Tomahawk::playlist_ptr p = Tomahawk::Playlist::create( SourceList::instance()->getLocal(), MAGIC_BOOKMARK_GUID, tr( "Bookmarks" ), tr( "Saved tracks" ), QString(), false );
|
||||
QString guid = uuid();
|
||||
Tomahawk::playlist_ptr p = Tomahawk::Playlist::create( SourceList::instance()->getLocal(), guid, tr( "Bookmarks" ), tr( "Saved tracks" ), QString(), false );
|
||||
ViewManager::instance()->createPageForPlaylist( p );
|
||||
// connect( p.data(), SIGNAL( revisionLoaded( Tomahawk::PlaylistRevision ) ), this, SLOT( loaded( Tomahawk::PlaylistRevision ) ), Qt::QueuedConnection );
|
||||
connect( p.data(), SIGNAL( created() ), this, SLOT( created() ) );
|
||||
|
||||
TomahawkSettings::instance()->setBookmarkPlaylist( guid );
|
||||
// p->createNewRevision( uuid(), p->currentrevision(), QList< Tomahawk::plentry_ptr >() );
|
||||
}
|
||||
}
|
||||
|
@ -306,6 +306,18 @@ TomahawkSettings::appendRecentlyPlayedPlaylist( const Tomahawk::playlist_ptr& pl
|
||||
setValue( "playlists/recentlyPlayed", playlist_guids );
|
||||
}
|
||||
|
||||
QString
|
||||
TomahawkSettings::bookmarkPlaylist() const
|
||||
{
|
||||
return value( "playlists/bookmark", QString() ).toString();
|
||||
}
|
||||
|
||||
void
|
||||
TomahawkSettings::setBookmarkPlaylist( const QString& guid )
|
||||
{
|
||||
setValue( "playlists/bookmark", guid );
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
TomahawkSettings::jabberAutoConnect() const
|
||||
|
@ -68,6 +68,9 @@ public:
|
||||
QList<Tomahawk::playlist_ptr> recentlyPlayedPlaylists() const;
|
||||
void appendRecentlyPlayedPlaylist( const Tomahawk::playlist_ptr& playlist );
|
||||
|
||||
void setBookmarkPlaylist( const QString& guid );
|
||||
QString bookmarkPlaylist() const;
|
||||
|
||||
/// Jabber settings
|
||||
bool jabberAutoConnect() const; /// true by default
|
||||
void setJabberAutoConnect( bool autoconnect = false );
|
||||
|
Loading…
x
Reference in New Issue
Block a user