Set current time to default WatchTime constructor 39/78939/2 accepted/tizen/common/20160707.172136 accepted/tizen/ivi/20160707.114150 accepted/tizen/mobile/20160707.114101 accepted/tizen/tv/20160707.114124 accepted/tizen/wearable/20160707.114140 submit/tizen/20160707.112709
authorsuhyung Eom <suhyung.eom@samsung.com>
Thu, 7 Jul 2016 11:06:36 +0000 (20:06 +0900)
committersu hyung Eom <suhyung.eom@samsung.com>
Thu, 7 Jul 2016 11:19:09 +0000 (04:19 -0700)
Signed-off-by: suhyung Eom <suhyung.eom@samsung.com>
Change-Id: I147536f54ecc78db5d328613ae2cb540e9256c7a

adaptors/wearable/watch/watch-time.cpp

index 34c4089..6c60b54 100644 (file)
@@ -36,11 +36,6 @@ struct WatchTime::Impl
   void *mTimeHandle;
 };
 
-WatchTime::WatchTime()
-  :mImpl(NULL)
-{
-}
-
 WatchTime::WatchTime(void *time_handle)
 {
   mImpl = new Impl(time_handle);
@@ -57,6 +52,14 @@ WatchTime::~WatchTime()
 
 #ifdef APPCORE_WATCH_AVAILABLE
 
+WatchTime::WatchTime()
+{
+  watch_time_h watch_time = {0,};
+
+  watch_time_get_current_time(&watch_time);
+  mImpl = new Impl(watch_time);
+}
+
 int WatchTime::GetHour() const
 {
   int hour;
@@ -90,6 +93,10 @@ int WatchTime::GetSecond() const
 }
 
 #else
+WatchTime::WatchTime()
+  :mImpl(NULL)
+{
+}
 
 int WatchTime::GetHour() const
 {