diff options
Diffstat (limited to 'examples/network')
-rw-r--r-- | examples/network/blockingfortuneclient/blockingfortuneclient.pro | 2 | ||||
-rw-r--r-- | examples/network/broadcastreceiver/broadcastreceiver.pro | 2 | ||||
-rw-r--r-- | examples/network/broadcastsender/broadcastsender.pro | 2 | ||||
-rw-r--r-- | examples/network/download/download.pro | 2 | ||||
-rw-r--r-- | examples/network/downloadmanager/downloadmanager.pro | 2 | ||||
-rw-r--r-- | examples/network/fortuneclient/fortuneclient.pro | 2 | ||||
-rw-r--r-- | examples/network/fortuneserver/fortuneserver.pro | 2 | ||||
-rw-r--r-- | examples/network/ftp/ftp.pro | 10 | ||||
-rw-r--r-- | examples/network/ftp/ftpwindow.cpp | 15 | ||||
-rw-r--r-- | examples/network/ftp/main.cpp | 58 | ||||
-rw-r--r-- | examples/network/http/http.pro | 2 | ||||
-rw-r--r-- | examples/network/loopback/loopback.pro | 2 | ||||
-rw-r--r-- | examples/network/network-chat/network-chat.pro | 2 | ||||
-rw-r--r-- | examples/network/network.pro | 12 | ||||
-rw-r--r-- | examples/network/securesocketclient/securesocketclient.pro | 2 | ||||
-rw-r--r-- | examples/network/threadedfortuneserver/threadedfortuneserver.pro | 2 | ||||
-rw-r--r-- | examples/network/torrent/torrent.pro | 2 |
17 files changed, 114 insertions, 7 deletions
diff --git a/examples/network/blockingfortuneclient/blockingfortuneclient.pro b/examples/network/blockingfortuneclient/blockingfortuneclient.pro index fa146fa..96fbc1f 100644 --- a/examples/network/blockingfortuneclient/blockingfortuneclient.pro +++ b/examples/network/blockingfortuneclient/blockingfortuneclient.pro @@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/blockingfortuneclient sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS blockingfortuneclient.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/blockingfortuneclient INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/broadcastreceiver/broadcastreceiver.pro b/examples/network/broadcastreceiver/broadcastreceiver.pro index ad04e2c..36ad096 100644 --- a/examples/network/broadcastreceiver/broadcastreceiver.pro +++ b/examples/network/broadcastreceiver/broadcastreceiver.pro @@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastreceiver sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastreceiver.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastreceiver INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/broadcastsender/broadcastsender.pro b/examples/network/broadcastsender/broadcastsender.pro index b300a50..84e6593 100644 --- a/examples/network/broadcastsender/broadcastsender.pro +++ b/examples/network/broadcastsender/broadcastsender.pro @@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastsender sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastsender.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastsender INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/download/download.pro b/examples/network/download/download.pro index 254c356..f0db340 100644 --- a/examples/network/download/download.pro +++ b/examples/network/download/download.pro @@ -17,3 +17,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/download sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png sources.path = $$[QT_INSTALL_EXAMPLES]/network/download INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/downloadmanager/downloadmanager.pro b/examples/network/downloadmanager/downloadmanager.pro index 1b979ca..ef7052c 100644 --- a/examples/network/downloadmanager/downloadmanager.pro +++ b/examples/network/downloadmanager/downloadmanager.pro @@ -18,3 +18,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/downloadmanager sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png sources.path = $$[QT_INSTALL_EXAMPLES]/network/downloadmanager INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro index 1c7b0a8..bb125e8 100644 --- a/examples/network/fortuneclient/fortuneclient.pro +++ b/examples/network/fortuneclient/fortuneclient.pro @@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneclient sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fortuneclient.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneclient INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro index e98385a..8cf52ee 100644 --- a/examples/network/fortuneserver/fortuneserver.pro +++ b/examples/network/fortuneserver/fortuneserver.pro @@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fortuneserver.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/ftp/ftp.pro b/examples/network/ftp/ftp.pro index cabc003..90594f5 100644 --- a/examples/network/ftp/ftp.pro +++ b/examples/network/ftp/ftp.pro @@ -9,3 +9,13 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/ftp sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS ftp.pro images sources.path = $$[QT_INSTALL_EXAMPLES]/network/ftp 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 +}
\ No newline at end of file diff --git a/examples/network/ftp/ftpwindow.cpp b/examples/network/ftp/ftpwindow.cpp index a05a5dd..52c31e0 100644 --- a/examples/network/ftp/ftpwindow.cpp +++ b/examples/network/ftp/ftpwindow.cpp @@ -52,6 +52,10 @@ FtpWindow::FtpWindow(QWidget *parent) ftpServerLabel->setBuddy(ftpServerLineEdit); statusLabel = new QLabel(tr("Please enter the name of an FTP server.")); +#ifdef Q_OS_SYMBIAN + // Use word wrapping to fit the text on screen + statusLabel->setWordWrap( true ); +#endif fileList = new QTreeWidget; fileList->setEnabled(false); @@ -90,11 +94,22 @@ FtpWindow::FtpWindow(QWidget *parent) QHBoxLayout *topLayout = new QHBoxLayout; topLayout->addWidget(ftpServerLabel); topLayout->addWidget(ftpServerLineEdit); +#ifndef Q_OS_SYMBIAN topLayout->addWidget(cdToParentButton); topLayout->addWidget(connectButton); +#else + // Make app better lookin on small screen + QHBoxLayout *topLayout2 = new QHBoxLayout; + topLayout2->addWidget(cdToParentButton); + topLayout2->addWidget(connectButton); +#endif QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(topLayout); +#ifdef Q_OS_SYMBIAN + // Make app better lookin on small screen + mainLayout->addLayout(topLayout2); +#endif mainLayout->addWidget(fileList); mainLayout->addWidget(statusLabel); mainLayout->addWidget(buttonBox); diff --git a/examples/network/ftp/main.cpp b/examples/network/ftp/main.cpp index b9ffd33..a472fd7 100644 --- a/examples/network/ftp/main.cpp +++ b/examples/network/ftp/main.cpp @@ -40,15 +40,67 @@ ****************************************************************************/ #include <QApplication> - +#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> + +static void setDefaultIapL() +{ + TInt err = KErrNone; + RSocketServ serv; + CleanupClosePushL(serv); + User::LeaveIfError(serv.Connect()); + + RConnection conn; + CleanupClosePushL(conn); + User::LeaveIfError(conn.Open(serv)); + User::LeaveIfError(conn.Start()); + + _LIT(KIapNameSetting, "IAP\\Name"); + TBuf8<50> iapName; + User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iapName)); + + struct ifreq ifReq; + strcpy( ifReq.ifr_name, (char*)iapName.Ptr()); + User::LeaveIfError(setdefaultif( &ifReq )); + + CleanupStack::PopAndDestroy(&conn); + CleanupStack::PopAndDestroy(&serv); +} + +static int setDefaultIap() +{ + TRAPD(err, setDefaultIapL()); + return err; +} + +#endif + int main(int argc, char *argv[]) { Q_INIT_RESOURCE(ftp); - - QApplication app(argc, argv); + +#ifdef Q_OS_SYMBIAN +#ifdef SETDEFAULTIF_AVAILABLE + setDefaultIap(); +#endif + // Change current directory from default private to c:\data + // in order that user can access the downloaded content + QDir::setCurrent( "c:\\data" ); +#endif + QApplication app(argc, argv); FtpWindow ftpWin; +#ifdef Q_OS_SYMBIAN + // Make application better looking and more usable on small screen + ftpWin.showMaximized(); +#endif ftpWin.show(); return ftpWin.exec(); } diff --git a/examples/network/http/http.pro b/examples/network/http/http.pro index 7f58d9f..99aa717 100644 --- a/examples/network/http/http.pro +++ b/examples/network/http/http.pro @@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/http sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS http.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/http INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/loopback/loopback.pro b/examples/network/loopback/loopback.pro index 88b7a8b..0a09e34 100644 --- a/examples/network/loopback/loopback.pro +++ b/examples/network/loopback/loopback.pro @@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/loopback sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS loopback.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/loopback INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro index 5d5efea..6967228 100644 --- a/examples/network/network-chat/network-chat.pro +++ b/examples/network/network-chat/network-chat.pro @@ -17,3 +17,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/network-chat sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS network-chat.pro *.chat sources.path = $$[QT_INSTALL_EXAMPLES]/network/network-chat INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/network.pro b/examples/network/network.pro index 8c45745..9e48e9a 100644 --- a/examples/network/network.pro +++ b/examples/network/network.pro @@ -1,10 +1,10 @@ TEMPLATE = subdirs SUBDIRS = blockingfortuneclient \ - broadcastreceiver \ + broadcastreceiver \ broadcastsender \ network-chat \ - download \ - downloadmanager \ + download \ + downloadmanager \ fortuneclient \ fortuneserver \ ftp \ @@ -12,7 +12,9 @@ SUBDIRS = blockingfortuneclient \ loopback \ threadedfortuneserver \ googlesuggest \ - torrent + torrent + +symbian: SUBDIRS = ftp contains(QT_CONFIG, openssl):SUBDIRS += securesocketclient @@ -20,3 +22,5 @@ contains(QT_CONFIG, openssl):SUBDIRS += securesocketclient sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS network.pro README sources.path = $$[QT_INSTALL_EXAMPLES]/network INSTALLS += sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/securesocketclient/securesocketclient.pro b/examples/network/securesocketclient/securesocketclient.pro index 4d70a71..166d7ad 100644 --- a/examples/network/securesocketclient/securesocketclient.pro +++ b/examples/network/securesocketclient/securesocketclient.pro @@ -14,3 +14,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/securesocketclient sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.png *.jpg images sources.path = $$[QT_INSTALL_EXAMPLES]/network/securesocketclient INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/threadedfortuneserver/threadedfortuneserver.pro b/examples/network/threadedfortuneserver/threadedfortuneserver.pro index 0867dac..94543bf 100644 --- a/examples/network/threadedfortuneserver/threadedfortuneserver.pro +++ b/examples/network/threadedfortuneserver/threadedfortuneserver.pro @@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/threadedfortuneserver sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS threadedfortuneserver.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/threadedfortuneserver INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/network/torrent/torrent.pro b/examples/network/torrent/torrent.pro index 10b2672..bfd5767 100644 --- a/examples/network/torrent/torrent.pro +++ b/examples/network/torrent/torrent.pro @@ -35,3 +35,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES torrent.pro *.torrent sources.files += icons forms 3rdparty sources.path = $$[QT_INSTALL_EXAMPLES]/network/torrent INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) |