Commit 22449118 authored by Jarek Kobus's avatar Jarek Kobus Committed by Jarek Kobus
Browse files

Implement Code Style schemes

Task-number: QTCREATORBUG-5092

Change-Id: I218cef02f7c242e4dfae59b1b8021ea618e60d07
Reviewed-on: http://codereview.qt-project.org/5160

Reviewed-by: default avatarLeandro T. C. Melo <leandro.melo@nokia.com>
parent 3955df78
......@@ -47,8 +47,9 @@
#include <utils/qtcassert.h>
/*!
\class ProjectExplorer::PersistentSettingsReader
\class Utils::PersistentSettingsReader
\brief Reads a QVariantMap of arbitrary, nested data structures from a XML file.
......@@ -80,10 +81,10 @@
and added to the stack entry below (added to list or inserted into map). The first element
of the stack is the value of the <data> element.
\sa ProjectExplorer::PersistentSettingsWriter
\sa Utils::PersistentSettingsWriter
*/
namespace ProjectExplorer {
namespace Utils {
struct Context // Basic context containing element name string constants.
{
......@@ -300,7 +301,7 @@ PersistentSettingsReader::PersistentSettingsReader()
{
}
QVariant PersistentSettingsReader::restoreValue(const QString & variable) const
QVariant PersistentSettingsReader::restoreValue(const QString &variable) const
{
if (m_valueMap.contains(variable))
return m_valueMap.value(variable);
......@@ -312,7 +313,7 @@ QVariantMap PersistentSettingsReader::restoreValues() const
return m_valueMap;
}
bool PersistentSettingsReader::load(const QString & fileName)
bool PersistentSettingsReader::load(const QString &fileName)
{
m_valueMap.clear();
......@@ -326,10 +327,10 @@ bool PersistentSettingsReader::load(const QString & fileName)
}
/*!
\class ProjectExplorer::PersistentSettingsWriter
\class Utils::PersistentSettingsWriter
\brief Serializes a QVariantMap of arbitrary, nested data structures to a XML file.
\sa ProjectExplorer::PersistentSettingsReader
\sa Utils::PersistentSettingsReader
*/
PersistentSettingsWriter::PersistentSettingsWriter()
......@@ -373,12 +374,12 @@ static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx,
}
}
void PersistentSettingsWriter::saveValue(const QString & variable, const QVariant &value)
void PersistentSettingsWriter::saveValue(const QString &variable, const QVariant &value)
{
m_valueMap.insert(variable, value);
}
bool PersistentSettingsWriter::save(const QString & fileName, const QString &docType,
bool PersistentSettingsWriter::save(const QString &fileName, const QString &docType,
QWidget *parent) const
{
Utils::FileSaver saver(fileName, QIODevice::Text);
......@@ -406,4 +407,4 @@ bool PersistentSettingsWriter::save(const QString & fileName, const QString &doc
}
return saver.finalize(parent);
}
} // namespace ProjectExplorer
} // namespace Utils
......@@ -33,7 +33,7 @@
#ifndef PERSISTENTSETTINGS_H
#define PERSISTENTSETTINGS_H
#include "projectexplorer_export.h"
#include "utils_global.h"
#include <QtCore/QMap>
#include <QtCore/QVariant>
......@@ -42,31 +42,31 @@ QT_BEGIN_NAMESPACE
class QWidget;
QT_END_NAMESPACE
namespace ProjectExplorer {
namespace Utils {
class PROJECTEXPLORER_EXPORT PersistentSettingsReader
class QTCREATOR_UTILS_EXPORT PersistentSettingsReader
{
public:
PersistentSettingsReader();
QVariant restoreValue(const QString & variable) const;
QVariant restoreValue(const QString &variable) const;
QVariantMap restoreValues() const;
bool load(const QString & fileName);
bool load(const QString &fileName);
private:
QMap<QString, QVariant> m_valueMap;
};
class PROJECTEXPLORER_EXPORT PersistentSettingsWriter
class QTCREATOR_UTILS_EXPORT PersistentSettingsWriter
{
public:
PersistentSettingsWriter();
void saveValue(const QString & variable, const QVariant &value);
void saveValue(const QString &variable, const QVariant &value);
bool save(const QString &fileName, const QString &docType, QWidget *parent) const;
private:
QMap<QString, QVariant> m_valueMap;
};
} // namespace ProjectExplorer
} // namespace Utils
#endif // PERSISTENTSETTINGS_H
......@@ -90,7 +90,8 @@ SOURCES += $$PWD/environment.cpp \
$$PWD/ssh/sshkeypasswordretriever.cpp \
$$PWD/outputformatter.cpp \
$$PWD/flowlayout.cpp \
$$PWD/networkaccessmanager.cpp
$$PWD/networkaccessmanager.cpp \
$$PWD/persistentsettings.cpp
win32 {
SOURCES += \
......@@ -194,7 +195,8 @@ HEADERS += \
$$PWD/outputformatter.h \
$$PWD/outputformat.h \
$$PWD/flowlayout.h \
$$PWD/networkaccessmanager.h
$$PWD/networkaccessmanager.h \
$$PWD/persistentsettings.h
FORMS += $$PWD/filewizardpage.ui \
$$PWD/projectintropage.ui \
......
......@@ -53,9 +53,6 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/navigationwidget.h>
#include <texteditor/fontsettings.h>
#include <texteditor/tabpreferences.h>
#include <texteditor/storagesettings.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorplugin.h>
#include <texteditor/texteditorsettings.h>
......
......@@ -36,10 +36,8 @@ using namespace CppTools;
static const char *settingsSuffixKey = "CodeStyleSettings";
static const char *currentFallbackKey = "CurrentFallback";
CppCodeStylePreferences::CppCodeStylePreferences(const QList<TextEditor::IFallbackPreferences *> &fallbacks, QObject *parent) :
IFallbackPreferences(fallbacks, parent)
CppCodeStylePreferences::CppCodeStylePreferences(QObject *parent) :
ICodeStylePreferences(parent)
{
connect(this, SIGNAL(currentValueChanged(QVariant)),
this, SLOT(slotCurrentValueChanged(QVariant)));
......@@ -48,7 +46,7 @@ CppCodeStylePreferences::CppCodeStylePreferences(const QList<TextEditor::IFallba
QVariant CppCodeStylePreferences::value() const
{
QVariant v;
v.setValue(settings());
v.setValue(codeStyleSettings());
return v;
}
......@@ -57,15 +55,15 @@ void CppCodeStylePreferences::setValue(const QVariant &data)
if (!data.canConvert<CppCodeStyleSettings>())
return;
setSettings(data.value<CppCodeStyleSettings>());
setCodeStyleSettings(data.value<CppCodeStyleSettings>());
}
CppCodeStyleSettings CppCodeStylePreferences::settings() const
CppCodeStyleSettings CppCodeStylePreferences::codeStyleSettings() const
{
return m_data;
}
void CppCodeStylePreferences::setSettings(const CppCodeStyleSettings &data)
void CppCodeStylePreferences::setCodeStyleSettings(const CppCodeStyleSettings &data)
{
if (m_data == data)
return;
......@@ -75,13 +73,13 @@ void CppCodeStylePreferences::setSettings(const CppCodeStyleSettings &data)
QVariant v;
v.setValue(data);
emit valueChanged(v);
emit settingsChanged(m_data);
if (!currentFallback()) {
emit codeStyleSettingsChanged(m_data);
if (!currentDelegate()) {
emit currentValueChanged(v);
}
}
CppCodeStyleSettings CppCodeStylePreferences::currentSettings() const
CppCodeStyleSettings CppCodeStylePreferences::currentCodeStyleSettings() const
{
QVariant v = currentValue();
if (!v.canConvert<CppCodeStyleSettings>()) {
......@@ -96,7 +94,7 @@ void CppCodeStylePreferences::slotCurrentValueChanged(const QVariant &value)
if (!value.canConvert<CppCodeStyleSettings>())
return;
emit currentSettingsChanged(value.value<CppCodeStyleSettings>());
emit currentCodeStyleSettingsChanged(value.value<CppCodeStyleSettings>());
}
QString CppCodeStylePreferences::settingsSuffix() const
......@@ -106,13 +104,19 @@ QString CppCodeStylePreferences::settingsSuffix() const
void CppCodeStylePreferences::toMap(const QString &prefix, QVariantMap *map) const
{
ICodeStylePreferences::toMap(prefix, map);
if (currentDelegate())
return;
m_data.toMap(prefix, map);
map->insert(prefix + QLatin1String(currentFallbackKey), currentFallbackId());
}
void CppCodeStylePreferences::fromMap(const QString &prefix, const QVariantMap &map)
{
ICodeStylePreferences::fromMap(prefix, map);
if (currentDelegate())
return;
m_data.fromMap(prefix, map);
setCurrentFallback(map.value(prefix + QLatin1String(currentFallbackKey), QLatin1String("Global")).toString());
}
......@@ -35,35 +35,34 @@
#include "cpptools_global.h"
#include "cppcodestylesettings.h"
#include <texteditor/ifallbackpreferences.h>
#include <texteditor/icodestylepreferences.h>
namespace CppTools {
class CPPTOOLS_EXPORT CppCodeStylePreferences : public TextEditor::IFallbackPreferences
class CPPTOOLS_EXPORT CppCodeStylePreferences : public TextEditor::ICodeStylePreferences
{
Q_OBJECT
public:
explicit CppCodeStylePreferences(
const QList<TextEditor::IFallbackPreferences *> &fallbacks,
QObject *parent = 0);
virtual QVariant value() const;
virtual void setValue(const QVariant &);
CppCodeStyleSettings settings() const;
CppCodeStyleSettings codeStyleSettings() const;
// tracks parent hierarchy until currentParentSettings is null
CppCodeStyleSettings currentSettings() const;
CppCodeStyleSettings currentCodeStyleSettings() const;
virtual void toMap(const QString &prefix, QVariantMap *map) const;
virtual void fromMap(const QString &prefix, const QVariantMap &map);
public slots:
void setSettings(const CppTools::CppCodeStyleSettings &data);
void setCodeStyleSettings(const CppTools::CppCodeStyleSettings &data);
signals:
void settingsChanged(const CppTools::CppCodeStyleSettings &);
void currentSettingsChanged(const CppTools::CppCodeStyleSettings &);
void codeStyleSettingsChanged(const CppTools::CppCodeStyleSettings &);
void currentCodeStyleSettingsChanged(const CppTools::CppCodeStyleSettings &);
protected:
virtual QString settingsSuffix() const;
......
......@@ -30,18 +30,66 @@
**
**************************************************************************/
#include "cppcodestylesettingsfactory.h"
#include "cppcodestylepreferencesfactory.h"
#include "cppcodestylesettings.h"
#include "cppcodestylesettingspage.h"
#include "cppcodestylepreferences.h"
#include "cpptoolsconstants.h"
#include "cppqtstyleindenter.h"
#include <texteditor/tabpreferences.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/tabsettings.h>
#include <texteditor/snippets/isnippetprovider.h>
#include <cppeditor/cppeditorconstants.h>
#include <QtGui/QLayout>
using namespace CppTools;
static const char *defaultPreviewText =
"#include <math.h>\n"
"\n"
"class Complex\n"
" {\n"
"public:\n"
" Complex(double re, double im)\n"
" : _re(re), _im(im)\n"
" {}\n"
" double modulus() const\n"
" {\n"
" return sqrt(_re * _re + _im * _im);\n"
" }\n"
"private:\n"
" double _re;\n"
" double _im;\n"
" };\n"
"\n"
"void bar(int i)\n"
" {\n"
" static int counter = 0;\n"
" counter += i;\n"
" }\n"
"\n"
"namespace Foo\n"
" {\n"
" namespace Bar\n"
" {\n"
" void foo(int a, int b)\n"
" {\n"
" for (int i = 0; i < a; i++)\n"
" {\n"
" if (i < b)\n"
" bar(i);\n"
" else\n"
" {\n"
" bar(i);\n"
" bar(b);\n"
" }\n"
" }\n"
" }\n"
" } // namespace Bar\n"
" } // namespace Foo\n"
;
CppCodeStylePreferencesFactory::CppCodeStylePreferencesFactory()
{
}
......@@ -56,14 +104,12 @@ QString CppCodeStylePreferencesFactory::displayName()
return Constants::CPP_SETTINGS_NAME;
}
TextEditor::IFallbackPreferences *CppCodeStylePreferencesFactory::createPreferences(
const QList<TextEditor::IFallbackPreferences *> &fallbacks) const
TextEditor::ICodeStylePreferences *CppCodeStylePreferencesFactory::createCodeStyle() const
{
return new CppCodeStylePreferences(fallbacks);
return new CppCodeStylePreferences();
}
QWidget *CppCodeStylePreferencesFactory::createEditor(TextEditor::IFallbackPreferences *preferences,
TextEditor::TabPreferences *tabPreferences,
QWidget *CppCodeStylePreferencesFactory::createEditor(TextEditor::ICodeStylePreferences *preferences,
QWidget *parent) const
{
CppCodeStylePreferences *cppPreferences = qobject_cast<CppCodeStylePreferences *>(preferences);
......@@ -71,7 +117,7 @@ QWidget *CppCodeStylePreferencesFactory::createEditor(TextEditor::IFallbackPrefe
return 0;
Internal::CppCodeStylePreferencesWidget *widget = new Internal::CppCodeStylePreferencesWidget(parent);
widget->layout()->setMargin(0);
widget->setPreferences(cppPreferences, tabPreferences);
widget->setCodeStyle(cppPreferences);
return widget;
}
......@@ -80,3 +126,18 @@ TextEditor::Indenter *CppCodeStylePreferencesFactory::createIndenter() const
return new CppQtStyleIndenter();
}
TextEditor::ISnippetProvider *CppCodeStylePreferencesFactory::snippetProvider() const
{
const QList<TextEditor::ISnippetProvider *> &providers =
ExtensionSystem::PluginManager::instance()->getObjects<TextEditor::ISnippetProvider>();
foreach (TextEditor::ISnippetProvider *provider, providers)
if (provider->groupId() == QLatin1String(CppEditor::Constants::CPP_SNIPPETS_GROUP_ID))
return provider;
return 0;
}
QString CppCodeStylePreferencesFactory::previewText() const
{
return QLatin1String(defaultPreviewText);
}
......@@ -30,8 +30,8 @@
**
**************************************************************************/
#ifndef CPPCODESTYLESETTINGSFACTORY_H
#define CPPCODESTYLESETTINGSFACTORY_H
#ifndef CPPCODESTYLEPREFERENCESFACTORY_H
#define CPPCODESTYLEPREFERENCESFACTORY_H
#include <texteditor/icodestylepreferencesfactory.h>
......@@ -44,14 +44,14 @@ public:
virtual QString languageId();
virtual QString displayName();
virtual TextEditor::IFallbackPreferences *createPreferences(const QList<TextEditor::IFallbackPreferences *> &fallbacks) const;
virtual QWidget *createEditor(TextEditor::IFallbackPreferences *settings,
TextEditor::TabPreferences *tabSettings,
QWidget *parent) const;
virtual TextEditor::ICodeStylePreferences *createCodeStyle() const;
virtual QWidget *createEditor(TextEditor::ICodeStylePreferences *settings,
QWidget *parent) const;
virtual TextEditor::Indenter *createIndenter() const;
virtual TextEditor::ISnippetProvider *snippetProvider() const;
virtual QString previewText() const;
};
} // namespace CppTools
#endif // CPPCODESTYLESETTINGSFACTORY_H
#endif // CPPCODESTYLEPREFERENCESFACTORY_H
......@@ -41,7 +41,7 @@
#include <texteditor/displaysettings.h>
#include <texteditor/texteditorsettings.h>
#include <texteditor/tabsettings.h>
#include <texteditor/tabpreferences.h>
#include <texteditor/codestyleeditor.h>
#include <extensionsystem/pluginmanager.h>
#include <cppeditor/cppeditorconstants.h>
#include <coreplugin/icore.h>
......@@ -209,8 +209,7 @@ namespace Internal {
CppCodeStylePreferencesWidget::CppCodeStylePreferencesWidget(QWidget *parent)
: QWidget(parent),
m_tabPreferences(0),
m_cppCodeStylePreferences(0),
m_preferences(0),
m_ui(new Ui::CppCodeStyleSettingsPage),
m_blockUpdates(false)
{
......@@ -224,50 +223,51 @@ CppCodeStylePreferencesWidget::CppCodeStylePreferencesWidget(QWidget *parent)
m_previews[i]->setPlainText(defaultCodeStyleSnippets[i]);
}
TextEditor::TextEditorSettings *settings = TextEditorSettings::instance();
decorateEditors(settings->fontSettings());
connect(settings, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
TextEditor::TextEditorSettings *textEditorSettings = TextEditorSettings::instance();
decorateEditors(textEditorSettings->fontSettings());
connect(textEditorSettings, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
this, SLOT(decorateEditors(TextEditor::FontSettings)));
setVisualizeWhitespace(true);
connect(m_ui->tabSettingsWidget, SIGNAL(settingsChanged(TextEditor::TabSettings)),
this, SLOT(slotTabSettingsChanged(TextEditor::TabSettings)));
connect(m_ui->indentBlockBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentBlockBody, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentClassBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentNamespaceBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentEnumBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentNamespaceBody, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentSwitchLabels, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentCaseStatements, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentCaseBlocks, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentCaseBreak, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentAccessSpecifiers, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentDeclarationsRelativeToAccessSpecifiers, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentFunctionBody, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentFunctionBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->extraPaddingConditions, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->alignAssignments, SIGNAL(toggled(bool)),
this, SLOT(slotCppCodeStyleSettingsChanged()));
this, SLOT(slotCodeStyleSettingsChanged()));
m_ui->categoryTab->setCurrentIndex(0);
m_ui->tabPreferencesWidget->setFlat(true);
m_ui->fallbackWidget->setLabelText(tr("Code style settings:"));
m_ui->tabSettingsWidget->setFlat(true);
}
CppCodeStylePreferencesWidget::~CppCodeStylePreferencesWidget()
......@@ -275,27 +275,21 @@ CppCodeStylePreferencesWidget::~CppCodeStylePreferencesWidget()
delete m_ui;
}
void CppCodeStylePreferencesWidget::setPreferences(CppTools::CppCodeStylePreferences *codeStylePreferences,
TextEditor::TabPreferences *tabPreferences)
void CppCodeStylePreferencesWidget::setCodeStyle(CppTools::CppCodeStylePreferences *codeStylePreferences)
{
// tab preferences
m_tabPreferences = tabPreferences;
m_ui->tabPreferencesWidget->setTabPreferences(tabPreferences);
connect(m_tabPreferences, SIGNAL(currentSettingsChanged(TextEditor::TabSettings)),
this, SLOT(updatePreview()));
// code preferences
m_cppCodeStylePreferences = codeStylePreferences;
m_ui->fallbackWidget->setFallbackPreferences(codeStylePreferences);
m_ui->fallbackContainer->setVisible(!m_ui->fallbackWidget->isHidden());
m_preferences = codeStylePreferences;
connect(m_cppCodeStylePreferences, SIGNAL(currentSettingsChanged(CppTools::CppCodeStyleSettings)),
this, SLOT(setCppCodeStyleSettings(CppTools::CppCodeStyleSettings)));
connect(m_cppCodeStylePreferences, SIGNAL(currentPreferencesChanged(TextEditor::IFallbackPreferences*)),
this, SLOT(slotCurrentPreferencesChanged(TextEditor::IFallbackPreferences*)));
connect(m_preferences, SIGNAL(currentTabSettingsChanged(TextEditor::TabSettings)),
this, SLOT(setTabSettings(TextEditor::TabSettings)));
connect(m_preferences, SIGNAL(currentCodeStyleSettingsChanged(CppTools::CppCodeStyleSettings)),
this, SLOT(setCodeStyleSettings(CppTools::CppCodeStyleSettings)));
connect(m_preferences, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*)),
this, SLOT(slotCurrentPreferencesChanged(TextEditor::ICodeStylePreferences*)));
setCppCodeStyleSettings(m_cppCodeStylePreferences->settings(), false);
slotCurrentPreferencesChanged(m_cppCodeStylePreferences->currentPreferences(), false);
setTabSettings(m_preferences->tabSettings());
setCodeStyleSettings(m_preferences->codeStyleSettings(), false);
slotCurrentPreferencesChanged(m_preferences->currentPreferences(), false);
updatePreview();
}
......@@ -324,7 +318,12 @@ CppCodeStyleSettings CppCodeStylePreferencesWidget::cppCodeStyleSettings() const
return set;
}
void CppCodeStylePreferencesWidget::setCppCodeStyleSettings(const CppCodeStyleSettings &s, bool preview)
void CppCodeStylePreferencesWidget::setTabSettings(const TextEditor::TabSettings &settings)
{
m_ui->tabSettingsWidget->setTabSettings(settings);
}
void CppCodeStylePreferencesWidget::setCodeStyleSettings(const CppCodeStyleSettings &s, bool preview)
{
const bool wasBlocked = m_blockUpdates;
m_blockUpdates = true;
......@@ -349,9 +348,10 @@ void CppCodeStylePreferencesWidget::setCppCodeStyleSettings(const CppCodeStyleSe
updatePreview();
}
void CppCodeStylePreferencesWidget::slotCurrentPreferencesChanged(TextEditor::IFallbackPreferences *preferences, bool preview)
void CppCodeStylePreferencesWidget::slotCurrentPreferencesChanged(TextEditor::ICodeStylePreferences *preferences, bool preview)
{
const bool enable = !preferences->isReadOnly() && m_cppCodeStylePreferences->isFallbackEnabled(m_cppCodeStylePreferences->currentFallback());
const bool enable = !preferences->isReadOnly() && !m_preferences->currentDelegate();
m_ui->tabSettingsWidget->setEnabled(enable);
m_ui->contentGroupBox->setEnabled(enable);
m_ui->bracesGroupBox->setEnabled(enable);
m_ui->switchGroupBox->setEnabled(enable);
......@@ -365,8 +365,7 @@ QString CppCodeStylePreferencesWidget::searchKeywords() const
QString rc;
QLatin1Char sep(' ');
QTextStream(&rc)
<< sep << m_ui->tabPreferencesWidget->searchKeywords()
<< sep << m_ui->fallbackWidget->searchKeywords()
<< sep << m_ui->tabSettingsWidget->searchKeywords()
<< sep << m_ui->indentBlockBraces->text()
<< sep << m_ui->indentBlockBody->text()
<< sep << m_ui->indentClassBraces->text()
......@@ -394,15 +393,29 @@ QString CppCodeStylePreferencesWidget::searchKeywords() const