1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

Merge pull request #243 from TheOneRing/win_slots

As Q_OS_WIN doesn't work with qt4 moc, always define the slots.
This commit is contained in:
Uwe L. Korn
2014-07-17 09:56:56 +02:00
2 changed files with 10 additions and 12 deletions

View File

@@ -802,8 +802,7 @@ TomahawkWindow::keyPressEvent( QKeyEvent* e )
} }
#ifdef Q_OS_WIN #if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK( 5, 2, 0 )
#if QT_VERSION < QT_VERSION_CHECK( 5, 2, 0 )
bool bool
TomahawkWindow::winEvent( MSG* msg, long* result ) TomahawkWindow::winEvent( MSG* msg, long* result )
{ {
@@ -844,12 +843,15 @@ TomahawkWindow::winEvent( MSG* msg, long* result )
return false; return false;
} }
#endif #endif//defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK( 5, 2, 0 )
void void
TomahawkWindow::audioStateChanged( AudioState newState, AudioState oldState ) TomahawkWindow::audioStateChanged( AudioState newState, AudioState oldState )
{ {
Q_UNUSED(oldState); Q_UNUSED(oldState);
#ifndef Q_OS_WIN
Q_UNUSED(newState);
#else
#if QT_VERSION < QT_VERSION_CHECK( 5, 2, 0 ) #if QT_VERSION < QT_VERSION_CHECK( 5, 2, 0 )
if ( m_taskbarList == 0 ) if ( m_taskbarList == 0 )
return; return;
@@ -930,14 +932,15 @@ TomahawkWindow::audioStateChanged( AudioState newState, AudioState oldState )
default: default:
return; return;
} }
#endif #endif//QT_VERSION < QT_VERSION_CHECK( 5, 2, 0 )
#endif//Q_OS_WIN
} }
void void
TomahawkWindow::updateWindowsLoveButton() TomahawkWindow::updateWindowsLoveButton()
{ {
#if QT_VERSION < QT_VERSION_CHECK( 5, 2, 0 ) #if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK( 5, 2, 0 )
if ( m_taskbarList == 0 ) if ( m_taskbarList == 0 )
return; return;
if ( !AudioEngine::instance()->currentTrack().isNull() && AudioEngine::instance()->currentTrack()->track()->loved() ) if ( !AudioEngine::instance()->currentTrack().isNull() && AudioEngine::instance()->currentTrack()->track()->loved() )
@@ -953,7 +956,7 @@ TomahawkWindow::updateWindowsLoveButton()
m_thumbButtons[TP_LOVE].dwFlags = THBF_ENABLED; m_thumbButtons[TP_LOVE].dwFlags = THBF_ENABLED;
m_taskbarList->ThumbBarUpdateButtons( (HWND)winId(), ARRAYSIZE( m_thumbButtons ), m_thumbButtons ); m_taskbarList->ThumbBarUpdateButtons( (HWND)winId(), ARRAYSIZE( m_thumbButtons ), m_thumbButtons );
#else #elif defined(Q_OS_WIN)
QWinThumbnailToolButton *love = m_taskbarList->buttons()[ TP_LOVE ]; QWinThumbnailToolButton *love = m_taskbarList->buttons()[ TP_LOVE ];
if ( !AudioEngine::instance()->currentTrack().isNull() ) if ( !AudioEngine::instance()->currentTrack().isNull() )
@@ -976,12 +979,9 @@ TomahawkWindow::updateWindowsLoveButton()
love->setIcon( thumbIcon(TomahawkUtils::NotLoved) ); love->setIcon( thumbIcon(TomahawkUtils::NotLoved) );
love->setToolTip( tr( "Love" ) ); love->setToolTip( tr( "Love" ) );
} }
#endif//QT_VERSION < QT_VERSION_CHECK( 5, 2, 0 ) #endif//defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK( 5, 2, 0 )
} }
#endif // Q_OS_WIN
void void
TomahawkWindow::onHistoryBackAvailable( bool avail ) TomahawkWindow::onHistoryBackAvailable( bool avail )
{ {

View File

@@ -149,10 +149,8 @@ private slots:
void toggleLoved(); void toggleLoved();
#ifdef Q_OS_WIN
void audioStateChanged( AudioState newState, AudioState oldState ); void audioStateChanged( AudioState newState, AudioState oldState );
void updateWindowsLoveButton(); void updateWindowsLoveButton();
#endif
private: private:
void loadSettings(); void loadSettings();