File indexing completed on 2024-04-28 05:27:04

0001 /* This file is part of the KDE project
0002    SPDX-FileCopyrightText: 2022 Marco Rebhan <me@dblsaiko.net>
0003 
0004    SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
0005 */
0006 
0007 #include "typeslistproxyitem.h"
0008 
0009 #include "typeslistitem.h"
0010 
0011 TypesListProxyItem::TypesListProxyItem(TypesListItem *inner, QTreeWidget *parent)
0012     : TypesListItemBase(parent)
0013     , m_inner(inner)
0014 {
0015     setText(0, inner->text(0));
0016 }
0017 
0018 TypesListProxyItem::TypesListProxyItem(TypesListItem *inner, QTreeWidgetItem *parent)
0019     : TypesListItemBase(parent)
0020     , m_inner(inner)
0021 {
0022     setText(0, inner->text(0));
0023 }
0024 
0025 void TypesListProxyItem::loadIcon(bool forceReload)
0026 {
0027     m_inner->loadIcon(forceReload);
0028 
0029     if ((!m_inner->mimeTypeData().icon().isEmpty() && icon(0).isNull()) || forceReload) {
0030         QTreeWidgetItem::setIcon(0, QIcon::fromTheme(m_inner->mimeTypeData().icon()));
0031     }
0032 }
0033 
0034 TypesListItem *TypesListProxyItem::inner()
0035 {
0036     return m_inner;
0037 }