summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-06-10 06:29:19 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-06-10 06:29:19 (GMT)
commitdcaa6ab545e7532b5455734bd8d234cb76b152fa (patch)
tree4b5aac908e3b518296d7f0a192686a5a15d77852
parent3b4a2650064e1333684d2b2d2c3923d0b798ed82 (diff)
downloadQt-dcaa6ab545e7532b5455734bd8d234cb76b152fa.zip
Qt-dcaa6ab545e7532b5455734bd8d234cb76b152fa.tar.gz
Qt-dcaa6ab545e7532b5455734bd8d234cb76b152fa.tar.bz2
Enabled default iap setting for FTP example.
This should remove multiple IAP queries when using FTP example. The used IAP is now asked from user when application is started.
-rw-r--r--examples/network/ftp/ftp.pro4
-rw-r--r--examples/network/ftp/main.cpp23
2 files changed, 12 insertions, 15 deletions
diff --git a/examples/network/ftp/ftp.pro b/examples/network/ftp/ftp.pro
index 90594f5..b958f6a 100644
--- a/examples/network/ftp/ftp.pro
+++ b/examples/network/ftp/ftp.pro
@@ -13,9 +13,7 @@ INSTALLS += target sources
include($$QT_SOURCE_TREE/examples/examplebase.pri)
symbian {
- #Enable this macro if you have latest Open C and you want to get rid of IAP queries
- #DEFINES += SETDEFAULTIF_AVAILABLE
TARGET.CAPABILITY="NetworkServices"
TARGET.UID3 = 0xA000A648
- contains( DEFINES, SETDEFAULTIF_AVAILABLE ):LIBS+=-lesock
+ LIBS+=-lesock # For IAP selection
} \ No newline at end of file
diff --git a/examples/network/ftp/main.cpp b/examples/network/ftp/main.cpp
index a472fd7..a92a8b2 100644
--- a/examples/network/ftp/main.cpp
+++ b/examples/network/ftp/main.cpp
@@ -40,13 +40,12 @@
****************************************************************************/
#include <QApplication>
+#include "ftpwindow.h"
+
#ifdef Q_OS_SYMBIAN
#include <QDir>
#include <QDesktopWidget>
-#endif
-#include "ftpwindow.h"
-#if defined Q_OS_SYMBIAN && defined SETDEFAULTIF_AVAILABLE
#include <es_sock.h>
#include <sys/socket.h>
#include <net/if.h>
@@ -66,13 +65,15 @@ static void setDefaultIapL()
_LIT(KIapNameSetting, "IAP\\Name");
TBuf8<50> iapName;
User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iapName));
+ iapName.ZeroTerminate();
+
+ conn.Stop();
+ CleanupStack::PopAndDestroy(&conn);
+ CleanupStack::PopAndDestroy(&serv);
- struct ifreq ifReq;
+ struct ifreq ifReq;
strcpy( ifReq.ifr_name, (char*)iapName.Ptr());
User::LeaveIfError(setdefaultif( &ifReq ));
-
- CleanupStack::PopAndDestroy(&conn);
- CleanupStack::PopAndDestroy(&serv);
}
static int setDefaultIap()
@@ -80,7 +81,6 @@ static int setDefaultIap()
TRAPD(err, setDefaultIapL());
return err;
}
-
#endif
int main(int argc, char *argv[])
@@ -88,9 +88,7 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(ftp);
#ifdef Q_OS_SYMBIAN
-#ifdef SETDEFAULTIF_AVAILABLE
- setDefaultIap();
-#endif
+ setDefaultIap();
// Change current directory from default private to c:\data
// in order that user can access the downloaded content
QDir::setCurrent( "c:\\data" );
@@ -100,7 +98,8 @@ int main(int argc, char *argv[])
#ifdef Q_OS_SYMBIAN
// Make application better looking and more usable on small screen
ftpWin.showMaximized();
-#endif
+#else
ftpWin.show();
+#endif
return ftpWin.exec();
}