Commit d33debb2 authored by Willyanto Willyanto's avatar Willyanto Willyanto Committed by Albert Astals Cid
Browse files

Perform initialization in initialization list

Fixes variable is assigned in constructor body. Consider performing
initialization in initialization list. (CWE-398)
parent dd82a25a
Pipeline #237646 passed with stage
in 2 minutes and 12 seconds
......@@ -53,9 +53,8 @@ using namespace std::chrono_literals;
namespace Gwenview
{
NameFilterWidget::NameFilterWidget(SortedDirModel *model)
: mFilter(new NameFilter(model))
{
mFilter = new NameFilter(model);
mModeComboBox = new KComboBox;
mModeComboBox->addItem(i18n("Name contains"), QVariant(NameFilter::Contains));
mModeComboBox->addItem(i18n("Name does not contain"), QVariant(NameFilter::DoesNotContain));
......@@ -93,9 +92,8 @@ void NameFilterWidget::applyNameFilter()
}
DateFilterWidget::DateFilterWidget(SortedDirModel *model)
: mFilter(new DateFilter(model))
{
mFilter = new DateFilter(model);
mModeComboBox = new KComboBox;
mModeComboBox->addItem(i18n("Date >="), DateFilter::GreaterOrEqual);
mModeComboBox->addItem(i18n("Date ="), DateFilter::Equal);
......@@ -169,9 +167,8 @@ void RatingFilterWidget::updateFilterMode()
}
TagFilterWidget::TagFilterWidget(SortedDirModel *model)
: mFilter(new TagFilter(model))
{
mFilter = new TagFilter(model);
mModeComboBox = new KComboBox;
mModeComboBox->addItem(i18n("Tagged"), QVariant(true));
mModeComboBox->addItem(i18n("Not Tagged"), QVariant(false));
......
......@@ -44,8 +44,8 @@ struct LoadingIndicatorPrivate {
: q(qq)
, mIndex(0)
, mTimer(new QTimer(qq))
, mSequence(KIconLoader::global()->loadPixmapSequence(QStringLiteral("process-working"), 22))
{
mSequence = KIconLoader::global()->loadPixmapSequence(QStringLiteral("process-working"), 22);
mTimer->setInterval(100);
QObject::connect(mTimer, SIGNAL(timeout()), q, SLOT(showNextFrame()));
}
......
......@@ -33,8 +33,8 @@ static const int SLIDE_DURATION = 250;
SlideContainer::SlideContainer(QWidget *parent)
: QFrame(parent)
, mContent(nullptr)
{
mContent = nullptr;
mSlidingOut = false;
setFixedHeight(0);
}
......
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