homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappsettingsstate.cpp
changeset 62 341166945d65
parent 46 23b5d6a29cce
child 63 52b0f64eeb51
child 77 4b195f3bea29
equal deleted inserted replaced
57:2e2dc3d30ca8 62:341166945d65
    55  Confirm action. Owned.
    55  Confirm action. Owned.
    56  */
    56  */
    57 
    57 
    58 /*!
    58 /*!
    59  Constructor
    59  Constructor
    60  \param parent: parent state
    60  \param parent Parent state.
    61  \retval void
    61  \retval void
    62  */
    62  */
    63 HsViewAppSettingsState::HsViewAppSettingsState(QState *parent) :
    63 HsViewAppSettingsState::HsViewAppSettingsState(QState *parent) :
    64         QState(parent),
    64         QState(parent),
    65         mView(0), 
    65         mView(0), 
    66         mPreviousView(0), 
    66         mPreviousView(0), 
    67         mActionConfirm(0),
    67         mActionConfirm(0),
    68         mNotifier(0)
    68         mNotifier(0)
    69         
    69         
    70 {
    70 {
    71         construct();
    71     construct();
    72 }
    72 }
    73 
    73 
    74 /*!
    74 /*!
    75  Constructs contained objects.
    75  Constructs contained objects.
    76  */
    76  */
    77 void HsViewAppSettingsState::construct()
    77 void HsViewAppSettingsState::construct()
    78 {
    78 {
    79     setObjectName(this->parent()->objectName()
    79     setObjectName("/ViewAppSettingsState");
    80                   + "/ViewAppSettingsState");
    80     if (this->parent()) {
       
    81         setObjectName(this->parent()->objectName() + objectName());
       
    82     }
    81 }
    83 }
    82 
    84 
    83 /*!
    85 /*!
    84  Destructor.
    86  Destructor.
    85  */
    87  */
   104     QVariantMap data = menuEvent->data();
   106     QVariantMap data = menuEvent->data();
   105     
   107     
   106     const int entryId = data.value(itemIdKey()).toInt();   
   108     const int entryId = data.value(itemIdKey()).toInt();   
   107     QSharedPointer<const CaEntry> entry = CaService::instance()->getEntry(entryId);    
   109     QSharedPointer<const CaEntry> entry = CaService::instance()->getEntry(entryId);    
   108     
   110     
   109     QString pluginPath(entry->attribute(appSettingsPlugin()));
   111     QString pluginPath;
       
   112     pluginPath = pluginPath.append("/resource/qt/plugins/appsettings/").append(entry->attribute(appSettingsPlugin())).append(".qtplugin");
   110     QPluginLoader loader(pluginPath);
   113     QPluginLoader loader(pluginPath);
   111     mView = qobject_cast<HbView *>(loader.instance()); 
   114     mView = qobject_cast<HbView *>(loader.instance()); 
   112     
   115     
   113     mActionConfirm = new HbAction(Hb::ConfirmNaviAction, mView);
   116     mActionConfirm = new HbAction(Hb::ConfirmNaviAction, mView);
   114     connect(mActionConfirm, SIGNAL(triggered()),SLOT(settingsDone()));
   117     connect(mActionConfirm, SIGNAL(triggered()),SLOT(settingsDone()));
   136 }
   139 }
   137 
   140 
   138 
   141 
   139 #ifdef COVERAGE_MEASUREMENT
   142 #ifdef COVERAGE_MEASUREMENT
   140 #pragma CTC SKIP
   143 #pragma CTC SKIP
   141 #endif //COVERAGE_MEASUREMENT
   144 #endif //COVERAGE_MEASUREMENT (only returns HbMainWindow)
   142 /*!
   145 /*!
   143  Returns pointer to tha main window.
   146  Returns pointer to tha main window.
   144  \return Pointer to the main window.
   147  \return Pointer to the main window.
   145  */
   148  */
   146 HbMainWindow *HsViewAppSettingsState::mainWindow() const
   149 HbMainWindow *HsViewAppSettingsState::mainWindow() const
   150 #ifdef COVERAGE_MEASUREMENT
   153 #ifdef COVERAGE_MEASUREMENT
   151 #pragma CTC ENDSKIP
   154 #pragma CTC ENDSKIP
   152 #endif //COVERAGE_MEASUREMENT
   155 #endif //COVERAGE_MEASUREMENT
   153 
   156 
   154 
   157 
   155 #ifdef COVERAGE_MEASUREMENT
       
   156 #pragma CTC SKIP
       
   157 #endif //COVERAGE_MEASUREMENT
       
   158 /*!
   158 /*!
   159  Invoked when plugin view exits
   159  Invoked when plugin view exits
   160  */
   160  */
   161 void HsViewAppSettingsState::settingsDone()
   161 void HsViewAppSettingsState::settingsDone()
   162 {
   162 {
   163     emit exit();
   163     emit exit();
   164 }
   164 }
   165 #ifdef COVERAGE_MEASUREMENT
       
   166 #pragma CTC ENDSKIP
       
   167 #endif //COVERAGE_MEASUREMENT
       
   168 
   165 
   169 /*!
   166 /*!
   170  Subscribe for memory card remove.
   167  Subscribe for memory card remove.
   171  \param entryId: entry id.
   168  \param entryId: entry id.
   172  \retval void
   169  \retval void