155 supported = false; |
155 supported = false; |
156 |
156 |
157 return supported; |
157 return supported; |
158 } |
158 } |
159 |
159 |
160 //common code to perform a call, videocall and message action |
160 //common code to perform a call, videocall action |
161 void CntAction::performNumberAction(const QString &interface, const QString &operation) |
161 void CntAction::performNumberAction(const QString &interface, const QString &operation) |
162 { |
162 { |
163 QVariantList args; |
|
164 QVariant retValue; |
163 QVariant retValue; |
165 |
164 |
166 // TODO: Using XQApplicationManager is not working with calls |
165 // XQApplicationManager is not supported by PhoneUI to initiate calls, |
167 // The factory method cannot create a request. Find out why |
166 // only old approarch using XQServiceRequest can be used. |
168 //bool isCallAction = (m_actionName == "call" || m_actionName == "videocall"); |
167 XQServiceRequest snd(interface, operation); //sync request |
169 XQServiceRequest snd(interface, operation, false); |
|
170 |
168 |
171 //QContactType == TypeGroup |
169 //QContactType == TypeGroup |
172 if (QContactType::TypeGroup == m_contact.type()) { |
170 if (QContactType::TypeGroup == m_contact.type()) { |
173 QContactPhoneNumber conferenceCall = m_contact.detail<QContactPhoneNumber>(); |
171 QContactPhoneNumber conferenceCall = m_contact.detail<QContactPhoneNumber>(); |
174 args << conferenceCall.number() << m_contact.localId() << m_contact.displayLabel(); |
172 |
175 |
|
176 // TODO remove once call action works |
|
177 snd << conferenceCall.number() << m_contact.localId() << m_contact.displayLabel(); |
173 snd << conferenceCall.number() << m_contact.localId() << m_contact.displayLabel(); |
178 snd.send(retValue); |
174 snd.send(retValue); |
179 emitResult(snd.latestError(), retValue); |
175 emitResult(snd.latestError(), retValue); |
180 } |
176 } |
181 //QContactType == TypeContact |
177 //QContactType == TypeContact |
182 //detail exist use it |
178 //detail exist use it |
183 else if (m_detail.definitionName() == QContactPhoneNumber::DefinitionName) { |
179 else if (m_detail.definitionName() == QContactPhoneNumber::DefinitionName) { |
184 const QContactPhoneNumber &phoneNumber = static_cast<const QContactPhoneNumber &>(m_detail); |
180 const QContactPhoneNumber &phoneNumber = static_cast<const QContactPhoneNumber &>(m_detail); |
185 |
181 |
186 args << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); |
|
187 |
|
188 snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); |
182 snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); |
189 snd.send(retValue); |
183 snd.send(retValue); |
190 emitResult(snd.latestError(), retValue); |
184 emitResult(snd.latestError(), retValue); |
191 } |
185 } |
192 //QContactType == TypeContact |
186 //QContactType == TypeContact |
204 //if not empty, cast detail to phonenumber |
198 //if not empty, cast detail to phonenumber |
205 else { |
199 else { |
206 phoneNumber = static_cast<QContactPhoneNumber>(detail); |
200 phoneNumber = static_cast<QContactPhoneNumber>(detail); |
207 } |
201 } |
208 |
202 |
209 args << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); |
|
210 |
|
211 snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); |
203 snd << phoneNumber.number() << m_contact.localId() << m_contact.displayLabel(); |
212 snd.send(retValue); |
204 snd.send(retValue); |
213 emitResult(snd.latestError(), retValue); |
205 emitResult(snd.latestError(), retValue); |
214 } |
206 } |
215 //else return an error |
207 //else return an error |