From: Tom Robinson Date: Thu, 1 Dec 2016 16:44:08 +0000 (+0000) Subject: Move ELDbus init & shutdown to DALi::Application X-Git-Tag: accepted/tizen/3.0/common/20161207.195829~5 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=b35c370293df4576f87c2c00e381a7997615bb6f Move ELDbus init & shutdown to DALi::Application Change-Id: I13ddbd40fb3e1f3e00fbdf906c357d3c29236d55 --- diff --git a/adaptors/common/application-impl.cpp b/adaptors/common/application-impl.cpp index c3cdd1e..dece482 100644 --- a/adaptors/common/application-impl.cpp +++ b/adaptors/common/application-impl.cpp @@ -28,6 +28,11 @@ #include #include +// CONDITIONAL INCLUDES +#ifdef DALI_ELDBUS_AVAILABLE +#include +#endif // DALI_ELDBUS_AVAILABLE + namespace Dali { @@ -47,6 +52,13 @@ namespace Internal namespace Adaptor { +#if defined(DEBUG_ENABLED) +namespace +{ +Integration::Log::Filter* gDBusLogging = Integration::Log::Filter::New( Debug::NoLogging, false, "LOG_ADAPTOR_EVENTS_DBUS" ); +} // anonymous namespace +#endif + ApplicationPtr Application::New( int* argc, char **argv[], @@ -104,6 +116,13 @@ Application::~Application() delete mFramework; delete mCommandLineOptions; delete mAdaptor; + +#ifdef DALI_ELDBUS_AVAILABLE + // Shutdown ELDBus. + DALI_LOG_INFO( gDBusLogging, Debug::General, "Shutting down DBus\n" ); + eldbus_shutdown(); +#endif + mWindow.Reset(); } @@ -173,9 +192,15 @@ void Application::OnInit() mFramework->AddAbortCallback( MakeCallback( this, &Application::QuitFromMainLoop ) ); CreateWindow(); - CreateAdaptor(); - // Run the adaptor +#ifdef DALI_ELDBUS_AVAILABLE + // Initialize ElDBus. + DALI_LOG_INFO( gDBusLogging, Debug::General, "Starting DBus Initialization\n" ); + eldbus_init(); +#endif + + // Start the adaptor + CreateAdaptor(); mAdaptor->Start(); // Check if user requires no vsyncing and set on X11 Adaptor diff --git a/adaptors/ecore/wayland/event-handler-ecore-wl.cpp b/adaptors/ecore/wayland/event-handler-ecore-wl.cpp index 1b3012d..1186afe 100644 --- a/adaptors/ecore/wayland/event-handler-ecore-wl.cpp +++ b/adaptors/ecore/wayland/event-handler-ecore-wl.cpp @@ -307,10 +307,6 @@ struct EventHandler::Impl #ifdef DALI_ELDBUS_AVAILABLE - // Initialize ElDBus. - DALI_LOG_INFO( gImfLogging, Debug::General, "Starting DBus Initialization\n" ); - eldbus_init(); - mSessionConnection = eldbus_connection_get( ELDBUS_CONNECTION_TYPE_SESSION ); Eldbus_Object *a11yObject = eldbus_object_get( mSessionConnection, A11Y_BUS, A11Y_PATH ); @@ -341,7 +337,8 @@ struct EventHandler::Impl } #ifdef DALI_ELDBUS_AVAILABLE - // Close down ElDBus + + // Close down ElDBus connections. if( mA11yConnection ) { eldbus_connection_unref( mA11yConnection ); @@ -352,7 +349,6 @@ struct EventHandler::Impl eldbus_connection_unref( mSessionConnection ); } - eldbus_shutdown(); #endif // DALI_ELDBUS_AVAILABLE }