summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/network/ftp/ftpwindow.cpp14
-rw-r--r--examples/network/ftp/ftpwindow.h4
-rw-r--r--examples/network/ftp/main.cpp2
3 files changed, 18 insertions, 2 deletions
diff --git a/examples/network/ftp/ftpwindow.cpp b/examples/network/ftp/ftpwindow.cpp
index abfb6cc..a48252a 100644
--- a/examples/network/ftp/ftpwindow.cpp
+++ b/examples/network/ftp/ftpwindow.cpp
@@ -44,6 +44,10 @@
#include "ftpwindow.h"
+#ifdef Q_OS_SYMBIAN
+#include "sym_iap_util.h"
+#endif
+
FtpWindow::FtpWindow(QWidget *parent)
: QDialog(parent), ftp(0)
{
@@ -115,6 +119,10 @@ FtpWindow::FtpWindow(QWidget *parent)
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);
+#ifdef Q_OS_SYMBIAN
+ bDefaultIapSet = false;
+#endif
+
setWindowTitle(tr("FTP"));
}
@@ -126,6 +134,12 @@ QSize FtpWindow::sizeHint() const
//![0]
void FtpWindow::connectOrDisconnect()
{
+#ifdef Q_OS_SYMBIAN
+ if(!bDefaultIapSet) {
+ qt_SetDefaultIap();
+ bDefaultIapSet = true;
+ }
+#endif
if (ftp) {
ftp->abort();
ftp->deleteLater();
diff --git a/examples/network/ftp/ftpwindow.h b/examples/network/ftp/ftpwindow.h
index a3045fa..70c1210 100644
--- a/examples/network/ftp/ftpwindow.h
+++ b/examples/network/ftp/ftpwindow.h
@@ -98,6 +98,10 @@ private:
QString currentPath;
QFtp *ftp;
QFile *file;
+
+#ifdef Q_OS_SYMBIAN
+ bool bDefaultIapSet;
+#endif
//![1]
};
diff --git a/examples/network/ftp/main.cpp b/examples/network/ftp/main.cpp
index ecabb31..5c24788 100644
--- a/examples/network/ftp/main.cpp
+++ b/examples/network/ftp/main.cpp
@@ -45,14 +45,12 @@
#ifdef Q_OS_SYMBIAN
#include <QDir>
#include <QDesktopWidget>
-#include "sym_iap_util.h"
#endif
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(ftp);
#ifdef Q_OS_SYMBIAN
- qt_SetDefaultIap();
// Change current directory from default private to c:\data
// in order that user can access the downloaded content
QDir::setCurrent( "c:\\data" );