mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-04 21:27:58 +02:00
connectNotify changed its signature with Qt5
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "SharedTimeLine.h"
|
||||
|
||||
#include <QMetaMethod>
|
||||
|
||||
namespace TomahawkUtils
|
||||
{
|
||||
@@ -37,20 +38,39 @@ SharedTimeLine::SharedTimeLine()
|
||||
|
||||
|
||||
void
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
SharedTimeLine::connectNotify( const QMetaMethod& signal )
|
||||
#else
|
||||
SharedTimeLine::connectNotify( const char* signal )
|
||||
#endif
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
if ( signal == QMetaMethod::fromSignal( &SharedTimeLine::frameChanged ) )
|
||||
#else
|
||||
if ( signal == QMetaObject::normalizedSignature( SIGNAL( frameChanged( int ) ) ) )
|
||||
#endif
|
||||
{
|
||||
if ( signal == QMetaObject::normalizedSignature( SIGNAL( frameChanged( int ) ) ) ) {
|
||||
m_refcount++;
|
||||
if ( m_timeline.state() != QTimeLine::Running )
|
||||
{
|
||||
m_timeline.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
SharedTimeLine::disconnectNotify( const QMetaMethod& signal )
|
||||
#else
|
||||
SharedTimeLine::disconnectNotify( const char* signal )
|
||||
#endif
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
if ( signal == QMetaMethod::fromSignal( &SharedTimeLine::frameChanged ) )
|
||||
#else
|
||||
if ( signal == QMetaObject::normalizedSignature( SIGNAL( frameChanged( int ) ) ) )
|
||||
#endif
|
||||
{
|
||||
m_refcount--;
|
||||
if ( m_timeline.state() == QTimeLine::Running && m_refcount == 0 )
|
||||
|
@@ -46,9 +46,13 @@ class DLLEXPORT SharedTimeLine : public QObject
|
||||
void frameChanged( int );
|
||||
|
||||
protected slots:
|
||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
|
||||
virtual void connectNotify( const QMetaMethod & signal );
|
||||
virtual void disconnectNotify( const QMetaMethod & signal );
|
||||
#else
|
||||
virtual void connectNotify( const char *signal );
|
||||
|
||||
virtual void disconnectNotify( const char *signal );
|
||||
#endif
|
||||
|
||||
private:
|
||||
int m_refcount;
|
||||
|
Reference in New Issue
Block a user