Add api for get the internal media player handle of the VideoView
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / feedback / feedback-style.cpp
index da2f055..4375a29 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -19,6 +19,7 @@
 #include <dali-toolkit/internal/feedback/feedback-style.h>
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/object-registry.h>
@@ -102,7 +103,6 @@ struct FeedbackStyleInfo
 static const FeedbackStyleInfo DEFAULT_FEEDBACK_STYLE_INFO;
 
 FeedbackStyle::FeedbackStyle()
-: mConnections( this )
 {
   mFeedback = Dali::FeedbackPlayer::Get();
 
@@ -195,7 +195,7 @@ const FeedbackStyleInfo& FeedbackStyle::GetStyleInfo( const string& type ) const
 
 void FeedbackStyle::StyleChanged( const std::string& userDefinedThemePath, Dali::StyleChange::Type styleChange )
 {
-  if( StyleChange::THEME_CHANGE )
+  if( styleChange == StyleChange::THEME_CHANGE )
   {
     string userDefinedTheme;
 
@@ -307,7 +307,7 @@ void FeedbackStyle::LoadFromString( const string& data )
 
             if( signalFeedbackInfo.mHasHapticFeedbackInfo || signalFeedbackInfo.mHasSoundFeedbackInfo )
             {
-              AddSignalInfo( themeInfo, signalFeedbackInfo );
+              AddSignalInfo( themeInfo, std::move( signalFeedbackInfo ) );
             }
           }
         }
@@ -320,10 +320,10 @@ void FeedbackStyle::LoadFromString( const string& data )
 
 } // LoadFromString()
 
-void FeedbackStyle::AddSignalInfo( FeedbackStyleInfo& styleInfo, SignalFeedbackInfo signalInfo )
+void FeedbackStyle::AddSignalInfo( FeedbackStyleInfo& styleInfo, SignalFeedbackInfo&& signalInfo )
 {
   bool updated = false;
-  std::vector<SignalFeedbackInfo>::iterator iter;
+  SignalFeedbackInfoContainer::iterator iter;
 
   // If info exists for the signal then update it, else add new
   for( iter = styleInfo.mSignalFeedbackInfoList.begin(); iter != styleInfo.mSignalFeedbackInfoList.end(); ++iter )
@@ -344,7 +344,7 @@ void FeedbackStyle::AddSignalInfo( FeedbackStyleInfo& styleInfo, SignalFeedbackI
 
   if( !updated )
   {
-    styleInfo.mSignalFeedbackInfoList.push_back( signalInfo );
+    styleInfo.mSignalFeedbackInfoList.emplace_back( std::move( signalInfo ) );
   }
 }