Commit 67520b94 authored by Willyanto Willyanto's avatar Willyanto Willyanto
Browse files

Perform some initializations in initialization list

Fixes some variable is assigned in constructor body. Consider performing
initialization in initialization list. (CWE-398)
parent 89ae7bcb
Pipeline #256570 canceled with stage
in 15 minutes and 56 seconds
......@@ -19,13 +19,11 @@
TextOutputWidget::TextOutputWidget(QWidget *parent)
: QWidget(parent)
, m_succesTextColor(QColor::fromRgb(3, 191, 3))
, m_succesBackgroundColor(QColor::fromRgb(231, 247, 231))
, m_errorTextColor(QColor::fromRgb(191, 3, 3))
, m_errorBackgroundColor(QColor::fromRgb(247, 231, 231))
{
m_succesTextColor = QColor::fromRgb(3, 191, 3);
m_succesBackgroundColor = QColor::fromRgb(231, 247, 231);
m_errorTextColor = QColor::fromRgb(191, 3, 3);
m_errorBackgroundColor = QColor::fromRgb(247, 231, 231);
m_layout = new QHBoxLayout(this);
m_output = new QTextEdit();
......
......@@ -48,8 +48,8 @@ static const QStringList s_escapeExceptions{QStringLiteral("vi"), QStringLiteral
KateKonsolePlugin::KateKonsolePlugin(QObject *parent, const QList<QVariant> &)
: KTextEditor::Plugin(parent)
, m_previousEditorEnv(qgetenv("EDITOR"))
{
m_previousEditorEnv = qgetenv("EDITOR");
if (!KAuthorized::authorize(QStringLiteral("shell_access"))) {
KMessageBox::error(nullptr, i18n("You do not have enough karma to access a shell or terminal emulation"));
}
......
......@@ -103,13 +103,12 @@ class CompletionIcons : public QObject
public:
CompletionIcons()
: QObject(KTextEditor::Editor::instance())
, classIcon(QIcon::fromTheme(QStringLiteral("code-class")))
, blockIcon(QIcon::fromTheme(QStringLiteral("code-block")))
, funcIcon(QIcon::fromTheme(QStringLiteral("code-function")))
, varIcon(QIcon::fromTheme(QStringLiteral("code-variable")))
, enumIcon(QIcon::fromTheme(QStringLiteral("enum")))
{
classIcon = QIcon::fromTheme(QStringLiteral("code-class"));
blockIcon = QIcon::fromTheme(QStringLiteral("code-block"));
funcIcon = QIcon::fromTheme(QStringLiteral("code-function"));
varIcon = QIcon::fromTheme(QStringLiteral("code-variable"));
enumIcon = QIcon::fromTheme(QStringLiteral("enum"));
auto e = KTextEditor::Editor::instance();
QObject::connect(e, &KTextEditor::Editor::configChanged, this, [this](KTextEditor::Editor *e) {
colorIcons(e);
......
Supports Markdown
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