summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-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();
}