From 6d7e6fe267a990b85419dddcdfa7f91c923f1b24 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 2 Dec 2024 10:55:05 +0100 Subject: [PATCH] Axivion: Fix settings handling Do not apply settings automatically. Additionally guard against the crash mentioned inside the bugreport. Fixes: QTCREATORBUG-32078 Change-Id: Id8de16171a070672fa18b72eebfef46669874788 Reviewed-by: hjk --- src/plugins/axivion/axivionperspective.cpp | 12 +++++++++--- src/plugins/axivion/axivionsettings.cpp | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/axivion/axivionperspective.cpp b/src/plugins/axivion/axivionperspective.cpp index 16842d79fef..4ee772ade43 100644 --- a/src/plugins/axivion/axivionperspective.cpp +++ b/src/plugins/axivion/axivionperspective.cpp @@ -767,11 +767,17 @@ IssueListSearch IssuesWidget::searchFromUi() const { IssueListSearch search; QTC_ASSERT(m_currentTableInfo, return search); + const int userIndex = m_ownerFilter->currentIndex(); + QTC_ASSERT(userIndex >= 0 && m_userNames.size() > userIndex, return search); + const int versionStartIndex = m_versionStart->currentIndex(); + QTC_ASSERT(versionStartIndex >= 0 && m_versionDates.size() > versionStartIndex, return search); + const int versionEndIndex = m_versionEnd->currentIndex(); + QTC_ASSERT(versionEndIndex >= 0 && m_versionDates.size() > versionEndIndex, return search); search.kind = m_currentPrefix; // not really ui.. but anyhow - search.owner = m_userNames.at(m_ownerFilter->currentIndex()); + search.owner = m_userNames.at(userIndex); search.filter_path = m_pathGlobFilter->text(); - search.versionStart = m_versionDates.at(m_versionStart->currentIndex()); - search.versionEnd = m_versionDates.at(m_versionEnd->currentIndex()); + search.versionStart = m_versionDates.at(versionStartIndex); + search.versionEnd = m_versionDates.at(versionEndIndex); // different approach: checked means disabling in webview, checked here means explicitly request // the checked one, having both checked is impossible (having none checked means fetch both) // reason for different approach: currently poor reflected inside the ui (TODO) diff --git a/src/plugins/axivion/axivionsettings.cpp b/src/plugins/axivion/axivionsettings.cpp index 508f4e47225..0c84f0bd590 100644 --- a/src/plugins/axivion/axivionsettings.cpp +++ b/src/plugins/axivion/axivionsettings.cpp @@ -225,6 +225,7 @@ AxivionSettings &settings() AxivionSettings::AxivionSettings() { setSettingsGroup("Axivion"); + setAutoApply(false); highlightMarks.setSettingsKey("HighlightMarks"); highlightMarks.setLabelText(Tr::tr("Highlight marks")); @@ -490,6 +491,7 @@ void AxivionSettingsWidget::apply() : servers.at(m_dashboardServers->currentIndex()).id; if (settings().updateDashboardServers(servers, selected)) settings().toSettings(); + settings().apply(); } void AxivionSettingsWidget::updateDashboardServers()