Commit 31dada8d authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Renamed braces to brackets

Since we're automatically inserting several kinds of brackets, but not
braces ({ }).
parent 4774ba14
......@@ -73,7 +73,7 @@ QWidget *CompletionSettingsPage::createPage(QWidget *parent)
m_page->setupUi(w);
m_page->caseSensitive->setChecked(m_completion->caseSensitivity() == Qt::CaseSensitive);
m_page->autoInsertBraces->setChecked(m_completion->autoInsertBraces());
m_page->autoInsertBrackets->setChecked(m_completion->autoInsertBrackets());
m_page->partiallyComplete->setChecked(m_completion->isPartialCompletionEnabled());
return w;
......@@ -83,6 +83,6 @@ void CompletionSettingsPage::apply()
{
m_completion->setCaseSensitivity(
m_page->caseSensitive->isChecked() ? Qt::CaseSensitive : Qt::CaseInsensitive);
m_completion->setAutoInsertBraces(m_page->autoInsertBraces->isChecked());
m_completion->setAutoInsertBrackets(m_page->autoInsertBrackets->isChecked());
m_completion->setPartialCompletionEnabled(m_page->partiallyComplete->isChecked());
}
......@@ -31,12 +31,12 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="autoInsertBraces">
<widget class="QCheckBox" name="autoInsertBrackets">
<property name="toolTip">
<string>Automatically insert (, ) and ; when appropriate.</string>
</property>
<property name="text">
<string>&amp;Automatically insert braces</string>
<string>&amp;Automatically insert brackets</string>
</property>
<property name="checked">
<bool>true</bool>
......
......@@ -414,7 +414,7 @@ CppCodeCompletion::CppCodeCompletion(CppModelManager *manager)
: ICompletionCollector(manager),
m_manager(manager),
m_caseSensitivity(Qt::CaseSensitive),
m_autoInsertBraces(true),
m_autoInsertBrackets(true),
m_forcedCompletion(false),
m_completionOperator(T_EOF_SYMBOL)
{
......@@ -435,14 +435,14 @@ void CppCodeCompletion::setCaseSensitivity(Qt::CaseSensitivity caseSensitivity)
m_caseSensitivity = caseSensitivity;
}
bool CppCodeCompletion::autoInsertBraces() const
bool CppCodeCompletion::autoInsertBrackets() const
{
return m_autoInsertBraces;
return m_autoInsertBrackets;
}
void CppCodeCompletion::setAutoInsertBraces(bool autoInsertBraces)
void CppCodeCompletion::setAutoInsertBrackets(bool autoInsertBrackets)
{
m_autoInsertBraces = autoInsertBraces;
m_autoInsertBrackets = autoInsertBrackets;
}
bool CppCodeCompletion::isPartialCompletionEnabled() const
......@@ -1230,7 +1230,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
//qDebug() << "current symbol:" << overview.prettyName(symbol->name())
//<< overview.prettyType(symbol->type());
if (m_autoInsertBraces && symbol && symbol->type()) {
if (m_autoInsertBrackets && symbol && symbol->type()) {
QString extraChars;
if (Function *function = symbol->type()->asFunctionType()) {
......
......@@ -72,8 +72,8 @@ public:
Qt::CaseSensitivity caseSensitivity() const;
void setCaseSensitivity(Qt::CaseSensitivity caseSensitivity);
bool autoInsertBraces() const;
void setAutoInsertBraces(bool autoInsertBraces);
bool autoInsertBrackets() const;
void setAutoInsertBrackets(bool autoInsertBrackets);
bool isPartialCompletionEnabled() const;
void setPartialCompletionEnabled(bool partialCompletionEnabled);
......@@ -125,7 +125,7 @@ private:
CppModelManager *m_manager;
Qt::CaseSensitivity m_caseSensitivity;
bool m_autoInsertBraces;
bool m_autoInsertBrackets;
bool m_partialCompletionEnabled;
bool m_forcedCompletion;
......
......@@ -119,7 +119,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
settings->beginGroup(QLatin1String("Completion"));
const bool caseSensitive = settings->value(QLatin1String("CaseSensitive"), true).toBool();
m_completion->setCaseSensitivity(caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
m_completion->setAutoInsertBraces(settings->value(QLatin1String("AutoInsertBraces"), true).toBool());
m_completion->setAutoInsertBrackets(settings->value(QLatin1String("AutoInsertBraces"), true).toBool());
m_completion->setPartialCompletionEnabled(settings->value(QLatin1String("PartiallyComplete"), true).toBool());
settings->endGroup();
settings->endGroup();
......@@ -143,7 +143,7 @@ void CppToolsPlugin::shutdown()
settings->beginGroup(QLatin1String("CppTools"));
settings->beginGroup(QLatin1String("Completion"));
settings->setValue(QLatin1String("CaseSensitive"), m_completion->caseSensitivity() == Qt::CaseSensitive);
settings->setValue(QLatin1String("AutoInsertBraces"), m_completion->autoInsertBraces());
settings->setValue(QLatin1String("AutoInsertBraces"), m_completion->autoInsertBrackets());
settings->setValue(QLatin1String("PartiallyComplete"), m_completion->isPartialCompletionEnabled());
settings->endGroup();
settings->endGroup();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment