Fixed a minor coding style

pull/41/head
Hieromon Ikasamo 6 years ago
parent 661f4c3463
commit d5ca170a86
  1. 6
      src/AutoConnectAux.cpp
  2. 4
      src/AutoConnectAux.h
  3. 4
      src/AutoConnectElementJson.h

@ -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) {

@ -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<String> 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 */

@ -137,7 +137,7 @@ class AutoConnectInputJson : public AutoConnectElementJson, public AutoConnectIn
*/
class AutoConnectRadioJson : public AutoConnectElementJson, public AutoConnectRadioBasis {
public:
explicit AutoConnectRadioJson(const char* name = "", std::vector<String> values = {}, const char* label = "", const ACArrange_t order = AC_Vertical, const uint8_t checked = 0) {
explicit AutoConnectRadioJson(const char* name = "", std::vector<String> 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<String> options = {}, const char* label = "") {
explicit AutoConnectSelectJson(const char* name = "", std::vector<String> const& options = {}, const char* label = "") {
AutoConnectSelectBasis::name = name;
AutoConnectSelectBasis::_options = options;
AutoConnectSelectBasis::label = label;

Loading…
Cancel
Save