diff options
author | Roopesh Chander <roop@forwardbias.in> | 2009-10-04 00:26:21 +0530 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-02-08 16:59:10 +0100 |
commit | ea13309b9a1ecc7499849488eda9da2a7f79812e (patch) | |
tree | 4a562a4ccd75451b8aec07dee5c86412f9983d36 /src/plugins/texteditor/tabsettings.cpp | |
parent | 2a58049e6a99acb5b1525776ee04189c38817d0d (diff) |
Add a checkbox for 'auto-determine spaces or tabs from the previous line'
Merge-request: 1766
Reviewed-by: Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
Diffstat (limited to 'src/plugins/texteditor/tabsettings.cpp')
-rw-r--r-- | src/plugins/texteditor/tabsettings.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index 2f3721ff6b9..0efee830158 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -36,6 +36,7 @@ #include <QtGui/QTextDocument> static const char *spacesForTabsKey = "SpacesForTabs"; +static const char *autoSpacesForTabsKey = "AutoSpacesForTabs"; static const char *smartBackspaceKey = "SmartBackspace"; static const char *autoIndentKey = "AutoIndent"; static const char *tabSizeKey = "TabSize"; @@ -65,6 +66,7 @@ void TabSettings::toSettings(const QString &category, QSettings *s) const group.insert(0, category); s->beginGroup(group); s->setValue(QLatin1String(spacesForTabsKey), m_spacesForTabs); + s->setValue(QLatin1String(autoSpacesForTabsKey), m_autoSpacesForTabs); s->setValue(QLatin1String(autoIndentKey), m_autoIndent); s->setValue(QLatin1String(smartBackspaceKey), m_smartBackspace); s->setValue(QLatin1String(tabSizeKey), m_tabSize); @@ -84,6 +86,7 @@ void TabSettings::fromSettings(const QString &category, const QSettings *s) *this = TabSettings(); // Assign defaults m_spacesForTabs = s->value(group + QLatin1String(spacesForTabsKey), m_spacesForTabs).toBool(); + m_autoSpacesForTabs = s->value(group + QLatin1String(autoSpacesForTabsKey), m_autoSpacesForTabs).toBool(); m_autoIndent = s->value(group + QLatin1String(autoIndentKey), m_autoIndent).toBool(); m_smartBackspace = s->value(group + QLatin1String(smartBackspaceKey), m_smartBackspace).toBool(); m_tabSize = s->value(group + QLatin1String(tabSizeKey), m_tabSize).toInt(); @@ -316,6 +319,7 @@ void TabSettings::reindentLine(QTextBlock block, int delta) const bool TabSettings::equals(const TabSettings &ts) const { return m_spacesForTabs == ts.m_spacesForTabs + && m_autoSpacesForTabs == ts.m_autoSpacesForTabs && m_autoIndent == ts.m_autoIndent && m_smartBackspace == ts.m_smartBackspace && m_tabSize == ts.m_tabSize |