From f3e0778129f26c46f45cb83586c9a2f4180812b2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 18 Jan 2022 23:31:52 +0100 Subject: [PATCH] weather_setup: formatting code using astyle Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/40b5b553a3f46070063daa9625f941c71b5cb3dd Author: vanhofen Date: 2022-01-18 (Tue, 18 Jan 2022) Origin message was: ------------------ - weather_setup: formatting code using astyle ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/weather_setup.cpp | 16 +++++++++------- src/gui/weather_setup.h | 10 ++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/gui/weather_setup.cpp b/src/gui/weather_setup.cpp index 0e1cfda91..8a110c899 100644 --- a/src/gui/weather_setup.cpp +++ b/src/gui/weather_setup.cpp @@ -47,21 +47,21 @@ CWeatherSetup::~CWeatherSetup() { } -int CWeatherSetup::exec(CMenuTarget* parent, const std::string &actionKey) +int CWeatherSetup::exec(CMenuTarget *parent, const std::string &actionKey) { dprintf(DEBUG_DEBUG, "init weather setup menu\n"); - int res = menu_return::RETURN_REPAINT; + int res = menu_return::RETURN_REPAINT; if (parent) parent->hide(); - if(actionKey == "select_location") + if (actionKey == "select_location") { return showSelectWeatherLocation(); } res = showWeatherSetup(); - + return res; } @@ -87,7 +87,7 @@ int CWeatherSetup::showWeatherSetup() mf_wl->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_WEATHER_LOCATION); ms_oservices->addItem(mf_wl); - int res = ms_oservices->exec (NULL, ""); + int res = ms_oservices->exec(NULL, ""); selected = ms_oservices->getSelected(); delete ms_oservices; return res; @@ -101,11 +101,11 @@ int CWeatherSetup::showSelectWeatherLocation() if (WEATHER_LOCATION_OPTION_COUNT > 1) { CMenuWidget *m = new CMenuWidget(LOCALE_WEATHER_LOCATION, NEUTRINO_ICON_LANGUAGE); - CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); + CMenuSelectorTarget *selector = new CMenuSelectorTarget(&select); m->addItem(GenericMenuSeparator); - CMenuForwarder* mf; + CMenuForwarder *mf; for (size_t i = 0; i < WEATHER_LOCATION_OPTION_COUNT; i++) { mf = new CMenuForwarder(WEATHER_LOCATION_OPTIONS[i].key, true, NULL, selector, to_string(i).c_str()); @@ -121,9 +121,11 @@ int CWeatherSetup::showSelectWeatherLocation() delete selector; } + g_settings.weather_location = WEATHER_LOCATION_OPTIONS[select].value; g_settings.weather_city = std::string(WEATHER_LOCATION_OPTIONS[select].key); CWeather::getInstance()->setCoords(g_settings.weather_location, g_settings.weather_city); + return res; } diff --git a/src/gui/weather_setup.h b/src/gui/weather_setup.h index e408d04e8..06d52ebcb 100644 --- a/src/gui/weather_setup.h +++ b/src/gui/weather_setup.h @@ -28,19 +28,17 @@ class CWeatherSetup : public CMenuTarget, CChangeObserver private: int width, selected; - CMenuOptionChooser * weather_onoff; + CMenuOptionChooser *weather_onoff; std::string weather_api_key_short; int showWeatherSetup(); int showSelectWeatherLocation(); - - public: + public: CWeatherSetup(); ~CWeatherSetup(); - int exec(CMenuTarget* parent, const std::string & actionKey); - bool changeNotify(const neutrino_locale_t OptionName, void * /*data*/); + int exec(CMenuTarget *parent, const std::string &actionKey); + bool changeNotify(const neutrino_locale_t OptionName, void */*data*/); }; - #endif