Skip to content

Commit

Permalink
audqt: Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
radioactiveman committed Oct 14, 2024
1 parent 762fd08 commit 70f01e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libaudqt/equalizer-qt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ EqualizerWindow::EqualizerWindow()
updatePreamp();
updateBands();

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
connect(&m_onoff_checkbox, &QCheckBox::checkStateChanged, [](Qt::CheckState state) {
#else
connect(&m_onoff_checkbox, &QCheckBox::stateChanged, [](int state) {
#endif
aud_set_bool("equalizer_active", (state == Qt::Checked));
});

Expand Down
4 changes: 4 additions & 0 deletions src/libaudqt/playlist-management.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ static QDialog * buildDeleteDialog(Playlist playlist)
remove->setIcon(QIcon::fromTheme("edit-delete"));
cancel->setIcon(QIcon::fromTheme("process-stop"));

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
QObject::connect(skip_prompt, &QCheckBox::checkStateChanged, [](Qt::CheckState state) {
#else
QObject::connect(skip_prompt, &QCheckBox::stateChanged, [](int state) {
#endif
aud_set_bool("audgui", "no_confirm_playlist_delete",
(state == Qt::Checked));
});
Expand Down
4 changes: 4 additions & 0 deletions src/libaudqt/prefs-widget-qt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ BooleanWidget::BooleanWidget(const PreferencesWidget * parent,
{
update();

#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
QObject::connect(this, &QCheckBox::checkStateChanged, [this](Qt::CheckState state) {
#else
QObject::connect(this, &QCheckBox::stateChanged, [this](int state) {
#endif
if (m_updating)
return;
m_parent->cfg.set_bool(state != Qt::Unchecked);
Expand Down

0 comments on commit 70f01e8

Please sign in to comment.