examples/network/qftp/sym_iap_util.h
changeset 7 f7bc934e204c
parent 3 41300fa6a67c
--- a/examples/network/qftp/sym_iap_util.h	Tue Feb 02 00:43:10 2010 +0200
+++ b/examples/network/qftp/sym_iap_util.h	Wed Mar 31 11:06:36 2010 +0300
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -60,6 +60,7 @@
 //#include <QTextCodec>
 
 _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
@@ -298,7 +299,7 @@
 #ifdef QT_NO_UNICODE
     return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length());
 #else
-    return QString::fromUtf16(aDescriptor.Ptr(), aDescriptor.Length());
+    return QString((const QChar *)aDescriptor.Ptr(), aDescriptor.Length());
 #endif
 }
 
@@ -367,20 +368,25 @@
     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);