summaryrefslogtreecommitdiff
path: root/src/plugins/help
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@nokia.com>2012-05-24 16:19:44 +0200
committerKarsten Heimrich <karsten.heimrich@nokia.com>2012-05-31 14:55:58 +0200
commite1e65f6e5663b71fcfbe2d258d88cccd74566eb4 (patch)
tree833178ddc57624e1ac9585c78c4f55d852e4baad /src/plugins/help
parent788772a23e35243fd89fbb2d878eae5af3c2b17e (diff)
downloadqt-creator-e1e65f6e5663b71fcfbe2d258d88cccd74566eb4.tar.gz
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>
Diffstat (limited to 'src/plugins/help')
-rw-r--r--src/plugins/help/generalsettingspage.cpp14
-rw-r--r--src/plugins/help/generalsettingspage.h1
2 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/help/generalsettingspage.cpp b/src/plugins/help/generalsettingspage.cpp
index 33ae77acf1..806b9127fb 100644
--- a/src/plugins/help/generalsettingspage.cpp
+++ b/src/plugins/help/generalsettingspage.cpp
@@ -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);
- manager->setCustomValue(QLatin1String("HomePage"), homePage);
+ if (m_homePage != homePage) {
+ m_homePage = homePage;
+ manager->setCustomValue(QLatin1String("HomePage"), homePage);
+ }
const int startOption = m_ui->helpStartComboBox->currentIndex();
- manager->setCustomValue(QLatin1String("StartOption"), startOption);
+ if (m_startOption != startOption) {
+ m_startOption = startOption;
+ manager->setCustomValue(QLatin1String("StartOption"), startOption);
+ }
const int helpOption = m_ui->contextHelpComboBox->currentIndex();
if (m_contextOption != helpOption) {
diff --git a/src/plugins/help/generalsettingspage.h b/src/plugins/help/generalsettingspage.h
index 87d7a848c5..21f9d66d2f 100644
--- a/src/plugins/help/generalsettingspage.h
+++ b/src/plugins/help/generalsettingspage.h
@@ -79,6 +79,7 @@ private:
QString m_homePage;
int m_contextOption;
+ int m_startOption;
bool m_returnOnClose;
QString m_searchKeywords;