From bfacd0879f2ca1c1328fb647d1cc16fa8114066a Mon Sep 17 00:00:00 2001 From: Shuhrat Dehkanov Date: Fri, 8 May 2015 19:08:09 +0900 Subject: [PATCH] Fix 'Class has non-virtual destructor' warning Also, applied cpplint check fixes Change-Id: I63a0275d8ca510bb3685478757c184735f879ade --- src/main.cpp | 113 +++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 46 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c4f3084..2885fc0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,19 +15,19 @@ */ #include -#include "common_defs.h" +#include #include -#include "settingviewmgr.h" -#include "utils.h" + +#include "common_defs.h" #include "json_marco.h" #include "settings_provider.h" +#include "settingviewmgr.h" +#include "utils.h" -#include #define PARAM_SETTINGS_ITEM "settings-item" #define MAIN_CATALOG "maincatalog" - SET_TAG("org.tizen.settings-tv-ref"); Evas_Object *_add_win(const char *name) @@ -52,7 +52,6 @@ Evas_Object *_add_win(const char *name) } class CApp : public CBaseApp { - struct _appdata { Evas_Object *win; CSettingMgr *mgr; @@ -60,10 +59,9 @@ class CApp : public CBaseApp { char *item; unsigned int app_control; } ad; -protected: - virtual bool OnCreate(void) - { +protected: + virtual bool OnCreate(void) { Evas_Object *win; int r; @@ -91,50 +89,74 @@ protected: ad.item = NULL; ad.app_control = 0; - /* Set Default value by vconf */ + /* Set default vconf values */ /* Proxy */ - if(vconf_set_int(VCONF_PROXY_METHOD, 0)) _DBG("Fail to set vconf"); - if(vconf_set_str(VCONF_PROXY_IP, "0.0.0.0")) _DBG("Fail to set vconf"); - if(vconf_set_str(VCONF_PROXY_URL, "")) _DBG("Fail to set vconf"); + if (vconf_set_int(VCONF_PROXY_METHOD, 0)) + _DBG("Fail to set vconf"); + if (vconf_set_str(VCONF_PROXY_IP, "0.0.0.0")) + _DBG("Fail to set vconf"); + if (vconf_set_str(VCONF_PROXY_URL, "")) + _DBG("Fail to set vconf"); /* Network */ - if(vconf_set_str(WIRED_DNS_KEY, "0.0.0.0")) _DBG("Fail to set vconf"); - if(vconf_set_str(WIRED_GATEWAY_KEY, "0.0.0.0")) _DBG("Fail to set vconf"); - if(vconf_set_str(WIRED_IP_LAST_MODE, "Obtain automatically")) _DBG("Fail to set vconf"); - if(vconf_set_str(WIRED_DNS_LAST_MODE, "Obtain automatically")) _DBG("Fail to set vconf"); - if(vconf_set_str(WIRED_IP_KEY, "0.0.0.0")) _DBG("Fail to set vconf"); - if(vconf_set_str(WIRED_SUBMASK_KEY, "0.0.0.0")) _DBG("Fail to set vconf"); - - if(vconf_set_str(WIRELESS_DNS_KEY, "0.0.0.0")) _DBG("Fail to set vconf"); - if(vconf_set_str(WIRELESS_GATEWAY_KEY, "0.0.0.0")) _DBG("Fail to set vconf"); - if(vconf_set_str(WIRELESS_IP_LAST_MODE, "Obtain automatically")) _DBG("Fail to set vconf"); - if(vconf_set_str(WIRELESS_DNS_LAST_MODE, "Obtain automatically")) _DBG("Fail to set vconf"); - if(vconf_set_str(WIRELESS_IP_KEY, "0.0.0.0")) _DBG("Fail to set vconf"); - if(vconf_set_str(WIRELESS_SUBMASK_KEY, "0.0.0.0")) _DBG("Fail to set vconf"); + if (vconf_set_str(WIRED_DNS_KEY, "0.0.0.0")) + _DBG("Fail to set vconf"); + if (vconf_set_str(WIRED_GATEWAY_KEY, "0.0.0.0")) + _DBG("Fail to set vconf"); + if (vconf_set_str(WIRED_IP_LAST_MODE, "Obtain automatically")) + _DBG("Fail to set vconf"); + if (vconf_set_str(WIRED_DNS_LAST_MODE, "Obtain automatically")) + _DBG("Fail to set vconf"); + if (vconf_set_str(WIRED_IP_KEY, "0.0.0.0")) + _DBG("Fail to set vconf"); + if (vconf_set_str(WIRED_SUBMASK_KEY, "0.0.0.0")) + _DBG("Fail to set vconf"); + + if (vconf_set_str(WIRELESS_DNS_KEY, "0.0.0.0")) + _DBG("Fail to set vconf"); + if (vconf_set_str(WIRELESS_GATEWAY_KEY, "0.0.0.0")) + _DBG("Fail to set vconf"); + if (vconf_set_str(WIRELESS_IP_LAST_MODE, "Obtain automatically")) + _DBG("Fail to set vconf"); + if (vconf_set_str(WIRELESS_DNS_LAST_MODE, "Obtain automatically")) + _DBG("Fail to set vconf"); + if (vconf_set_str(WIRELESS_IP_KEY, "0.0.0.0")) + _DBG("Fail to set vconf"); + if (vconf_set_str(WIRELESS_SUBMASK_KEY, "0.0.0.0")) + _DBG("Fail to set vconf"); /* Time */ - if(vconf_set_int(KEY_SYSTEM_CLOCK_MODE, 0)) _DBG("Fail to set vconf"); - if(vconf_set_int(KEY_SLEEPTIMER, 0)) _DBG("Fail to set vconf"); - if(vconf_set_int(KEY_SLEEPTIMER_TIMERID, 0)) _DBG("Fail to set vconf"); - if(vconf_set_str(KEY_WAKEUP_TIMER_SETUP, "OFF")) _DBG("Fail to set vconf"); - - if(vconf_set_int(VCONF_KEY_24HOUR_MODE, 0)) _DBG("Fail to set vconf"); - if(vconf_set_str(KEY_CHANGE_PASSCODE, "0000")) _DBG("Fail to set vconf"); - if(vconf_set_int(KEY_SUBTITLE_LANGUAGE, 0)) _DBG("Fail to set vconf"); + if (vconf_set_int(KEY_SYSTEM_CLOCK_MODE, 0)) + _DBG("Fail to set vconf"); + if (vconf_set_int(KEY_SLEEPTIMER, 0)) + _DBG("Fail to set vconf"); + if (vconf_set_int(KEY_SLEEPTIMER_TIMERID, 0)) + _DBG("Fail to set vconf"); + if (vconf_set_str(KEY_WAKEUP_TIMER_SETUP, "OFF")) + _DBG("Fail to set vconf"); + + if (vconf_set_int(VCONF_KEY_24HOUR_MODE, 0)) + _DBG("Fail to set vconf"); + if (vconf_set_str(KEY_CHANGE_PASSCODE, "0000")) + _DBG("Fail to set vconf"); + if (vconf_set_int(KEY_SUBTITLE_LANGUAGE, 0)) + _DBG("Fail to set vconf"); /* Broadcasting */ - if(vconf_set_bool(KEY_CHANNEL_LOCK, false)) _DBG("Fail to set vconf"); + if (vconf_set_bool(KEY_CHANNEL_LOCK, false)) + _DBG("Fail to set vconf"); /* Lang and Region */ - if(vconf_set_str(KEY_SYSTEM_LANGUAGE, "en_US.UTF-8")) _DBG("Fail to set vconf"); - if(vconf_set_str(KEY_SYSTEM_COUNTRY, "en_US.UTF-8")) _DBG("Fail to set vconf"); + if (vconf_set_str(KEY_SYSTEM_LANGUAGE, "en_US.UTF-8")) + _DBG("Fail to set vconf"); + if (vconf_set_str(KEY_SYSTEM_COUNTRY, "en_US.UTF-8")) + _DBG("Fail to set vconf"); return true; } - virtual void OnTerminate(void) - { + virtual void OnTerminate(void) { CSettingMgr::Finalize(); ad.mgr = NULL; @@ -146,8 +168,8 @@ protected: if(ad.item) free(ad.item); } - virtual void OnAppControl(app_control_h app_control) - { + + virtual void OnAppControl(app_control_h app_control) { _DBG(" ******************* OnAppControl *********************"); CSettingMgr *mgr; int r; @@ -159,8 +181,7 @@ protected: if (ad.app_control) { app_control_get_extra_data(app_control, PARAM_SETTINGS_ITEM, ¶m); if ((!param && !ad.item) || - (param && ad.item && - !strcmp(ad.item, param))) { + (param && ad.item && !strcmp(ad.item, param))) { refresh = 1; relaunch = 0; } else { @@ -171,8 +192,7 @@ protected: if (relaunch) { CSettingMgr::Finalize(); } else { - if (refresh) - { + if (refresh) { if (!ad.mgr) return; @@ -203,13 +223,14 @@ protected: } public: - virtual int Run(int argc, char **argv) { memset(&ad, 0x00, sizeof(_appdata)); ad.name = PACKAGE; return CBaseApp::Run(argc, argv); } + + virtual ~CApp(void){} }; int main(int argc, char **argv) -- 2.7.4