diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-06-10 07:07:16 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-06-10 07:07:16 (GMT) |
commit | 0b5b2664d5ca6dfbe9c6a0170bbd2caaa47ccd3b (patch) | |
tree | 193a05bb6b8b08571e1eb89d44de91981cd80f7f /examples | |
parent | 9108392448f4906bbd6916dcb0bc8117171c7804 (diff) | |
parent | b97671a3b40623c1499c13c3d74c896ac6b9406f (diff) | |
download | Qt-0b5b2664d5ca6dfbe9c6a0170bbd2caaa47ccd3b.zip Qt-0b5b2664d5ca6dfbe9c6a0170bbd2caaa47ccd3b.tar.gz Qt-0b5b2664d5ca6dfbe9c6a0170bbd2caaa47ccd3b.tar.bz2 |
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
Diffstat (limited to 'examples')
-rw-r--r-- | examples/network/ftp/ftp.pro | 4 | ||||
-rw-r--r-- | examples/network/ftp/main.cpp | 23 |
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(); } |