diff --git a/src/AutoConnect.cpp b/src/AutoConnect.cpp index d81840b..f8f08c0 100644 --- a/src/AutoConnect.cpp +++ b/src/AutoConnect.cpp @@ -115,7 +115,7 @@ bool AutoConnect::begin(const char* ssid, const char* passphrase, unsigned long if (_apConfig.hostName.length()) WiFi.hostname(_apConfig.hostName.c_str()); - // If the portal is requested promptly skip the first WiFi.begin and + // If the portal is requested promptly skip the first WiFi.begin and // immediately start the portal. if (_apConfig.immediateStart) { cs = false; diff --git a/src/AutoConnectAux.cpp b/src/AutoConnectAux.cpp index 6f355c5..d75402a 100644 --- a/src/AutoConnectAux.cpp +++ b/src/AutoConnectAux.cpp @@ -285,10 +285,6 @@ const String AutoConnectAux::_insertElement(PageArgument& args) { for (AutoConnectElement& addon : _addonElm) body += addon.toHTML(); - //for (std::size_t n = 0; n < _addonElm.size(); n++) { - // AutoConnectElement& addon = _addonElm[n]; - // body += addon.toHTML(); - //} if (_handler) { if (_order & AC_EXIT_LATER) { @@ -308,7 +304,7 @@ const String AutoConnectAux::_insertElement(PageArgument& args) { * @param uri An uri of the auxiliary page. * @return A PageElement of auxiliary page. */ -PageElement* AutoConnectAux::_setupPage(String uri) { +PageElement* AutoConnectAux::_setupPage(const String& uri) { PageElement* elm = nullptr; if (_ac) { diff --git a/src/AutoConnectAux.h b/src/AutoConnectAux.h index 8703c99..ded40bb 100644 --- a/src/AutoConnectAux.h +++ b/src/AutoConnectAux.h @@ -58,8 +58,6 @@ class AutoConnectAux : public PageBuilder { AutoConnectElement* getElement(const String& name); /**< Get registered AutoConnectElement as specified name */ void menu(const bool post) { _menu = post; } /**< Set or reset the display as menu item for this aux */ bool release(const String& name); /**< Release an AutoConnectElement */ -// bool setElementValue(const String& name, const bool checked); /**< Set checked value to specified AutoConnectChechbox element */ -// bool setElementValue(const String& name, const uint8_t checked); /**< Set checked value to specified AutoConnectRadio element */ bool setElementValue(const String& name, const String value); /**< Set value to specified element */ bool setElementValue(const String& name, std::vector const& values); /**< Set values collection to specified element */ void setTitle(const String title) { _title = title; } /**< Set a title of the auxiliary page */ @@ -78,7 +76,7 @@ class AutoConnectAux : public PageBuilder { protected: void _concat(AutoConnectAux& aux); /**< Make up chain of AutoConnectAux */ void _join(AutoConnect& ac); /**< Make a link to AutoConnect */ - PageElement* _setupPage(String uri); /**< AutoConnectAux page builder */ + PageElement* _setupPage(const String& uri); /**< AutoConnectAux page builder */ const String _insertElement(PageArgument& args); /**< Insert a generated HTML to the page built by PageBuilder */ const String _injectTitle(PageArgument& args) const { (void)(args); return _title; } /**< Returns title of this page to PageBuilder */ const String _injectMenu(PageArgument& args); /**< Inject menu title of this page to PageBuilder */ diff --git a/src/AutoConnectElementBasis.h b/src/AutoConnectElementBasis.h index 7e5ba4a..3c70382 100644 --- a/src/AutoConnectElementBasis.h +++ b/src/AutoConnectElementBasis.h @@ -121,11 +121,11 @@ class AutoConnectInputBasis : virtual public AutoConnectElementBasis { class AutoConnectRadioBasis : virtual public AutoConnectElementBasis { public: explicit AutoConnectRadioBasis(const char* name = "", std::vector const& values = {}, const char* label = "", const ACArrange_t order = AC_Vertical, const uint8_t checked = 0) : AutoConnectElementBasis(name, ""), label(label), order(order), checked(checked), _values(values) { - _type = AC_Radio; + _type = AC_Radio; } virtual ~AutoConnectRadioBasis() {} const String toHTML(void) const override; - const String& operator [] (const std::size_t n) const { return at(n); } + const String& operator[] (const std::size_t n) const { return at(n); } void add(const String& value) { _values.push_back(String(value)); } const String& at(const std::size_t n) const { return _values.at(n); } void check(const String& value); @@ -154,7 +154,7 @@ class AutoConnectSelectBasis : virtual public AutoConnectElementBasis { } virtual ~AutoConnectSelectBasis() {} const String toHTML(void) const override; - const String& operator [] (const std::size_t n) const { return at(n); } + const String& operator[] (const std::size_t n) const { return at(n); } void add(const String& option) { _options.push_back(String(option)); } const String& at(const std::size_t n) const { return _options.at(n); } void empty(const size_t reserve = 0); diff --git a/src/AutoConnectElementJson.h b/src/AutoConnectElementJson.h index 0f9b9c5..e7bc7a4 100644 --- a/src/AutoConnectElementJson.h +++ b/src/AutoConnectElementJson.h @@ -69,7 +69,7 @@ class AutoConnectElementJson : virtual public AutoConnectElementBasis { * @param action Script code to execute with the button pushed. */ class AutoConnectButtonJson : public AutoConnectElementJson, public AutoConnectButtonBasis { -public: + public: explicit AutoConnectButtonJson(const char* name = "", const char* value = "", const String action = String()) { AutoConnectButtonBasis::name = name; AutoConnectButtonBasis::value = value; @@ -137,7 +137,7 @@ class AutoConnectInputJson : public AutoConnectElementJson, public AutoConnectIn */ class AutoConnectRadioJson : public AutoConnectElementJson, public AutoConnectRadioBasis { public: - explicit AutoConnectRadioJson(const char* name = "", std::vector values = {}, const char* label = "", const ACArrange_t order = AC_Vertical, const uint8_t checked = 0) { + explicit AutoConnectRadioJson(const char* name = "", std::vector const& values = {}, const char* label = "", const ACArrange_t order = AC_Vertical, const uint8_t checked = 0) { AutoConnectRadioBasis::name = name; AutoConnectRadioBasis::_values = values; AutoConnectRadioBasis::label = label; @@ -160,7 +160,7 @@ class AutoConnectRadioJson : public AutoConnectElementJson, public AutoConnectRa */ class AutoConnectSelectJson : public AutoConnectElementJson, public AutoConnectSelectBasis { public: - explicit AutoConnectSelectJson(const char* name = "", std::vector options = {}, const char* label = "") { + explicit AutoConnectSelectJson(const char* name = "", std::vector const& options = {}, const char* label = "") { AutoConnectSelectBasis::name = name; AutoConnectSelectBasis::_options = options; AutoConnectSelectBasis::label = label;