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