124 // --------------------------------------------------------------------------- |
124 // --------------------------------------------------------------------------- |
125 // --------------------------------------------------------------------------- |
125 // --------------------------------------------------------------------------- |
126 // |
126 // |
127 void HsDeleteCollectionState::deleteMessageFinished(HbAction* finishedAction) |
127 void HsDeleteCollectionState::deleteMessageFinished(HbAction* finishedAction) |
128 { |
128 { |
129 if (mItemId !=0 ) { // (work-around for crash if more then one action is selected in HbDialog) |
129 if (finishedAction == mConfirmAction) { |
130 |
130 HsMenuService::removeCollection(mItemId); |
131 if (finishedAction == mConfirmAction) { |
131 machine()->postEvent( |
132 HsMenuService::removeCollection(mItemId); |
132 HsMenuEventFactory::createCollectionDeletedEvent()); |
133 machine()->postEvent( |
|
134 HsMenuEventFactory::createCollectionDeletedEvent()); |
|
135 } |
|
136 mItemId = 0; |
|
137 emit exit(); |
|
138 } else { |
|
139 // (work-around for crash if more then one action is selected in HbDialog) |
|
140 qWarning("Another signal finished was emited."); |
|
141 } |
133 } |
|
134 emit exit(); |
142 } |
135 } |
143 |
136 |
144 /*! |
137 /*! |
145 Slot launched after state has exited and in destructor. |
138 Slot launched after state has exited and in destructor. |
146 \retval void |
139 \retval void |
147 */ |
140 */ |
148 void HsDeleteCollectionState::cleanUp() |
141 void HsDeleteCollectionState::cleanUp() |
149 { |
142 { |
150 // Close messagebox if App key was pressed |
143 // Close messagebox if App key was pressed |
151 if (mDeleteMessage) { |
144 if (mDeleteMessage) { |
|
145 disconnect(mDeleteMessage, SIGNAL(finished(HbAction*)), this, SLOT(deleteMessageFinished(HbAction*))); |
152 mDeleteMessage->close(); |
146 mDeleteMessage->close(); |
|
147 mDeleteMessage = NULL; |
153 } |
148 } |
154 |
149 |
155 mDeleteMessage = NULL; |
150 mConfirmAction = NULL; |
156 mConfirmAction= NULL; |
|
157 mItemId = 0; |
151 mItemId = 0; |
158 } |
152 } |