Use size (applications + picture/videos + downloads + audio + miscellaneous + availab...
authoryigang.jing <yigang.jing@samsung.com>
Wed, 19 Dec 2012 06:43:50 +0000 (14:43 +0800)
committeryigang.jing <yigang.jing@samsung.com>
Wed, 19 Dec 2012 06:43:50 +0000 (14:43 +0800)
Change-Id: I2902f81829e3e99bcdaa97a4db2a580854dafa5b

setting-storage/src/setting-storage-main.c

index 0fe53ec..68b66aa 100755 (executable)
@@ -80,6 +80,11 @@ static Evas_Object *__gl_content_get(void *data, Evas_Object *obj, const char *p
        }
        float temp_size = 0.0;
 
+       /* use size (applications + picture/videos + downloads + audio + miscellaneous + available) as 100% */
+       double total_size = ad->apps_status.dTotal + ad->pics_videos_status.dTotal +
+                               ad->downloads_status.dTotal + ad->audio_status.dTotal +
+                               ad->others_status.dTotal + ad->internal_status.dAvail;
+
        if (!safeStrCmp(part, "elm.icon")){
                Evas_Object *status_box = NULL;
                status_box = elm_box_add(obj);
@@ -93,7 +98,7 @@ static Evas_Object *__gl_content_get(void *data, Evas_Object *obj, const char *p
 
                /* apps */
                unsigned int apps_size = 0;
-               temp_size = ((float)ad->apps_status.dTotal / ad->internal_status.dTotal) * width;
+               temp_size = ((float)ad->apps_status.dTotal / total_size) * width;
                if (temp_size < 1 && temp_size > 0) {
                        apps_size = 1;
                } else {
@@ -106,7 +111,7 @@ static Evas_Object *__gl_content_get(void *data, Evas_Object *obj, const char *p
 
                /* pictures, videos */
                unsigned int pics_videos_size = 0;
-               temp_size = ((float)ad->pics_videos_status.dTotal / ad->internal_status.dTotal) * width;
+               temp_size = ((float)ad->pics_videos_status.dTotal / total_size) * width;
                if (temp_size < 1 && temp_size > 0) {
                        pics_videos_size = 1;
                } else {
@@ -119,7 +124,7 @@ static Evas_Object *__gl_content_get(void *data, Evas_Object *obj, const char *p
 
                /* downloads */
                unsigned int downloads_size = 0;
-               temp_size = ((float)ad->downloads_status.dTotal / ad->internal_status.dTotal) * width;
+               temp_size = ((float)ad->downloads_status.dTotal / total_size) * width;
                if (temp_size < 1 && temp_size > 0) {
                        downloads_size = 1;
                } else {
@@ -132,7 +137,7 @@ static Evas_Object *__gl_content_get(void *data, Evas_Object *obj, const char *p
 
                /* audio */
                unsigned int audio_size = 0;
-               temp_size = ((float)ad->audio_status.dTotal / ad->internal_status.dTotal) * width;
+               temp_size = ((float)ad->audio_status.dTotal / total_size) * width;
                if (temp_size < 1 && temp_size > 0) {
                        audio_size = 1;
                } else {
@@ -145,7 +150,7 @@ static Evas_Object *__gl_content_get(void *data, Evas_Object *obj, const char *p
 
                /* Miscellaneous files */
                unsigned int others_size = 0;
-               temp_size = ((float)ad->others_status.dTotal / ad->internal_status.dTotal) * width;
+               temp_size = ((float)ad->others_status.dTotal / total_size) * width;
                if (temp_size < 1 && temp_size > 0) {
                        others_size = 1;
                } else {
@@ -158,7 +163,7 @@ static Evas_Object *__gl_content_get(void *data, Evas_Object *obj, const char *p
 
                /* available */
                unsigned int avail_size = 0;
-               temp_size = ((float)ad->internal_status.dAvail / ad->internal_status.dTotal) * width;
+               temp_size = ((float)ad->internal_status.dAvail / total_size) * width;
                if (temp_size < 1 && temp_size > 0) {
                        avail_size = 1;
                } else {