From 356b7d8e64127a1a62483563c4de04cffd4ba323 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sun, 10 Nov 2024 01:11:01 +0100 Subject: [PATCH] MainWindow: Remove engine changed --- src/core/mainwindow.cpp | 20 ++++++-------------- src/core/mainwindow.h | 2 -- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/core/mainwindow.cpp b/src/core/mainwindow.cpp index c409335d8..7ac7b18c0 100644 --- a/src/core/mainwindow.cpp +++ b/src/core/mainwindow.cpp @@ -422,7 +422,7 @@ MainWindow::MainWindow(Application *app, SharedPtr tray_icon, OS app_->player()->SetAnalyzer(ui_->analyzer); app_->player()->SetEqualizer(equalizer_); app_->player()->Init(); - EngineChanged(app_->player()->engine()->type()); + const uint volume = app_->player()->GetVolume(); ui_->volume->SetValue(volume); VolumeChanged(volume); @@ -595,7 +595,6 @@ MainWindow::MainWindow(Application *app, SharedPtr tray_icon, OS // Player connections QObject::connect(ui_->volume, &VolumeSlider::valueChanged, &*app_->player(), &Player::SetVolumeFromSlider); - QObject::connect(&*app_->player(), &Player::EngineChanged, this, &MainWindow::EngineChanged); QObject::connect(&*app_->player(), &Player::Error, this, &MainWindow::ShowErrorDialog); QObject::connect(&*app_->player(), &Player::SongChangeRequestProcessed, &*app_->playlist_manager(), &PlaylistManager::SongChangeRequestProcessed); @@ -942,6 +941,11 @@ MainWindow::MainWindow(Application *app, SharedPtr tray_icon, OS QObject::connect(&*app_->lastfm_import(), &LastFMImport::UpdateLastPlayed, &*app_->collection_backend(), &CollectionBackend::UpdateLastPlayed); QObject::connect(&*app_->lastfm_import(), &LastFMImport::UpdatePlayCount, &*app_->collection_backend(), &CollectionBackend::UpdatePlayCount); +#if !defined(HAVE_AUDIOCD) || defined(Q_OS_WIN) + ui_->action_open_cd->setEnabled(false); + ui_->action_open_cd->setVisible(false); +#endif + // Load settings qLog(Debug) << "Loading settings"; settings_.beginGroup(MainWindowSettings::kSettingsGroup); @@ -1358,18 +1362,6 @@ void MainWindow::ExitFinished() { } -void MainWindow::EngineChanged(const EngineBase::Type enginetype) { - - ui_->action_equalizer->setEnabled(enginetype == EngineBase::Type::GStreamer); -#if defined(HAVE_AUDIOCD) && !defined(Q_OS_WIN) - ui_->action_open_cd->setEnabled(enginetype == EngineBase::Type::GStreamer); -#else - ui_->action_open_cd->setEnabled(false); - ui_->action_open_cd->setVisible(false); -#endif - -} - void MainWindow::MediaStopped() { setWindowTitle(u"Strawberry Music Player"_s); diff --git a/src/core/mainwindow.h b/src/core/mainwindow.h index 648f16597..54af2685e 100644 --- a/src/core/mainwindow.h +++ b/src/core/mainwindow.h @@ -53,7 +53,6 @@ #include "core/song.h" #include "core/settings.h" #include "tagreader/tagreaderclient.h" -#include "engine/enginebase.h" #include "osd/osdbase.h" #include "playlist/playlist.h" #include "playlist/playlistitem.h" @@ -134,7 +133,6 @@ class MainWindow : public QMainWindow, public PlatformInterface { private Q_SLOTS: void FilePathChanged(const QString &path); - void EngineChanged(const EngineBase::Type enginetype); void MediaStopped(); void MediaPaused(); void MediaPlaying();