Index: trunk/src/DBITEPlayerLib/DbtPlyUserInterface.cpp
===================================================================
--- trunk/src/DBITEPlayerLib/DbtPlyUserInterface.cpp	(revision 172)
+++ trunk/src/DBITEPlayerLib/DbtPlyUserInterface.cpp	(revision 288)
@@ -61,7 +61,9 @@
 ComponentBase::COMPONENT_CONFIGURATION DbtPlyUserInterface::configureComponent(XmlComponentConfig /*config*/)
 {
+    using boost::dynamic_pointer_cast;
+
     ComponentManager * mgr = ComponentManager::getInstance();
-    mEngine = dynamic_cast<DbtPlyEngine *>(mgr->getComponent("dbiteEngine"));
-    if (NULL == mEngine) {
+    mEngine = dynamic_pointer_cast<DbtPlyEngine>(mgr->getComponent("dbiteEngine"));
+    if (!mEngine) {
         LOG_FATAL("cannot get a pointer of the 'dbiteEngine' component");
         return CONFIGURED_FAILED;
@@ -275,33 +277,35 @@
         componentTableWidget->setItem(idx, 0, new QTableWidgetItem(componentName));
 
-        ComponentBase * component = mgr->getComponent(componentName);
-        if (component) {
-            COMPONENT_STATE state = component->getState();
-
-            QString stateString;
-            switch (state) {
-            case STOPPED:
-                stateString = tr("Stopped");
-                break;
-            case NOT_MONITORED:
-                stateString = tr("Not monitored");
-                break;
-            case MONITOR_OK:
-                stateString = tr("Monitor OK");
-                break;
-            case MONITOR_NOK:
-                stateString = tr("Monitor wrong");
-                break;
-
-            default:
-                stateString = tr("UNKNOWN");
-                break;
-            }
-            componentTableWidget->setItem(idx, 1, new QTableWidgetItem(stateString));
-
-            // TODO: ADD component type and some detailed information (e.g. parameters)
-            //QString componentInfo = component->getDetails();
-            //componentTableWidget->setItem(idx, 2, new QTableWidgetItem(componentInfo));
+        ComponentSharedPointer component = mgr->getComponent(componentName);
+        if (!component) {
+            continue;
         }
+
+        COMPONENT_STATE state = component->getState();
+
+        QString stateString;
+        switch (state) {
+        case STOPPED:
+            stateString = tr("Stopped");
+            break;
+        case NOT_MONITORED:
+            stateString = tr("Not monitored");
+            break;
+        case MONITOR_OK:
+            stateString = tr("Monitor OK");
+            break;
+        case MONITOR_NOK:
+            stateString = tr("Monitor wrong");
+            break;
+
+        default:
+            stateString = tr("UNKNOWN");
+            break;
+        }
+        componentTableWidget->setItem(idx, 1, new QTableWidgetItem(stateString));
+
+        // TODO: ADD component type and some detailed information (e.g. parameters)
+        //QString componentInfo = component->getDetails();
+        //componentTableWidget->setItem(idx, 2, new QTableWidgetItem(componentInfo));
     }
 }
@@ -309,27 +313,28 @@
 void DbtPlyUserInterface::connectButtons()
 {
+    // FIXME: use Qt5 connect style
     connect(playBut, SIGNAL(clicked()),
-        mEngine, SLOT(playEvent()));
+        mEngine.get(), SLOT(playEvent()));
     connect(pauseBut, SIGNAL(clicked()),
-        mEngine, SLOT(pauseEvent()));
+        mEngine.get(), SLOT(pauseEvent()));
     connect(stopBut, SIGNAL(clicked()),
-        mEngine, SLOT(stopEvent()));
+        mEngine.get(), SLOT(stopEvent()));
     connect(speedUpBut, SIGNAL(clicked()),
-        mEngine, SLOT(speedUpEvent()));
+        mEngine.get(), SLOT(speedUpEvent()));
     connect(speedDownBut, SIGNAL(clicked()),
-        mEngine, SLOT(speedDownEvent()));
+        mEngine.get(), SLOT(speedDownEvent()));
 }
 
 void DbtPlyUserInterface::connectDisplay()
 {
-    connect(mEngine, SIGNAL(displayStateSig(DbtPlyEngineState *, float)),
+    connect(mEngine.get(), SIGNAL(displayStateSig(DbtPlyEngineState *, float)),
         this, SLOT(displayStateSlot(DbtPlyEngineState *, float)));
 
-    connect (mEngine, SIGNAL(timeMinMax(road_time_t, road_time_t)),
+    connect (mEngine.get(), SIGNAL(timeMinMax(road_time_t, road_time_t)),
         this, SLOT(displayMinMaxTime(road_time_t , road_time_t)));
-    connect (mEngine, SIGNAL(curReplayTime(road_time_t)),
+    connect (mEngine.get(), SIGNAL(curReplayTime(road_time_t)),
         this, SLOT(displayTime(road_time_t)));
     connect (rev, SIGNAL(toggled(bool)),
-        mEngine, SLOT(changeDirection(bool)));
+        mEngine.get(), SLOT(changeDirection(bool)));
 }
 
@@ -337,7 +342,7 @@
 {
     connect (timeSlider, SIGNAL(sliderPressed()),
-        mEngine, SLOT(pauseEvent()));
+        mEngine.get(), SLOT(pauseEvent()));
     connect (timeSlider, SIGNAL(sliderReleased()),
-        mEngine, SLOT(playEvent()));
+        mEngine.get(), SLOT(playEvent()));
 }
 
