[HORUS] Arbitrary limit for themes / layouts / widgets now removed
This commit is contained in:
@@ -28,10 +28,8 @@ std::list<const LayoutFactory *> & getRegisteredLayouts()
|
|||||||
|
|
||||||
void registerLayout(const LayoutFactory * factory)
|
void registerLayout(const LayoutFactory * factory)
|
||||||
{
|
{
|
||||||
if (getRegisteredLayouts().size() < MAX_REGISTERED_LAYOUTS) {
|
TRACE("register layout %s", factory->getName());
|
||||||
TRACE("register layout %s", factory->getName());
|
getRegisteredLayouts().push_back(factory);
|
||||||
getRegisteredLayouts().push_back(factory);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const LayoutFactory * getLayoutFactory(const char * name)
|
const LayoutFactory * getLayoutFactory(const char * name)
|
||||||
|
|||||||
@@ -117,7 +117,6 @@ class BaseLayoutFactory: public LayoutFactory
|
|||||||
Layout * loadLayout(const char * name, Layout::PersistentData * persistentData);
|
Layout * loadLayout(const char * name, Layout::PersistentData * persistentData);
|
||||||
void loadCustomScreens();
|
void loadCustomScreens();
|
||||||
|
|
||||||
#define MAX_REGISTERED_LAYOUTS 10
|
|
||||||
std::list<const LayoutFactory *> & getRegisteredLayouts();
|
std::list<const LayoutFactory *> & getRegisteredLayouts();
|
||||||
|
|
||||||
#endif // _LAYOUT_H_
|
#endif // _LAYOUT_H_
|
||||||
|
|||||||
@@ -32,10 +32,8 @@ std::list<Theme *> & getRegisteredThemes()
|
|||||||
|
|
||||||
void registerTheme(Theme * theme)
|
void registerTheme(Theme * theme)
|
||||||
{
|
{
|
||||||
if (getRegisteredThemes().size() < MAX_REGISTERED_THEMES) {
|
TRACE("register theme %s", theme->getName());
|
||||||
TRACE("register theme %s", theme->getName());
|
getRegisteredThemes().push_back(theme);
|
||||||
getRegisteredThemes().push_back(theme);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Theme::init() const
|
void Theme::init() const
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ Theme * getTheme(const char * name);
|
|||||||
void loadTheme(Theme * theme);
|
void loadTheme(Theme * theme);
|
||||||
void loadTheme();
|
void loadTheme();
|
||||||
|
|
||||||
#define MAX_REGISTERED_THEMES 10
|
|
||||||
std::list<Theme *> & getRegisteredThemes();
|
std::list<Theme *> & getRegisteredThemes();
|
||||||
|
|
||||||
#endif // _THEME_H_
|
#endif // _THEME_H_
|
||||||
|
|||||||
@@ -28,10 +28,8 @@ std::list<const WidgetFactory *> & getRegisteredWidgets()
|
|||||||
|
|
||||||
void registerWidget(const WidgetFactory * factory)
|
void registerWidget(const WidgetFactory * factory)
|
||||||
{
|
{
|
||||||
if (getRegisteredWidgets().size() < MAX_REGISTERED_WIDGETS) {
|
TRACE("register widget %s", factory->getName());
|
||||||
TRACE("register widget %s", factory->getName());
|
getRegisteredWidgets().push_back(factory);
|
||||||
getRegisteredWidgets().push_back(factory);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const WidgetFactory * getWidgetFactory(const char * name)
|
const WidgetFactory * getWidgetFactory(const char * name)
|
||||||
|
|||||||
@@ -188,7 +188,6 @@ inline const ZoneOption * Widget::getOptions() const
|
|||||||
|
|
||||||
Widget * loadWidget(const char * name, const Zone & zone, Widget::PersistentData * persistentData);
|
Widget * loadWidget(const char * name, const Zone & zone, Widget::PersistentData * persistentData);
|
||||||
|
|
||||||
#define MAX_REGISTERED_WIDGETS 20 // TODO: arbitrary limit, not checked
|
|
||||||
std::list<const WidgetFactory *> & getRegisteredWidgets();
|
std::list<const WidgetFactory *> & getRegisteredWidgets();
|
||||||
|
|
||||||
#endif // _WIDGET_H_
|
#endif // _WIDGET_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user