/* * SPDX-FileCopyrightText: (C) 2021 Mikel Johnson * * SPDX-License-Identifier: LGPL-2.0-or-later */ #include "imagefavoritesmodel.h" #include "imagestorage.h" #include "roles.h" #include #include ImageFavoritesModel::ImageFavoritesModel(QObject *parent) : OpenFileModel({}, parent) { connect(ImageStorage::instance(), &ImageStorage::storageModified, this, &ImageFavoritesModel::slotPopulate); slotPopulate(); } void ImageFavoritesModel::slotPopulate() { beginResetModel(); m_images = ImageStorage::instance()->imagesForFavorites(); endResetModel(); }