ukui-search/libsearch/plugininterface/action-transmiter.cpp

25 lines
590 B
C++

#include "action-transmiter.h"
#include <mutex>
using namespace UkuiSearch;
static std::once_flag flag;
static ActionTransmiter *global_intance = nullptr;
ActionTransmiter::ActionTransmiter(QObject *parent) : QObject(parent)
{
}
ActionTransmiter *ActionTransmiter::getInstance()
{
std::call_once(flag, [ & ] {
global_intance = new ActionTransmiter();
});
return global_intance;
}
void ActionTransmiter::invokeActions(SearchPluginIface::InvokableActions actions)
{
if(SearchPluginIface::InvokableAction::HideUI == actions) {
Q_EMIT hideUIAction();
}
}