76 |
77 |
77 /*! |
78 /*! |
78 * Execute a given command. |
79 * Execute a given command. |
79 * \param entry a reference to a CaEntry instance. |
80 * \param entry a reference to a CaEntry instance. |
80 * \param command a given command. |
81 * \param command a given command. |
|
82 * \param receiver a QObject class with slot to invoke. |
|
83 * \param member a slot to invoke. |
81 * \retval an error code. |
84 * \retval an error code. |
82 */ |
85 */ |
83 int CaAppHandler::execute(const CaEntry &entry, const QString &command) |
86 int CaAppHandler::execute(const CaEntry &entry, const QString &command, |
84 { |
87 QObject* receiver, const char* member) |
|
88 { |
|
89 if ( receiver && member ) { |
|
90 connect( this, SIGNAL(uninstallFailed(int)), receiver, member, Qt::UniqueConnection ); |
|
91 } |
|
92 |
85 int result(KErrGeneral); |
93 int result(KErrGeneral); |
86 if (command == caCmdOpen && entry.entryTypeName() == caTypeApp) { |
94 if (command == caCmdOpen && entry.entryTypeName() == caTypeApp) { |
87 QString viewIdValue = entry.attribute(caAttrView); |
95 QString viewIdValue = entry.attribute(caAttrView); |
88 bool viewIdIsCorrect(true); |
96 bool viewIdIsCorrect(true); |
89 int viewId(-1); |
97 int viewId(-1); |
177 * \retval an error code. |
185 * \retval an error code. |
178 */ |
186 */ |
179 int CaAppHandler::closeApplication(const EntryFlags &flags, int windowGroupId) |
187 int CaAppHandler::closeApplication(const EntryFlags &flags, int windowGroupId) |
180 { |
188 { |
181 int result(KErrNone); |
189 int result(KErrNone); |
182 if (flags.testFlag(RunningEntryFlag) && windowGroupId > 0) { |
190 if (windowGroupId > 0) { |
183 RWsSession wsSession; |
191 RWsSession wsSession; |
184 result = wsSession.Connect(); |
192 result = wsSession.Connect(); |
185 if (result==KErrNone) { |
193 if (result==KErrNone) { |
186 TWsEvent event; |
194 TWsEvent event; |
187 event.SetTimeNow(); |
195 event.SetTimeNow(); |
235 * \param componentId component id. |
243 * \param componentId component id. |
236 */ |
244 */ |
237 void CaAppHandler::startUsifUninstallL(TInt componentId) |
245 void CaAppHandler::startUsifUninstallL(TInt componentId) |
238 { |
246 { |
239 if (iUsifUninstallOperation && iUsifUninstallOperation->IsActive()) { |
247 if (iUsifUninstallOperation && iUsifUninstallOperation->IsActive()) { |
240 User::Leave( KErrInUse ); |
248 uninstallError(Usif::EInstallerBusy); |
241 } |
249 } else { |
242 delete iUsifUninstallOperation; |
250 delete iUsifUninstallOperation; |
243 iUsifUninstallOperation = NULL; |
251 iUsifUninstallOperation = NULL; |
244 iUsifUninstallOperation = CCaUsifUninstallOperation::NewL(componentId); |
252 iUsifUninstallOperation = CCaUsifUninstallOperation::NewL(componentId); |
245 } |
253 iUsifUninstallOperation->AddObserver(this); |
246 |
254 } |
|
255 } |
|
256 |
|
257 #ifdef COVERAGE_MEASUREMENT |
|
258 #pragma CTC SKIP |
|
259 #endif //COVERAGE_MEASUREMENT |
|
260 /*! |
|
261 * Show information message about unninstall error. |
|
262 * \param error uninstall error. |
|
263 * \retval void. |
|
264 */ |
|
265 void CaAppHandler::uninstallError(int error) |
|
266 { |
|
267 emit uninstallFailed(error); |
|
268 } |
|
269 #ifdef COVERAGE_MEASUREMENT |
|
270 #pragma CTC ENDSKIP |
|
271 #endif //COVERAGE_MEASUREMENT |
|
272 |
|
273 |