X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/16a3aea6a629a91aab937be5c111b64b3ed6cf86..3bf471e0:/src/kitemviews/kitemlistviewaccessible.cpp diff --git a/src/kitemviews/kitemlistviewaccessible.cpp b/src/kitemviews/kitemlistviewaccessible.cpp index 0188408a7..a1afadff4 100644 --- a/src/kitemviews/kitemlistviewaccessible.cpp +++ b/src/kitemviews/kitemlistviewaccessible.cpp @@ -1,24 +1,10 @@ -/*************************************************************************** - * Copyright (C) 2012 by Amandeep Singh * - * * - * 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 Amandeep Singh + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #ifndef QT_NO_ACCESSIBILITY - #include "kitemlistviewaccessible.h" #include "kitemlistcontainer.h" @@ -44,7 +30,7 @@ KItemListViewAccessible::KItemListViewAccessible(KItemListView* view_) : KItemListViewAccessible::~KItemListViewAccessible() { - foreach (AccessibleIdWrapper idWrapper, m_cells) { + for (AccessibleIdWrapper idWrapper : qAsConst(m_cells)) { if (idWrapper.isValid) { QAccessible::deleteAccessibleInterface(idWrapper.id); } @@ -215,8 +201,8 @@ QAccessible::State KItemListViewAccessible::state() const QAccessibleInterface* KItemListViewAccessible::childAt(int x, int y) const { const QPointF point = QPointF(x, y); - int itemIndex = view()->itemAt(view()->mapFromScene(point)); - return child(itemIndex); + const std::optional itemIndex = view()->itemAt(view()->mapFromScene(point)); + return child(itemIndex.value_or(-1)); } QAccessibleInterface* KItemListViewAccessible::parent() const