diff --git a/kstyle/animations/breezescrollbarengine.cpp b/kstyle/animations/breezescrollbarengine.cpp --- a/kstyle/animations/breezescrollbarengine.cpp +++ b/kstyle/animations/breezescrollbarengine.cpp @@ -52,7 +52,7 @@ { const ScrollBarData* scrollBarData( static_cast( data.data() ) ); - Animation::Pointer animation = scrollBarData->animation( control ); + const Animation::Pointer &animation = scrollBarData->animation( control ); return animation.data()->isRunning(); } else return false; diff --git a/kstyle/breezeframeshadow.cpp b/kstyle/breezeframeshadow.cpp --- a/kstyle/breezeframeshadow.cpp +++ b/kstyle/breezeframeshadow.cpp @@ -151,7 +151,7 @@ void FrameShadowFactory::updateShadowsGeometry( const QObject* object, QRect rect ) const { - const QList children = object->children(); + const QList &children = object->children(); foreach( QObject *child, children ) { if( FrameShadow* shadow = qobject_cast(child) ) @@ -164,7 +164,7 @@ void FrameShadowFactory::raiseShadows( QObject* object ) const { - const QList children = object->children(); + const QList &children = object->children(); foreach( QObject *child, children ) { if( FrameShadow* shadow = qobject_cast(child) ) @@ -177,7 +177,7 @@ void FrameShadowFactory::update( QObject* object ) const { - const QList children = object->children(); + const QList &children = object->children(); foreach( QObject *child, children ) { if( FrameShadow* shadow = qobject_cast(child) ) @@ -190,7 +190,7 @@ void FrameShadowFactory::updateState( const QWidget* widget, bool focus, bool hover, qreal opacity, AnimationMode mode ) const { - const QList children = widget->children(); + const QList &children = widget->children(); foreach( QObject *child, children ) { if( FrameShadow* shadow = qobject_cast(child) ) diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp --- a/kstyle/breezehelper.cpp +++ b/kstyle/breezehelper.cpp @@ -42,7 +42,7 @@ //____________________________________________________________________ Helper::Helper( KSharedConfig::Ptr config ): - _config( config ) + _config( std::move( config ) ) { init(); } //____________________________________________________________________ @@ -128,7 +128,7 @@ { QColor outline( palette.color( QPalette::Inactive, QPalette::Highlight ) ); - QColor focus( palette.color( QPalette::Active, QPalette::Highlight ) ); + const QColor &focus = palette.color( QPalette::Active, QPalette::Highlight ); if( mode == AnimationFocus ) { diff --git a/kstyle/breezemdiwindowshadow.h b/kstyle/breezemdiwindowshadow.h --- a/kstyle/breezemdiwindowshadow.h +++ b/kstyle/breezemdiwindowshadow.h @@ -45,7 +45,7 @@ public: //* constructor - explicit MdiWindowShadow( QWidget*, TileSet ); + explicit MdiWindowShadow( QWidget*, const TileSet & ); //* update geometry void updateGeometry(); diff --git a/kstyle/breezemdiwindowshadow.cpp b/kstyle/breezemdiwindowshadow.cpp --- a/kstyle/breezemdiwindowshadow.cpp +++ b/kstyle/breezemdiwindowshadow.cpp @@ -33,7 +33,7 @@ { //____________________________________________________________________ - MdiWindowShadow::MdiWindowShadow( QWidget* parent, TileSet shadowTiles ): + MdiWindowShadow::MdiWindowShadow( QWidget* parent, const TileSet &shadowTiles ): QWidget( parent ), _shadowTiles( shadowTiles ) { diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -3112,7 +3112,7 @@ if( rect.height() < 2*Metrics::LineEdit_FrameWidth + option->fontMetrics.height()) { - const auto background( palette.color( QPalette::Base ) ); + const auto &background = palette.color( QPalette::Base ); painter->setPen( Qt::NoPen ); painter->setBrush( background ); @@ -3136,7 +3136,7 @@ const qreal opacity( _animations->inputWidgetEngine().frameOpacity( widget ) ); // render - const auto background( palette.color( QPalette::Base ) ); + const auto &background = palette.color( QPalette::Base ); const auto outline( _helper->frameOutlineColor( palette, mouseOver, hasFocus, opacity, mode ) ); _helper->renderFrame( painter, rect, background, outline ); @@ -3729,7 +3729,7 @@ { _shadowHelper->registerWidget( widget->window(), true ); } const auto& palette( option->palette ); - const auto background( palette.color( QPalette::ToolTipBase ) ); + const auto &background = palette.color( QPalette::ToolTipBase ); const auto outline( KColorUtils::mix( palette.color( QPalette::ToolTipBase ), palette.color( QPalette::ToolTipText ), 0.25 ) ); const bool hasAlpha( _helper->hasAlphaChannel( widget ) ); @@ -5043,7 +5043,7 @@ const qreal progress( _animations->busyIndicatorEngine().value() ); - const auto first( palette.color( QPalette::Highlight ) ); + const auto &first = palette.color( QPalette::Highlight ); const auto second( KColorUtils::mix( palette.color( QPalette::Highlight ), palette.color( QPalette::Window ), 0.7 ) ); _helper->renderProgressBarBusyContents( painter, rect, first, second, horizontal, reverse, progress ); @@ -5271,7 +5271,7 @@ // colors const auto& palette( option->palette ); - const auto background( palette.color( QPalette::Window ) ); + const auto &background = palette.color( QPalette::Window ); // adjust rect, based on number of buttons to be drawn const auto rect( scrollBarInternalSubControlRect( sliderOption, SC_ScrollBarSubLine ) ); @@ -5425,7 +5425,7 @@ const qreal opacity( _animations->headerViewEngine().opacity( widget, rect.topLeft() ) ); // fill - const auto normal( palette.color( QPalette::Button ) ); + const auto &normal = palette.color( QPalette::Button ); const auto focus( KColorUtils::mix( normal, _helper->focusColor( palette ), 0.2 ) ); const auto hover( KColorUtils::mix( normal, _helper->hoverColor( palette ), 0.2 ) ); @@ -6194,7 +6194,7 @@ if( flat ) { - const auto background( palette.color( QPalette::Base ) ); + const auto &background = palette.color( QPalette::Base ); painter->setBrush( background ); painter->setPen( Qt::NoPen ); @@ -6322,7 +6322,7 @@ if( flat ) { - const auto background( palette.color( QPalette::Base ) ); + const auto &background = palette.color( QPalette::Base ); painter->setBrush( background ); painter->setPen( Qt::NoPen ); @@ -6395,7 +6395,7 @@ // colors const auto base( _helper->separatorColor( palette ) ); - const auto highlight( palette.color( QPalette::Highlight ) ); + const auto &highlight = palette.color( QPalette::Highlight ); while( current <= sliderOption->maximum ) { @@ -6437,7 +6437,7 @@ auto handleRect( subControlRect( CC_Slider, sliderOption, SC_SliderHandle, widget ) ); // highlight color - const auto highlight( palette.color( QPalette::Highlight ) ); + const auto &highlight = palette.color( QPalette::Highlight ); if( sliderOption->orientation == Qt::Horizontal ) { @@ -6484,7 +6484,7 @@ const qreal opacity( _animations->widgetStateEngine().buttonOpacity( widget ) ); // define colors - const auto background( palette.color( QPalette::Button ) ); + const auto &background = palette.color( QPalette::Button ); const auto outline( _helper->sliderOutlineColor( palette, handleActive && mouseOver, hasFocus, opacity, mode ) ); const auto shadow( _helper->shadowColor( palette ) ); @@ -6535,7 +6535,7 @@ { // highlight - const auto highlight( palette.color( QPalette::Highlight ) ); + const auto &highlight = palette.color( QPalette::Highlight ); // angles const qreal second( dialAngle( sliderOption, sliderOption->sliderPosition ) ); @@ -6567,7 +6567,7 @@ const qreal opacity( _animations->dialEngine().buttonOpacity( widget ) ); // define colors - const auto background( palette.color( QPalette::Button ) ); + const auto &background = palette.color( QPalette::Button ); const auto outline( _helper->sliderOutlineColor( palette, handleActive && mouseOver, hasFocus, opacity, mode ) ); const auto shadow( _helper->shadowColor( palette ) );