Warning, file /network/kdeconnect-kde/smsapp/thumbnailsprovider.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /**
0002  * SPDX-FileCopyrightText: 2020 Aniket Kumar <anikketkumar786@gmail.com>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 #include "thumbnailsprovider.h"
0008 
0009 ThumbnailsProvider::ThumbnailsProvider()
0010     : QQuickImageProvider(QQuickImageProvider::Image)
0011 {
0012 }
0013 
0014 QImage ThumbnailsProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
0015 {
0016     Q_UNUSED(size)
0017     Q_UNUSED(requestedSize)
0018 
0019     if (m_thumbnails.contains(id)) {
0020         return m_thumbnails.value(id);
0021     }
0022 
0023     return QImage();
0024 }
0025 
0026 void ThumbnailsProvider::addImage(const QString &id, const QImage &image)
0027 {
0028     m_thumbnails.insert(id, image);
0029 }
0030 
0031 void ThumbnailsProvider::clear()
0032 {
0033     m_thumbnails.clear();
0034 }