From 4197a508a32d938b34997c75ae0f0c72ed066286 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sun, 4 Nov 2018 21:23:34 +0100 Subject: [PATCH] Remove obsolete xine warning and engine reinitialization --- src/settings/backendsettingspage.cpp | 24 ------------------------ src/settings/backendsettingspage.h | 1 - src/settings/settingsdialog.cpp | 8 +------- src/settings/settingsdialog.h | 4 ---- 4 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/settings/backendsettingspage.cpp b/src/settings/backendsettingspage.cpp index 4cc61b8da..b60f51ca4 100644 --- a/src/settings/backendsettingspage.cpp +++ b/src/settings/backendsettingspage.cpp @@ -78,7 +78,6 @@ void BackendSettingsPage::Load() { configloaded_ = false; engineloaded_ = false; - xinewarning_ = false; Engine::EngineType enginetype = Engine::EngineTypeFromName(s_.value("engine", EngineName(Engine::None)).toString()); if (enginetype == Engine::None && engine()) enginetype = engine()->type(); @@ -193,7 +192,6 @@ void BackendSettingsPage::Load_Engine(Engine::EngineType enginetype) { qLog(Debug) << "Switching engine."; Engine::EngineType new_enginetype = dialog()->app()->player()->CreateEngine(enginetype); dialog()->app()->player()->Init(); - dialog()->set_output_changed(false); if (new_enginetype != enginetype) { ui_->combobox_engine->setCurrentIndex(ui_->combobox_engine->findData(engine()->type())); } @@ -373,10 +371,6 @@ void BackendSettingsPage::Save() { else if (ui_->radiobutton_alsa_plughw->isChecked()) s_.setValue("alsaplugin", static_cast(alsa_plugin::alsa_plughw)); else s_.remove("alsaplugin"); - // If engine has not been changed, but output or device has been changed, - // then set_output_changed(true) to reinitialize engine when dialog closes. - if (enginetype == enginetype_current_ && (output_name != output_current_ || device_value != device_current_)) dialog()->set_output_changed(true); - } void BackendSettingsPage::Cancel() { @@ -402,7 +396,6 @@ void BackendSettingsPage::EngineChanged(int index) { } engineloaded_ = false; - xinewarning_ = false; ResetWarning(); Load_Engine(enginetype); @@ -415,8 +408,6 @@ void BackendSettingsPage::OutputChanged(int index) { EngineBase::OutputDetails output = ui_->combobox_output->itemData(index).value(); Load_Device(output.name, QVariant()); - if (engine()->type() == Engine::Xine && engine()->state() != Engine::Empty) XineWarning(); - } void BackendSettingsPage::DeviceSelectionChanged(int index) { @@ -438,8 +429,6 @@ void BackendSettingsPage::DeviceSelectionChanged(int index) { if (!ui_->lineedit_device->text().isEmpty()) ui_->lineedit_device->setText(""); } - if (engine()->type() == Engine::Xine && engine()->state() != Engine::Empty) XineWarning(); - } void BackendSettingsPage::DeviceStringChanged() { @@ -541,19 +530,6 @@ void BackendSettingsPage::ResetWarning() { } -void BackendSettingsPage::XineWarning() { - - if (!engineloaded_) return; - if (!configloaded_) return; - if (engine()->type() != Engine::Xine) return; - if (engine()->state() == Engine::Empty) return; - if (xinewarning_) return; - - ShowWarning("You need to restart Strawberry for output/device changes to take affect for Xine."); - xinewarning_ = true; - -} - void BackendSettingsPage::SwitchALSADevices(alsa_plugin alsaplugin) { // All ALSA devices are listed twice, one for "hw" and one for "plughw" diff --git a/src/settings/backendsettingspage.h b/src/settings/backendsettingspage.h index d50b83598..0b06d3eaf 100644 --- a/src/settings/backendsettingspage.h +++ b/src/settings/backendsettingspage.h @@ -91,7 +91,6 @@ private: QSettings s_; bool configloaded_; bool engineloaded_; - bool xinewarning_; ErrorDialog errordialog_; Engine::EngineType enginetype_current_; diff --git a/src/settings/settingsdialog.cpp b/src/settings/settingsdialog.cpp index 48ea1a321..4ee8973e5 100644 --- a/src/settings/settingsdialog.cpp +++ b/src/settings/settingsdialog.cpp @@ -112,8 +112,7 @@ SettingsDialog::SettingsDialog(Application *app, QWidget *parent) model_(app_->collection_model()->directory_model()), appearance_(app_->appearance()), ui_(new Ui_SettingsDialog), - loading_settings_(false), - output_changed_(false) { + loading_settings_(false) { ui_->setupUi(this); ui_->list->setItemDelegate(new SettingsItemDelegate(this)); @@ -221,11 +220,6 @@ void SettingsDialog::Save() { void SettingsDialog::accept() { Save(); - // Only Xine needs to reinitialize to switch output and device. - if (output_changed_ && engine() && engine()->type() == Engine::Xine && engine()->state() == Engine::Empty) { - engine()->ReloadSettings(); - engine()->Init(); - } QDialog::accept(); } diff --git a/src/settings/settingsdialog.h b/src/settings/settingsdialog.h index a152c0176..219462cd3 100644 --- a/src/settings/settingsdialog.h +++ b/src/settings/settingsdialog.h @@ -109,8 +109,6 @@ public: // QWidget void showEvent(QShowEvent *e); - void set_output_changed(bool output_changed) { output_changed_ = output_changed; } - void ComboBoxLoadFromSettings(QSettings &s, QComboBox *combobox, QString setting, QString default_value); signals: @@ -144,8 +142,6 @@ private: bool loading_settings_; QMap pages_; - - bool output_changed_; }; #endif // SETTINGSDIALOG_H