mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-19 15:29:42 +01:00
Fix warnings that led to shared pointers not being correctly deleted.
See upcoming email to tomahawk-devel@ for how to avoi them in the future, this was a PITA and I don't want to do it again.
This commit is contained in:
parent
22d3048017
commit
a2f139c204
@ -23,6 +23,7 @@
|
||||
|
||||
#include "typedefs.h"
|
||||
#include "widgets/animatedsplitter.h"
|
||||
#include "query.h"
|
||||
|
||||
class StreamConnection;
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "result.h"
|
||||
#include "playlistinterface.h"
|
||||
#include "infosystem/infosystem.h"
|
||||
#include "query.h"
|
||||
|
||||
class QDropEvent;
|
||||
class QDragEnterEvent;
|
||||
|
@ -32,6 +32,7 @@ set( libSources
|
||||
globalactionmanager.cpp
|
||||
contextmenu.cpp
|
||||
dropjob.cpp
|
||||
playlistinterface.cpp
|
||||
|
||||
sip/SipPlugin.cpp
|
||||
sip/SipHandler.cpp
|
||||
@ -145,6 +146,7 @@ set( libSources
|
||||
playlist/dynamic/GeneratorInterface.cpp
|
||||
playlist/dynamic/DynamicView.cpp
|
||||
playlist/dynamic/DynamicModel.cpp
|
||||
playlist/dynamic/DynamicPlaylistRevision.cpp
|
||||
playlist/dynamic/echonest/EchonestGenerator.cpp
|
||||
playlist/dynamic/echonest/EchonestControl.cpp
|
||||
playlist/dynamic/echonest/EchonestSteerer.cpp
|
||||
|
@ -28,6 +28,8 @@
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
Album::Album() {}
|
||||
Album::~Album() {}
|
||||
|
||||
album_ptr
|
||||
Album::get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCreate )
|
||||
@ -98,6 +100,11 @@ Album::siblingItem( int itemsAway )
|
||||
return m_currentItem;
|
||||
}
|
||||
|
||||
result_ptr
|
||||
Album::currentItem() const
|
||||
{
|
||||
return m_currentItem;
|
||||
}
|
||||
|
||||
bool
|
||||
Album::hasNextItem()
|
||||
@ -110,6 +117,11 @@ Album::hasNextItem()
|
||||
return true;
|
||||
}
|
||||
|
||||
artist_ptr
|
||||
Album::artist() const
|
||||
{
|
||||
return m_artist;
|
||||
}
|
||||
|
||||
QList<Tomahawk::query_ptr>
|
||||
Album::tracks()
|
||||
|
@ -38,10 +38,11 @@ public:
|
||||
static album_ptr get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist );
|
||||
|
||||
Album( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist );
|
||||
~Album();
|
||||
|
||||
unsigned int id() const { return m_id; }
|
||||
QString name() const { return m_name; }
|
||||
artist_ptr artist() const { return m_artist; }
|
||||
artist_ptr artist() const;
|
||||
|
||||
QList<Tomahawk::query_ptr> tracks();
|
||||
|
||||
@ -51,7 +52,7 @@ public:
|
||||
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
|
||||
|
||||
virtual bool hasNextItem();
|
||||
virtual Tomahawk::result_ptr currentItem() const { return m_currentItem; }
|
||||
virtual Tomahawk::result_ptr currentItem() const;
|
||||
|
||||
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
|
||||
virtual bool shuffled() const { return false; }
|
||||
@ -75,6 +76,8 @@ private slots:
|
||||
void onTracksAdded( const QList<Tomahawk::query_ptr>& tracks );
|
||||
|
||||
private:
|
||||
Album();
|
||||
|
||||
unsigned int m_id;
|
||||
QString m_name;
|
||||
|
||||
|
@ -120,6 +120,12 @@ Artist::hasNextItem()
|
||||
return true;
|
||||
}
|
||||
|
||||
result_ptr
|
||||
Artist::currentItem() const
|
||||
{
|
||||
return m_currentItem;
|
||||
}
|
||||
|
||||
|
||||
QList<Tomahawk::query_ptr>
|
||||
Artist::tracks()
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
|
||||
|
||||
virtual bool hasNextItem();
|
||||
virtual Tomahawk::result_ptr currentItem() const { return m_currentItem; }
|
||||
virtual Tomahawk::result_ptr currentItem() const;
|
||||
|
||||
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
|
||||
virtual bool shuffled() const { return false; }
|
||||
@ -77,6 +77,8 @@ private slots:
|
||||
void onTracksAdded( const QList<Tomahawk::query_ptr>& tracks );
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(Artist)
|
||||
|
||||
unsigned int m_id;
|
||||
QString m_name;
|
||||
QString m_sortname;
|
||||
|
@ -170,6 +170,12 @@ Collection::station( const QString& guid )
|
||||
return m_stations.value( guid, dynplaylist_ptr() );
|
||||
}
|
||||
|
||||
QList< query_ptr >
|
||||
Collection::tracks() const
|
||||
{
|
||||
return m_tracks;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Collection::setPlaylists( const QList<Tomahawk::playlist_ptr>& plists )
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "functimeout.h"
|
||||
#include "playlist.h"
|
||||
#include "playlist/dynamic/DynamicPlaylist.h"
|
||||
#include "query.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
@ -74,7 +75,7 @@ public:
|
||||
virtual QList< Tomahawk::playlist_ptr > playlists() { return m_playlists.values(); }
|
||||
virtual QList< Tomahawk::dynplaylist_ptr > autoPlaylists() { return m_autoplaylists.values(); }
|
||||
virtual QList< Tomahawk::dynplaylist_ptr > stations() { return m_stations.values(); }
|
||||
virtual QList< Tomahawk::query_ptr > tracks() { return m_tracks; }
|
||||
virtual QList< Tomahawk::query_ptr > tracks() const;
|
||||
|
||||
const source_ptr& source() const;
|
||||
unsigned int lastmodified() const { return m_lastmodified; }
|
||||
|
@ -21,7 +21,10 @@
|
||||
#include "globalactionmanager.h"
|
||||
#include "playlistview.h"
|
||||
#include "viewmanager.h"
|
||||
|
||||
#include "query.h"
|
||||
#include "source.h"
|
||||
#include "artist.h"
|
||||
#include "album.h"
|
||||
#include "utils/logger.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
@ -36,6 +39,8 @@ ContextMenu::ContextMenu( QWidget* parent )
|
||||
m_supportedActions = ActionPlay | ActionQueue | ActionCopyLink;
|
||||
}
|
||||
|
||||
ContextMenu::~ContextMenu()
|
||||
{}
|
||||
|
||||
void
|
||||
ContextMenu::clear()
|
||||
@ -47,6 +52,11 @@ ContextMenu::clear()
|
||||
m_artists.clear();
|
||||
}
|
||||
|
||||
unsigned int
|
||||
ContextMenu::itemCount() const
|
||||
{
|
||||
return m_queries.count() + m_artists.count() + m_albums.count();
|
||||
}
|
||||
|
||||
void
|
||||
ContextMenu::setQueries( const QList<Tomahawk::query_ptr>& queries )
|
||||
|
@ -37,6 +37,7 @@ public:
|
||||
{ ActionPlay = 1, ActionQueue = 2, ActionDelete = 4, ActionCopyLink = 8 };
|
||||
|
||||
explicit ContextMenu( QWidget* parent = 0 );
|
||||
virtual ~ContextMenu();
|
||||
|
||||
int supportedActions() const { return m_supportedActions; }
|
||||
void setSupportedActions( int actions ) { m_supportedActions = actions; }
|
||||
@ -52,7 +53,7 @@ public:
|
||||
|
||||
void clear();
|
||||
|
||||
unsigned int itemCount() const { return m_queries.count() + m_artists.count() + m_albums.count(); }
|
||||
unsigned int itemCount() const;
|
||||
|
||||
signals:
|
||||
void triggered( int action );
|
||||
|
@ -24,10 +24,10 @@
|
||||
|
||||
#include "artist.h"
|
||||
#include "album.h"
|
||||
#include "databasecommand.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DatabaseCommand;
|
||||
class DatabaseImpl;
|
||||
class DatabaseWorker;
|
||||
|
||||
|
@ -49,6 +49,10 @@ DatabaseCommand::DatabaseCommand( const source_ptr& src, QObject* parent )
|
||||
//qDebug() << Q_FUNC_INFO;
|
||||
}
|
||||
|
||||
DatabaseCommand::DatabaseCommand( const DatabaseCommand& other )
|
||||
: QObject( other.parent() )
|
||||
{
|
||||
}
|
||||
|
||||
DatabaseCommand::~DatabaseCommand()
|
||||
{
|
||||
@ -68,6 +72,18 @@ DatabaseCommand::_exec( DatabaseImpl* lib )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DatabaseCommand::setSource( const Tomahawk::source_ptr& s )
|
||||
{
|
||||
m_source = s;
|
||||
}
|
||||
|
||||
const Tomahawk::source_ptr&
|
||||
DatabaseCommand::source() const
|
||||
{
|
||||
return m_source;
|
||||
}
|
||||
|
||||
DatabaseCommand*
|
||||
DatabaseCommand::factory( const QVariant& op, const source_ptr& source )
|
||||
{
|
||||
|
@ -47,10 +47,7 @@ public:
|
||||
explicit DatabaseCommand( QObject* parent = 0 );
|
||||
explicit DatabaseCommand( const Tomahawk::source_ptr& src, QObject* parent = 0 );
|
||||
|
||||
DatabaseCommand( const DatabaseCommand &other )
|
||||
: QObject( other.parent() )
|
||||
{
|
||||
}
|
||||
DatabaseCommand( const DatabaseCommand &other );
|
||||
|
||||
virtual ~DatabaseCommand();
|
||||
|
||||
@ -69,8 +66,8 @@ public:
|
||||
void postCommit() { postCommitHook(); emit committed(); }
|
||||
virtual void postCommitHook(){};
|
||||
|
||||
void setSource( const Tomahawk::source_ptr& s ) { m_source = s; }
|
||||
const Tomahawk::source_ptr& source() const { return m_source; }
|
||||
void setSource( const Tomahawk::source_ptr& s );
|
||||
const Tomahawk::source_ptr& source() const;
|
||||
|
||||
virtual bool loggable() const { return false; }
|
||||
virtual bool singletonCmd() const { return false; }
|
||||
|
@ -26,6 +26,23 @@
|
||||
#include "utils/tomahawkutils.h"
|
||||
#include "utils/logger.h"
|
||||
|
||||
DatabaseCommand_AllAlbums::DatabaseCommand_AllAlbums( const Tomahawk::collection_ptr &collection, const Tomahawk::artist_ptr &artist, QObject *parent )
|
||||
: DatabaseCommand( parent )
|
||||
, m_collection( collection )
|
||||
, m_artist( artist )
|
||||
, m_amount( 0 )
|
||||
, m_sortOrder( DatabaseCommand_AllAlbums::None )
|
||||
, m_sortDescending( false )
|
||||
{}
|
||||
|
||||
DatabaseCommand_AllAlbums::~DatabaseCommand_AllAlbums()
|
||||
{}
|
||||
|
||||
void
|
||||
DatabaseCommand_AllAlbums::setArtist( const Tomahawk::artist_ptr &artist )
|
||||
{
|
||||
m_artist = artist;
|
||||
}
|
||||
|
||||
void
|
||||
DatabaseCommand_AllAlbums::execForArtist( DatabaseImpl* dbi )
|
||||
|
@ -37,14 +37,8 @@ public:
|
||||
ModificationTime = 1
|
||||
};
|
||||
|
||||
explicit DatabaseCommand_AllAlbums( const Tomahawk::collection_ptr& collection = Tomahawk::collection_ptr(), const Tomahawk::artist_ptr& artist = Tomahawk::artist_ptr(), QObject* parent = 0 )
|
||||
: DatabaseCommand( parent )
|
||||
, m_collection( collection )
|
||||
, m_artist( artist )
|
||||
, m_amount( 0 )
|
||||
, m_sortOrder( DatabaseCommand_AllAlbums::None )
|
||||
, m_sortDescending( false )
|
||||
{}
|
||||
explicit DatabaseCommand_AllAlbums( const Tomahawk::collection_ptr& collection = Tomahawk::collection_ptr(), const Tomahawk::artist_ptr& artist = Tomahawk::artist_ptr(), QObject* parent = 0 );
|
||||
virtual ~DatabaseCommand_AllAlbums();
|
||||
|
||||
virtual void exec( DatabaseImpl* );
|
||||
|
||||
@ -54,7 +48,7 @@ public:
|
||||
void execForCollection( DatabaseImpl* );
|
||||
void execForArtist( DatabaseImpl* );
|
||||
|
||||
void setArtist( const Tomahawk::artist_ptr& artist ) { m_artist = artist; }
|
||||
void setArtist( const Tomahawk::artist_ptr& artist );
|
||||
void setLimit( unsigned int amount ) { m_amount = amount; }
|
||||
void setSortOrder( DatabaseCommand_AllAlbums::SortOrder order ) { m_sortOrder = order; }
|
||||
void setSortDescending( bool descending ) { m_sortDescending = descending; }
|
||||
|
@ -26,6 +26,17 @@
|
||||
#include "utils/tomahawkutils.h"
|
||||
#include "utils/logger.h"
|
||||
|
||||
DatabaseCommand_AllArtists::DatabaseCommand_AllArtists( const Tomahawk::collection_ptr &collection, QObject *parent )
|
||||
: DatabaseCommand( parent )
|
||||
, m_collection( collection )
|
||||
, m_amount( 0 )
|
||||
, m_sortOrder( DatabaseCommand_AllArtists::None )
|
||||
, m_sortDescending( false )
|
||||
{}
|
||||
|
||||
DatabaseCommand_AllArtists::~DatabaseCommand_AllArtists()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
DatabaseCommand_AllArtists::exec( DatabaseImpl* dbi )
|
||||
|
@ -36,13 +36,8 @@ public:
|
||||
ModificationTime = 1
|
||||
};
|
||||
|
||||
explicit DatabaseCommand_AllArtists( const Tomahawk::collection_ptr& collection = Tomahawk::collection_ptr(), QObject* parent = 0 )
|
||||
: DatabaseCommand( parent )
|
||||
, m_collection( collection )
|
||||
, m_amount( 0 )
|
||||
, m_sortOrder( DatabaseCommand_AllArtists::None )
|
||||
, m_sortDescending( false )
|
||||
{}
|
||||
explicit DatabaseCommand_AllArtists( const Tomahawk::collection_ptr& collection = Tomahawk::collection_ptr(), QObject* parent = 0 );
|
||||
virtual ~DatabaseCommand_AllArtists();
|
||||
|
||||
virtual void exec( DatabaseImpl* );
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "databasecommand.h"
|
||||
#include "collection.h"
|
||||
#include "typedefs.h"
|
||||
#include "query.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
|
@ -52,6 +52,17 @@ DatabaseCommand_CreateDynamicPlaylist::DatabaseCommand_CreateDynamicPlaylist( co
|
||||
tDebug() << Q_FUNC_INFO << "creating dynamiccreatecommand 2";
|
||||
}
|
||||
|
||||
DatabaseCommand_CreateDynamicPlaylist::~DatabaseCommand_CreateDynamicPlaylist()
|
||||
{}
|
||||
|
||||
QVariant
|
||||
DatabaseCommand_CreateDynamicPlaylist::playlistV() const
|
||||
{
|
||||
if( m_v.isNull() )
|
||||
return QJson::QObjectHelper::qobject2qvariant( (QObject*)m_playlist.data() );
|
||||
else
|
||||
return m_v;
|
||||
}
|
||||
|
||||
void
|
||||
DatabaseCommand_CreateDynamicPlaylist::exec( DatabaseImpl* lib )
|
||||
|
@ -37,6 +37,7 @@ class DatabaseCommand_CreateDynamicPlaylist : public DatabaseCommand_CreatePlayl
|
||||
public:
|
||||
explicit DatabaseCommand_CreateDynamicPlaylist( QObject* parent = 0 );
|
||||
explicit DatabaseCommand_CreateDynamicPlaylist( const Tomahawk::source_ptr& author, const Tomahawk::dynplaylist_ptr& playlist, bool autoLoad = true );
|
||||
virtual ~DatabaseCommand_CreateDynamicPlaylist();
|
||||
|
||||
QString commandname() const { return "createdynamicplaylist"; }
|
||||
|
||||
@ -46,13 +47,7 @@ public:
|
||||
|
||||
virtual bool loggable() const { return m_autoLoad; }
|
||||
|
||||
QVariant playlistV() const
|
||||
{
|
||||
if( m_v.isNull() )
|
||||
return QJson::QObjectHelper::qobject2qvariant( (QObject*)m_playlist.data() );
|
||||
else
|
||||
return m_v;
|
||||
}
|
||||
QVariant playlistV() const;
|
||||
|
||||
void setPlaylistV( const QVariant& v )
|
||||
{
|
||||
|
@ -45,6 +45,8 @@ DatabaseCommand_CreatePlaylist::DatabaseCommand_CreatePlaylist( const source_ptr
|
||||
{
|
||||
}
|
||||
|
||||
DatabaseCommand_CreatePlaylist::~DatabaseCommand_CreatePlaylist()
|
||||
{}
|
||||
|
||||
void
|
||||
DatabaseCommand_CreatePlaylist::exec( DatabaseImpl* lib )
|
||||
@ -52,6 +54,15 @@ DatabaseCommand_CreatePlaylist::exec( DatabaseImpl* lib )
|
||||
createPlaylist( lib, false );
|
||||
}
|
||||
|
||||
QVariant
|
||||
DatabaseCommand_CreatePlaylist::playlistV() const
|
||||
{
|
||||
if( m_v.isNull() )
|
||||
return QJson::QObjectHelper::qobject2qvariant( (QObject*)m_playlist.data() );
|
||||
else
|
||||
return m_v;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DatabaseCommand_CreatePlaylist::postCommitHook()
|
||||
|
@ -33,6 +33,7 @@ Q_PROPERTY( QVariant playlist READ playlistV WRITE setPlaylistV )
|
||||
public:
|
||||
explicit DatabaseCommand_CreatePlaylist( QObject* parent = 0 );
|
||||
explicit DatabaseCommand_CreatePlaylist( const Tomahawk::source_ptr& author, const Tomahawk::playlist_ptr& playlist );
|
||||
virtual ~DatabaseCommand_CreatePlaylist();
|
||||
|
||||
QString commandname() const { return "createplaylist"; }
|
||||
|
||||
@ -40,13 +41,7 @@ public:
|
||||
virtual void postCommitHook();
|
||||
virtual bool doesMutates() const { return true; }
|
||||
|
||||
QVariant playlistV() const
|
||||
{
|
||||
if( m_v.isNull() )
|
||||
return QJson::QObjectHelper::qobject2qvariant( (QObject*)m_playlist.data() );
|
||||
else
|
||||
return m_v;
|
||||
}
|
||||
QVariant playlistV() const;
|
||||
|
||||
void setPlaylistV( const QVariant& v )
|
||||
{
|
||||
@ -58,7 +53,7 @@ protected:
|
||||
|
||||
virtual bool report() { return m_report; }
|
||||
|
||||
void setPlaylist( const Tomahawk::playlist_ptr& playlist ) { m_playlist = playlist; }
|
||||
void setPlaylist( const Tomahawk::playlist_ptr& playlist );
|
||||
|
||||
QVariant m_v;
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <QMap>
|
||||
|
||||
#include "databasecommand.h"
|
||||
|
||||
#include "result.h"
|
||||
#include "dllmacro.h"
|
||||
|
||||
class DLLEXPORT DatabaseCommand_LoadFile : public DatabaseCommand
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "databasecommand_modifyplaylist.h"
|
||||
|
||||
#include "utils/logger.h"
|
||||
#include "playlist.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
@ -31,6 +32,8 @@ DatabaseCommand_ModifyPlaylist::DatabaseCommand_ModifyPlaylist( Playlist* playli
|
||||
{
|
||||
}
|
||||
|
||||
DatabaseCommand_ModifyPlaylist::~DatabaseCommand_ModifyPlaylist()
|
||||
{}
|
||||
|
||||
void
|
||||
DatabaseCommand_ModifyPlaylist::exec( DatabaseImpl* lib )
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
};
|
||||
|
||||
explicit DatabaseCommand_ModifyPlaylist( Tomahawk::Playlist* playlist, const QList< Tomahawk::plentry_ptr >& entries, Mode mode );
|
||||
virtual ~DatabaseCommand_ModifyPlaylist();
|
||||
|
||||
virtual bool doesMutates() const { return true; }
|
||||
|
||||
|
@ -32,6 +32,8 @@ DatabaseCommand_Resolve::DatabaseCommand_Resolve( const query_ptr& query )
|
||||
{
|
||||
}
|
||||
|
||||
DatabaseCommand_Resolve::~DatabaseCommand_Resolve()
|
||||
{}
|
||||
|
||||
void
|
||||
DatabaseCommand_Resolve::exec( DatabaseImpl* lib )
|
||||
|
@ -32,6 +32,7 @@ class DLLEXPORT DatabaseCommand_Resolve : public DatabaseCommand
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DatabaseCommand_Resolve( const Tomahawk::query_ptr& query );
|
||||
virtual ~DatabaseCommand_Resolve();
|
||||
|
||||
virtual QString commandname() const { return "dbresolve"; }
|
||||
virtual bool doesMutates() const { return false; }
|
||||
@ -44,6 +45,8 @@ signals:
|
||||
public slots:
|
||||
|
||||
private:
|
||||
DatabaseCommand_Resolve();
|
||||
|
||||
void fullTextResolve( DatabaseImpl* lib );
|
||||
void resolve( DatabaseImpl* lib );
|
||||
|
||||
|
@ -22,4 +22,4 @@
|
||||
|
||||
void script( const char* status );
|
||||
|
||||
#endif ADIUM_TOMAHAWK_H
|
||||
#endif
|
||||
|
@ -63,6 +63,11 @@ ControlConnection::~ControlConnection()
|
||||
m_dbsyncconn->deleteLater();
|
||||
}
|
||||
|
||||
source_ptr
|
||||
ControlConnection::source() const
|
||||
{
|
||||
return m_source;
|
||||
}
|
||||
|
||||
Connection*
|
||||
ControlConnection::clone()
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
|
||||
DBSyncConnection* dbSyncConnection();
|
||||
|
||||
Tomahawk::source_ptr source() const { return m_source; }
|
||||
Tomahawk::source_ptr source() const;
|
||||
|
||||
protected:
|
||||
virtual void setup();
|
||||
|
@ -61,6 +61,19 @@ AlbumProxyModel::setSourceAlbumModel( AlbumModel* sourceModel )
|
||||
QSortFilterProxyModel::setSourceModel( sourceModel );
|
||||
}
|
||||
|
||||
QList< Tomahawk::query_ptr >
|
||||
AlbumProxyModel::tracks()
|
||||
{
|
||||
Q_ASSERT( FALSE );
|
||||
QList<Tomahawk::query_ptr> queries;
|
||||
return queries;
|
||||
}
|
||||
|
||||
Tomahawk::result_ptr
|
||||
AlbumProxyModel::currentItem() const
|
||||
{
|
||||
return Tomahawk::result_ptr();
|
||||
}
|
||||
|
||||
void
|
||||
AlbumProxyModel::setFilter( const QString& pattern )
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
virtual void setSourceAlbumModel( AlbumModel* sourceModel );
|
||||
virtual void setSourceModel( QAbstractItemModel* sourceModel );
|
||||
|
||||
virtual QList<Tomahawk::query_ptr> tracks() { Q_ASSERT( FALSE ); QList<Tomahawk::query_ptr> queries; return queries; }
|
||||
virtual QList<Tomahawk::query_ptr> tracks();
|
||||
|
||||
virtual int unfilteredTrackCount() const { return sourceModel()->rowCount( QModelIndex() ); }
|
||||
virtual int trackCount() const { return rowCount( QModelIndex() ); }
|
||||
@ -47,7 +47,7 @@ public:
|
||||
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
||||
|
||||
virtual bool hasNextItem() { return true; }
|
||||
virtual Tomahawk::result_ptr currentItem() const { return Tomahawk::result_ptr(); }
|
||||
virtual Tomahawk::result_ptr currentItem() const;
|
||||
virtual Tomahawk::result_ptr siblingItem( int direction );
|
||||
|
||||
virtual void setFilter( const QString& pattern );
|
||||
|
@ -51,6 +51,8 @@ CustomPlaylistView::CustomPlaylistView( CustomPlaylistView::PlaylistType type, c
|
||||
}
|
||||
}
|
||||
|
||||
CustomPlaylistView::~CustomPlaylistView()
|
||||
{}
|
||||
|
||||
void
|
||||
CustomPlaylistView::generateTracks()
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
};
|
||||
|
||||
explicit CustomPlaylistView( PlaylistType type, const source_ptr& s, QWidget* parent = 0 );
|
||||
virtual ~CustomPlaylistView() {}
|
||||
virtual ~CustomPlaylistView();
|
||||
|
||||
virtual bool showFilter() const { return false; }
|
||||
virtual bool showStatsBar() const { return false; }
|
||||
|
36
src/libtomahawk/playlist/dynamic/DynamicPlaylistRevision.cpp
Normal file
36
src/libtomahawk/playlist/dynamic/DynamicPlaylistRevision.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Tomahawk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "DynamicPlaylistRevision.h"
|
||||
|
||||
#include "dynamic/DynamicControl.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
DynamicPlaylistRevision::DynamicPlaylistRevision(const PlaylistRevision &other)
|
||||
{
|
||||
revisionguid = other.revisionguid;
|
||||
oldrevisionguid = other.oldrevisionguid;
|
||||
newlist = other.newlist;
|
||||
added = other.added;
|
||||
removed = other.removed;
|
||||
applied = other.applied;
|
||||
}
|
||||
|
||||
DynamicPlaylistRevision::DynamicPlaylistRevision()
|
||||
{}
|
@ -1,6 +1,6 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -33,17 +33,8 @@ public:
|
||||
Tomahawk::GeneratorMode mode;
|
||||
QString type;
|
||||
|
||||
DynamicPlaylistRevision( const PlaylistRevision& other )
|
||||
{
|
||||
revisionguid = other.revisionguid;
|
||||
oldrevisionguid = other.oldrevisionguid;
|
||||
newlist = other.newlist;
|
||||
added = other.added;
|
||||
removed = other.removed;
|
||||
applied = other.applied;
|
||||
}
|
||||
|
||||
DynamicPlaylistRevision() {}
|
||||
DynamicPlaylistRevision( const PlaylistRevision& other );
|
||||
DynamicPlaylistRevision();
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -27,8 +27,8 @@
|
||||
#include <QToolButton>
|
||||
#include <QPropertyAnimation>
|
||||
|
||||
#include <echonest/Playlist.h>
|
||||
#include <dynamic/widgets/DynamicWidget.h>
|
||||
#include "echonest/Playlist.h"
|
||||
#include "dynamic/widgets/DynamicWidget.h"
|
||||
|
||||
#include "utils/tomahawkutils.h"
|
||||
#include "utils/logger.h"
|
||||
|
@ -43,7 +43,7 @@ namespace Tomahawk
|
||||
{
|
||||
|
||||
class DynamicModel;
|
||||
|
||||
class DynamicControl;
|
||||
class DynamicSetupWidget;
|
||||
class DynamicView;
|
||||
class CollapsibleControls;
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "utils/logger.h"
|
||||
#include "dropjob.h"
|
||||
#include "artist.h"
|
||||
#include "album.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
|
@ -73,6 +73,11 @@ TreeModel::clear()
|
||||
}
|
||||
}
|
||||
|
||||
Tomahawk::collection_ptr
|
||||
TreeModel::collection() const
|
||||
{
|
||||
return m_collection;
|
||||
}
|
||||
|
||||
void
|
||||
TreeModel::getCover( const QModelIndex& index )
|
||||
|
@ -89,7 +89,7 @@ public:
|
||||
|
||||
virtual QPersistentModelIndex currentItem() { return m_currentIndex; }
|
||||
|
||||
Tomahawk::collection_ptr collection() const { return m_collection; }
|
||||
Tomahawk::collection_ptr collection() const;
|
||||
|
||||
void addAllCollections();
|
||||
void addCollection( const Tomahawk::collection_ptr& collection );
|
||||
|
45
src/libtomahawk/playlistinterface.cpp
Normal file
45
src/libtomahawk/playlistinterface.cpp
Normal file
@ -0,0 +1,45 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Tomahawk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "playlistinterface.h"
|
||||
|
||||
#include "result.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
PlaylistInterface::PlaylistInterface (QObject *parent )
|
||||
: m_object( parent )
|
||||
{
|
||||
qRegisterMetaType<Tomahawk::PlaylistInterface::RepeatMode>( "Tomahawk::PlaylistInterface::RepeatMode" );
|
||||
}
|
||||
|
||||
PlaylistInterface::~PlaylistInterface()
|
||||
{
|
||||
}
|
||||
|
||||
result_ptr
|
||||
PlaylistInterface::previousItem()
|
||||
{
|
||||
return siblingItem( -1 );
|
||||
}
|
||||
|
||||
result_ptr
|
||||
PlaylistInterface::nextItem()
|
||||
{
|
||||
return siblingItem( 1 );
|
||||
}
|
@ -40,11 +40,8 @@ public:
|
||||
enum SkipRestrictions { NoSkipRestrictions, NoSkipForwards, NoSkipBackwards, NoSkip };
|
||||
enum RetryMode { NoRetry, Retry };
|
||||
|
||||
PlaylistInterface( QObject* parent = 0 ) : m_object( parent )
|
||||
{
|
||||
qRegisterMetaType<Tomahawk::PlaylistInterface::RepeatMode>( "Tomahawk::PlaylistInterface::RepeatMode" );
|
||||
}
|
||||
virtual ~PlaylistInterface() {}
|
||||
explicit PlaylistInterface( QObject* parent = 0 );
|
||||
virtual ~PlaylistInterface();
|
||||
|
||||
virtual QList< Tomahawk::query_ptr > tracks() = 0;
|
||||
|
||||
@ -52,9 +49,9 @@ public:
|
||||
virtual int trackCount() const = 0;
|
||||
|
||||
virtual Tomahawk::result_ptr currentItem() const = 0;
|
||||
virtual Tomahawk::result_ptr previousItem() { return siblingItem( -1 ); }
|
||||
virtual Tomahawk::result_ptr previousItem();
|
||||
virtual bool hasNextItem() { return true; }
|
||||
virtual Tomahawk::result_ptr nextItem() { return siblingItem( 1 ); }
|
||||
virtual Tomahawk::result_ptr nextItem();
|
||||
virtual Tomahawk::result_ptr siblingItem( int itemsAway ) = 0;
|
||||
|
||||
virtual PlaylistInterface::RepeatMode repeatMode() const = 0;
|
||||
@ -99,6 +96,8 @@ signals:
|
||||
virtual void nextTrackReady() = 0;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY( PlaylistInterface )
|
||||
|
||||
QObject* m_object;
|
||||
Tomahawk::playlistinterface_ptr m_sharedPtr;
|
||||
|
||||
|
@ -432,6 +432,12 @@ Query::howSimilar( const Tomahawk::result_ptr& r )
|
||||
}
|
||||
|
||||
|
||||
QPair< Tomahawk::source_ptr, unsigned int >
|
||||
Query::playedBy() const
|
||||
{
|
||||
return m_playedBy;
|
||||
}
|
||||
|
||||
int
|
||||
Query::levenshtein( const QString& source, const QString& target )
|
||||
{
|
||||
|
@ -77,7 +77,7 @@ public:
|
||||
bool resolvingFinished() const { return m_resolveFinished; }
|
||||
float howSimilar( const Tomahawk::result_ptr& r );
|
||||
|
||||
QPair< Tomahawk::source_ptr, unsigned int > playedBy() const { return m_playedBy; }
|
||||
QPair< Tomahawk::source_ptr, unsigned int > playedBy() const;
|
||||
Tomahawk::Resolver* currentResolver() const;
|
||||
QList< QWeakPointer< Tomahawk::Resolver > > resolvedBy() const { return m_resolvers; }
|
||||
|
||||
@ -126,6 +126,8 @@ private slots:
|
||||
void refreshResults();
|
||||
|
||||
private:
|
||||
Query();
|
||||
|
||||
void init();
|
||||
|
||||
void setCurrentResolver( Tomahawk::Resolver* resolver );
|
||||
|
@ -123,6 +123,7 @@ private slots:
|
||||
private:
|
||||
// private constructor
|
||||
explicit Result( const QString& url );
|
||||
Result();
|
||||
|
||||
void updateAttributes();
|
||||
void parseSocialActions();
|
||||
|
@ -31,6 +31,8 @@ SipPluginFactory::generateId()
|
||||
return factoryId() + "_" + uniq;
|
||||
}
|
||||
|
||||
SipPlugin::SipPlugin() : QObject() {}
|
||||
SipPlugin::~SipPlugin() {}
|
||||
|
||||
SipPlugin::SipPlugin( const QString& pluginId, QObject* parent )
|
||||
: QObject( parent )
|
||||
|
@ -60,8 +60,9 @@ public:
|
||||
enum SipErrorCode { AuthError, ConnectionError }; // Placeholder for errors, to be defined
|
||||
enum ConnectionState { Disconnected, Connecting, Connected, Disconnecting };
|
||||
|
||||
SipPlugin();
|
||||
explicit SipPlugin( const QString& pluginId, QObject* parent = 0 );
|
||||
virtual ~SipPlugin() {}
|
||||
virtual ~SipPlugin();
|
||||
|
||||
// plugin id is "pluginfactoryname_someuniqueid". get it from SipPluginFactory::generateId
|
||||
QString pluginId() const;
|
||||
|
@ -35,6 +35,8 @@ SourcePlaylistInterface::SourcePlaylistInterface( Tomahawk::source_ptr& source )
|
||||
connect( source.data(), SIGNAL( playbackStarted( const Tomahawk::query_ptr& ) ), SLOT( onSourcePlaybackStarted( const Tomahawk::query_ptr& ) ) );
|
||||
}
|
||||
|
||||
SourcePlaylistInterface::~SourcePlaylistInterface()
|
||||
{}
|
||||
|
||||
Tomahawk::result_ptr
|
||||
SourcePlaylistInterface::siblingItem( int itemsAway )
|
||||
@ -65,6 +67,11 @@ SourcePlaylistInterface::nextItem()
|
||||
return m_currentItem;
|
||||
}
|
||||
|
||||
result_ptr
|
||||
SourcePlaylistInterface::currentItem() const
|
||||
{
|
||||
return m_currentItem;
|
||||
}
|
||||
|
||||
bool
|
||||
SourcePlaylistInterface::hasNextItem()
|
||||
@ -84,6 +91,13 @@ SourcePlaylistInterface::tracks()
|
||||
}
|
||||
|
||||
|
||||
source_ptr
|
||||
SourcePlaylistInterface::source() const
|
||||
{
|
||||
return m_source;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SourcePlaylistInterface::reset()
|
||||
{
|
||||
@ -110,4 +124,4 @@ SourcePlaylistInterface::resolvingFinished( bool hasResults )
|
||||
tDebug( LOGEXTRA ) << Q_FUNC_INFO << " and has results? : " << (hasResults ? "true" : "false");
|
||||
if ( hasResults )
|
||||
emit nextTrackReady();
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ Q_OBJECT
|
||||
|
||||
public:
|
||||
SourcePlaylistInterface( Tomahawk::source_ptr& source );
|
||||
~SourcePlaylistInterface();
|
||||
|
||||
QList<Tomahawk::query_ptr> tracks();
|
||||
|
||||
@ -45,7 +46,7 @@ public:
|
||||
virtual Tomahawk::result_ptr siblingItem( int itemsAway );
|
||||
virtual bool hasNextItem();
|
||||
virtual Tomahawk::result_ptr nextItem();
|
||||
virtual Tomahawk::result_ptr currentItem() const { return m_currentItem; }
|
||||
virtual Tomahawk::result_ptr currentItem() const;
|
||||
|
||||
virtual PlaylistInterface::RepeatMode repeatMode() const { return PlaylistInterface::NoRepeat; }
|
||||
virtual PlaylistInterface::SeekRestrictions seekRestrictions() const { return PlaylistInterface::NoSeek; }
|
||||
@ -56,7 +57,7 @@ public:
|
||||
virtual bool shuffled() const { return false; }
|
||||
virtual void setFilter( const QString& /*pattern*/ ) {}
|
||||
|
||||
virtual Tomahawk::source_ptr source() const { return m_source; }
|
||||
virtual Tomahawk::source_ptr source() const;
|
||||
|
||||
virtual void reset();
|
||||
|
||||
@ -76,6 +77,8 @@ private slots:
|
||||
void resolvingFinished( bool hasResults );
|
||||
|
||||
private:
|
||||
SourcePlaylistInterface();
|
||||
|
||||
Tomahawk::source_ptr m_source;
|
||||
Tomahawk::result_ptr m_currentItem;
|
||||
bool m_gotNextItem;
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <QSharedPointer>
|
||||
#include <QUuid>
|
||||
|
||||
template <typename T> class QSharedPointer;
|
||||
//template <typename T> class QSharedPointer;
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
|
@ -34,6 +34,22 @@
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
JSPFLoader::JSPFLoader( bool autoCreate, QObject *parent )
|
||||
: QObject( parent )
|
||||
, m_autoCreate( autoCreate )
|
||||
{}
|
||||
|
||||
JSPFLoader::~JSPFLoader()
|
||||
{
|
||||
}
|
||||
|
||||
QList< Tomahawk::query_ptr >
|
||||
JSPFLoader::entries() const
|
||||
{
|
||||
return m_entries;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
JSPFLoader::load( const QUrl& url )
|
||||
{
|
||||
|
@ -38,14 +38,11 @@ class DLLEXPORT JSPFLoader : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit JSPFLoader( bool autoCreate = true, QObject* parent = 0 )
|
||||
: QObject( parent )
|
||||
, m_autoCreate( autoCreate )
|
||||
{}
|
||||
explicit JSPFLoader( bool autoCreate = true, QObject* parent = 0 );
|
||||
|
||||
virtual ~JSPFLoader() {}
|
||||
virtual ~JSPFLoader();
|
||||
|
||||
QList< Tomahawk::query_ptr > entries() const { return m_entries; }
|
||||
QList< Tomahawk::query_ptr > entries() const;
|
||||
void setOverrideTitle( const QString& newTitle ) { m_overrideTitle = newTitle; }
|
||||
|
||||
signals:
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "dllmacro.h"
|
||||
#include "typedefs.h"
|
||||
#include "query.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
|
@ -30,6 +30,15 @@
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
XSPFLoader::XSPFLoader( bool autoCreate, QObject *parent )
|
||||
: QObject( parent )
|
||||
, m_autoCreate( autoCreate )
|
||||
, m_NS("http://xspf.org/ns/0/")
|
||||
{}
|
||||
|
||||
|
||||
XSPFLoader::~XSPFLoader()
|
||||
{}
|
||||
|
||||
void
|
||||
XSPFLoader::setOverrideTitle( const QString& newTitle )
|
||||
@ -37,6 +46,11 @@ XSPFLoader::setOverrideTitle( const QString& newTitle )
|
||||
m_overrideTitle = newTitle;
|
||||
}
|
||||
|
||||
QList< Tomahawk::query_ptr >
|
||||
XSPFLoader::entries() const
|
||||
{
|
||||
return m_entries;
|
||||
}
|
||||
|
||||
void
|
||||
XSPFLoader::load( const QUrl& url )
|
||||
|
@ -39,18 +39,10 @@ class DLLEXPORT XSPFLoader : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit XSPFLoader( bool autoCreate = true, QObject* parent = 0 )
|
||||
: QObject( parent )
|
||||
, m_autoCreate( autoCreate )
|
||||
, m_NS("http://xspf.org/ns/0/")
|
||||
{}
|
||||
explicit XSPFLoader( bool autoCreate = true, QObject* parent = 0 );
|
||||
|
||||
virtual ~XSPFLoader()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
}
|
||||
|
||||
QList< Tomahawk::query_ptr > entries() const { return m_entries; }
|
||||
virtual ~XSPFLoader();
|
||||
QList< Tomahawk::query_ptr > entries() const;
|
||||
|
||||
void setOverrideTitle( const QString& newTitle );
|
||||
|
||||
|
@ -32,9 +32,10 @@
|
||||
#include <QWidget>
|
||||
|
||||
#include "viewpage.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
#include "typedefs.h"
|
||||
#include "album.h"
|
||||
#include "query.h"
|
||||
|
||||
class AlbumModel;
|
||||
class PlaylistModel;
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "typedefs.h"
|
||||
#include "playlistinterface.h"
|
||||
#include "viewpage.h"
|
||||
#include "infosystem/infosystem.h"
|
||||
|
@ -30,6 +30,8 @@ ZeroconfFactory::createPlugin( const QString& pluginId )
|
||||
return new ZeroconfPlugin( pluginId.isEmpty() ? generateId() : pluginId );
|
||||
}
|
||||
|
||||
ZeroconfPlugin::ZeroconfPlugin() : SipPlugin( "") {}
|
||||
|
||||
ZeroconfPlugin::ZeroconfPlugin ( const QString& pluginId )
|
||||
: SipPlugin( pluginId )
|
||||
, m_zeroconf( 0 )
|
||||
@ -39,6 +41,8 @@ ZeroconfPlugin::ZeroconfPlugin ( const QString& pluginId )
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
}
|
||||
|
||||
ZeroconfPlugin::~ZeroconfPlugin() {}
|
||||
|
||||
const QString
|
||||
ZeroconfPlugin::name() const
|
||||
{
|
||||
|
@ -48,18 +48,16 @@ class SIPDLLEXPORT ZeroconfPlugin : public SipPlugin
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ZeroconfPlugin();
|
||||
ZeroconfPlugin( const QString& pluginId );
|
||||
|
||||
virtual ~ZeroconfPlugin()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
}
|
||||
virtual ~ZeroconfPlugin();
|
||||
|
||||
virtual const QString name() const;
|
||||
virtual const QString friendlyName() const;
|
||||
virtual const QString accountName() const;
|
||||
virtual ConnectionState connectionState() const;
|
||||
virtual bool isValid() const { return true; };
|
||||
virtual bool isValid() const { return true; }
|
||||
virtual QIcon icon() const;
|
||||
virtual void checkSettings() {}
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <QStringList>
|
||||
|
||||
#include "typedefs.h"
|
||||
#include "source.h"
|
||||
|
||||
class QMimeData;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user