added "auto-fold first comment"-option to the editor

Convenient when you don't want to see all the big license headers.
This commit is contained in:
mae
2009-12-01 18:08:02 +01:00
parent 491527ab06
commit dc713d0684
7 changed files with 57 additions and 8 deletions

View File

@@ -45,6 +45,7 @@ static const char * const highlightBlocksKey = "HighlightBlocksKey";
static const char * const animateMatchingParenthesesKey= "AnimateMatchingParenthesesKey";
static const char * const mouseNavigationKey = "MouseNavigation";
static const char * const markTextChangesKey = "MarkTextChanges";
static const char * const autoFoldFirstCommentKey= "AutoFoldFirstComment";
static const char * const groupPostfix = "DisplaySettings";
namespace TextEditor {
@@ -60,7 +61,8 @@ DisplaySettings::DisplaySettings() :
m_highlightBlocks(false),
m_animateMatchingParentheses(true),
m_mouseNavigation(true),
m_markTextChanges(true)
m_markTextChanges(true),
m_autoFoldFirstComment(true)
{
}
@@ -81,6 +83,7 @@ void DisplaySettings::toSettings(const QString &category, QSettings *s) const
s->setValue(QLatin1String(animateMatchingParenthesesKey), m_animateMatchingParentheses);
s->setValue(QLatin1String(mouseNavigationKey), m_mouseNavigation);
s->setValue(QLatin1String(markTextChangesKey), m_markTextChanges);
s->setValue(QLatin1String(autoFoldFirstCommentKey), m_autoFoldFirstComment);
s->endGroup();
}
@@ -104,6 +107,7 @@ void DisplaySettings::fromSettings(const QString &category, const QSettings *s)
m_animateMatchingParentheses = s->value(group + QLatin1String(animateMatchingParenthesesKey), m_animateMatchingParentheses).toBool();
m_mouseNavigation = s->value(group + QLatin1String(mouseNavigationKey), m_mouseNavigation).toBool();
m_markTextChanges = s->value(group + QLatin1String(markTextChangesKey), m_markTextChanges).toBool();
m_autoFoldFirstComment = s->value(group + QLatin1String(autoFoldFirstCommentKey), m_autoFoldFirstComment).toBool();
}
bool DisplaySettings::equals(const DisplaySettings &ds) const
@@ -119,6 +123,7 @@ bool DisplaySettings::equals(const DisplaySettings &ds) const
&& m_animateMatchingParentheses == ds.m_animateMatchingParentheses
&& m_mouseNavigation == ds.m_mouseNavigation
&& m_markTextChanges == ds.m_markTextChanges
&& m_autoFoldFirstComment== ds.m_autoFoldFirstComment
;
}