seoz pushed a commit to branch master.
commit 97baa5be31ebdc9f3fc8d6e5c08610dcca6f8b25
Author: Daniel Juyung Seo <[email protected]>
Date: Thu Aug 8 02:23:59 2013 +0900
test_progressbar.c: refactoring. run flag is not needed.
---
src/bin/test_progressbar.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/bin/test_progressbar.c b/src/bin/test_progressbar.c
index e05aa91..67bc018 100644
--- a/src/bin/test_progressbar.c
+++ b/src/bin/test_progressbar.c
@@ -12,7 +12,6 @@ typedef struct Progressbar
Evas_Object *pb5;
Evas_Object *pb6;
Evas_Object *pb7;
- Eina_Bool run;
Ecore_Timer *timer;
} Progressbar;
@@ -30,8 +29,10 @@ _my_progressbar_value_set (void *data __UNUSED__)
elm_progressbar_value_set(_test_progressbar.pb4, progress);
elm_progressbar_value_set(_test_progressbar.pb3, progress);
elm_progressbar_value_set(_test_progressbar.pb6, progress);
+
if (progress < 1.0) return ECORE_CALLBACK_RENEW;
- _test_progressbar.run = 0;
+
+ _test_progressbar.timer = NULL;
return ECORE_CALLBACK_CANCEL;
}
@@ -45,11 +46,9 @@ my_progressbar_test_start(void *data __UNUSED__, Evas_Object
*obj __UNUSED__, vo
fprintf(stderr, "s3 %p\n", _test_progressbar.pb7);
elm_progressbar_pulse(_test_progressbar.pb7, EINA_TRUE);
fprintf(stderr, "s4\n");
- if (!_test_progressbar.run)
- {
- _test_progressbar.timer = ecore_timer_add(0.1,
_my_progressbar_value_set, NULL);
- _test_progressbar.run = EINA_TRUE;
- }
+ if (!_test_progressbar.timer)
+ _test_progressbar.timer = ecore_timer_add(0.1,
+ _my_progressbar_value_set,
NULL);
}
static void
@@ -58,10 +57,10 @@ my_progressbar_test_stop(void *data __UNUSED__, Evas_Object
*obj __UNUSED__, voi
elm_progressbar_pulse(_test_progressbar.pb2, EINA_FALSE);
elm_progressbar_pulse(_test_progressbar.pb5, EINA_FALSE);
elm_progressbar_pulse(_test_progressbar.pb7, EINA_FALSE);
- if (_test_progressbar.run)
+ if (_test_progressbar.timer)
{
ecore_timer_del(_test_progressbar.timer);
- _test_progressbar.run = EINA_FALSE;
+ _test_progressbar.timer = NULL;
}
}
--
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk