refactor: adapt magic_enum to Qt (#5258)
This commit is contained in:
@@ -107,14 +107,14 @@ public:
|
||||
return {};
|
||||
}
|
||||
// this uses magic enum to help automatic tooling find usages
|
||||
auto typeName =
|
||||
magic_enum::enum_name(lua::api::EventType::CompletionRequested);
|
||||
std::string cbName;
|
||||
cbName.reserve(5 + typeName.size());
|
||||
cbName += "c2cb-";
|
||||
cbName += typeName;
|
||||
auto typ =
|
||||
lua_getfield(this->state_, LUA_REGISTRYINDEX,
|
||||
QString("c2cb-%1")
|
||||
.arg(magic_enum::enum_name<lua::api::EventType>(
|
||||
lua::api::EventType::CompletionRequested)
|
||||
.data())
|
||||
.toStdString()
|
||||
.c_str());
|
||||
lua_getfield(this->state_, LUA_REGISTRYINDEX, cbName.c_str());
|
||||
if (typ != LUA_TFUNCTION)
|
||||
{
|
||||
lua_pop(this->state_, 1);
|
||||
|
||||
Reference in New Issue
Block a user