Fix conversion warnings for event refactor
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / tizen-wayland / framework-tizen.cpp
index 925db04..09ee3fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
 #include <app_control_internal.h>
 #include <app_common.h>
 #include <bundle.h>
-#include <Ecore.h>
+#include <dali/internal/system/linux/dali-ecore.h>
 
 #include <system_info.h>
 #include <system_settings.h>
@@ -193,12 +193,20 @@ struct Framework::Impl
     mApplicationType = type;
     mCallbackManager = CallbackManager::New();
 
-    char* region;
-    char* language;
+    char* region = nullptr;
+    char* language = nullptr;
     system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, &region );
     system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &language );
-    mRegion = std::string( region );
-    mLanguage = std::string( language );
+
+    if (region != nullptr)
+    {
+      mRegion = std::string( region );
+    }
+
+    if ( language != nullptr)
+    {
+      mLanguage = std::string( language );
+    }
   }
 
   ~Impl()
@@ -815,6 +823,18 @@ std::string Framework::GetResourcePath()
   return resourcePath;
 }
 
+std::string Framework::GetDataPath()
+{
+  std::string result;
+  char* dataPath = app_get_data_path();
+  if( dataPath )
+  {
+    result = dataPath;
+    free(dataPath);
+  }
+  return result;
+}
+
 void Framework::SetBundleId(const std::string& id)
 {
   mBundleId = id;