diff options
Diffstat (limited to 'src/assistant/assistant/openpagesmodel.cpp')
-rw-r--r-- | src/assistant/assistant/openpagesmodel.cpp | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/src/assistant/assistant/openpagesmodel.cpp b/src/assistant/assistant/openpagesmodel.cpp index 6efc46bcb..12620f6f8 100644 --- a/src/assistant/assistant/openpagesmodel.cpp +++ b/src/assistant/assistant/openpagesmodel.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Assistant module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "openpagesmodel.h" #include "helpenginewrapper.h" @@ -36,6 +11,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + OpenPagesModel::OpenPagesModel(QObject *parent) : QAbstractTableModel(parent) { TRACE_OBJ @@ -44,7 +21,7 @@ OpenPagesModel::OpenPagesModel(QObject *parent) : QAbstractTableModel(parent) int OpenPagesModel::rowCount(const QModelIndex &parent) const { TRACE_OBJ - return parent.isValid() ? 0 : m_pages.count(); + return parent.isValid() ? 0 : m_pages.size(); } int OpenPagesModel::columnCount(const QModelIndex &/*parent*/) const @@ -60,8 +37,8 @@ QVariant OpenPagesModel::data(const QModelIndex &index, int role) const || role != Qt::DisplayRole) return QVariant(); QString title = m_pages.at(index.row())->title(); - title.replace(QLatin1Char('&'), QLatin1String("&&")); - return title.isEmpty() ? QLatin1String("(Untitled)") : title; + title.replace(u'&', "&&"_L1); + return title.isEmpty() ? "(Untitled)"_L1 : title; } HelpViewer *OpenPagesModel::addPage(const QUrl &url, qreal zoom) @@ -69,8 +46,7 @@ HelpViewer *OpenPagesModel::addPage(const QUrl &url, qreal zoom) TRACE_OBJ beginInsertRows(QModelIndex(), rowCount(), rowCount()); HelpViewer *page = new HelpViewer(zoom); - connect(page, &HelpViewer::titleChanged, - this, &OpenPagesModel::handleTitleChanged); + connect(page, &HelpViewer::titleChanged, this, &OpenPagesModel::handleTitleChanged); m_pages << page; endInsertRows(); page->setSource(url); |