317 if(model->removeItem(posTypeModelItem)) { |
317 if(model->removeItem(posTypeModelItem)) { |
318 //Note: In removeItem, modelitem is removed and then deleted too. |
318 //Note: In removeItem, modelitem is removed and then deleted too. |
319 // So next time when we want to check if it is present, we have to create dummy modelitem |
319 // So next time when we want to check if it is present, we have to create dummy modelitem |
320 // else with existing handle, we will get kern exec 3 error |
320 // else with existing handle, we will get kern exec 3 error |
321 createPosTypeModelItem(posTypeModelItemIndex); |
321 createPosTypeModelItem(posTypeModelItemIndex); |
322 if(posTypeModelItem == mBgPosType) { |
322 if(posTypeModelItemIndex == PosTypeIndexBackground) { |
323 mSettingsEngine.setBackGroundPositioningState(StateDisable); |
323 mSettingsEngine.setBackGroundPositioningState(StateDisable); |
324 } |
324 } |
325 } |
325 } |
326 } |
326 } |
327 } |
327 } |
328 else { |
328 else { |
329 if(!model->indexFromItem(posTypeModelItem).isValid()) { |
329 if(!model->indexFromItem(posTypeModelItem).isValid()) { |
330 model->insertDataFormItem(posIndex,posTypeModelItem,model->invisibleRootItem()); |
330 model->insertDataFormItem(posIndex,posTypeModelItem,model->invisibleRootItem()); |
331 addPosTypeConnection(posTypeModelItem); |
331 addPosTypeConnection(posTypeModelItem); |
332 |
332 |
333 if(posTypeModelItem == mBgPosType) { |
333 if(posTypeModelItemIndex == PosTypeIndexBackground){ |
334 //Restore to old state in case of background positioning. |
334 //Restore to old state in case of background positioning. |
335 if(mSettingsEngine.cRBackgroundPositioningStatus()) { |
335 if(mSettingsEngine.cRBackgroundPositioningStatus()) { |
336 mSettingsEngine.setBackGroundPositioningState(StateEnable); |
336 mSettingsEngine.setBackGroundPositioningState(StateEnable); |
337 } |
337 } |
338 else { |
338 else { |