void CntThumbnailCreator::CreateContactFieldL() { __ASSERT_DEBUG(m_imageData, User::Panic(KPanicCategory, KPanicUnitialized)); initializeThumbnailFieldL(); CContactItemField *thumbnailField = CContactItemField::NewLC(*m_thumbnailFieldFromTemplate); thumbnailField->StoreStorage()->SetThingL(*m_imageData); QT_TRYCATCH_LEAVING(m_fieldList->append(thumbnailField)); CleanupStack::Pop(thumbnailField); // Complete request to proceed to the final state TRequestStatus *status = &iStatus; User::RequestComplete(status, KErrNone); SetActive(); }
// ---------------------------------------------------------------------------- // QBtServiceAdvertiserPrivate::StopAdvertiser() // // stop service advertiser. delete service record from service discovery // database to stop advertising. // ---------------------------------------------------------------------------- void QBtServiceAdvertiserPrivate::StopAdvertiser() { if ( iRecord!=0 ) { // delete out record from service discovery database iSdpDB.DeleteRecordL(iRecord); // close sdp and sdp db sessions iSdpDB.Close(); iSdp.Close(); iRecord=0; // QT_TRYCATCH_LEAVING (emit p_ptr->advertisingStopped() ); } }
const QMimeData* QClipboard::mimeData(Mode mode) const { if (mode != Clipboard) return 0; QClipboardData *d = clipboardData(); if (d) { TRAPD(err,{ RFs fs = qt_s60GetRFs(); CClipboard* cb = CClipboard::NewForReadingLC(fs); Q_ASSERT(cb); RStoreReadStream stream; TStreamId stid = (cb->StreamDictionary()).At(KQtCbDataStream); stream.OpenLC(cb->Store(),stid); QT_TRYCATCH_LEAVING(readFromStreamLX(d->source(),stream)); CleanupStack::PopAndDestroy(2,cb); return d->source(); }); if (err != KErrNone){ qDebug()<< "clipboard is empty/err: " << err; } }
void CPredictiveSearchSynchronizer::DeletePredSearchTableL(CPplPredictiveSearchTableBase& aTable) { PRINT(_L("CPredictiveSearchSynchronizer::DeletePredSearchTableL")); // IF EXISTS suppresses error that would occur if table does not exist _LIT(KDropTable, "DROP TABLE IF EXISTS %S;"); QList<QChar> tables; QT_TRYCATCH_LEAVING(tables = aTable.FillAllTables()); HBufC* tableName(NULL); while ((tableName = aTable.GetNextTableNameL(tables)) != NULL) { CleanupStack::PushL(tableName); HBufC* dropTable = HBufC::NewLC(KDropTable().Length() + tableName->Length()); dropTable->Des().Format(KDropTable, tableName); User::LeaveIfError(iDatabase.Exec(*dropTable)); CleanupStack::PopAndDestroy(dropTable); CleanupStack::PopAndDestroy(tableName); } PRINT(_L("CPredictiveSearchSynchronizer::DeletePredSearchTableL ends")); }
static bool handleMailtoScheme(const QUrl &url) { TRAPD(err, QT_TRYCATCH_LEAVING(handleMailtoSchemeLX(url))); return err ? false : true; }
void QBtSingleDeviceSelectorUIPrivate::BTCanceledL() { // if this throws, generate a leave as this is symbian code QT_TRYCATCH_LEAVING (emit _publicClass->userCanceled() ); }
void QSymbianHostResolver::RunL() { QT_TRYCATCH_LEAVING(run()); }
QGeoPositionInfoSource *QGeoPositionInfoSource::createDefaultSource(QObject *parent) { QSettings pluginSettings(QSettings::SystemScope, QLatin1String("Nokia"), QLatin1String("QtLocationPosAndSat")); QVariant value = pluginSettings.value("position.plugin.operator.whitelist"); if (value.isValid()) { QStringList parts = value.toString().split(","); if (parts.size() == 4) { QGeoPositionInfoSource *source = createSource(parts.at(0), parent); if (source) return source; } } #if defined(Q_OS_SYMBIAN) QGeoPositionInfoSource *ret = NULL; #if defined(LOCATION_FIX_QTM_1550) TRAPD(error, QT_TRYCATCH_LEAVING(ret = CQGeoPositionInfoSourceSymbian::NewL(parent))); #else TRAPD(error, QT_TRYCATCH_LEAVING(ret = CQGeoPositionInfoSourceS60::NewL(parent))); #endif if (error == KErrNone) return ret; #elif defined(QT_SIMULATOR) return new QGeoPositionInfoSourceSimulator(parent); #elif defined(Q_OS_WINCE) return new QGeoPositionInfoSourceWinCE(parent); #elif (defined(Q_WS_MAEMO_6)) || (defined(Q_WS_MAEMO_5)) QGeoPositionInfoSourceMaemo *source = new QGeoPositionInfoSourceMaemo(parent); int status = source->init(); if (status != -1) return source; else delete source; #elif defined(Q_WS_MEEGO) // Use Maemo6 backend if its available, otherwise use Geoclue backend QSettings maemo6Settings(QSettings::UserScope, QLatin1String("Nokia"), QLatin1String("QtLocationPosAndSatMaemo6")); if (!maemo6Settings.value("maemo6positioningavailable").isValid()) { QGeoPositionInfoSourceMaemo* maemo6Source = new QGeoPositionInfoSourceMaemo(parent); int status = maemo6Source->init(); if (status == -1) { delete maemo6Source; maemo6Source = 0; maemo6Settings.setValue("maemo6positioningavailable", false); } else { return maemo6Source; } } #ifdef GEOCLUE_MASTER_AVAILABLE QGeoPositionInfoSourceGeoclueMaster *geoclueSource = new QGeoPositionInfoSourceGeoclueMaster(parent); int status = geoclueSource->init(); if (status >= 0) return geoclueSource; delete geoclueSource; #endif // GEOCLUE_MASTER_AVAILABLE #endif // no good platform source, try plugins foreach (QGeoPositionInfoSourceFactory *f, QGeoPositionInfoSourcePrivate::pluginsSorted()) { QGeoPositionInfoSource *src = f->positionInfoSource(parent); if (src) return src; }
// ---------------------------------------------------------------------------- // QBtServiceAdvertiserPrivate::StartAdvertiser(const QBtService& service) // // start service advertiser on given channel. an entry to service discovery // database will be entered describing our advertised service. // ---------------------------------------------------------------------------- void QBtServiceAdvertiserPrivate::StartAdvertiser (const QBtService& service) { //localService = new QBtService(service); // open sdp session User::LeaveIfError(iSdp.Connect()); // open sdp database session User::LeaveIfError(iSdpDB.Open(iSdp)); // create a record of the correct service class //QBtUuid uuid = service.getClass(); TUUID uuid = QBtUuidToSymbianUuid (service.getClass() ); iSdpDB.CreateServiceRecordL (uuid, iRecord); // add a protocol to the record CSdpAttrValueDES* protocolDescriptorList = CSdpAttrValueDES::NewDESL(NULL); CleanupStack::PushL(protocolDescriptorList); TBuf8<1> channel; channel.Append((TChar)service.getPort()); // create protocol list for our service MSdpElementBuilder* e = protocolDescriptorList->StartListL(); QBtService::ProtocolList protocolList = service.getProtocols(); for (int i=0; i < protocolList.size(); i++) { e = e->BuildDESL(); e = e->StartListL(); TUUID u = QBtUuidToSymbianUuid (protocolList[i]); e = e->BuildUUIDL (u); if (u == TUUID (KRFCOMM) ) e = e->BuildUintL(channel); e = e->EndListL(); } e->EndListL(); // set protocol list to the record iSdpDB.UpdateAttributeL(iRecord, KSdpAttrIdProtocolDescriptorList, *protocolDescriptorList); CleanupStack::PopAndDestroy(protocolDescriptorList); // add a name to the record TPtrC16 servName(service.getName().utf16()); iSdpDB.UpdateAttributeL(iRecord, KSdpAttrIdBasePrimaryLanguage + KSdpAttrIdOffsetServiceName, servName); // add a description to the record TPtrC16 servDescr(service.getDescription().utf16()); iSdpDB.UpdateAttributeL(iRecord, KSdpAttrIdBasePrimaryLanguage + KSdpAttrIdOffsetServiceDescription, servDescr); // set service available UpdateAvailability(ETrue); // notify QT_TRYCATCH_LEAVING (emit p_ptr->advertisingStarted(service) ); }
void QWakeUpActiveObject::RunL() { iStatus = KRequestPending; SetActive(); QT_TRYCATCH_LEAVING(m_dispatcher->wakeUpWasCalled()); }