59 Uses XQApplicationManager |
58 Uses XQApplicationManager |
60 \param entry Subject of the \a command. |
59 \param entry Subject of the \a command. |
61 \param command Description of the command. |
60 \param command Description of the command. |
62 \return Error code described in QSERVICEMANAGER.H |
61 \return Error code described in QSERVICEMANAGER.H |
63 */ |
62 */ |
64 int CaTappHandler::execute(CCaInnerEntry& innerEntry, const QString& command) |
63 int CaTappHandler::execute(const CaEntry& entry, const QString& command) |
65 { |
64 { |
66 int error = 0; // this returns Error enum from QSERVICEMANAGER.H |
65 // this returns Error enum from QSERVICEMANAGER.H |
|
66 int error = 0; |
67 if (command == caCmdOpen) { |
67 if (command == caCmdOpen) { |
68 TPtrC attribute; |
68 QString attribute = entry.attribute(hsitemLaunchUri); |
69 innerEntry.FindAttribute(hsitemLaunchUri, attribute); |
69 if (!attribute.isNull()) { |
70 |
70 // e.g. QUrl("appto://101F7AE7?"); |
71 // e.g. QUrl url ("application://101F7AE7?"); |
71 QScopedPointer<XQAiwRequest> request(mAiwMgr->create(QUrl(attribute), |
72 QUrl url(QString::fromUtf16(attribute.Ptr(), attribute.Length())); |
72 false)); |
73 QScopedPointer<XQAiwRequest> request(mAiwMgr->create(url, false)); |
73 if (!request.isNull()) { |
74 if (!request.isNull()) { |
74 bool res = request->send(); |
75 bool res = request->send(); |
75 if (!res) { |
76 if (!res) { |
76 error = request->lastError(); |
77 error = request->lastError(); |
77 } |
78 } |
78 } |
79 } |
79 } |
|
80 } else { |
|
81 // TODO: error code cleanning and appropriate conversion (in other classes too). |
|
82 static const int NotSupportedErrorCode = 100; |
|
83 error = NotSupportedErrorCode; |
80 } |
84 } |
81 return error; |
85 return error; |
82 } |
86 } |