1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#include "customicons.h"
6#include <QIcon>
7#include <QMimeDatabase>
8
9namespace {
10QFileIconProvider provider;
11QMimeDatabase mimeDatabase;
12}
13
14QIcon CustomIcons::icon(QFileIconProvider::IconType type)
15{
16 return provider.icon(type);
17}
18
19QIcon CustomIcons::icon(CustomIcons::CustomIconType type)
20{
21 switch (type) {
22 case CustomIcons::Exe:
23 return QIcon::fromTheme("application/x-executable");
24 case CustomIcons::Lib:
25 return QIcon::fromTheme("application/x-sharedlib");
26 }
27 return {};
28}
29
30QIcon CustomIcons::icon(const QFileInfo &info)
31{
32 return provider.icon(info);
33}
34
35QString CustomIcons::type(const QFileInfo &info)
36{
37 return provider.type(info);
38}
39
40void CustomIcons::setOptions(QFileIconProvider::Options options)
41{
42 return provider.setOptions(options);
43}
44
45QFileIconProvider::Options CustomIcons::options()
46{
47 return provider.options();
48}
49