Skip to content

Commit

Permalink
Fix Qt 6.7 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kraxarn committed Jan 27, 2025
1 parent e41d03e commit 70ec287
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/settingspage/spotify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "util/process.hpp"

#include <QStandardPaths>
#include <QtVersionChecks>

SettingsPage::Spotify::Spotify(lib::settings &settings, QWidget *parent)
: SettingsPage::Base(settings, parent)
Expand Down Expand Up @@ -88,8 +89,15 @@ auto SettingsPage::Spotify::spotify() -> QWidget *
sptAppStart->setToolTip("Start, and close, spotify client together with the app "
"(only closes when using app config)");
sptAppStart->setChecked(settings.spotify.start_client);

#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
QCheckBox::connect(sptAppStart, &QCheckBox::stateChanged,
this, &SettingsPage::Spotify::startClientToggle);
#else
QCheckBox::connect(sptAppStart, &QCheckBox::checkStateChanged,
this, &SettingsPage::Spotify::startClientToggle);
#endif

content->addWidget(sptAppStart);

// Always start
Expand Down Expand Up @@ -181,8 +189,15 @@ auto SettingsPage::Spotify::config() -> QWidget *
sptGlobal->setToolTip("Use spotifyd.conf file in ~/.config/spotifyd, /etc or "
"/etc/xdg/spotifyd (spotifyd only)");
sptGlobal->setChecked(settings.spotify.global_config);
QCheckBox::connect(sptGlobal, &QCheckBox::stateChanged,
this, &SettingsPage::Spotify::globalConfigToggle);

#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
connect(sptGlobal, &QCheckBox::stateChanged,
this, &Spotify::globalConfigToggle);
#else
connect(sptGlobal, &QCheckBox::checkStateChanged,
this, &Spotify::globalConfigToggle);
#endif

content->addWidget(sptGlobal);

// Box and layout for all app specific settings
Expand Down

0 comments on commit 70ec287

Please sign in to comment.