diff options
author | m0dB <79429057+m0dB@users.noreply.github.com> | 2023-05-15 19:48:43 +0200 |
---|---|---|
committer | m0dB <79429057+m0dB@users.noreply.github.com> | 2023-05-27 01:28:25 +0200 |
commit | e10dab9f0e8ee6b0642e3367dd5dd2a49cc98677 (patch) | |
tree | 40edad2714bcda45f50627b56dc0288f25bd9bd4 | |
parent | 1631d50d7db9aee22a1d409ef0db3b3b23230989 (diff) |
removed spurious makeCurrentIfNeeded, postpone call to slotLoadTrack for initial player to setup, to avoid calling a virtual (indirectly) from the constructor
-rw-r--r-- | src/widget/wspinnybase.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widget/wspinnybase.cpp b/src/widget/wspinnybase.cpp index 95cecd78a1..a060a806b6 100644 --- a/src/widget/wspinnybase.cpp +++ b/src/widget/wspinnybase.cpp @@ -73,7 +73,6 @@ WSpinnyBase::WSpinnyBase( qDebug() << "WSpinnyBase(): Created WGLWidget, Context" << "Valid:" << isContextValid() << "Sharing:" << isContextSharing(); - makeCurrentIfNeeded(); CoverArtCache* pCache = CoverArtCache::instance(); if (pCache) { @@ -86,8 +85,6 @@ WSpinnyBase::WSpinnyBase( if (m_pPlayer != nullptr) { connect(m_pPlayer, &BaseTrackPlayer::newTrackLoaded, this, &WSpinnyBase::slotLoadTrack); connect(m_pPlayer, &BaseTrackPlayer::loadingTrack, this, &WSpinnyBase::slotLoadingTrack); - // just in case a track is already loaded - slotLoadTrack(m_pPlayer->getLoadedTrack()); } connect(m_pCoverMenu, @@ -146,6 +143,11 @@ void WSpinnyBase::onVinylSignalQualityUpdate(const VinylSignalQualityReport& rep void WSpinnyBase::setup(const QDomNode& node, const SkinContext& context, const ConfigKey& showCoverConfigKey) { + if (m_pPlayer) { + // just in case a track is already loaded + slotLoadTrack(m_pPlayer->getLoadedTrack()); + } + // Set images QDomElement backPathElement = context.selectElement(node, "PathBackground"); m_pBgImage = WImageStore::getImage(context.getPixmapSource(backPathElement), |