Commit 96eeaffd authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: use a better name for artWork function to avoid the issue we had by the past...

doSomehting() is not a good function name.
parent 89b6530d
...@@ -407,21 +407,22 @@ CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i ) ...@@ -407,21 +407,22 @@ CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i )
: QLabel( parent ), p_intf( _p_i ) : QLabel( parent ), p_intf( _p_i )
{ {
setContextMenuPolicy( Qt::ActionsContextMenu ); setContextMenuPolicy( Qt::ActionsContextMenu );
CONNECT( this, updateRequested(), this, doUpdate() ); CONNECT( this, updateRequested(), this, askForUpdate() );
CONNECT( THEMIM->getIM(), artChanged( QString ), CONNECT( THEMIM->getIM(), artChanged( QString ),
this, doUpdate( const QString& ) ); this, showArtUpdate( const QString& ) );
setMinimumHeight( 128 ); setMinimumHeight( 128 );
setMinimumWidth( 128 ); setMinimumWidth( 128 );
setMaximumHeight( 128 ); setMaximumHeight( 128 );
setMaximumWidth( 128 ); setMaximumWidth( 128 );
setScaledContents( true ); setScaledContents( true );
QList< QAction* > artActions = actions(); QList< QAction* > artActions = actions();
QAction *action = new QAction( qtr( "Download cover art" ), this ); QAction *action = new QAction( qtr( "Download cover art" ), this );
CONNECT( action, triggered(), this, askForUpdate() );
addAction( action ); addAction( action );
CONNECT( action, triggered(), this, doUpdate() );
doUpdate( "" ); showArtUpdate( "" );
} }
CoverArtLabel::~CoverArtLabel() CoverArtLabel::~CoverArtLabel()
...@@ -431,7 +432,7 @@ CoverArtLabel::~CoverArtLabel() ...@@ -431,7 +432,7 @@ CoverArtLabel::~CoverArtLabel()
removeAction( act ); removeAction( act );
} }
void CoverArtLabel::doUpdate( const QString& url ) void CoverArtLabel::showArtUpdate( const QString& url )
{ {
QPixmap pix; QPixmap pix;
if( !url.isEmpty() && pix.load( url ) ) if( !url.isEmpty() && pix.load( url ) )
...@@ -444,7 +445,7 @@ void CoverArtLabel::doUpdate( const QString& url ) ...@@ -444,7 +445,7 @@ void CoverArtLabel::doUpdate( const QString& url )
} }
} }
void CoverArtLabel::doUpdate() void CoverArtLabel::askForUpdate()
{ {
THEMIM->getIM()->requestArtUpdate(); THEMIM->getIM()->requestArtUpdate();
} }
......
...@@ -207,8 +207,8 @@ public slots: ...@@ -207,8 +207,8 @@ public slots:
} }
private slots: private slots:
void doUpdate(); void askForUpdate();
void doUpdate( const QString& ); void showArtUpdate( const QString& );
signals: signals:
void updateRequested(); void updateRequested();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment