Skip to content
Snippets Groups Projects
Commit ef7cb1b0 authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

settingwidget: fix the issue where sometimes account setting does not match account type

- create a pastAccount, if pastAccount matches the current account,
  setSelected will return as usual, and if not, it will reselect
  the correct account setting widget

Change-Id: I870eb6d52d7e5f352489ddbd9347c3a5437e918d
parent 36a18c85
No related branches found
No related tags found
No related merge requests found
......@@ -172,7 +172,9 @@ void SettingsWidget::setSelected(Button sel)
ui->accountSettingsButton->setChecked(true);
ui->generalSettingsButton->setChecked(false);
ui->mediaSettingsButton->setChecked(false);
if (pastButton_ == sel) { return; }
if (pastButton_ == sel && pastAccount_ == LRCInstance::getCurrentAccountInfo().profileInfo.type) {
return;
}
if (!LRCInstance::getActiveCalls().size()) {
QtConcurrent::run( [this] { LRCInstance::avModel().stopPreview(); });
......@@ -183,11 +185,13 @@ void SettingsWidget::setSelected(Button sel)
if (advancedSIPSettingsDropped_) {
toggleAdvancedSIPSettings();
}
pastAccount_ = lrc::api::profile::Type::SIP;
} else {
ui->stackedWidget->setCurrentWidget(ui->currentAccountSettingsScrollWidget);
if (advancedSettingsDropped_) {
toggleAdvancedSettings();
}
pastAccount_ = lrc::api::profile::Type::RING;
}
break;
......
......@@ -93,6 +93,7 @@ private:
AdvancedSettingsWidget* advancedSettingsWidget_;
QScrollArea* scrollArea_;
Button pastButton_ = Button::generalSettingsButton;
lrc::api::profile::Type pastAccount_ = lrc::api::profile::Type::INVALID;
bool advancedSettingsDropped_ = false;
QList<QPair<std::string, float>> formatIndexList_;
std::string currentDisplayedVideoDevice_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment