kdeconnect-kde/smsapp/thumbnailsprovider.cpp
Alexander Lohnau 405f61bf85 Discard unused params more elegantly
By commenting out the parameter name, we get compile-time checks
Also, we can omit them for slots and Qt will not forward the parameters.

In case we had TODOs next to the code, I kept the Q_UNUSED statements
for now.
2023-08-05 20:22:18 +00:00

31 lines
703 B
C++

/**
* SPDX-FileCopyrightText: 2020 Aniket Kumar <anikketkumar786@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#include "thumbnailsprovider.h"
ThumbnailsProvider::ThumbnailsProvider()
: QQuickImageProvider(QQuickImageProvider::Image)
{
}
QImage ThumbnailsProvider::requestImage(const QString &id, QSize * /*size*/, const QSize & /*requestedSize*/)
{
if (m_thumbnails.contains(id)) {
return m_thumbnails.value(id);
}
return QImage();
}
void ThumbnailsProvider::addImage(const QString &id, const QImage &image)
{
m_thumbnails.insert(id, image);
}
void ThumbnailsProvider::clear()
{
m_thumbnails.clear();
}