controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.cpp
changeset 41 ab0490982943
parent 33 0cfa53de576f
equal deleted inserted replaced
36:2fee987ebaff 41:ab0490982943
    34     mProfileModel = new CpProfileModel();
    34     mProfileModel = new CpProfileModel();
    35     
    35     
    36     int currentId = mProfileModel->activeProfileId();
    36     int currentId = mProfileModel->activeProfileId();
    37     QString currentName = mProfileModel->profileName(currentId);
    37     QString currentName = mProfileModel->profileName(currentId);
    38     this->setDescription(currentName);
    38     this->setDescription(currentName);
    39     connect(mProfileMonitor, SIGNAL(profileActivated(int)), this, SLOT(onProfileChanged(int)));        
    39     connect(mProfileMonitor, SIGNAL(profileActivated(int)), this, SLOT(onProfileActivated(int)));
       
    40     connect(mProfileMonitor, SIGNAL(profileNameModified()), this, SLOT(onProfileNameChanged()));
    40 }
    41 }
    41 
    42 
    42 CpProfileActivatorEntryItem::~CpProfileActivatorEntryItem()
    43 CpProfileActivatorEntryItem::~CpProfileActivatorEntryItem()
    43 {
    44 {
    44     delete mProfileModel;
    45     delete mProfileModel;
    53    // dialog->open(this, SLOT(ultimateDialogSlot(HbAction*)));
    54    // dialog->open(this, SLOT(ultimateDialogSlot(HbAction*)));
    54     dialog->show();
    55     dialog->show();
    55     
    56     
    56 }
    57 }
    57 
    58 
    58 void CpProfileActivatorEntryItem::onProfileChanged(int activeProfileId)
    59 void CpProfileActivatorEntryItem::onProfileActivated(int profileId)
    59 {
    60 {
    60     QString profileName = mProfileModel->profileName(activeProfileId);
    61     QString profileName = mProfileModel->profileName(profileId);
    61     this->setDescription(profileName);    
    62     this->setDescription(profileName);
    62 }
    63 }
    63 /*void CpPersonalizationEntryItemData::handleOk(const QVariant &result)
    64 
       
    65 void CpProfileActivatorEntryItem::onProfileNameChanged()
    64 {
    66 {
    65     if (!result.canConvert<QString>())
    67     QString profileName = mProfileModel->profileName(mProfileModel->activeProfileId());
    66     {
    68     this->setDescription(profileName);
    67         setDescription( "Corrupt result" );
       
    68     }
       
    69     else
       
    70     {
       
    71         setDescription( result.value<QString>() );
       
    72     }
       
    73 }
    69 }
    74 void CpPersonalizationEntryItemData::handleError(int errorCode, const QString& errorMessage)
       
    75 {
       
    76     //
       
    77     Q_UNUSED(errorCode);
       
    78     Q_UNUSED(errorMessage);
       
    79     setDescription("Error");
       
    80 }*/
       
    81 
    70 
    82 CpBaseSettingView *CpProfileActivatorEntryItem::createSettingView() const
    71 CpBaseSettingView *CpProfileActivatorEntryItem::createSettingView() const
    83 {
    72 {
    84         return 0;
    73         return 0;
    85 }
    74 }