X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/48b58f830a585b773435c9af5ee2fe8f0c7c641d..9abe299c77a7bd194d781bba0e6a3d037c0431d1:/src/kitemviews/kitemlistheader.cpp diff --git a/src/kitemviews/kitemlistheader.cpp b/src/kitemviews/kitemlistheader.cpp index cfc2c2b72..dedeb57e3 100644 --- a/src/kitemviews/kitemlistheader.cpp +++ b/src/kitemviews/kitemlistheader.cpp @@ -1,21 +1,8 @@ -/*************************************************************************** - * Copyright (C) 2012 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: 2012 Peter Penz + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "kitemlistheader.h" #include "kitemlistview.h" @@ -58,7 +45,8 @@ qreal KItemListHeader::columnWidth(const QByteArray& role) const void KItemListHeader::setColumnWidths(const QHash& columnWidths) { if (!m_headerWidget->automaticColumnResizing()) { - foreach (const QByteArray& role, m_view->visibleRoles()) { + const auto visibleRoles = m_view->visibleRoles(); + for (const QByteArray& role : visibleRoles) { const qreal width = columnWidths.value(role); m_headerWidget->setColumnWidth(role, width); } @@ -74,7 +62,7 @@ qreal KItemListHeader::preferredColumnWidth(const QByteArray& role) const } KItemListHeader::KItemListHeader(KItemListView* listView) : - QObject(listView->parent()), + QObject(listView), m_view(listView) { m_headerWidget = m_view->m_headerWidget;