Commit 063d4995 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Initialize members in-class

parent 81dc5f37
Pipeline #198827 failed with stage
in 11 minutes and 16 seconds
......@@ -181,73 +181,14 @@ QAccessibleInterface *accessibleInterfaceFactory(const QString &key, QObject *ob
TerminalDisplay::TerminalDisplay(QWidget *parent)
: QWidget(parent)
, _screenWindow(nullptr)
, _verticalLayout(new QVBoxLayout(this))
, _lines(1)
, _columns(1)
, _prevCharacterLine(-1)
, _prevCharacterColumn(-1)
, _usedLines(1)
, _usedColumns(1)
, _contentRect(QRect())
, _image(nullptr)
, _imageSize(0)
, _lineProperties(QVector<LineProperty>())
, _randomSeed(0)
, _resizing(false)
, _showTerminalSizeHint(true)
, _bidiEnabled(false)
, _usesMouseTracking(false)
, _allowMouseTracking(true)
, _bracketedPasteMode(false)
, _iPntSel(QPoint(-1, -1))
, _pntSel(QPoint(-1, -1))
, _tripleSelBegin(QPoint(-1, -1))
, _actSel(0)
, _wordSelectionMode(false)
, _lineSelectionMode(false)
, _preserveLineBreaks(true)
, _columnSelectionMode(false)
, _autoCopySelectedText(false)
, _copyTextAsHTML(true)
, _middleClickPasteMode(Enum::PasteFromX11Selection)
, _wordCharacters(QStringLiteral(":@-./_~"))
, _bell(Enum::NotifyBell)
, _allowBlinkingText(true)
, _allowBlinkingCursor(false)
, _textBlinking(false)
, _cursorBlinking(false)
, _hasTextBlinker(false)
, _openLinksByDirectClick(false)
, _ctrlRequiredForDrag(true)
, _dropUrlsAsText(false)
, _tripleClickMode(Enum::SelectWholeLine)
, _possibleTripleClick(false)
, _resizeWidget(nullptr)
, _resizeTimer(nullptr)
, _flowControlWarningEnabled(false)
, _outputSuspendedMessageWidget(nullptr)
, _size(QSize())
, _wallpaper(nullptr)
, _filterChain(new TerminalImageFilterChain(this))
, _filterUpdateRequired(true)
, _cursorShape(Enum::BlockCursor)
, _sessionController(nullptr)
, _trimLeadingSpaces(false)
, _trimTrailingSpaces(false)
, _mouseWheelZoom(false)
, _margin(1)
, _centerContents(false)
, _readOnlyMessageWidget(nullptr)
, _readOnly(false)
, _dimWhenInactive(false)
, _scrollWheelState(ScrollState())
, _searchBar(new IncrementalSearchBar(this))
, _headerBar(new TerminalHeaderBar(this))
, _searchResultRect(QRect())
, _drawOverlay(false)
, _scrollBar(nullptr)
, _terminalColor(nullptr)
, _terminalFont(std::make_unique<TerminalFont>(this))
{
// terminal applications are not designed with Right-To-Left in mind,
......
......@@ -624,83 +624,83 @@ private:
bool _bellMasked;
QVBoxLayout *_verticalLayout;
QVBoxLayout *_verticalLayout = nullptr;
int _lines; // the number of lines that can be displayed in the widget
int _columns; // the number of columns that can be displayed in the widget
int _lines = 1; // the number of lines that can be displayed in the widget
int _columns = 1; // the number of columns that can be displayed in the widget
// Character line and character column as per a previous call to
// getCharacterPosition() in mouseMoveEvent().
int _prevCharacterLine;
int _prevCharacterColumn;
int _prevCharacterLine = -1;
int _prevCharacterColumn = -1;
int _usedLines; // the number of lines that are actually being used, this will be less
int _usedLines = 1; // the number of lines that are actually being used, this will be less
// than 'lines' if the character image provided with setImage() is smaller
// than the maximum image size which can be displayed
int _usedColumns; // the number of columns that are actually being used, this will be less
int _usedColumns = 1; // the number of columns that are actually being used, this will be less
// than 'columns' if the character image provided with setImage() is smaller
// than the maximum image size which can be displayed
QRect _contentRect;
Character *_image; // [lines][columns]
Character *_image = nullptr; // [lines][columns]
// only the area [usedLines][usedColumns] in the image contains valid data
int _imageSize;
int _imageSize = 0;
QVector<LineProperty> _lineProperties;
QColor _colorTable[TABLE_COLORS];
uint _randomSeed;
uint _randomSeed = 0;
bool _resizing;
bool _showTerminalSizeHint;
bool _bidiEnabled;
bool _usesMouseTracking;
bool _allowMouseTracking;
bool _bracketedPasteMode;
bool _resizing = false;
bool _showTerminalSizeHint = true;
bool _bidiEnabled = false;
bool _usesMouseTracking = false;
bool _allowMouseTracking = true;
bool _bracketedPasteMode = false;
QPoint _iPntSel; // initial selection point
QPoint _pntSel; // current selection point
QPoint _tripleSelBegin; // help avoid flicker
int _actSel; // selection state
bool _wordSelectionMode;
bool _lineSelectionMode;
bool _preserveLineBreaks;
bool _columnSelectionMode;
int _actSel = 0; // selection state
bool _wordSelectionMode = false;
bool _lineSelectionMode = false;
bool _preserveLineBreaks = true;
bool _columnSelectionMode = false;
bool _autoCopySelectedText;
bool _copyTextAsHTML;
Enum::MiddleClickPasteModeEnum _middleClickPasteMode;
bool _autoCopySelectedText = false;
bool _copyTextAsHTML = true;
Enum::MiddleClickPasteModeEnum _middleClickPasteMode = Enum::PasteFromX11Selection;
QString _wordCharacters;
TerminalBell _bell;
TerminalBell _bell{Enum::NotifyBell};
bool _allowBlinkingText; // allow text to blink
bool _allowBlinkingCursor; // allow cursor to blink
bool _textBlinking; // text is blinking, hide it when drawing
bool _cursorBlinking; // cursor is blinking, hide it when drawing
bool _hasTextBlinker; // has characters to blink
QTimer *_blinkTextTimer;
QTimer *_blinkCursorTimer;
bool _allowBlinkingText = true; // allow text to blink
bool _allowBlinkingCursor = false; // allow cursor to blink
bool _textBlinking = false; // text is blinking, hide it when drawing
bool _cursorBlinking = false; // cursor is blinking, hide it when drawing
bool _hasTextBlinker = false; // has characters to blink
QTimer *_blinkTextTimer = nullptr;
QTimer *_blinkCursorTimer = nullptr;
bool _openLinksByDirectClick; // Open URL and hosts by single mouse click
bool _openLinksByDirectClick = false; // Open URL and hosts by single mouse click
bool _ctrlRequiredForDrag; // require Ctrl key for drag selected text
bool _dropUrlsAsText; // always paste URLs as text without showing copy/move menu
bool _ctrlRequiredForDrag = true; // require Ctrl key for drag selected text
bool _dropUrlsAsText = false; // always paste URLs as text without showing copy/move menu
Enum::TripleClickModeEnum _tripleClickMode;
bool _possibleTripleClick; // is set in mouseDoubleClickEvent and deleted
Enum::TripleClickModeEnum _tripleClickMode = Enum::SelectWholeLine;
bool _possibleTripleClick = false; // is set in mouseDoubleClickEvent and deleted
// after QApplication::doubleClickInterval() delay
QLabel *_resizeWidget;
QTimer *_resizeTimer;
QLabel *_resizeWidget = nullptr;
QTimer *_resizeTimer = nullptr;
bool _flowControlWarningEnabled;
bool _flowControlWarningEnabled = false;
// widgets related to the warning message that appears when the user presses Ctrl+S to suspend
// terminal output - informing them what has happened and how to resume output
KMessageWidget *_outputSuspendedMessageWidget;
KMessageWidget *_outputSuspendedMessageWidget = nullptr;
QSize _size;
......@@ -709,10 +709,10 @@ private:
// list of filters currently applied to the display. used for links and
// search highlight
TerminalImageFilterChain *_filterChain;
bool _filterUpdateRequired;
TerminalImageFilterChain *_filterChain = nullptr;
bool _filterUpdateRequired = true;
Enum::CursorShapeEnum _cursorShape;
Enum::CursorShapeEnum _cursorShape = Enum::BlockCursor;
InputMethodData _inputMethodData;
......@@ -722,41 +722,41 @@ private:
// the duration of the size hint in milliseconds
static const int SIZE_HINT_DURATION = 1000;
SessionController *_sessionController;
SessionController *_sessionController = nullptr;
bool _trimLeadingSpaces; // trim leading spaces in selected text
bool _trimTrailingSpaces; // trim trailing spaces in selected text
bool _mouseWheelZoom; // enable mouse wheel zooming or not
bool _trimLeadingSpaces = false; // trim leading spaces in selected text
bool _trimTrailingSpaces = false; // trim trailing spaces in selected text
bool _mouseWheelZoom = false; // enable mouse wheel zooming or not
int _margin; // the contents margin
bool _centerContents; // center the contents between margins
int _margin = 1; // the contents margin
bool _centerContents = false; // center the contents between margins
KMessageWidget *_readOnlyMessageWidget; // Message shown at the top when read-only mode gets activated
KMessageWidget *_readOnlyMessageWidget = nullptr; // Message shown at the top when read-only mode gets activated
// Needed to know whether the mode really changed between update calls
bool _readOnly;
bool _readOnly = false;
bool _dimWhenInactive;
bool _dimWhenInactive = false;
int _dimValue;
ScrollState _scrollWheelState;
IncrementalSearchBar *_searchBar;
TerminalHeaderBar *_headerBar;
IncrementalSearchBar *_searchBar = nullptr;
TerminalHeaderBar *_headerBar = nullptr;
QRect _searchResultRect;
friend class TerminalDisplayAccessible;
bool _drawOverlay;
bool _drawOverlay = false;
Qt::Edge _overlayEdge;
bool _hasCompositeFocus;
bool _displayVerticalLine;
int _displayVerticalLineAtChar;
bool _displayVerticalLine = false;
int _displayVerticalLineAtChar = 80;
QKeySequence _peekPrimaryShortcut;
TerminalPainter *_terminalPainter;
TerminalScrollBar *_scrollBar;
TerminalColor *_terminalColor;
TerminalPainter *_terminalPainter = nullptr;
TerminalScrollBar *_scrollBar = nullptr;
TerminalColor *_terminalColor = nullptr;
std::unique_ptr<TerminalFont> _terminalFont;
std::unique_ptr<KonsolePrintManager> _printManager;
......
......@@ -24,14 +24,6 @@ namespace Konsole
{
TerminalFont::TerminalFont(QWidget *parent)
: m_parent(parent)
, m_lineSpacing(0)
, m_fontHeight(1)
, m_fontWidth(1)
, m_fontAscent(1)
, m_boldIntense(false)
, m_antialiasText(true)
, m_useFontLineCharacters(false)
, m_profile(nullptr)
{
}
......
......@@ -46,14 +46,14 @@ protected:
void fontChange(const QFont &);
private:
QWidget *m_parent;
uint m_lineSpacing;
int m_fontHeight;
int m_fontWidth;
int m_fontAscent;
bool m_boldIntense;
bool m_antialiasText;
bool m_useFontLineCharacters;
QWidget *m_parent = nullptr;
uint m_lineSpacing = 0;
int m_fontHeight = 1;
int m_fontWidth = 1;
int m_fontAscent = 1;
bool m_boldIntense = false;
bool m_antialiasText = true;
bool m_useFontLineCharacters = false;
Profile::Ptr m_profile;
};
......
......@@ -29,9 +29,6 @@ namespace Konsole
{
TerminalScrollBar::TerminalScrollBar(QWidget *parent)
: QScrollBar(parent)
, _scrollFullPage(false)
, _alternateScrolling(false)
, _scrollbarLocation(Enum::ScrollBarRight)
{
connect(this, &QScrollBar::valueChanged, this, &TerminalScrollBar::scrollBarPositionChanged);
}
......
......@@ -94,9 +94,9 @@ public Q_SLOTS:
void highlightScrolledLinesEvent();
private:
bool _scrollFullPage;
bool _alternateScrolling;
Enum::ScrollBarPositionEnum _scrollbarLocation;
bool _scrollFullPage = false;
bool _alternateScrolling = false;
Enum::ScrollBarPositionEnum _scrollbarLocation = Enum::ScrollBarRight;
HighlightScrolledLines _highlightScrolledLines;
QPalette _backgroundMatchingPalette;
};
......
......@@ -14,7 +14,6 @@ using namespace Konsole;
AutoScrollHandler::AutoScrollHandler(QWidget *parent)
: QObject(parent)
, _timerId(0)
{
parent->installEventFilter(this);
}
......
......@@ -29,7 +29,7 @@ private:
return static_cast<QWidget *>(parent());
}
int _timerId;
int _timerId = 0;
};
}
......
......@@ -14,16 +14,9 @@
namespace Konsole
{
HighlightScrolledLines::HighlightScrolledLines()
: _enabled(false)
, _previousScrollCount(0)
, _timer(nullptr)
{
}
HighlightScrolledLines::HighlightScrolledLines() = default;
HighlightScrolledLines::~HighlightScrolledLines()
{
}
HighlightScrolledLines::~HighlightScrolledLines() = default;
bool HighlightScrolledLines::isEnabled()
{
......
......@@ -64,9 +64,9 @@ public:
static const int HIGHLIGHT_SCROLLED_LINES_WIDTH = 3;
private:
bool _enabled;
bool _enabled = false;
QRect _rect;
int _previousScrollCount;
int _previousScrollCount = 0;
std::unique_ptr<QTimer> _timer;
};
} // namespace Konsole
......
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