equal
deleted
inserted
replaced
16 */ |
16 */ |
17 |
17 |
18 // Version : |
18 // Version : |
19 |
19 |
20 // INCLUDE FILES |
20 // INCLUDE FILES |
|
21 #include "videocollectiontrace.h" |
21 #include "videooperatorservice_p.h" |
22 #include "videooperatorservice_p.h" |
22 #include "videocollectionviewutils.h" |
23 #include "videocollectionviewutils.h" |
23 #include "videocollectioncenrepdefs.h" |
24 #include "videocollectioncenrepdefs.h" |
24 #include "videocollectiontrace.h" |
|
25 |
25 |
26 #include <qdesktopservices.h> |
26 #include <qdesktopservices.h> |
27 #include <qurl.h> |
27 #include <qurl.h> |
28 #include <e32base.h> |
28 #include <e32base.h> |
29 #include <coemain.h> |
29 #include <coemain.h> |
30 #include <apgcli.h> |
30 #include <apgcli.h> |
31 #include <apaid.h> |
31 #include <apaid.h> |
32 #include <apgtask.h> |
32 #include <apgtask.h> |
|
33 #include <xqappmgr.h> |
33 |
34 |
34 // --------------------------------------------------------------------------- |
35 // --------------------------------------------------------------------------- |
35 // Constructor |
36 // Constructor |
36 // --------------------------------------------------------------------------- |
37 // --------------------------------------------------------------------------- |
37 // |
38 // |
38 VideoOperatorServicePrivate::VideoOperatorServicePrivate() : |
39 VideoOperatorServicePrivate::VideoOperatorServicePrivate() : |
39 mProcess(0) |
40 mProcess(0), |
|
41 mAppMgr(0) |
40 { |
42 { |
41 |
43 |
42 } |
44 } |
43 |
45 |
44 // --------------------------------------------------------------------------- |
46 // --------------------------------------------------------------------------- |
55 disconnect(mProcess, SIGNAL(error(QProcess::ProcessError)), |
57 disconnect(mProcess, SIGNAL(error(QProcess::ProcessError)), |
56 this, SLOT(processError(QProcess::ProcessError))); |
58 this, SLOT(processError(QProcess::ProcessError))); |
57 mProcess->close(); |
59 mProcess->close(); |
58 } |
60 } |
59 delete mProcess; |
61 delete mProcess; |
|
62 mProcess = 0; |
|
63 delete mAppMgr; |
|
64 mAppMgr = 0; |
60 } |
65 } |
61 |
66 |
62 // --------------------------------------------------------------------------- |
67 // --------------------------------------------------------------------------- |
63 // load |
68 // load |
64 // --------------------------------------------------------------------------- |
69 // --------------------------------------------------------------------------- |
109 FUNC_LOG; |
114 FUNC_LOG; |
110 |
115 |
111 if(!mServiceUri.isEmpty()) |
116 if(!mServiceUri.isEmpty()) |
112 { |
117 { |
113 INFOQSTR_1("VideoOperatorServicePrivate::launchService() starting url: %S", mServiceUri); |
118 INFOQSTR_1("VideoOperatorServicePrivate::launchService() starting url: %S", mServiceUri); |
114 QDesktopServices::openUrl(QUrl(mServiceUri)); |
119 launchUrl(mServiceUri); |
115 } |
120 } |
116 else |
121 else |
117 { |
122 { |
118 INFO_1("VideoOperatorServicePrivate::launchService() starting application 0x%x", mApplicationUid); |
123 INFO_1("VideoOperatorServicePrivate::launchService() starting application 0x%x", mApplicationUid); |
119 TRAPD(err, startApplicationL(TUid::Uid(mApplicationUid))); |
124 TRAPD(err, startApplicationL(TUid::Uid(mApplicationUid))); |
220 mProcess->start(appName); |
225 mProcess->start(appName); |
221 } |
226 } |
222 } |
227 } |
223 |
228 |
224 // --------------------------------------------------------------------------- |
229 // --------------------------------------------------------------------------- |
|
230 // launchUrl |
|
231 // --------------------------------------------------------------------------- |
|
232 // |
|
233 void VideoOperatorServicePrivate::launchUrl(QString url) |
|
234 { |
|
235 if(!mAppMgr) |
|
236 { |
|
237 mAppMgr = new XQApplicationManager(); |
|
238 } |
|
239 |
|
240 XQAiwRequest *request = mAppMgr->create(QUrl(url)); |
|
241 if(!request) |
|
242 { |
|
243 INFO("VideoOperatorServicePrivate::launchUrl() handler was not found!"); |
|
244 return; |
|
245 } |
|
246 |
|
247 // Set function parameters |
|
248 QList<QVariant> args; |
|
249 args << url; |
|
250 request->setArguments(args); |
|
251 request->setEmbedded(true); |
|
252 // Send the request |
|
253 bool res = request->send(); |
|
254 if(!res) |
|
255 { |
|
256 // Request failed. |
|
257 int error = request->lastError(); |
|
258 INFO_1("VideoOperatorServicePrivate::launchUrl() send failed with error: %d", error); |
|
259 } |
|
260 |
|
261 delete request; |
|
262 } |
|
263 |
|
264 // --------------------------------------------------------------------------- |
225 // processFinished |
265 // processFinished |
226 // --------------------------------------------------------------------------- |
266 // --------------------------------------------------------------------------- |
227 // |
267 // |
228 void VideoOperatorServicePrivate::processFinished(int exitCode, QProcess::ExitStatus exitStatus) |
268 void VideoOperatorServicePrivate::processFinished(int exitCode, QProcess::ExitStatus exitStatus) |
229 { |
269 { |