MCPcopy Create free account
hub / github.com/KikoPlayProject/KikoPlay / remove

Method remove

Extension/Modules/lua_appui.cpp:35–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35int AppUI::remove(lua_State *L)
36{
37 KApp *app = KApp::getApp(L);
38 if (!app || lua_gettop(L) < 1) return 0;
39 AppWidget *w = nullptr;
40 if (lua_type(L, 1) == LUA_TSTRING)
41 {
42 w = app->getWidget(lua_tostring(L, 1));
43 }
44 else
45 {
46 w = AppWidget::checkWidget(L, 1, AppWidget::MetaName);
47 if (w)
48 {
49 lua_pushnil(L);
50 lua_setmetatable(L, 1); // widget meta
51 }
52 }
53 if (w)
54 {
55 w->deleteLater();
56 }
57 return 0;
58}
59
60
61}

Callers 2

refreshScriptsMethod · 0.45
deleteScriptMethod · 0.45

Calls 5

lua_gettopFunction · 0.85
lua_typeFunction · 0.85
lua_pushnilFunction · 0.85
lua_setmetatableFunction · 0.85
getWidgetMethod · 0.45

Tested by

no test coverage detected