File indexing completed on 2024-02-25 16:44:35

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "custombasemodel.h"
0008 
0009 CustomBaseModel::CustomBaseModel(QObject *parent)
0010     : QAbstractListModel(parent)
0011 {
0012 }
0013 
0014 CustomBaseModel::~CustomBaseModel() = default;
0015 
0016 bool CustomBaseModel::loadMoreInProgress() const
0017 {
0018     return mLoadMoreInProgress;
0019 }
0020 
0021 void CustomBaseModel::setLoadMoreInProgress(bool inProgress)
0022 {
0023     if (mLoadMoreInProgress != inProgress) {
0024         mLoadMoreInProgress = inProgress;
0025         Q_EMIT loadingInProgressChanged();
0026     }
0027 }
0028 
0029 QList<int> CustomBaseModel::excludeResizeToContentColumns() const
0030 {
0031     return {};
0032 }
0033 
0034 void CustomBaseModel::insertElement(const QJsonObject &obj)
0035 {
0036     Q_UNUSED(obj)
0037     // Nothing
0038 }
0039 
0040 void CustomBaseModel::removeElement(const QString &identifier)
0041 {
0042     Q_UNUSED(identifier)
0043 }
0044 
0045 void CustomBaseModel::updateElement(const QJsonObject &obj)
0046 {
0047     Q_UNUSED(obj)
0048     // Nothing
0049 }
0050 
0051 void CustomBaseModel::initialize()
0052 {
0053     mLoadMoreInProgress = false;
0054     setHasFullList(false);
0055 }
0056 
0057 void CustomBaseModel::setHasFullList(bool state)
0058 {
0059     if (mHasFullList != state) {
0060         mHasFullList = state;
0061         Q_EMIT hasFullListChanged();
0062     }
0063 }
0064 
0065 bool CustomBaseModel::hasFullList() const
0066 {
0067     return mHasFullList;
0068 }
0069 
0070 #include "moc_custombasemodel.cpp"