summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorRadoslaw Czerski <r.czerski@samsung.com>2016-04-01 11:52:57 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2016-04-01 03:56:17 -0700
commit74e49435c5e52c4c4a98dfce030f1b010b92cf74 (patch)
treedbef2d9e12b3ca86c1dbdeaaf79b22d2c09a858a /src/modules
parent5e40b01bf83c74277375b863d3b0f10fbab7eea1 (diff)
downloadindicator-win-74e49435c5e52c4c4a98dfce030f1b010b92cf74.tar.gz
indicator-win-74e49435c5e52c4c4a98dfce030f1b010b92cf74.tar.bz2
indicator-win-74e49435c5e52c4c4a98dfce030f1b010b92cf74.zip
modules/processing/uploading: Code fixes.
Warning fixed. Code uncommented. Other fixes. Change-Id: I912718a4f21a3fc9da410535a6623c6f79c26a22 Signed-off-by: Radoslaw Czerski <r.czerski@samsung.com>
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/processing/uploading.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/modules/processing/uploading.c b/src/modules/processing/uploading.c
index 1c64a3b..71b5ac6 100644
--- a/src/modules/processing/uploading.c
+++ b/src/modules/processing/uploading.c
@@ -117,8 +117,8 @@ static void hide_uploading_icon(void)
static void indicator_uploading_change_cb(keynode_t *node, void *data)
{
- /*int status = 0;*/
- int result = 0;
+ int status = 0;
+ int ret;
retm_if(data == NULL, "Invalid parameter!");
@@ -129,14 +129,11 @@ static void indicator_uploading_change_cb(keynode_t *node, void *data)
}
updated_while_lcd_off = 0;
-/* if (vconf_get_int(VCONFKEY_WIFI_DIRECT_SENDING_STATE, &status) == 0)
- {
- result = result | status;
- } else {
- _E("Failed to get VCONFKEY_WIFI_DIRECT_SENDING_STATE value");
- }*/
+ ret = vconf_get_int(VCONFKEY_WIFI_DIRECT_SENDING_STATE, &status);
+
+ retm_if(ret != 0, "Failed to get VCONFKEY_WIFI_DIRECT_SENDING_STATE value");
- if (result == 1) {
+ if (status == 1) {
show_uploading_icon(data);
} else {
@@ -180,10 +177,17 @@ static int register_uploading_module(void *data)
set_app_state(data);
-// ret = ret | vconf_notify_key_changed(VCONFKEY_WIFI_DIRECT_SENDING_STATE, indicator_uploading_change_cb, data);
+ ret = vconf_notify_key_changed(VCONFKEY_WIFI_DIRECT_SENDING_STATE,
+ indicator_uploading_change_cb, data);
+ retvm_if(ret != 0, FAIL, "vconf_notify_key_changed failed[%d]", ret);
ret = ret | vconf_notify_key_changed(VCONFKEY_PM_STATE,
- indicator_uploading_pm_state_change_cb, data);
+ indicator_uploading_pm_state_change_cb, data);
+ if(ret != 0) {
+ _E("vconf_notify_key_changed failed[%d]", ret);
+ unregister_uploading_module();
+ return FAIL;
+ }
indicator_uploading_change_cb(NULL, data);
@@ -192,12 +196,11 @@ static int register_uploading_module(void *data)
static int unregister_uploading_module(void)
{
- int ret = 0;
-
-// ret = ret | vconf_ignore_key_changed(VCONFKEY_WIFI_DIRECT_SENDING_STATE, indicator_uploading_change_cb);
+ vconf_ignore_key_changed(VCONFKEY_WIFI_DIRECT_SENDING_STATE,
+ indicator_uploading_change_cb);
- ret = ret | vconf_ignore_key_changed(VCONFKEY_PM_STATE,
- indicator_uploading_pm_state_change_cb);
+ vconf_ignore_key_changed(VCONFKEY_PM_STATE,
+ indicator_uploading_pm_state_change_cb);
return OK;
}