File indexing completed on 2024-07-14 14:34:06

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2000 Carsten Pfeiffer <pfeiffer@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #include "kurlpixmapprovider.h"
0009 #include <QUrl>
0010 #include <kio/global.h>
0011 #include <pixmaploader.h>
0012 
0013 #if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 66) && KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 66)
0014 
0015 KUrlPixmapProvider::KUrlPixmapProvider()
0016     : d(nullptr)
0017 {
0018 }
0019 
0020 KUrlPixmapProvider::~KUrlPixmapProvider()
0021 {
0022 }
0023 
0024 QPixmap KUrlPixmapProvider::pixmapFor(const QString &url, int size)
0025 {
0026     const QUrl u = QUrl::fromUserInput(url); // absolute path or URL
0027     return KIO::pixmapForUrl(u, 0, KIconLoader::Desktop, size);
0028 }
0029 
0030 void KUrlPixmapProvider::virtual_hook(int id, void *data)
0031 {
0032     KPixmapProvider::virtual_hook(id, data);
0033 }
0034 
0035 #endif