From 3d51d223bee55011876d12011970a5ad15c4acd0 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Fri, 5 Mar 2010 14:43:34 +0100 Subject: If no IAP defined force IAP dialog Using TCommDbConnPref to force IAP dialog when IAP is not defined Reviewed-by: TrustMe --- examples/network/qftp/sym_iap_util.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/examples/network/qftp/sym_iap_util.h b/examples/network/qftp/sym_iap_util.h index 41e43a9..445036a 100644 --- a/examples/network/qftp/sym_iap_util.h +++ b/examples/network/qftp/sym_iap_util.h @@ -60,6 +60,7 @@ //#include _LIT(KIapNameSetting, "IAP\\Name"); // text - mandatory +_LIT(KIapTableIdField, "IAP\Id"); _LIT(KIapDialogPref, "IAP\\DialogPref"); // TUnit32 - optional _LIT(KIapService, "IAP\\IAPService"); // TUnit32 - mandatory _LIT(KIapServiceType, "IAP\\IAPServiceType"); // text - mandatory @@ -367,20 +368,25 @@ static QString qt_OfferIapDialog() { CleanupClosePushL(connection); socketServ.Connect(); + + TCommDbConnPref prefs; + prefs.SetDialogPreference(ECommDbDialogPrefPrompt); + connection.Open(socketServ); - connection.Start(); + connection.Start(prefs); connection.GetDesSetting(TPtrC(KIapNameSetting), iapName); - //connection.Stop(); iapName.ZeroTerminate(); QString strIapName((char*)iapName.Ptr()); int error = 0; - if(!qt_SetDefaultIapName(strIapName, error)) { - //printf("failed setdefaultif @ %i with %s and errno = %d \n", __LINE__, strIapName.toUtf8().data(), error); - strIapName = QString(""); + if(!strIapName.isEmpty()) { + if(!qt_SetDefaultIapName(strIapName, error)) { + //printf("failed setdefaultif @ %i with %s and errno = %d \n", __LINE__, strIapName.toUtf8().data(), error); + strIapName = QString(""); + } } CleanupStack::PopAndDestroy(&connection); -- cgit v0.12