diff -r 22d3abee08da -r 2883a5458389 controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.cpp --- 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 #include #include +#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())