Reduce function call overhead

The arg() function of the QString class has a variable length argument
which allows to reduce the number of chained calls to the same function.
With proper formatting, readability is not affected.
This commit is contained in:
Gianluca Recchia 2018-10-28 12:23:06 +01:00
parent 18fd20f898
commit a67a574b89
No known key found for this signature in database
GPG key ID: 3C2B4128D9A1F218
8 changed files with 30 additions and 40 deletions

View file

@ -309,10 +309,10 @@ void KMessageWidget::setMessageType(KMessageWidget::MessageType type)
"}"
".QLabel { color: %6; }"
))
.arg(bg0.name())
.arg(bg1.name())
.arg(bg2.name())
.arg(border.name())
.arg(bg0.name(),
bg1.name(),
bg2.name(),
border.name())
// DefaultFrameWidth returns the size of the external margin + border width. We know our border is 1px,
// so we subtract this from the frame normal QStyle FrameWidth to get our margin
.arg(style()->pixelMetric(QStyle::PM_DefaultFrameWidth, nullptr, this) - 1)