X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/e07468c7840caeff97360edf08826aa38e8d96ae..edced8460b:/src/kitemviews/private/kitemlistsizehintresolver.cpp diff --git a/src/kitemviews/private/kitemlistsizehintresolver.cpp b/src/kitemviews/private/kitemlistsizehintresolver.cpp index 1d8067026..7deb5c621 100644 --- a/src/kitemviews/private/kitemlistsizehintresolver.cpp +++ b/src/kitemviews/private/kitemlistsizehintresolver.cpp @@ -1,30 +1,17 @@ -/*************************************************************************** - * Copyright (C) 2011 by Peter Penz * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ +/* + * SPDX-FileCopyrightText: 2011 Peter Penz + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "kitemlistsizehintresolver.h" - -#include +#include "kitemviews/kitemlistview.h" KItemListSizeHintResolver::KItemListSizeHintResolver(const KItemListView* itemListView) : m_itemListView(itemListView), m_logicalHeightHintCache(), m_logicalWidthHint(0.0), + m_minHeightHint(0.0), m_needsResolving(false) { } @@ -33,6 +20,12 @@ KItemListSizeHintResolver::~KItemListSizeHintResolver() { } +QSizeF KItemListSizeHintResolver::minSizeHint() +{ + updateCache(); + return QSizeF(m_logicalWidthHint, m_minHeightHint); +} + QSizeF KItemListSizeHintResolver::sizeHint(int index) { updateCache(); @@ -42,7 +35,7 @@ QSizeF KItemListSizeHintResolver::sizeHint(int index) void KItemListSizeHintResolver::itemsInserted(const KItemRangeList& itemRanges) { int insertedCount = 0; - foreach (const KItemRange& range, itemRanges) { + for (const KItemRange& range : itemRanges) { insertedCount += range.count; } @@ -129,7 +122,7 @@ void KItemListSizeHintResolver::itemsMoved(const KItemRange& range, const QList< void KItemListSizeHintResolver::itemsChanged(int index, int count, const QSet& roles) { - Q_UNUSED(roles); + Q_UNUSED(roles) while (count) { m_logicalHeightHintCache[index] = 0.0; ++index;