Commit 7d33f0f0 authored by Tobias Hunger's avatar Tobias Hunger

TextEditor: Initialize some members

Coverity was complaining about these, in some places even rightly so:-)

Change-Id: Ia85cdd2c74f05edba6f0d4534aa9f2ee2a750595
Reviewed-by: default avatarDavid Schulz <david.schulz@qt.io>
parent 2f0a3950
......@@ -57,13 +57,13 @@ struct BehaviorSettingsPage::BehaviorSettingsPagePrivate
const BehaviorSettingsPageParameters m_parameters;
QPointer<QWidget> m_widget;
Internal::Ui::BehaviorSettingsPage *m_page;
Internal::Ui::BehaviorSettingsPage *m_page = nullptr;
void init();
CodeStylePool *m_defaultCodeStylePool;
SimpleCodeStylePreferences *m_codeStyle;
SimpleCodeStylePreferences *m_pageCodeStyle;
CodeStylePool *m_defaultCodeStylePool = nullptr;
SimpleCodeStylePreferences *m_codeStyle = nullptr;
SimpleCodeStylePreferences *m_pageCodeStyle = nullptr;
TypingSettings m_typingSettings;
StorageSettings m_storageSettings;
BehaviorSettings m_behaviorSettings;
......@@ -72,7 +72,7 @@ struct BehaviorSettingsPage::BehaviorSettingsPagePrivate
BehaviorSettingsPage::BehaviorSettingsPagePrivate::BehaviorSettingsPagePrivate
(const BehaviorSettingsPageParameters &p)
: m_parameters(p), m_page(0), m_pageCodeStyle(0)
: m_parameters(p)
{
}
......
......@@ -33,10 +33,6 @@ using namespace TextEditor;
using namespace Internal;
ProcessorRunner::ProcessorRunner()
: m_processor(0)
, m_interface(0)
, m_discardProposal(false)
, m_proposal(0)
{}
ProcessorRunner::~ProcessorRunner()
......
......@@ -54,11 +54,11 @@ public:
IAssistProposal *proposal() const;
private:
IAssistProcessor *m_processor;
AssistInterface *m_interface;
bool m_discardProposal;
IAssistProposal *m_proposal;
AssistReason m_reason;
IAssistProcessor *m_processor = nullptr;
AssistInterface *m_interface = nullptr;
bool m_discardProposal = false;
IAssistProposal *m_proposal = nullptr;
AssistReason m_reason = IdleEditor;
};
} // Internal
......
......@@ -107,14 +107,13 @@ private:
virtual void doReplaceExpressions(const QStringList &captures);
QString m_string;
int m_length;
Qt::CaseSensitivity m_caseSensitivity;
int m_length = 0;
Qt::CaseSensitivity m_caseSensitivity = Qt::CaseSensitive;
};
class RegExprRule : public DynamicRule
{
public:
RegExprRule() : m_onlyBegin(false), m_isCached(false) {}
virtual ~RegExprRule() {}
void setPattern(const QString &pattern);
......@@ -131,10 +130,10 @@ private:
bool isExactMatch(ProgressData *progress);
bool m_onlyBegin;
bool m_isCached;
int m_offset;
int m_length;
bool m_onlyBegin = false;
bool m_isCached = false;
int m_offset = 0;
int m_length = 0;
QStringList m_captures;
QRegExp m_expression;
};
......
......@@ -75,7 +75,7 @@ private:
private:
QString m_helpId;
QString m_docMark;
Category m_category;
Category m_category = Unknown;
mutable QMap<QString, QUrl> m_helpLinks; // cached help links
};
......
......@@ -51,7 +51,7 @@ public:
void refresh(QFutureInterface<void> &) override {}
private:
bool m_hasCurrentEditor;
bool m_hasCurrentEditor = false;
};
} // namespace Internal
......
......@@ -245,7 +245,7 @@ class BaseTextEditorPrivate
public:
BaseTextEditorPrivate() {}
TextEditorFactoryPrivate *m_origin;
TextEditorFactoryPrivate *m_origin = nullptr;
};
class HoverHandlerRunner
......@@ -561,7 +561,7 @@ public:
void disableBlockSelection(BlockSelectionUpdateKind kind);
void resetCursorFlashTimer();
QBasicTimer m_cursorFlashTimer;
bool m_cursorVisible;
bool m_cursorVisible = true;
bool m_moveLineUndoHack = false;
QTextCursor m_findScopeStart;
......
......@@ -44,10 +44,10 @@ enum TransFormationType { Uppercase, Lowercase };
struct TestBlockSelection
{
int positionBlock;
int positionColumn;
int anchorBlock;
int anchorColumn;
int positionBlock = 0;
int positionColumn = 0;
int anchorBlock = 0;
int anchorColumn = 0;
TestBlockSelection(int positionBlock, int positionColumn, int anchorBlock, int anchorColumn)
: positionBlock(positionBlock), positionColumn(positionColumn)
, anchorBlock(anchorBlock), anchorColumn(anchorColumn) {}
......
......@@ -94,7 +94,7 @@ TextMark::~TextMark()
TextMarkRegistry::remove(this);
if (m_baseTextDocument)
m_baseTextDocument->removeMark(this);
m_baseTextDocument = 0;
m_baseTextDocument = nullptr;
}
QString TextMark::fileName() const
......
......@@ -121,9 +121,9 @@ private:
QString m_fileName;
int m_lineNumber = 0;
Priority m_priority = LowPriority;
bool m_visible = false;
QIcon m_icon;
Utils::Theme::Color m_color;
Utils::Theme::Color m_color = Utils::Theme::TextColorNormal;
bool m_visible = false;
bool m_hasColor = false;
Core::Id m_category;
double m_widthFactor = 1.0;
......
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