examples/network/qftp/sym_iap_util.h
changeset 19 fcece45ef507
parent 18 2f34d5167611
child 30 5dc02b23752f
equal deleted inserted replaced
18:2f34d5167611 19:fcece45ef507
    58 #include <QSettings>
    58 #include <QSettings>
    59 #include <QStringList>
    59 #include <QStringList>
    60 //#include <QTextCodec>
    60 //#include <QTextCodec>
    61 
    61 
    62 _LIT(KIapNameSetting, "IAP\\Name");             // text - mandatory
    62 _LIT(KIapNameSetting, "IAP\\Name");             // text - mandatory
       
    63 _LIT(KIapTableIdField, "IAP\Id");
    63 _LIT(KIapDialogPref, "IAP\\DialogPref");        // TUnit32 - optional
    64 _LIT(KIapDialogPref, "IAP\\DialogPref");        // TUnit32 - optional
    64 _LIT(KIapService, "IAP\\IAPService");           // TUnit32 - mandatory
    65 _LIT(KIapService, "IAP\\IAPService");           // TUnit32 - mandatory
    65 _LIT(KIapServiceType, "IAP\\IAPServiceType");   // text - mandatory
    66 _LIT(KIapServiceType, "IAP\\IAPServiceType");   // text - mandatory
    66 _LIT(KIapBearer, "IAP\\IAPBearer");             // TUint32 - optional
    67 _LIT(KIapBearer, "IAP\\IAPBearer");             // TUint32 - optional
    67 _LIT(KIapBearerType, "IAP\\IAPBearerType");     // text - optional
    68 _LIT(KIapBearerType, "IAP\\IAPBearerType");     // text - optional
   365 
   366 
   366     RConnection connection;
   367     RConnection connection;
   367     CleanupClosePushL(connection);
   368     CleanupClosePushL(connection);
   368 
   369 
   369     socketServ.Connect();
   370     socketServ.Connect();
       
   371 
       
   372     TCommDbConnPref prefs;
       
   373     prefs.SetDialogPreference(ECommDbDialogPrefPrompt);
       
   374 
   370     connection.Open(socketServ);
   375     connection.Open(socketServ);
   371     connection.Start();
   376     connection.Start(prefs);
   372 
   377 
   373     connection.GetDesSetting(TPtrC(KIapNameSetting), iapName);
   378     connection.GetDesSetting(TPtrC(KIapNameSetting), iapName);
   374 
       
   375     //connection.Stop();
   379     //connection.Stop();
   376 
   380 
   377     iapName.ZeroTerminate();
   381     iapName.ZeroTerminate();
   378     QString strIapName((char*)iapName.Ptr());
   382     QString strIapName((char*)iapName.Ptr());
   379 
   383 
   380     int error = 0;
   384     int error = 0;
   381     if(!qt_SetDefaultIapName(strIapName, error)) {
   385     if(!strIapName.isEmpty()) {
   382         //printf("failed setdefaultif @ %i with %s and errno = %d \n", __LINE__, strIapName.toUtf8().data(), error);
   386         if(!qt_SetDefaultIapName(strIapName, error)) {
   383         strIapName = QString("");
   387             //printf("failed setdefaultif @ %i with %s and errno = %d \n", __LINE__, strIapName.toUtf8().data(), error);
       
   388             strIapName = QString("");
       
   389         }
   384     }
   390     }
   385 
   391 
   386     CleanupStack::PopAndDestroy(&connection);
   392     CleanupStack::PopAndDestroy(&connection);
   387     CleanupStack::PopAndDestroy(&socketServ);
   393     CleanupStack::PopAndDestroy(&socketServ);
   388 
   394