NOISSUE add missing files
This commit is contained in:
parent
271ad9e4fd
commit
33c3850b40
4 changed files with 153 additions and 0 deletions
37
application/handlers/IconResourceHandler.cpp
Normal file
37
application/handlers/IconResourceHandler.cpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
#include "IconResourceHandler.h"
|
||||
#include <xdgicon.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
|
||||
QList<std::weak_ptr<IconResourceHandler>> IconResourceHandler::m_iconHandlers;
|
||||
|
||||
IconResourceHandler::IconResourceHandler(const QString &key)
|
||||
: m_key(key)
|
||||
{
|
||||
}
|
||||
|
||||
void IconResourceHandler::setTheme(const QString &theme)
|
||||
{
|
||||
// notify everyone
|
||||
for (auto handler : m_iconHandlers)
|
||||
{
|
||||
std::shared_ptr<IconResourceHandler> ptr = handler.lock();
|
||||
if (ptr)
|
||||
{
|
||||
ptr->setResult(ptr->get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IconResourceHandler::init(std::shared_ptr<ResourceHandler> &ptr)
|
||||
{
|
||||
m_iconHandlers.append(std::dynamic_pointer_cast<IconResourceHandler>(ptr));
|
||||
// we always have a result, so lets report it now!
|
||||
setResult(get());
|
||||
}
|
||||
|
||||
QVariant IconResourceHandler::get() const
|
||||
{
|
||||
return XdgIcon::fromTheme(m_key);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue