From 66fb949c8268267316d11c1da50aabadac633f3d Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sat, 17 Dec 2016 23:33:47 +0100 Subject: [PATCH] [HORUS] Arbitrary limit for themes / layouts / widgets now removed --- radio/src/gui/480x272/layout.cpp | 6 ++---- radio/src/gui/480x272/layout.h | 1 - radio/src/gui/480x272/theme.cpp | 6 ++---- radio/src/gui/480x272/theme.h | 1 - radio/src/gui/480x272/widget.cpp | 6 ++---- radio/src/gui/480x272/widget.h | 1 - 6 files changed, 6 insertions(+), 15 deletions(-) diff --git a/radio/src/gui/480x272/layout.cpp b/radio/src/gui/480x272/layout.cpp index e221e3357..0176baddc 100644 --- a/radio/src/gui/480x272/layout.cpp +++ b/radio/src/gui/480x272/layout.cpp @@ -28,10 +28,8 @@ std::list & getRegisteredLayouts() void registerLayout(const LayoutFactory * factory) { - if (getRegisteredLayouts().size() < MAX_REGISTERED_LAYOUTS) { - TRACE("register layout %s", factory->getName()); - getRegisteredLayouts().push_back(factory); - } + TRACE("register layout %s", factory->getName()); + getRegisteredLayouts().push_back(factory); } const LayoutFactory * getLayoutFactory(const char * name) diff --git a/radio/src/gui/480x272/layout.h b/radio/src/gui/480x272/layout.h index 5ff0293ae..22a1320e8 100644 --- a/radio/src/gui/480x272/layout.h +++ b/radio/src/gui/480x272/layout.h @@ -117,7 +117,6 @@ class BaseLayoutFactory: public LayoutFactory Layout * loadLayout(const char * name, Layout::PersistentData * persistentData); void loadCustomScreens(); -#define MAX_REGISTERED_LAYOUTS 10 std::list & getRegisteredLayouts(); #endif // _LAYOUT_H_ diff --git a/radio/src/gui/480x272/theme.cpp b/radio/src/gui/480x272/theme.cpp index 2fccc8ab5..260ecefe4 100644 --- a/radio/src/gui/480x272/theme.cpp +++ b/radio/src/gui/480x272/theme.cpp @@ -32,10 +32,8 @@ std::list & getRegisteredThemes() void registerTheme(Theme * theme) { - if (getRegisteredThemes().size() < MAX_REGISTERED_THEMES) { - TRACE("register theme %s", theme->getName()); - getRegisteredThemes().push_back(theme); - } + TRACE("register theme %s", theme->getName()); + getRegisteredThemes().push_back(theme); } void Theme::init() const diff --git a/radio/src/gui/480x272/theme.h b/radio/src/gui/480x272/theme.h index 0c8849a85..8fb71c2f9 100644 --- a/radio/src/gui/480x272/theme.h +++ b/radio/src/gui/480x272/theme.h @@ -97,7 +97,6 @@ Theme * getTheme(const char * name); void loadTheme(Theme * theme); void loadTheme(); -#define MAX_REGISTERED_THEMES 10 std::list & getRegisteredThemes(); #endif // _THEME_H_ diff --git a/radio/src/gui/480x272/widget.cpp b/radio/src/gui/480x272/widget.cpp index cc62b51b4..ea7da3870 100644 --- a/radio/src/gui/480x272/widget.cpp +++ b/radio/src/gui/480x272/widget.cpp @@ -28,10 +28,8 @@ std::list & getRegisteredWidgets() void registerWidget(const WidgetFactory * factory) { - if (getRegisteredWidgets().size() < MAX_REGISTERED_WIDGETS) { - TRACE("register widget %s", factory->getName()); - getRegisteredWidgets().push_back(factory); - } + TRACE("register widget %s", factory->getName()); + getRegisteredWidgets().push_back(factory); } const WidgetFactory * getWidgetFactory(const char * name) diff --git a/radio/src/gui/480x272/widget.h b/radio/src/gui/480x272/widget.h index 1fc699b85..ea4c7fa78 100644 --- a/radio/src/gui/480x272/widget.h +++ b/radio/src/gui/480x272/widget.h @@ -188,7 +188,6 @@ inline const ZoneOption * Widget::getOptions() const Widget * loadWidget(const char * name, const Zone & zone, Widget::PersistentData * persistentData); -#define MAX_REGISTERED_WIDGETS 20 // TODO: arbitrary limit, not checked std::list & getRegisteredWidgets(); #endif // _WIDGET_H_