mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 08:34:34 +02:00
* Hopefully fixed 'hash-crash'.
This commit is contained in:
@@ -13,7 +13,9 @@ album_ptr
|
||||
Album::get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& artist, const Tomahawk::collection_ptr& collection )
|
||||
{
|
||||
static QHash< unsigned int, album_ptr > s_albums;
|
||||
static QMutex s_mutex;
|
||||
|
||||
QMutexLocker lock( &s_mutex );
|
||||
if ( s_albums.contains( id ) )
|
||||
{
|
||||
return s_albums.value( id );
|
||||
|
@@ -16,7 +16,9 @@ artist_ptr
|
||||
Artist::get( unsigned int id, const QString& name, const Tomahawk::collection_ptr& collection )
|
||||
{
|
||||
static QHash< unsigned int, artist_ptr > s_artists;
|
||||
static QMutex s_mutex;
|
||||
|
||||
QMutexLocker lock( &s_mutex );
|
||||
if ( s_artists.contains( id ) )
|
||||
{
|
||||
return s_artists.value( id );
|
||||
|
@@ -493,21 +493,21 @@ QueryLabel::mouseMoveEvent( QMouseEvent* event )
|
||||
{
|
||||
m_hoverType = Artist;
|
||||
hoverArea.setLeft( 0 );
|
||||
hoverArea.setRight( artistX + contentsMargins().left() );
|
||||
hoverArea.setRight( artistX + contentsMargins().left() - 1 );
|
||||
}
|
||||
else if ( m_type & Album && x < albumX && x > artistX )
|
||||
{
|
||||
m_hoverType = Album;
|
||||
int spacing = ( m_type & Artist ) ? dashX : 0;
|
||||
hoverArea.setLeft( artistX + spacing );
|
||||
hoverArea.setRight( albumX + spacing + contentsMargins().left() );
|
||||
hoverArea.setRight( albumX + spacing + contentsMargins().left() - 1 );
|
||||
}
|
||||
else if ( m_type & Track && x < trackX && x > albumX )
|
||||
{
|
||||
m_hoverType = Track;
|
||||
int spacing = ( m_type & Album ) ? dashX : 0;
|
||||
hoverArea.setLeft( albumX + spacing );
|
||||
hoverArea.setRight( trackX + contentsMargins().left() );
|
||||
hoverArea.setRight( trackX + contentsMargins().left() - 1 );
|
||||
}
|
||||
|
||||
if ( hoverArea.width() )
|
||||
|
Reference in New Issue
Block a user