forked from qt-creator/qt-creator
Skip calling set custom value if nothing has changed.
The call will trigger a setup of the local help manager, which is rather heavy and should be avoided if possible. Change-Id: I03fbe6a30fba6ac48361c7e2b5aa6d45dad5126b Reviewed-by: Niels Weber <niels.2.weber@nokia.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
This commit is contained in:
@@ -97,9 +97,9 @@ QWidget *GeneralSettingsPage::createPage(QWidget *parent)
|
||||
}
|
||||
m_ui->homePageLineEdit->setText(m_homePage);
|
||||
|
||||
const int startOption = manager->customValue(QLatin1String("StartOption"),
|
||||
m_startOption = manager->customValue(QLatin1String("StartOption"),
|
||||
Help::Constants::ShowLastPages).toInt();
|
||||
m_ui->helpStartComboBox->setCurrentIndex(startOption);
|
||||
m_ui->helpStartComboBox->setCurrentIndex(m_startOption);
|
||||
|
||||
m_contextOption = manager->customValue(QLatin1String("ContextHelpOption"),
|
||||
Help::Constants::SideBySideIfPossible).toInt();
|
||||
@@ -172,10 +172,16 @@ void GeneralSettingsPage::apply()
|
||||
if (homePage.isEmpty())
|
||||
homePage = Help::Constants::AboutBlank;
|
||||
m_ui->homePageLineEdit->setText(homePage);
|
||||
if (m_homePage != homePage) {
|
||||
m_homePage = homePage;
|
||||
manager->setCustomValue(QLatin1String("HomePage"), homePage);
|
||||
}
|
||||
|
||||
const int startOption = m_ui->helpStartComboBox->currentIndex();
|
||||
if (m_startOption != startOption) {
|
||||
m_startOption = startOption;
|
||||
manager->setCustomValue(QLatin1String("StartOption"), startOption);
|
||||
}
|
||||
|
||||
const int helpOption = m_ui->contextHelpComboBox->currentIndex();
|
||||
if (m_contextOption != helpOption) {
|
||||
|
@@ -79,6 +79,7 @@ private:
|
||||
QString m_homePage;
|
||||
int m_contextOption;
|
||||
|
||||
int m_startOption;
|
||||
bool m_returnOnClose;
|
||||
|
||||
QString m_searchKeywords;
|
||||
|
Reference in New Issue
Block a user