src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenucontent.cpp
changeset 5 627c4a0fd0e7
parent 2 06ff229162e9
child 21 4633027730f5
child 34 ed14f46c0e55
equal deleted inserted replaced
3:11d3954df52a 5:627c4a0fd0e7
   150 int HbIndicatorMenuContent::indicatorCount() const
   150 int HbIndicatorMenuContent::indicatorCount() const
   151 {
   151 {
   152      return indicatorModel.rowCount();
   152      return indicatorModel.rowCount();
   153 }
   153 }
   154 
   154 
       
   155 void HbIndicatorMenuContent::handleAboutToShow()
       
   156 {
       
   157     for (int i = 0; i < mIndicatorList->model()->rowCount(); ++i) {
       
   158         HbIndicatorInterface *indicator =
       
   159             indicatorFromIndex(indicatorModel.item(i)->index());
       
   160         if (indicator) {
       
   161             if (indicator->refreshData()) {
       
   162                 setData(indicator, indicatorModel.item(i)->index());
       
   163             }
       
   164         }
       
   165     }
       
   166 }
       
   167 
   155 void HbIndicatorMenuContent::updatePrimitives()
   168 void HbIndicatorMenuContent::updatePrimitives()
   156 {
   169 {
   157     repolish();
   170     repolish();
   158 }
   171 }
   159 
   172 
   231 void HbIndicatorMenuContent::indicatorRemoved(HbIndicatorInterface *indicatorRemoved)
   244 void HbIndicatorMenuContent::indicatorRemoved(HbIndicatorInterface *indicatorRemoved)
   232 {
   245 {
   233     int index = listIndexFromIndicator(indicatorRemoved);
   246     int index = listIndexFromIndicator(indicatorRemoved);
   234     if (index >= 0) {
   247     if (index >= 0) {
   235         indicatorModel.removeRow(index);
   248         indicatorModel.removeRow(index);
   236     }
   249         //update indices.
   237     //update indices.
   250         for(int i = indicatorRemoved->category()+1; i < IndicatorTypes;++i){
   238     for(int i = indicatorRemoved->category()+1; i < IndicatorTypes;++i){
   251             mGroupTypeIndeces[i]--;
   239         mGroupTypeIndeces[i]--;
   252         }
   240     }
   253         repolish();
   241     repolish();
   254     }
   242 }
   255 }
   243 
   256 
   244 //data changed inside indicator.
   257 //data changed inside indicator.
   245 void HbIndicatorMenuContent::indicatorUpdated()
   258 void HbIndicatorMenuContent::indicatorUpdated()
   246 {
   259 {