Commit 43857a23 authored by Igor Kushnir's avatar Igor Kushnir
Browse files

Share the list returned by AStylePlugin::predefinedStyles()

Creating all predefined styles in every function call is inefficient.
parent 2cd07174
......@@ -272,7 +272,7 @@ SourceFormatterStyle predefinedStyle(const QString& name, const QString& caption
QVector<SourceFormatterStyle> AStylePlugin::predefinedStyles() const
{
return {
static const QVector<SourceFormatterStyle> list = {
predefinedStyle(QStringLiteral("ANSI")),
predefinedStyle(QStringLiteral("GNU")),
predefinedStyle(QStringLiteral("Java")),
......@@ -286,6 +286,7 @@ QVector<SourceFormatterStyle> AStylePlugin::predefinedStyles() const
predefinedStyle(QStringLiteral("KDELibs"), QStringLiteral("KDE Frameworks")),
predefinedStyle(QStringLiteral("Qt")),
};
return list;
}
SettingsWidget* AStylePlugin::editStyleWidget(const QMimeType& mime) const
......
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