File: typeslistproxyitem.cpp

package info (click to toggle)
kde-cli-tools 4%3A6.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 7,396 kB
  • sloc: cpp: 4,368; sh: 42; makefile: 7
file content (37 lines) | stat: -rw-r--r-- 918 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* This file is part of the KDE project
   SPDX-FileCopyrightText: 2022 Marco Rebhan <me@dblsaiko.net>

   SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
*/

#include "typeslistproxyitem.h"

#include "typeslistitem.h"

TypesListProxyItem::TypesListProxyItem(TypesListItem *inner, QTreeWidget *parent)
    : TypesListItemBase(parent)
    , m_inner(inner)
{
    setText(0, inner->text(0));
}

TypesListProxyItem::TypesListProxyItem(TypesListItem *inner, QTreeWidgetItem *parent)
    : TypesListItemBase(parent)
    , m_inner(inner)
{
    setText(0, inner->text(0));
}

void TypesListProxyItem::loadIcon(bool forceReload)
{
    m_inner->loadIcon(forceReload);

    if ((!m_inner->mimeTypeData().icon().isEmpty() && icon(0).isNull()) || forceReload) {
        QTreeWidgetItem::setIcon(0, QIcon::fromTheme(m_inner->mimeTypeData().icon()));
    }
}

TypesListItem *TypesListProxyItem::inner()
{
    return m_inner;
}