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:
Luís Pereira
2019-04-11 12:46:23 +01:00
committed by Alf Gaida
parent 5e44880a70
commit b87de89767
5 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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)
+1 -1
View File
@@ -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()
+4 -4
View File
@@ -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)