1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 16:44:05 +02:00

* Hopefully fixed 'hash-crash'.

This commit is contained in:
Christian Muehlhaeuser
2011-02-10 01:43:31 +01:00
parent d15db5784c
commit 6c89dc4152
3 changed files with 7 additions and 3 deletions

View File

@@ -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 );

View File

@@ -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 );

View File

@@ -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() )