MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / loadWidget

Method loadWidget

src/app/widget_loader.cpp:64–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64Widget* WidgetLoader::loadWidget(const char* fileName, const char* widgetId, ui::Widget* widget)
65{
66 std::string buf;
67
68 ResourceFinder rf;
69 rf.addPath(fileName);
70
71 buf = "widgets/";
72 buf += fileName;
73 rf.includeDataDir(buf.c_str());
74
75 if (!rf.findFirst())
76 throw WidgetNotFound(widgetId);
77
78 widget = loadWidgetFromXmlFile(rf.filename(), widgetId, widget);
79 if (!widget)
80 throw WidgetNotFound(widgetId);
81
82 return widget;
83}
84
85Widget* WidgetLoader::loadWidgetFromXmlFile(
86 const std::string& xmlFilename,

Callers

nothing calls this directly

Calls 5

WidgetNotFoundClass · 0.85
addPathMethod · 0.80
includeDataDirMethod · 0.80
findFirstMethod · 0.80
filenameMethod · 0.45

Tested by

no test coverage detected