Use braced initializer list in returns
Replaces explicit calls to the constructor in a return with a braced initializer list.
This commit is contained in:
@@ -278,7 +278,7 @@ inline QColor CharacterColor::color(const ColorEntry* base) const
|
||||
case COLOR_SPACE_DEFAULT: return base[_u+0+(_v?BASE_COLORS:0)].color;
|
||||
case COLOR_SPACE_SYSTEM: return base[_u+2+(_v?BASE_COLORS:0)].color;
|
||||
case COLOR_SPACE_256: return color256(_u,base);
|
||||
case COLOR_SPACE_RGB: return QColor(_u,_v,_w);
|
||||
case COLOR_SPACE_RGB: return {_u,_v,_w};
|
||||
case COLOR_SPACE_UNDEFINED: return QColor();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -380,7 +380,7 @@ void Emulation::setImageSize(int lines, int columns)
|
||||
|
||||
QSize Emulation::imageSize() const
|
||||
{
|
||||
return QSize(_currentScreen->getColumns(), _currentScreen->getLines());
|
||||
return {_currentScreen->getColumns(), _currentScreen->getLines()};
|
||||
}
|
||||
|
||||
ushort ExtendedCharTable::extendedCharHash(ushort* unicodePoints , ushort length) const
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ void Pty::setWindowSize(int lines, int cols)
|
||||
}
|
||||
QSize Pty::windowSize() const
|
||||
{
|
||||
return QSize(_windowColumns,_windowLines);
|
||||
return {_windowColumns,_windowLines};
|
||||
}
|
||||
|
||||
void Pty::setFlowControlEnabled(bool enable)
|
||||
|
||||
@@ -259,7 +259,7 @@ QRect ScreenWindow::scrollRegion() const
|
||||
if ( atEndOfOutput() && equalToScreenSize )
|
||||
return _screen->lastScrolledRegion();
|
||||
else
|
||||
return QRect(0,0,windowColumns(),windowLines());
|
||||
return {0,0,windowColumns(),windowLines()};
|
||||
}
|
||||
|
||||
void ScreenWindow::notifyOutputChanged()
|
||||
|
||||
@@ -1390,7 +1390,7 @@ QPoint TerminalDisplay::cursorPosition() const
|
||||
if (_screenWindow)
|
||||
return _screenWindow->cursorPosition();
|
||||
else
|
||||
return QPoint(0,0);
|
||||
return {0,0};
|
||||
}
|
||||
|
||||
QRect TerminalDisplay::preeditRect() const
|
||||
@@ -1398,7 +1398,7 @@ QRect TerminalDisplay::preeditRect() const
|
||||
const int preeditLength = string_width(_inputMethodData.preeditString);
|
||||
|
||||
if ( preeditLength == 0 )
|
||||
return QRect();
|
||||
return {};
|
||||
|
||||
return QRect(_leftMargin + _fontWidth*cursorPosition().x(),
|
||||
_topMargin + _fontHeight*cursorPosition().y(),
|
||||
@@ -1560,10 +1560,10 @@ QRect TerminalDisplay::calculateTextArea(int topLeftX, int topLeftY, int startCo
|
||||
int left = _fixedFont ? _fontWidth * startColumn : textWidth(0, startColumn, line);
|
||||
int top = _fontHeight * line;
|
||||
int width = _fixedFont ? _fontWidth * length : textWidth(startColumn, length, line);
|
||||
return QRect(_leftMargin + topLeftX + left,
|
||||
return {_leftMargin + topLeftX + left,
|
||||
_topMargin + topLeftY + top,
|
||||
width,
|
||||
_fontHeight);
|
||||
_fontHeight};
|
||||
}
|
||||
|
||||
void TerminalDisplay::drawContents(QPainter &paint, const QRect &rect)
|
||||
|
||||
Reference in New Issue
Block a user