From b45c29bb24369385204661b8844fa802a19b1433 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 27 Mar 2022 22:54:04 +0200 Subject: [PATCH] plugins-hide: formatting code using astyle Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/96159566e195c45240e5fb21c1118ac1e6ef81d1 Author: vanhofen Date: 2022-03-27 (Sun, 27 Mar 2022) Origin message was: ------------------ - plugins-hide: formatting code using astyle --- src/gui/plugins_hide.cpp | 20 ++++++++++---------- src/gui/plugins_hide.h | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/gui/plugins_hide.cpp b/src/gui/plugins_hide.cpp index 5c6c7134a..e5ea8719e 100644 --- a/src/gui/plugins_hide.cpp +++ b/src/gui/plugins_hide.cpp @@ -59,7 +59,7 @@ CPluginsHideMenu::~CPluginsHideMenu() { } -int CPluginsHideMenu::exec(CMenuTarget* parent, const std::string & /*actionKey*/) +int CPluginsHideMenu::exec(CMenuTarget *parent, const std::string & /*actionKey*/) { if (parent) parent->hide(); @@ -69,13 +69,13 @@ int CPluginsHideMenu::exec(CMenuTarget* parent, const std::string & /*actionKey* int CPluginsHideMenu::menu() { - CMenuWidget* pluginsHideMenu = new CMenuWidget(LOCALE_PLUGINS_HIDE, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_PLUGINS_HIDE); + CMenuWidget *pluginsHideMenu = new CMenuWidget(LOCALE_PLUGINS_HIDE, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_PLUGINS_HIDE); pluginsHideMenu->addIntroItems(); unsigned int maxPlugins = g_Plugins->getNumberOfPlugins(); int isHidden[maxPlugins]; std::string file[maxPlugins]; - CPluginsHideNotifier * pluginsNotifier[maxPlugins]; + CPluginsHideNotifier *pluginsNotifier[maxPlugins]; for (unsigned int i = 0; i < maxPlugins; i++) { std::string tmp = g_Plugins->getName(i); @@ -83,23 +83,23 @@ int CPluginsHideMenu::menu() isHidden[i] = g_Plugins->isHidden(i); pluginsNotifier[i] = new CPluginsHideNotifier(file[i].c_str()); - CMenuOptionChooser * mc = new CMenuOptionChooser(tmp.c_str(), &isHidden[i], PLUGIN_HIDE_OPTIONS, PLUGIN_HIDE_OPTIONS_COUNT, true, pluginsNotifier[i]); + CMenuOptionChooser *mc = new CMenuOptionChooser(tmp.c_str(), &isHidden[i], PLUGIN_HIDE_OPTIONS, PLUGIN_HIDE_OPTIONS_COUNT, true, pluginsNotifier[i]); mc->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_PLUGINS_HIDE); pluginsHideMenu->addItem(mc); } - int res = pluginsHideMenu->exec(NULL,""); + int res = pluginsHideMenu->exec(NULL, ""); pluginsHideMenu->hide(); for (unsigned int i = 0; i < maxPlugins; i++) { - if(pluginsNotifier[i]) + if (pluginsNotifier[i]) delete pluginsNotifier[i]; } delete pluginsHideMenu; return res; } -bool CPluginsHideNotifier::changeNotify(const neutrino_locale_t, void * data) +bool CPluginsHideNotifier::changeNotify(const neutrino_locale_t, void *data) { std::fstream f; std::ostringstream os; @@ -107,7 +107,7 @@ bool CPluginsHideNotifier::changeNotify(const neutrino_locale_t, void * data) std::string cfg; bool exist = false; - printf("CPluginsHideNotifier::changeNotify %s\n",filename); + printf("CPluginsHideNotifier::changeNotify %s\n", filename); os << "hide=" << (((*(int *)data) != 0) ? 1 : 0) << std::endl; std::string hide = os.str(); @@ -116,10 +116,10 @@ bool CPluginsHideNotifier::changeNotify(const neutrino_locale_t, void * data) while (!f.eof()) { getline(f, line); - if (line.substr(0,1) == "") + if (line.substr(0, 1) == "") continue; - if (line.substr(0,4) == "hide") + if (line.substr(0, 4) == "hide") { cfg += (std::string) hide; exist = true; diff --git a/src/gui/plugins_hide.h b/src/gui/plugins_hide.h index 05ecee899..ed81923f3 100644 --- a/src/gui/plugins_hide.h +++ b/src/gui/plugins_hide.h @@ -29,11 +29,11 @@ class CPluginsHideNotifier : public CChangeObserver { - const char * filename; + const char *filename; public: - inline CPluginsHideNotifier(const char * _filename) { filename = _filename; }; - bool changeNotify(const neutrino_locale_t, void * data); + inline CPluginsHideNotifier(const char *_filename) { filename = _filename; }; + bool changeNotify(const neutrino_locale_t, void *data); }; class CPluginsHideMenu : public CMenuTarget @@ -44,10 +44,10 @@ class CPluginsHideMenu : public CMenuTarget protected: int width; - public: + public: CPluginsHideMenu(); ~CPluginsHideMenu(); - int exec(CMenuTarget* parent, const std::string & actionKey); + int exec(CMenuTarget *parent, const std::string &actionKey); };