forked from qt-creator/qt-creator
Add "indent blocks twice" option for GNU indenting
Reviewed-by: mae Merge-request: 133
This commit is contained in:
@@ -42,6 +42,7 @@ static const char *autoIndentKey = "AutoIndent";
|
||||
static const char *tabSizeKey = "TabSize";
|
||||
static const char *indentSizeKey = "IndentSize";
|
||||
static const char *indentBracesKey = "IndentBraces";
|
||||
static const char *doubleIndentBlocksKey = "DoubleIndentBlocks";
|
||||
static const char *tabKeyBehaviorKey = "TabKeyBehavior";
|
||||
static const char *groupPostfix = "TabSettings";
|
||||
|
||||
@@ -55,6 +56,7 @@ TabSettings::TabSettings() :
|
||||
m_tabSize(8),
|
||||
m_indentSize(4),
|
||||
m_indentBraces(false),
|
||||
m_doubleIndentBlocks(false),
|
||||
m_tabKeyBehavior(TabNeverIndents)
|
||||
{
|
||||
}
|
||||
@@ -72,6 +74,7 @@ void TabSettings::toSettings(const QString &category, QSettings *s) const
|
||||
s->setValue(QLatin1String(tabSizeKey), m_tabSize);
|
||||
s->setValue(QLatin1String(indentSizeKey), m_indentSize);
|
||||
s->setValue(QLatin1String(indentBracesKey), m_indentBraces);
|
||||
s->setValue(QLatin1String(doubleIndentBlocksKey), m_doubleIndentBlocks);
|
||||
s->setValue(QLatin1String(tabKeyBehaviorKey), m_tabKeyBehavior);
|
||||
s->endGroup();
|
||||
}
|
||||
@@ -92,6 +95,9 @@ void TabSettings::fromSettings(const QString &category, const QSettings *s)
|
||||
m_tabSize = s->value(group + QLatin1String(tabSizeKey), m_tabSize).toInt();
|
||||
m_indentSize = s->value(group + QLatin1String(indentSizeKey), m_indentSize).toInt();
|
||||
m_indentBraces = s->value(group + QLatin1String(indentBracesKey), m_indentBraces).toBool();
|
||||
m_doubleIndentBlocks
|
||||
= s->value(group + QLatin1String(doubleIndentBlocksKey), m_doubleIndentBlocks).toBool();
|
||||
|
||||
m_tabKeyBehavior = (TabKeyBehavior)s->value(group + QLatin1String(tabKeyBehaviorKey), m_tabKeyBehavior).toInt();
|
||||
}
|
||||
|
||||
@@ -339,6 +345,7 @@ bool TabSettings::equals(const TabSettings &ts) const
|
||||
&& m_tabSize == ts.m_tabSize
|
||||
&& m_indentSize == ts.m_indentSize
|
||||
&& m_indentBraces == ts.m_indentBraces
|
||||
&& m_doubleIndentBlocks == ts.m_doubleIndentBlocks
|
||||
&& m_tabKeyBehavior == ts.m_tabKeyBehavior;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user