23 lines
542 B
C++
23 lines
542 B
C++
//
|
|
// Created by zpf on 2023/9/1.
|
|
//
|
|
|
|
#include "icon-loader.h"
|
|
#include <QMutex>
|
|
#include <QMutexLocker>
|
|
#include <XdgIcon>
|
|
namespace UkuiSearch {
|
|
static QMutex qtIconMutex;
|
|
static QMutex xdgIconMutex;
|
|
QIcon IconLoader::loadIconQt(const QString &name, const QIcon &fallback)
|
|
{
|
|
QMutexLocker locker(&qtIconMutex);
|
|
return QIcon::fromTheme(name,fallback);
|
|
}
|
|
|
|
QIcon IconLoader::loadIconXdg(const QString &name, const QIcon &fallback)
|
|
{
|
|
QMutexLocker locker(&xdgIconMutex);
|
|
return XdgIcon::fromTheme(name,fallback);
|
|
}
|
|
} // UkuiSearch
|