2023-09-01 17:30:21 +08:00
|
|
|
//
|
|
|
|
// 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);
|
2023-11-06 16:50:56 +08:00
|
|
|
return XdgIcon::fromTheme(name,fallback);
|
2023-09-01 17:30:21 +08:00
|
|
|
}
|
|
|
|
} // UkuiSearch
|