mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 09:04:33 +02:00
Revert usage of boost::threads to speed up id loading. Our MinGW boost package is broken.
Revert "Set future on artist/album immediately after creating promise" This reverts commit9d9fae75b5
. Revert "Remove duplicate function, and fix copy link from sidebar track page" This reverts commit1fe28714cb
. Revert "Catch by const ref and assert to check hypothesis" This reverts commita8f0053fc8
. Revert "Reimplement QApplication::notify() to print out something about the exception if we can" This reverts commit7b8136a36e
. Revert "Catch boost::unitialized_future if it is thrown" This reverts commitc1d678e2b1
. Revert "Another boost/thread.hpp include rather than specific boost headers" This reverts commitee8d3e6a92
. Revert "One include to (hopefully) rule them all" This reverts commit52752cd234
. Revert "Add another boost include" This reverts commit7bec03560a
. Revert "Try some more includes" This reverts commite56f2f7ee0
. Revert "Remove old code" This reverts commit69b56e0836
. Revert "Fix oversight in queue draining" This reverts commit8c48af423c
. Revert "Safer locking of id() to prevent deadlocks" This reverts commit3f2906d4d1
. Revert "Cleanup fixes" This reverts commitcd3eeb2951
. Revert "Experimental asynchronous artist and album id loading" This reverts commit75eb35397d
. Conflicts: src/libtomahawk/CMakeLists.txt
This commit is contained in:
@@ -115,7 +115,7 @@ macro_log_feature(TAGLIB_FOUND "TagLib" "Audio Meta-Data Library" "http://develo
|
|||||||
include( CheckTagLibFileName )
|
include( CheckTagLibFileName )
|
||||||
check_taglib_filename( COMPLEX_TAGLIB_FILENAME )
|
check_taglib_filename( COMPLEX_TAGLIB_FILENAME )
|
||||||
|
|
||||||
macro_optional_find_package( Boost COMPONENTS thread )
|
macro_optional_find_package(Boost)
|
||||||
macro_log_feature(Boost_FOUND "Boost" "Provides free peer-reviewed portable C++ source libraries" "http://www.boost.org" TRUE "" "") #FIXME: give useful explaination
|
macro_log_feature(Boost_FOUND "Boost" "Provides free peer-reviewed portable C++ source libraries" "http://www.boost.org" TRUE "" "") #FIXME: give useful explaination
|
||||||
|
|
||||||
macro_optional_find_package(QCA2)
|
macro_optional_find_package(QCA2)
|
||||||
|
@@ -707,27 +707,6 @@ TomahawkApp::loadUrl( const QString& url )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
TomahawkApp::notify( QObject *receiver, QEvent *e )
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return TOMAHAWK_APPLICATION::notify( receiver, e );
|
|
||||||
}
|
|
||||||
catch ( const std::exception& e )
|
|
||||||
{
|
|
||||||
qWarning( "TomahawkApp::notify caught a std exception in a Qt event handler: " );
|
|
||||||
qFatal( e.what() );
|
|
||||||
}
|
|
||||||
catch ( ... )
|
|
||||||
{
|
|
||||||
qFatal( "TomahawkApp::notify caught a non-std-exception from a Qt event handler. Aborting." );
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
|
TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
|
||||||
{
|
{
|
||||||
|
@@ -99,9 +99,6 @@ public:
|
|||||||
|
|
||||||
bool isTomahawkLoaded() const { return m_loaded; }
|
bool isTomahawkLoaded() const { return m_loaded; }
|
||||||
|
|
||||||
// reimplemented from QApplication/QCoreApplication
|
|
||||||
virtual bool notify( QObject* receiver, QEvent* e );
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void tomahawkLoaded();
|
void tomahawkLoaded();
|
||||||
|
|
||||||
|
@@ -23,22 +23,13 @@
|
|||||||
#include "AlbumPlaylistInterface.h"
|
#include "AlbumPlaylistInterface.h"
|
||||||
#include "database/Database.h"
|
#include "database/Database.h"
|
||||||
#include "database/DatabaseImpl.h"
|
#include "database/DatabaseImpl.h"
|
||||||
#include "database/IdThreadWorker.h"
|
|
||||||
#include "Query.h"
|
#include "Query.h"
|
||||||
#include "Source.h"
|
#include "Source.h"
|
||||||
|
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include <QReadWriteLock>
|
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
QHash< QString, album_ptr > Album::s_albumsByName = QHash< QString, album_ptr >();
|
|
||||||
QHash< unsigned int, album_ptr > Album::s_albumsById = QHash< unsigned int, album_ptr >();
|
|
||||||
|
|
||||||
static QMutex s_nameCacheMutex;
|
|
||||||
static QMutex s_idCacheMutex;
|
|
||||||
static QReadWriteLock s_idMutex;
|
|
||||||
|
|
||||||
Album::~Album()
|
Album::~Album()
|
||||||
{
|
{
|
||||||
@@ -49,12 +40,6 @@ Album::~Album()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
inline QString
|
|
||||||
albumCacheKey( const Tomahawk::artist_ptr& artist, const QString& albumName )
|
|
||||||
{
|
|
||||||
return QString( "%1\t\t%2" ).arg( artist->name() ).arg( albumName );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
album_ptr
|
album_ptr
|
||||||
Album::get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCreate )
|
Album::get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCreate )
|
||||||
@@ -62,22 +47,11 @@ Album::get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCr
|
|||||||
if ( !Database::instance() || !Database::instance()->impl() )
|
if ( !Database::instance() || !Database::instance()->impl() )
|
||||||
return album_ptr();
|
return album_ptr();
|
||||||
|
|
||||||
QMutexLocker l( &s_nameCacheMutex );
|
int albid = Database::instance()->impl()->albumId( artist->id(), name, autoCreate );
|
||||||
|
if ( albid < 1 && autoCreate )
|
||||||
|
return album_ptr();
|
||||||
|
|
||||||
const QString key = albumCacheKey( artist, name );
|
return Album::get( albid, name, artist );
|
||||||
if ( s_albumsByName.contains( key ) )
|
|
||||||
{
|
|
||||||
return s_albumsByName[ key ];
|
|
||||||
}
|
|
||||||
|
|
||||||
// qDebug() << "LOOKING UP ALBUM:" << artist->name() << name;
|
|
||||||
album_ptr album = album_ptr( new Album( name, artist ) );
|
|
||||||
album->setWeakRef( album.toWeakRef() );
|
|
||||||
album->loadId( autoCreate );
|
|
||||||
|
|
||||||
s_albumsByName[ key ] = album;
|
|
||||||
|
|
||||||
return album;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -87,17 +61,17 @@ Album::get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& ar
|
|||||||
static QHash< unsigned int, album_ptr > s_albums;
|
static QHash< unsigned int, album_ptr > s_albums;
|
||||||
static QMutex s_mutex;
|
static QMutex s_mutex;
|
||||||
|
|
||||||
QMutexLocker lock( &s_idCacheMutex );
|
QMutexLocker lock( &s_mutex );
|
||||||
if ( s_albumsById.contains( id ) )
|
if ( s_albums.contains( id ) )
|
||||||
{
|
{
|
||||||
return s_albumsById.value( id );
|
return s_albums.value( id );
|
||||||
}
|
}
|
||||||
|
|
||||||
album_ptr a = album_ptr( new Album( id, name, artist ), &QObject::deleteLater );
|
album_ptr a = album_ptr( new Album( id, name, artist ), &QObject::deleteLater );
|
||||||
a->setWeakRef( a.toWeakRef() );
|
a->setWeakRef( a.toWeakRef() );
|
||||||
|
|
||||||
if ( id > 0 )
|
if ( id > 0 )
|
||||||
s_albumsById.insert( id, a );
|
s_albums.insert( id, a );
|
||||||
|
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -105,7 +79,6 @@ Album::get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& ar
|
|||||||
|
|
||||||
Album::Album( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist )
|
Album::Album( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist )
|
||||||
: QObject()
|
: QObject()
|
||||||
, m_waitingForId( false )
|
|
||||||
, m_id( id )
|
, m_id( id )
|
||||||
, m_name( name )
|
, m_name( name )
|
||||||
, m_artist( artist )
|
, m_artist( artist )
|
||||||
@@ -119,20 +92,6 @@ Album::Album( unsigned int id, const QString& name, const Tomahawk::artist_ptr&
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Album::Album( const QString& name, const Tomahawk::artist_ptr& artist )
|
|
||||||
: QObject()
|
|
||||||
, m_waitingForId( true )
|
|
||||||
, m_name( name )
|
|
||||||
, m_artist( artist )
|
|
||||||
, m_coverLoaded( false )
|
|
||||||
, m_coverLoading( false )
|
|
||||||
#ifndef ENABLE_HEADLESS
|
|
||||||
, m_cover( 0 )
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
m_sortname = DatabaseImpl::sortname( name );
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Album::onTracksLoaded( Tomahawk::ModelMode mode, const Tomahawk::collection_ptr& collection )
|
Album::onTracksLoaded( Tomahawk::ModelMode mode, const Tomahawk::collection_ptr& collection )
|
||||||
{
|
{
|
||||||
@@ -147,56 +106,6 @@ Album::artist() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
Album::loadId( bool autoCreate )
|
|
||||||
{
|
|
||||||
Q_ASSERT( m_waitingForId );
|
|
||||||
IdThreadWorker::getAlbumId( m_ownRef.toStrongRef(), autoCreate );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
Album::setIdFuture( boost::unique_future< unsigned int > future )
|
|
||||||
{
|
|
||||||
m_idFuture = boost::move( future );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
unsigned int
|
|
||||||
Album::id() const
|
|
||||||
{
|
|
||||||
s_idMutex.lockForRead();
|
|
||||||
const bool waiting = m_waitingForId;
|
|
||||||
unsigned int finalId = m_id;
|
|
||||||
s_idMutex.unlock();
|
|
||||||
|
|
||||||
if ( waiting )
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
finalId = m_idFuture.get();
|
|
||||||
|
|
||||||
s_idMutex.lockForWrite();
|
|
||||||
m_id = finalId;
|
|
||||||
m_waitingForId = false;
|
|
||||||
|
|
||||||
if ( m_id > 0 )
|
|
||||||
s_albumsById[ m_id ] = m_ownRef.toStrongRef();
|
|
||||||
s_idMutex.unlock();
|
|
||||||
}
|
|
||||||
catch( const boost::future_uninitialized& e )
|
|
||||||
{
|
|
||||||
qWarning() << "Caught boost::future_uninitialized when trying to get artist id from future, WTF?";
|
|
||||||
qWarning() << "Potential race condition, do we have an ID?" << m_id << "and waiting?" << m_waitingForId << e.what();
|
|
||||||
|
|
||||||
Q_ASSERT( !m_waitingForId );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return finalId;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef ENABLE_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
QPixmap
|
QPixmap
|
||||||
Album::cover( const QSize& size, bool forceLoad ) const
|
Album::cover( const QSize& size, bool forceLoad ) const
|
||||||
|
@@ -28,16 +28,12 @@
|
|||||||
#include <QtGui/QPixmap>
|
#include <QtGui/QPixmap>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/thread.hpp>
|
|
||||||
|
|
||||||
#include "Typedefs.h"
|
#include "Typedefs.h"
|
||||||
#include "PlaylistInterface.h"
|
#include "PlaylistInterface.h"
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "Collection.h"
|
#include "Collection.h"
|
||||||
#include "infosystem/InfoSystem.h"
|
#include "infosystem/InfoSystem.h"
|
||||||
|
|
||||||
class IdThreadWorker;
|
|
||||||
|
|
||||||
namespace Tomahawk
|
namespace Tomahawk
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -49,11 +45,10 @@ public:
|
|||||||
static album_ptr get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCreate = false );
|
static album_ptr get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCreate = false );
|
||||||
static album_ptr get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist );
|
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 );
|
explicit Album( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist );
|
||||||
Album( const QString& name, const Tomahawk::artist_ptr& artist );
|
|
||||||
virtual ~Album();
|
virtual ~Album();
|
||||||
|
|
||||||
unsigned int id() const;
|
unsigned int id() const { return m_id; }
|
||||||
QString name() const { return m_name; }
|
QString name() const { return m_name; }
|
||||||
QString sortname() const { return m_sortname; }
|
QString sortname() const { return m_sortname; }
|
||||||
|
|
||||||
@@ -69,7 +64,6 @@ public:
|
|||||||
QWeakPointer< Tomahawk::Album > weakRef() { return m_ownRef; }
|
QWeakPointer< Tomahawk::Album > weakRef() { return m_ownRef; }
|
||||||
void setWeakRef( QWeakPointer< Tomahawk::Album > weakRef ) { m_ownRef = weakRef; }
|
void setWeakRef( QWeakPointer< Tomahawk::Album > weakRef ) { m_ownRef = weakRef; }
|
||||||
|
|
||||||
void loadId( bool autoCreate );
|
|
||||||
signals:
|
signals:
|
||||||
void tracksAdded( const QList<Tomahawk::query_ptr>& tracks, Tomahawk::ModelMode mode, const Tomahawk::collection_ptr& collection );
|
void tracksAdded( const QList<Tomahawk::query_ptr>& tracks, Tomahawk::ModelMode mode, const Tomahawk::collection_ptr& collection );
|
||||||
void updated();
|
void updated();
|
||||||
@@ -84,11 +78,8 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY( Album )
|
Q_DISABLE_COPY( Album )
|
||||||
QString infoid() const;
|
QString infoid() const;
|
||||||
void setIdFuture( boost::unique_future< unsigned int > future );
|
|
||||||
|
|
||||||
mutable bool m_waitingForId;
|
unsigned int m_id;
|
||||||
mutable boost::unique_future< unsigned int > m_idFuture;
|
|
||||||
mutable unsigned int m_id;
|
|
||||||
QString m_name;
|
QString m_name;
|
||||||
QString m_sortname;
|
QString m_sortname;
|
||||||
|
|
||||||
@@ -107,11 +98,6 @@ private:
|
|||||||
QHash< Tomahawk::ModelMode, QHash< Tomahawk::collection_ptr, Tomahawk::playlistinterface_ptr > > m_playlistInterface;
|
QHash< Tomahawk::ModelMode, QHash< Tomahawk::collection_ptr, Tomahawk::playlistinterface_ptr > > m_playlistInterface;
|
||||||
|
|
||||||
QWeakPointer< Tomahawk::Album > m_ownRef;
|
QWeakPointer< Tomahawk::Album > m_ownRef;
|
||||||
|
|
||||||
static QHash< QString, album_ptr > s_albumsByName;
|
|
||||||
static QHash< unsigned int, album_ptr > s_albumsById;
|
|
||||||
|
|
||||||
friend class ::IdThreadWorker;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
|
@@ -25,21 +25,12 @@
|
|||||||
#include "database/DatabaseImpl.h"
|
#include "database/DatabaseImpl.h"
|
||||||
#include "database/DatabaseCommand_AllAlbums.h"
|
#include "database/DatabaseCommand_AllAlbums.h"
|
||||||
#include "database/DatabaseCommand_TrackStats.h"
|
#include "database/DatabaseCommand_TrackStats.h"
|
||||||
#include "database/IdThreadWorker.h"
|
|
||||||
#include "Source.h"
|
#include "Source.h"
|
||||||
|
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include <QReadWriteLock>
|
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
QHash< QString, artist_ptr > Artist::s_artistsByName = QHash< QString, artist_ptr >();
|
|
||||||
QHash< unsigned int, artist_ptr > Artist::s_artistsById = QHash< unsigned int, artist_ptr >();
|
|
||||||
|
|
||||||
static QMutex s_nameCacheMutex;
|
|
||||||
static QMutex s_idCacheMutex;
|
|
||||||
static QReadWriteLock s_idMutex;
|
|
||||||
|
|
||||||
Artist::~Artist()
|
Artist::~Artist()
|
||||||
{
|
{
|
||||||
@@ -54,40 +45,34 @@ Artist::~Artist()
|
|||||||
artist_ptr
|
artist_ptr
|
||||||
Artist::get( const QString& name, bool autoCreate )
|
Artist::get( const QString& name, bool autoCreate )
|
||||||
{
|
{
|
||||||
if ( name.isEmpty() )
|
|
||||||
return artist_ptr();
|
|
||||||
|
|
||||||
QMutexLocker lock( &s_nameCacheMutex );
|
|
||||||
if ( s_artistsByName.contains( name ) )
|
|
||||||
return s_artistsByName.value( name );
|
|
||||||
|
|
||||||
if ( !Database::instance() || !Database::instance()->impl() )
|
if ( !Database::instance() || !Database::instance()->impl() )
|
||||||
return artist_ptr();
|
return artist_ptr();
|
||||||
|
|
||||||
artist_ptr artist = artist_ptr( new Artist( name ), &QObject::deleteLater );
|
int artid = Database::instance()->impl()->artistId( name, autoCreate );
|
||||||
artist->setWeakRef( artist.toWeakRef() );
|
if ( artid < 1 && autoCreate )
|
||||||
artist->loadId( autoCreate );
|
return artist_ptr();
|
||||||
|
|
||||||
s_artistsByName[ name ] = artist;
|
return Artist::get( artid, name );
|
||||||
|
|
||||||
return artist;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
artist_ptr
|
artist_ptr
|
||||||
Artist::get( unsigned int id, const QString& name )
|
Artist::get( unsigned int id, const QString& name )
|
||||||
{
|
{
|
||||||
QMutexLocker lock( &s_idCacheMutex );
|
static QHash< unsigned int, artist_ptr > s_artists;
|
||||||
if ( s_artistsById.contains( id ) )
|
static QMutex s_mutex;
|
||||||
|
|
||||||
|
QMutexLocker lock( &s_mutex );
|
||||||
|
if ( s_artists.contains( id ) )
|
||||||
{
|
{
|
||||||
return s_artistsById.value( id );
|
return s_artists.value( id );
|
||||||
}
|
}
|
||||||
|
|
||||||
artist_ptr a = artist_ptr( new Artist( id, name ), &QObject::deleteLater );
|
artist_ptr a = artist_ptr( new Artist( id, name ), &QObject::deleteLater );
|
||||||
a->setWeakRef( a.toWeakRef() );
|
a->setWeakRef( a.toWeakRef() );
|
||||||
|
|
||||||
if ( id > 0 )
|
if ( id > 0 )
|
||||||
s_artistsById.insert( id, a );
|
s_artists.insert( id, a );
|
||||||
|
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
@@ -95,7 +80,6 @@ Artist::get( unsigned int id, const QString& name )
|
|||||||
|
|
||||||
Artist::Artist( unsigned int id, const QString& name )
|
Artist::Artist( unsigned int id, const QString& name )
|
||||||
: QObject()
|
: QObject()
|
||||||
, m_waitingForFuture( false )
|
|
||||||
, m_id( id )
|
, m_id( id )
|
||||||
, m_name( name )
|
, m_name( name )
|
||||||
, m_coverLoaded( false )
|
, m_coverLoaded( false )
|
||||||
@@ -111,24 +95,6 @@ Artist::Artist( unsigned int id, const QString& name )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Artist::Artist( const QString& name )
|
|
||||||
: QObject()
|
|
||||||
, m_waitingForFuture( true )
|
|
||||||
, m_id( 0 )
|
|
||||||
, m_name( name )
|
|
||||||
, m_coverLoaded( false )
|
|
||||||
, m_coverLoading( false )
|
|
||||||
, m_simArtistsLoaded( false )
|
|
||||||
, m_biographyLoaded( false )
|
|
||||||
, m_infoJobs( 0 )
|
|
||||||
#ifndef ENABLE_HEADLESS
|
|
||||||
, m_cover( 0 )
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
m_sortname = DatabaseImpl::sortname( name, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Artist::onTracksLoaded( Tomahawk::ModelMode mode, const Tomahawk::collection_ptr& collection )
|
Artist::onTracksLoaded( Tomahawk::ModelMode mode, const Tomahawk::collection_ptr& collection )
|
||||||
{
|
{
|
||||||
@@ -226,57 +192,6 @@ Artist::similarArtists() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
Artist::loadId( bool autoCreate )
|
|
||||||
{
|
|
||||||
Q_ASSERT( m_waitingForFuture );
|
|
||||||
|
|
||||||
IdThreadWorker::getArtistId( m_ownRef.toStrongRef(), autoCreate );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
Artist::setIdFuture( boost::unique_future< unsigned int > future )
|
|
||||||
{
|
|
||||||
m_idFuture = boost::move(future);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
unsigned int
|
|
||||||
Artist::id() const
|
|
||||||
{
|
|
||||||
s_idMutex.lockForRead();
|
|
||||||
const bool waiting = m_waitingForFuture;
|
|
||||||
unsigned int finalid = m_id;
|
|
||||||
s_idMutex.unlock();
|
|
||||||
|
|
||||||
if ( waiting )
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
finalid = m_idFuture.get();
|
|
||||||
|
|
||||||
s_idMutex.lockForWrite();
|
|
||||||
m_id = finalid;
|
|
||||||
m_waitingForFuture = false;
|
|
||||||
|
|
||||||
if ( m_id > 0 )
|
|
||||||
s_artistsById[ m_id ] = m_ownRef.toStrongRef();
|
|
||||||
s_idMutex.unlock();
|
|
||||||
}
|
|
||||||
catch( const boost::future_uninitialized& e )
|
|
||||||
{
|
|
||||||
qWarning() << "Caught boost::future_uninitialized when trying to get artist id from future, WTF?";
|
|
||||||
qWarning() << "Potential race condition, do we have an ID?" << m_id << "and waiting?" << m_waitingForFuture << e.what();
|
|
||||||
|
|
||||||
Q_ASSERT( !m_waitingForFuture );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString
|
QString
|
||||||
Artist::biography() const
|
Artist::biography() const
|
||||||
{
|
{
|
||||||
|
@@ -31,10 +31,6 @@
|
|||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "Query.h"
|
#include "Query.h"
|
||||||
|
|
||||||
#include <boost/thread.hpp>
|
|
||||||
|
|
||||||
class IdThreadWorker;
|
|
||||||
|
|
||||||
namespace Tomahawk
|
namespace Tomahawk
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -46,11 +42,10 @@ public:
|
|||||||
static artist_ptr get( const QString& name, bool autoCreate = false );
|
static artist_ptr get( const QString& name, bool autoCreate = false );
|
||||||
static artist_ptr get( unsigned int id, const QString& name );
|
static artist_ptr get( unsigned int id, const QString& name );
|
||||||
|
|
||||||
Artist( unsigned int id, const QString& name );
|
explicit Artist( unsigned int id, const QString& name );
|
||||||
explicit Artist( const QString& name );
|
|
||||||
virtual ~Artist();
|
virtual ~Artist();
|
||||||
|
|
||||||
unsigned int id() const;
|
unsigned int id() const { return m_id; }
|
||||||
QString name() const { return m_name; }
|
QString name() const { return m_name; }
|
||||||
QString sortname() const { return m_sortname; }
|
QString sortname() const { return m_sortname; }
|
||||||
|
|
||||||
@@ -77,7 +72,6 @@ public:
|
|||||||
QWeakPointer< Tomahawk::Artist > weakRef() { return m_ownRef; }
|
QWeakPointer< Tomahawk::Artist > weakRef() { return m_ownRef; }
|
||||||
void setWeakRef( QWeakPointer< Tomahawk::Artist > weakRef ) { m_ownRef = weakRef; }
|
void setWeakRef( QWeakPointer< Tomahawk::Artist > weakRef ) { m_ownRef = weakRef; }
|
||||||
|
|
||||||
void loadId( bool autoCreate );
|
|
||||||
signals:
|
signals:
|
||||||
void tracksAdded( const QList<Tomahawk::query_ptr>& tracks, Tomahawk::ModelMode mode, const Tomahawk::collection_ptr& collection );
|
void tracksAdded( const QList<Tomahawk::query_ptr>& tracks, Tomahawk::ModelMode mode, const Tomahawk::collection_ptr& collection );
|
||||||
void albumsAdded( const QList<Tomahawk::album_ptr>& albums, Tomahawk::ModelMode mode );
|
void albumsAdded( const QList<Tomahawk::album_ptr>& albums, Tomahawk::ModelMode mode );
|
||||||
@@ -99,12 +93,7 @@ private:
|
|||||||
Artist();
|
Artist();
|
||||||
QString infoid() const;
|
QString infoid() const;
|
||||||
|
|
||||||
void setIdFuture( boost::unique_future< unsigned int > future );
|
unsigned int m_id;
|
||||||
|
|
||||||
mutable bool m_waitingForFuture;
|
|
||||||
mutable boost::unique_future< unsigned int > m_idFuture;
|
|
||||||
mutable unsigned int m_id;
|
|
||||||
|
|
||||||
QString m_name;
|
QString m_name;
|
||||||
QString m_sortname;
|
QString m_sortname;
|
||||||
|
|
||||||
@@ -134,11 +123,6 @@ private:
|
|||||||
QHash< Tomahawk::ModelMode, QHash< Tomahawk::collection_ptr, Tomahawk::playlistinterface_ptr > > m_playlistInterface;
|
QHash< Tomahawk::ModelMode, QHash< Tomahawk::collection_ptr, Tomahawk::playlistinterface_ptr > > m_playlistInterface;
|
||||||
|
|
||||||
QWeakPointer< Tomahawk::Artist > m_ownRef;
|
QWeakPointer< Tomahawk::Artist > m_ownRef;
|
||||||
|
|
||||||
static QHash< QString, artist_ptr > s_artistsByName;
|
|
||||||
static QHash< unsigned int, artist_ptr > s_artistsById;
|
|
||||||
|
|
||||||
friend class ::IdThreadWorker;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
|
@@ -256,7 +256,6 @@ set( libSources
|
|||||||
database/DatabaseCommand_SetTrackAttributes.cpp
|
database/DatabaseCommand_SetTrackAttributes.cpp
|
||||||
database/Database.cpp
|
database/Database.cpp
|
||||||
database/TomahawkSqlQuery.cpp
|
database/TomahawkSqlQuery.cpp
|
||||||
database/IdThreadWorker.cpp
|
|
||||||
|
|
||||||
infosystem/InfoSystem.cpp
|
infosystem/InfoSystem.cpp
|
||||||
infosystem/InfoSystemCache.cpp
|
infosystem/InfoSystemCache.cpp
|
||||||
@@ -455,7 +454,6 @@ TARGET_LINK_LIBRARIES( tomahawklib
|
|||||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
${LINK_LIBRARIES}
|
${LINK_LIBRARIES}
|
||||||
${Boost_LIBRARIES}
|
|
||||||
${SQLITE_LIBRARIES}
|
${SQLITE_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -97,6 +97,20 @@ GlobalActionManager::openLinkFromQuery( const query_ptr& query ) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QUrl
|
||||||
|
GlobalActionManager::copyOpenLink( const query_ptr& query ) const
|
||||||
|
{
|
||||||
|
const QUrl link = openLinkFromQuery( query );
|
||||||
|
|
||||||
|
QClipboard* cb = QApplication::clipboard();
|
||||||
|
QByteArray data = link.toEncoded();
|
||||||
|
data.replace( "'", "%27" ); // QUrl doesn't encode ', which it doesn't have to. Some apps don't like ' though, and want %27. Both are valid.
|
||||||
|
cb->setText( data );
|
||||||
|
|
||||||
|
return link;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QUrl
|
QUrl
|
||||||
GlobalActionManager::copyOpenLink( const artist_ptr& artist ) const
|
GlobalActionManager::copyOpenLink( const artist_ptr& artist ) const
|
||||||
{
|
{
|
||||||
|
@@ -46,6 +46,7 @@ public:
|
|||||||
|
|
||||||
QUrl copyOpenLink( const Tomahawk::artist_ptr& artist ) const;
|
QUrl copyOpenLink( const Tomahawk::artist_ptr& artist ) const;
|
||||||
QUrl copyOpenLink( const Tomahawk::album_ptr& album ) const;
|
QUrl copyOpenLink( const Tomahawk::album_ptr& album ) const;
|
||||||
|
QUrl copyOpenLink( const Tomahawk::query_ptr& query ) const;
|
||||||
|
|
||||||
QUrl openLink( const QString& title, const QString& artist, const QString& album ) const;
|
QUrl openLink( const QString& title, const QString& artist, const QString& album ) const;
|
||||||
|
|
||||||
@@ -60,10 +61,7 @@ public slots:
|
|||||||
/// Takes a spotify link and performs the default open action on it
|
/// Takes a spotify link and performs the default open action on it
|
||||||
bool openRdioLink( const QString& link );
|
bool openRdioLink( const QString& link );
|
||||||
|
|
||||||
/// Creates a link from the requested data and copies it to the clipboard
|
|
||||||
void copyToClipboard( const Tomahawk::query_ptr& query );
|
void copyToClipboard( const Tomahawk::query_ptr& query );
|
||||||
|
|
||||||
|
|
||||||
QString copyPlaylistToClipboard( const Tomahawk::dynplaylist_ptr& playlist );
|
QString copyPlaylistToClipboard( const Tomahawk::dynplaylist_ptr& playlist );
|
||||||
void savePlaylistToFile( const Tomahawk::playlist_ptr& playlist, const QString& filename );
|
void savePlaylistToFile( const Tomahawk::playlist_ptr& playlist, const QString& filename );
|
||||||
|
|
||||||
|
@@ -22,7 +22,6 @@
|
|||||||
#include "DatabaseCommand.h"
|
#include "DatabaseCommand.h"
|
||||||
#include "DatabaseImpl.h"
|
#include "DatabaseImpl.h"
|
||||||
#include "DatabaseWorker.h"
|
#include "DatabaseWorker.h"
|
||||||
#include "IdThreadWorker.h"
|
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "Source.h"
|
#include "Source.h"
|
||||||
|
|
||||||
@@ -44,7 +43,6 @@ Database::Database( const QString& dbname, QObject* parent )
|
|||||||
, m_ready( false )
|
, m_ready( false )
|
||||||
, m_impl( new DatabaseImpl( dbname, this ) )
|
, m_impl( new DatabaseImpl( dbname, this ) )
|
||||||
, m_workerRW( new DatabaseWorker( this, true ) )
|
, m_workerRW( new DatabaseWorker( this, true ) )
|
||||||
, m_idWorker( new IdThreadWorker( this ) )
|
|
||||||
{
|
{
|
||||||
s_instance = this;
|
s_instance = this;
|
||||||
|
|
||||||
@@ -60,7 +58,6 @@ Database::Database( const QString& dbname, QObject* parent )
|
|||||||
connect( m_impl, SIGNAL( indexReady() ), SLOT( setIsReadyTrue() ) );
|
connect( m_impl, SIGNAL( indexReady() ), SLOT( setIsReadyTrue() ) );
|
||||||
|
|
||||||
m_workerRW->start();
|
m_workerRW->start();
|
||||||
m_idWorker->start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -70,8 +67,6 @@ Database::~Database()
|
|||||||
|
|
||||||
qDeleteAll( m_workers );
|
qDeleteAll( m_workers );
|
||||||
delete m_workerRW;
|
delete m_workerRW;
|
||||||
m_idWorker->stop();
|
|
||||||
delete m_idWorker;
|
|
||||||
delete m_impl;
|
delete m_impl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
class DatabaseImpl;
|
class DatabaseImpl;
|
||||||
class DatabaseWorker;
|
class DatabaseWorker;
|
||||||
class IdThreadWorker;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This class is really a firewall/pimpl - the public functions of LibraryImpl
|
This class is really a firewall/pimpl - the public functions of LibraryImpl
|
||||||
@@ -80,7 +79,6 @@ private:
|
|||||||
DatabaseImpl* m_impl;
|
DatabaseImpl* m_impl;
|
||||||
DatabaseWorker* m_workerRW;
|
DatabaseWorker* m_workerRW;
|
||||||
QList<DatabaseWorker*> m_workers;
|
QList<DatabaseWorker*> m_workers;
|
||||||
IdThreadWorker* m_idWorker;
|
|
||||||
bool m_indexReady;
|
bool m_indexReady;
|
||||||
int m_maxConcurrentThreads;
|
int m_maxConcurrentThreads;
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
#define CURRENT_SCHEMA_VERSION 28
|
#define CURRENT_SCHEMA_VERSION 28
|
||||||
|
|
||||||
DatabaseImpl::DatabaseImpl( const QString& dbname, Database* parent )
|
DatabaseImpl::DatabaseImpl( const QString& dbname, Database* parent )
|
||||||
: QObject( parent )
|
: QObject( (QObject*) parent )
|
||||||
, m_parent( parent )
|
, m_parent( parent )
|
||||||
{
|
{
|
||||||
QTime t;
|
QTime t;
|
||||||
|
@@ -69,7 +69,7 @@ void
|
|||||||
DatabaseWorker::run()
|
DatabaseWorker::run()
|
||||||
{
|
{
|
||||||
m_dbimpl = m_db->impl()->clone();
|
m_dbimpl = m_db->impl()->clone();
|
||||||
tDebug() << "New db connection with name:" << m_dbimpl->database().connectionName() << "this thread:" << thread() << "Parent of dbcon:" << m_dbimpl->parent()->thread();
|
tDebug() << "New db connection with name:" << m_dbimpl->database().connectionName();
|
||||||
exec();
|
exec();
|
||||||
qDebug() << Q_FUNC_INFO << "DatabaseWorker finishing...";
|
qDebug() << Q_FUNC_INFO << "DatabaseWorker finishing...";
|
||||||
}
|
}
|
||||||
|
@@ -1,180 +0,0 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
|
||||||
*
|
|
||||||
* Copyright 2012 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 "IdThreadWorker.h"
|
|
||||||
|
|
||||||
#include "Artist.h"
|
|
||||||
#include "Album.h"
|
|
||||||
#include "Database.h"
|
|
||||||
#include "DatabaseImpl.h"
|
|
||||||
#include "Source.h"
|
|
||||||
|
|
||||||
#define ID_THREAD_DEBUG 0
|
|
||||||
|
|
||||||
using namespace Tomahawk;
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
enum QueryType {
|
|
||||||
ArtistType,
|
|
||||||
AlbumType
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static QWaitCondition s_waitCond;
|
|
||||||
static QMutex s_mutex;
|
|
||||||
|
|
||||||
struct QueueItem
|
|
||||||
{
|
|
||||||
boost::promise< unsigned int > promise;
|
|
||||||
artist_ptr artist;
|
|
||||||
album_ptr album;
|
|
||||||
QueryType type;
|
|
||||||
bool create;
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO Q_GLOBAL_STATIC
|
|
||||||
QQueue< QueueItem* > IdThreadWorker::s_workQueue = QQueue< QueueItem* >();
|
|
||||||
|
|
||||||
IdThreadWorker::IdThreadWorker( Database* db )
|
|
||||||
: QThread()
|
|
||||||
, m_db( db )
|
|
||||||
, m_stop( false )
|
|
||||||
{
|
|
||||||
moveToThread( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
IdThreadWorker::~IdThreadWorker()
|
|
||||||
{
|
|
||||||
wait();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
IdThreadWorker::stop()
|
|
||||||
{
|
|
||||||
{
|
|
||||||
QMutexLocker l( &s_mutex );
|
|
||||||
m_stop = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
s_waitCond.wakeOne();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QueueItem*
|
|
||||||
internalGet( const artist_ptr& artist, const album_ptr& album, bool autoCreate, QueryType type )
|
|
||||||
{
|
|
||||||
QueueItem* item = new QueueItem;
|
|
||||||
item->artist = artist;
|
|
||||||
item->album = album;
|
|
||||||
item->type = type;
|
|
||||||
item->create = autoCreate;
|
|
||||||
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
IdThreadWorker::getArtistId( const artist_ptr& artist, bool autoCreate )
|
|
||||||
{
|
|
||||||
QueueItem* item = internalGet( artist, album_ptr(), autoCreate, ArtistType );
|
|
||||||
artist->setIdFuture( item->promise.get_future() );
|
|
||||||
|
|
||||||
#if ID_THREAD_DEBUG
|
|
||||||
qDebug() << "QUEUEING ARTIST:" << artist->name();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
s_mutex.lock();
|
|
||||||
s_workQueue.enqueue( item );
|
|
||||||
s_mutex.unlock();
|
|
||||||
s_waitCond.wakeOne();
|
|
||||||
#if ID_THREAD_DEBUG
|
|
||||||
qDebug() << "DONE WOKE UP THREAD:" << artist->name();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
IdThreadWorker::getAlbumId( const album_ptr& album, bool autoCreate )
|
|
||||||
{
|
|
||||||
QueueItem* item = internalGet( artist_ptr(), album, autoCreate, AlbumType );
|
|
||||||
album->setIdFuture( item->promise.get_future() );
|
|
||||||
|
|
||||||
#if ID_THREAD_DEBUG
|
|
||||||
qDebug() << "QUEUEING ALUBM:" << album->artist()->name() << album->name();
|
|
||||||
#endif
|
|
||||||
s_mutex.lock();
|
|
||||||
s_workQueue.enqueue( item );
|
|
||||||
s_mutex.unlock();
|
|
||||||
s_waitCond.wakeOne();
|
|
||||||
#if ID_THREAD_DEBUG
|
|
||||||
qDebug() << "DONE WOKE UP THREAD:" << album->artist()->name() << album->name();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
IdThreadWorker::run()
|
|
||||||
{
|
|
||||||
m_impl = m_db->impl()->clone();
|
|
||||||
|
|
||||||
while ( !m_stop )
|
|
||||||
{
|
|
||||||
s_mutex.lock();
|
|
||||||
#if ID_THREAD_DEBUG
|
|
||||||
qDebug() << "IdWorkerThread waiting on condition...";
|
|
||||||
#endif
|
|
||||||
s_waitCond.wait( &s_mutex );
|
|
||||||
#if ID_THREAD_DEBUG
|
|
||||||
qDebug() << "IdWorkerThread WOKEN UP";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while ( !s_workQueue.isEmpty() )
|
|
||||||
{
|
|
||||||
QueueItem* item = s_workQueue.dequeue();
|
|
||||||
s_mutex.unlock();
|
|
||||||
|
|
||||||
#if ID_THREAD_DEBUG
|
|
||||||
qDebug() << "WITH CONTENTS:" << (item->type == ArtistType ? item->artist->name() : item->album->artist()->name() + " _ " + item->album->name());
|
|
||||||
#endif
|
|
||||||
if ( item->type == ArtistType )
|
|
||||||
{
|
|
||||||
unsigned int id = m_impl->artistId( item->artist->name(), item->create );
|
|
||||||
item->promise.set_value( id );
|
|
||||||
|
|
||||||
item->artist->id();
|
|
||||||
delete item;
|
|
||||||
}
|
|
||||||
else if ( item->type == AlbumType )
|
|
||||||
{
|
|
||||||
unsigned int artistId = m_impl->artistId( item->album->artist()->name(), item->create );
|
|
||||||
unsigned int albumId = m_impl->albumId( artistId, item->album->name(), item->create );
|
|
||||||
item->promise.set_value( albumId );
|
|
||||||
|
|
||||||
item->album->id();
|
|
||||||
delete item;
|
|
||||||
}
|
|
||||||
|
|
||||||
s_mutex.lock();
|
|
||||||
}
|
|
||||||
|
|
||||||
s_mutex.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,56 +0,0 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
|
||||||
*
|
|
||||||
* Copyright 2012 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/>.
|
|
||||||
*/
|
|
||||||
#ifndef IDTHREADWORKER_H
|
|
||||||
#define IDTHREADWORKER_H
|
|
||||||
|
|
||||||
#include "DllMacro.h"
|
|
||||||
#include "Typedefs.h"
|
|
||||||
|
|
||||||
#include <QThread>
|
|
||||||
#include <QQueue>
|
|
||||||
#include <QWaitCondition>
|
|
||||||
#include <QMutex>
|
|
||||||
|
|
||||||
#include <boost/thread.hpp>
|
|
||||||
|
|
||||||
class QueueItem;
|
|
||||||
class Database;
|
|
||||||
class DatabaseImpl;
|
|
||||||
|
|
||||||
class DLLEXPORT IdThreadWorker : public QThread
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit IdThreadWorker( Database* db );
|
|
||||||
virtual ~IdThreadWorker();
|
|
||||||
|
|
||||||
void run();
|
|
||||||
void stop();
|
|
||||||
|
|
||||||
static void getArtistId( const Tomahawk::artist_ptr& artist, bool autoCreate = false );
|
|
||||||
static void getAlbumId( const Tomahawk::album_ptr& album, bool autoCreate = false );
|
|
||||||
|
|
||||||
private:
|
|
||||||
Database* m_db;
|
|
||||||
DatabaseImpl* m_impl;
|
|
||||||
bool m_stop;
|
|
||||||
|
|
||||||
static QQueue< QueueItem* > s_workQueue;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // IDTHREADWORKER_H
|
|
@@ -165,7 +165,7 @@ TemporaryPageItem::linkActionTriggered( QAction* action )
|
|||||||
{
|
{
|
||||||
TrackInfoWidget* tPage = dynamic_cast< TrackInfoWidget* >( m_page );
|
TrackInfoWidget* tPage = dynamic_cast< TrackInfoWidget* >( m_page );
|
||||||
Q_ASSERT( tPage );
|
Q_ASSERT( tPage );
|
||||||
GlobalActionManager::instance()->copyToClipboard( tPage->query() );
|
GlobalActionManager::instance()->copyOpenLink( tPage->query() );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user