controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.cpp
changeset 21 2883a5458389
parent 19 36aa4756ee82
child 22 a5692c68d772
--- a/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.cpp	Tue May 25 04:10:19 2010 +0800
+++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.cpp	Thu Jun 10 16:07:41 2010 +0800
@@ -20,23 +20,31 @@
 #include <cpitemdatahelper.h>
 #include <cpprofilemodel.h>
 #include <QScopedPointer>
+#include "cpprofilemonitor.h"
+
 CpProfileActivatorEntryItem::CpProfileActivatorEntryItem(CpItemDataHelper &itemDataHelper,
                 const QString &text,
                 const QString &description,
                 const HbIcon &icon,
                 const HbDataFormModelItem *parent)
                 :CpSettingFormEntryItemData(itemDataHelper,text,description,
-                                            icon,parent)
+                                            icon,parent),mProfileModel(0),mProfileMonitor(0)
 {
+    mProfileMonitor = new CpProfileMonitor();
     mProfileModel = new CpProfileModel();
+    
     int currentId = mProfileModel->activeProfileId();
     QString currentName = mProfileModel->profileName(currentId);
     this->setDescription(currentName);
+    connect(mProfileMonitor, SIGNAL(profileActivated(int)), this, SLOT(onProfileChanged(int)));        
 }
+
 CpProfileActivatorEntryItem::~CpProfileActivatorEntryItem()
 {
     delete mProfileModel;
+    delete mProfileMonitor;
 }
+
 void CpProfileActivatorEntryItem::onLaunchView()
 {
     CpProfileActivatorDialog *dialog = 
@@ -46,6 +54,12 @@
     dialog->show();
     
 }
+
+void CpProfileActivatorEntryItem::onProfileChanged(int activeProfileId)
+{
+    QString profileName = mProfileModel->profileName(activeProfileId);
+    this->setDescription(profileName);    
+}
 /*void CpPersonalizationEntryItemData::handleOk(const QVariant &result)
 {
     if (!result.canConvert<QString>())