forked from qt-creator/qt-creator
ProjectExplorer: Don't save defaults to settings
Writes less settings and makes it possible to change defaults in the future. Task-number: QTCREATORBUG-24762 Change-Id: I73873b3684827b4fe27cfa5ea2f62a76003f9750 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -305,21 +305,26 @@ void CompileOutputWindow::updateFilter()
|
||||
filterUsesRegexp(), filterIsInverted());
|
||||
}
|
||||
|
||||
const bool kPopUpDefault = false;
|
||||
const bool kWrapOutputDefault = true;
|
||||
|
||||
void CompileOutputWindow::loadSettings()
|
||||
{
|
||||
QSettings * const s = Core::ICore::settings();
|
||||
m_settings.popUp = s->value(POP_UP_KEY, false).toBool();
|
||||
m_settings.wrapOutput = s->value(WRAP_OUTPUT_KEY, true).toBool();
|
||||
m_settings.popUp = s->value(POP_UP_KEY, kPopUpDefault).toBool();
|
||||
m_settings.wrapOutput = s->value(WRAP_OUTPUT_KEY, kWrapOutputDefault).toBool();
|
||||
m_settings.maxCharCount = s->value(MAX_LINES_KEY,
|
||||
Core::Constants::DEFAULT_MAX_CHAR_COUNT).toInt() * 100;
|
||||
}
|
||||
|
||||
void CompileOutputWindow::storeSettings() const
|
||||
{
|
||||
QSettings * const s = Core::ICore::settings();
|
||||
s->setValue(POP_UP_KEY, m_settings.popUp);
|
||||
s->setValue(WRAP_OUTPUT_KEY, m_settings.wrapOutput);
|
||||
s->setValue(MAX_LINES_KEY, m_settings.maxCharCount / 100);
|
||||
Utils::QtcSettings *const s = Core::ICore::settings();
|
||||
s->setValueWithDefault(POP_UP_KEY, m_settings.popUp, kPopUpDefault);
|
||||
s->setValueWithDefault(WRAP_OUTPUT_KEY, m_settings.wrapOutput, kWrapOutputDefault);
|
||||
s->setValueWithDefault(MAX_LINES_KEY,
|
||||
m_settings.maxCharCount / 100,
|
||||
Core::Constants::DEFAULT_MAX_CHAR_COUNT);
|
||||
}
|
||||
|
||||
class CompileOutputSettingsWidget : public Core::IOptionsPageWidget
|
||||
|
||||
Reference in New Issue
Block a user