diff options
Diffstat (limited to 'src/widget/wstarrating.cpp')
-rw-r--r-- | src/widget/wstarrating.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/widget/wstarrating.cpp b/src/widget/wstarrating.cpp index d2c6a8150b..db98a0ad7c 100644 --- a/src/widget/wstarrating.cpp +++ b/src/widget/wstarrating.cpp @@ -10,11 +10,15 @@ WStarRating::WStarRating(QString group, QWidget* pParent) m_starRating(0, 5), m_group(group), m_focused(false) { - // Controls to change the star rating with controllers - m_pStarsUp = std::make_unique<ControlPushButton>(ConfigKey(group, "stars_up")); - m_pStarsDown = std::make_unique<ControlPushButton>(ConfigKey(group, "stars_down")); - connect(m_pStarsUp.get(), SIGNAL(valueChanged(double)), this, SLOT(slotStarsUp(double))); - connect(m_pStarsDown.get(), SIGNAL(valueChanged(double)), this, SLOT(slotStarsDown(double))); + // Controls to change the star rating with controllers. + // Note that 'group' maybe NULLPTR, e.g. when called from DlgTrackInfo, + // so only create rate change COs if there's a group passed when creating deck widgets. + if (!m_group.isEmpty()) { + m_pStarsUp = std::make_unique<ControlPushButton>(ConfigKey(group, "stars_up")); + m_pStarsDown = std::make_unique<ControlPushButton>(ConfigKey(group, "stars_down")); + connect(m_pStarsUp.get(), SIGNAL(valueChanged(double)), this, SLOT(slotStarsUp(double))); + connect(m_pStarsDown.get(), SIGNAL(valueChanged(double)), this, SLOT(slotStarsDown(double))); + } } void WStarRating::setup(const QDomNode& node, const SkinContext& context) { |