summaryrefslogtreecommitdiffstats
path: root/examples/network
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-01-16 17:52:29 +0100
committerJoão Abecasis <joao.abecasis@nokia.com>2012-01-16 17:53:41 +0100
commit5b250d497fd798c476765b22a2906e1c0ff1e432 (patch)
treefd4215ca375cc2402e536bf670c2977cf64ae2ef /examples/network
parent2c52e9a5c1d6ef6cbf4577430e14027375465c96 (diff)
parent7a0099183a1c107126bda3b59a47651aac612426 (diff)
Merge remote-tracking branch 'gerrit/master' into containers
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/bearermonitor/bearermonitor.cpp2
-rw-r--r--examples/network/bearermonitor/bearermonitor.h2
-rw-r--r--examples/network/bearermonitor/main.cpp2
-rw-r--r--examples/network/bearermonitor/sessionwidget.cpp2
-rw-r--r--examples/network/bearermonitor/sessionwidget.h2
-rw-r--r--examples/network/blockingfortuneclient/blockingclient.cpp2
-rw-r--r--examples/network/blockingfortuneclient/blockingclient.h2
-rw-r--r--examples/network/blockingfortuneclient/fortunethread.cpp2
-rw-r--r--examples/network/blockingfortuneclient/fortunethread.h2
-rw-r--r--examples/network/blockingfortuneclient/main.cpp2
-rw-r--r--examples/network/broadcastreceiver/main.cpp2
-rw-r--r--examples/network/broadcastreceiver/receiver.cpp2
-rw-r--r--examples/network/broadcastreceiver/receiver.h2
-rw-r--r--examples/network/broadcastsender/main.cpp2
-rw-r--r--examples/network/broadcastsender/sender.cpp2
-rw-r--r--examples/network/broadcastsender/sender.h2
-rw-r--r--examples/network/download/main.cpp2
-rw-r--r--examples/network/downloadmanager/downloadmanager.cpp2
-rw-r--r--examples/network/downloadmanager/downloadmanager.h2
-rw-r--r--examples/network/downloadmanager/main.cpp2
-rw-r--r--examples/network/downloadmanager/textprogressbar.cpp2
-rw-r--r--examples/network/downloadmanager/textprogressbar.h2
-rw-r--r--examples/network/fortuneclient/client.cpp2
-rw-r--r--examples/network/fortuneclient/client.h2
-rw-r--r--examples/network/fortuneclient/main.cpp2
-rw-r--r--examples/network/fortuneserver/main.cpp2
-rw-r--r--examples/network/fortuneserver/server.cpp2
-rw-r--r--examples/network/fortuneserver/server.h2
-rw-r--r--examples/network/googlesuggest/googlesuggest.cpp2
-rw-r--r--examples/network/googlesuggest/googlesuggest.h2
-rw-r--r--examples/network/googlesuggest/main.cpp2
-rw-r--r--examples/network/googlesuggest/searchbox.cpp2
-rw-r--r--examples/network/googlesuggest/searchbox.h2
-rw-r--r--examples/network/http/httpwindow.cpp2
-rw-r--r--examples/network/http/httpwindow.h2
-rw-r--r--examples/network/http/main.cpp2
-rw-r--r--examples/network/loopback/dialog.cpp2
-rw-r--r--examples/network/loopback/dialog.h2
-rw-r--r--examples/network/loopback/main.cpp2
-rw-r--r--examples/network/multicastreceiver/main.cpp2
-rw-r--r--examples/network/multicastreceiver/receiver.cpp2
-rw-r--r--examples/network/multicastreceiver/receiver.h2
-rw-r--r--examples/network/multicastsender/main.cpp2
-rw-r--r--examples/network/multicastsender/sender.cpp2
-rw-r--r--examples/network/multicastsender/sender.h2
-rw-r--r--examples/network/network-chat/chatdialog.cpp2
-rw-r--r--examples/network/network-chat/chatdialog.h2
-rw-r--r--examples/network/network-chat/client.cpp2
-rw-r--r--examples/network/network-chat/client.h2
-rw-r--r--examples/network/network-chat/connection.cpp2
-rw-r--r--examples/network/network-chat/connection.h2
-rw-r--r--examples/network/network-chat/main.cpp2
-rw-r--r--examples/network/network-chat/peermanager.cpp2
-rw-r--r--examples/network/network-chat/peermanager.h2
-rw-r--r--examples/network/network-chat/server.cpp4
-rw-r--r--examples/network/network-chat/server.h4
-rw-r--r--examples/network/network.pro1
-rw-r--r--examples/network/qftp/ftp.qrc7
-rw-r--r--examples/network/qftp/ftpwindow.cpp406
-rw-r--r--examples/network/qftp/ftpwindow.h110
-rw-r--r--examples/network/qftp/images/cdtoparent.pngbin139 -> 0 bytes
-rw-r--r--examples/network/qftp/images/dir.pngbin154 -> 0 bytes
-rw-r--r--examples/network/qftp/images/file.pngbin129 -> 0 bytes
-rw-r--r--examples/network/qftp/main.cpp52
-rw-r--r--examples/network/qftp/qftp.desktop11
-rw-r--r--examples/network/qftp/qftp.pro13
-rw-r--r--examples/network/securesocketclient/certificateinfo.cpp2
-rw-r--r--examples/network/securesocketclient/certificateinfo.h2
-rw-r--r--examples/network/securesocketclient/main.cpp2
-rw-r--r--examples/network/securesocketclient/sslclient.cpp2
-rw-r--r--examples/network/securesocketclient/sslclient.h2
-rw-r--r--examples/network/threadedfortuneserver/dialog.cpp2
-rw-r--r--examples/network/threadedfortuneserver/dialog.h2
-rw-r--r--examples/network/threadedfortuneserver/fortuneserver.cpp4
-rw-r--r--examples/network/threadedfortuneserver/fortuneserver.h4
-rw-r--r--examples/network/threadedfortuneserver/fortunethread.cpp2
-rw-r--r--examples/network/threadedfortuneserver/fortunethread.h2
-rw-r--r--examples/network/threadedfortuneserver/main.cpp2
-rw-r--r--examples/network/torrent/addtorrentdialog.cpp2
-rw-r--r--examples/network/torrent/addtorrentdialog.h2
-rw-r--r--examples/network/torrent/bencodeparser.cpp2
-rw-r--r--examples/network/torrent/bencodeparser.h2
-rw-r--r--examples/network/torrent/connectionmanager.cpp2
-rw-r--r--examples/network/torrent/connectionmanager.h2
-rw-r--r--examples/network/torrent/filemanager.cpp2
-rw-r--r--examples/network/torrent/filemanager.h2
-rw-r--r--examples/network/torrent/main.cpp2
-rw-r--r--examples/network/torrent/mainwindow.cpp2
-rw-r--r--examples/network/torrent/mainwindow.h2
-rw-r--r--examples/network/torrent/metainfo.cpp2
-rw-r--r--examples/network/torrent/metainfo.h2
-rw-r--r--examples/network/torrent/peerwireclient.cpp2
-rw-r--r--examples/network/torrent/peerwireclient.h2
-rw-r--r--examples/network/torrent/ratecontroller.cpp2
-rw-r--r--examples/network/torrent/ratecontroller.h2
-rw-r--r--examples/network/torrent/torrentclient.cpp2
-rw-r--r--examples/network/torrent/torrentclient.h2
-rw-r--r--examples/network/torrent/torrentserver.cpp4
-rw-r--r--examples/network/torrent/torrentserver.h4
-rw-r--r--examples/network/torrent/trackerclient.cpp39
-rw-r--r--examples/network/torrent/trackerclient.h15
101 files changed, 129 insertions, 715 deletions
diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp
index a543c937c6..d0d406da5e 100644
--- a/examples/network/bearermonitor/bearermonitor.cpp
+++ b/examples/network/bearermonitor/bearermonitor.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/bearermonitor/bearermonitor.h b/examples/network/bearermonitor/bearermonitor.h
index c4199d6230..41672344c7 100644
--- a/examples/network/bearermonitor/bearermonitor.h
+++ b/examples/network/bearermonitor/bearermonitor.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/bearermonitor/main.cpp b/examples/network/bearermonitor/main.cpp
index cc6d918ee7..eb07302433 100644
--- a/examples/network/bearermonitor/main.cpp
+++ b/examples/network/bearermonitor/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/bearermonitor/sessionwidget.cpp b/examples/network/bearermonitor/sessionwidget.cpp
index eed3660ca0..c827e393b1 100644
--- a/examples/network/bearermonitor/sessionwidget.cpp
+++ b/examples/network/bearermonitor/sessionwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/bearermonitor/sessionwidget.h b/examples/network/bearermonitor/sessionwidget.h
index 4b14993082..21488ab0a6 100644
--- a/examples/network/bearermonitor/sessionwidget.h
+++ b/examples/network/bearermonitor/sessionwidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/blockingfortuneclient/blockingclient.cpp b/examples/network/blockingfortuneclient/blockingclient.cpp
index 8867e25678..2961f79498 100644
--- a/examples/network/blockingfortuneclient/blockingclient.cpp
+++ b/examples/network/blockingfortuneclient/blockingclient.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/blockingfortuneclient/blockingclient.h b/examples/network/blockingfortuneclient/blockingclient.h
index 99b97f13c5..ba564d9311 100644
--- a/examples/network/blockingfortuneclient/blockingclient.h
+++ b/examples/network/blockingfortuneclient/blockingclient.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/blockingfortuneclient/fortunethread.cpp b/examples/network/blockingfortuneclient/fortunethread.cpp
index ad3688bc5a..41b1a9187a 100644
--- a/examples/network/blockingfortuneclient/fortunethread.cpp
+++ b/examples/network/blockingfortuneclient/fortunethread.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/blockingfortuneclient/fortunethread.h b/examples/network/blockingfortuneclient/fortunethread.h
index 3f4ca25c86..3e426fa7bb 100644
--- a/examples/network/blockingfortuneclient/fortunethread.h
+++ b/examples/network/blockingfortuneclient/fortunethread.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/blockingfortuneclient/main.cpp b/examples/network/blockingfortuneclient/main.cpp
index b67464089b..d2eaf7a05a 100644
--- a/examples/network/blockingfortuneclient/main.cpp
+++ b/examples/network/blockingfortuneclient/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/broadcastreceiver/main.cpp b/examples/network/broadcastreceiver/main.cpp
index 748f4b5de1..7b451e0192 100644
--- a/examples/network/broadcastreceiver/main.cpp
+++ b/examples/network/broadcastreceiver/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/broadcastreceiver/receiver.cpp b/examples/network/broadcastreceiver/receiver.cpp
index 6a49046c91..e9dec57452 100644
--- a/examples/network/broadcastreceiver/receiver.cpp
+++ b/examples/network/broadcastreceiver/receiver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/broadcastreceiver/receiver.h b/examples/network/broadcastreceiver/receiver.h
index 7a282d2253..a415c83cda 100644
--- a/examples/network/broadcastreceiver/receiver.h
+++ b/examples/network/broadcastreceiver/receiver.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/broadcastsender/main.cpp b/examples/network/broadcastsender/main.cpp
index 7c70255aec..e610902975 100644
--- a/examples/network/broadcastsender/main.cpp
+++ b/examples/network/broadcastsender/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/broadcastsender/sender.cpp b/examples/network/broadcastsender/sender.cpp
index 33b34a4a4c..9ddca66604 100644
--- a/examples/network/broadcastsender/sender.cpp
+++ b/examples/network/broadcastsender/sender.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/broadcastsender/sender.h b/examples/network/broadcastsender/sender.h
index 666269f38e..55bc7f2672 100644
--- a/examples/network/broadcastsender/sender.h
+++ b/examples/network/broadcastsender/sender.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/download/main.cpp b/examples/network/download/main.cpp
index 1b7e54ba11..22d3b1db13 100644
--- a/examples/network/download/main.cpp
+++ b/examples/network/download/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/downloadmanager/downloadmanager.cpp b/examples/network/downloadmanager/downloadmanager.cpp
index d58ffdf99d..30f982e42e 100644
--- a/examples/network/downloadmanager/downloadmanager.cpp
+++ b/examples/network/downloadmanager/downloadmanager.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/downloadmanager/downloadmanager.h b/examples/network/downloadmanager/downloadmanager.h
index 98e72b0f4c..389982835e 100644
--- a/examples/network/downloadmanager/downloadmanager.h
+++ b/examples/network/downloadmanager/downloadmanager.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/downloadmanager/main.cpp b/examples/network/downloadmanager/main.cpp
index ed738472f7..cb1c015b84 100644
--- a/examples/network/downloadmanager/main.cpp
+++ b/examples/network/downloadmanager/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/downloadmanager/textprogressbar.cpp b/examples/network/downloadmanager/textprogressbar.cpp
index 0303752b4b..cb986bd489 100644
--- a/examples/network/downloadmanager/textprogressbar.cpp
+++ b/examples/network/downloadmanager/textprogressbar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/downloadmanager/textprogressbar.h b/examples/network/downloadmanager/textprogressbar.h
index 3d2be5565a..d42c357419 100644
--- a/examples/network/downloadmanager/textprogressbar.h
+++ b/examples/network/downloadmanager/textprogressbar.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/fortuneclient/client.cpp b/examples/network/fortuneclient/client.cpp
index 27443659df..1c5f1acf81 100644
--- a/examples/network/fortuneclient/client.cpp
+++ b/examples/network/fortuneclient/client.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/fortuneclient/client.h b/examples/network/fortuneclient/client.h
index f4a76c4dc2..1573580dda 100644
--- a/examples/network/fortuneclient/client.h
+++ b/examples/network/fortuneclient/client.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/fortuneclient/main.cpp b/examples/network/fortuneclient/main.cpp
index f6c459ee90..3678daece8 100644
--- a/examples/network/fortuneclient/main.cpp
+++ b/examples/network/fortuneclient/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/fortuneserver/main.cpp b/examples/network/fortuneserver/main.cpp
index 6c0e9ee9f3..77e3efa009 100644
--- a/examples/network/fortuneserver/main.cpp
+++ b/examples/network/fortuneserver/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/fortuneserver/server.cpp b/examples/network/fortuneserver/server.cpp
index 9ce6b650e0..e73c97b149 100644
--- a/examples/network/fortuneserver/server.cpp
+++ b/examples/network/fortuneserver/server.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/fortuneserver/server.h b/examples/network/fortuneserver/server.h
index a04dfa9e71..68402cad42 100644
--- a/examples/network/fortuneserver/server.h
+++ b/examples/network/fortuneserver/server.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/googlesuggest/googlesuggest.cpp b/examples/network/googlesuggest/googlesuggest.cpp
index ed9ff6a20e..ad8c94353d 100644
--- a/examples/network/googlesuggest/googlesuggest.cpp
+++ b/examples/network/googlesuggest/googlesuggest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/googlesuggest/googlesuggest.h b/examples/network/googlesuggest/googlesuggest.h
index 6b4abff5d9..b5787c8adc 100644
--- a/examples/network/googlesuggest/googlesuggest.h
+++ b/examples/network/googlesuggest/googlesuggest.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/googlesuggest/main.cpp b/examples/network/googlesuggest/main.cpp
index f20e8f6c0e..2f51df138b 100644
--- a/examples/network/googlesuggest/main.cpp
+++ b/examples/network/googlesuggest/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/googlesuggest/searchbox.cpp b/examples/network/googlesuggest/searchbox.cpp
index cf22fd1369..00960d488e 100644
--- a/examples/network/googlesuggest/searchbox.cpp
+++ b/examples/network/googlesuggest/searchbox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/googlesuggest/searchbox.h b/examples/network/googlesuggest/searchbox.h
index 5ffcbc8614..30dfae1c79 100644
--- a/examples/network/googlesuggest/searchbox.h
+++ b/examples/network/googlesuggest/searchbox.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp
index 082dc910ca..15492daff4 100644
--- a/examples/network/http/httpwindow.cpp
+++ b/examples/network/http/httpwindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/http/httpwindow.h b/examples/network/http/httpwindow.h
index 0ec87af48a..01d7ca1cd2 100644
--- a/examples/network/http/httpwindow.h
+++ b/examples/network/http/httpwindow.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/http/main.cpp b/examples/network/http/main.cpp
index ae20f6f41c..e66d2ea1fa 100644
--- a/examples/network/http/main.cpp
+++ b/examples/network/http/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/loopback/dialog.cpp b/examples/network/loopback/dialog.cpp
index 34fc999dcc..b7d970b5ef 100644
--- a/examples/network/loopback/dialog.cpp
+++ b/examples/network/loopback/dialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/loopback/dialog.h b/examples/network/loopback/dialog.h
index 8261b2279a..0b55f7cd42 100644
--- a/examples/network/loopback/dialog.h
+++ b/examples/network/loopback/dialog.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/loopback/main.cpp b/examples/network/loopback/main.cpp
index 03ac9ad84c..397075ff3b 100644
--- a/examples/network/loopback/main.cpp
+++ b/examples/network/loopback/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/multicastreceiver/main.cpp b/examples/network/multicastreceiver/main.cpp
index 041163178d..b14e222950 100644
--- a/examples/network/multicastreceiver/main.cpp
+++ b/examples/network/multicastreceiver/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/multicastreceiver/receiver.cpp b/examples/network/multicastreceiver/receiver.cpp
index 8db3042a4e..767aef52c2 100644
--- a/examples/network/multicastreceiver/receiver.cpp
+++ b/examples/network/multicastreceiver/receiver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/multicastreceiver/receiver.h b/examples/network/multicastreceiver/receiver.h
index fd1a67377f..9a5796cd38 100644
--- a/examples/network/multicastreceiver/receiver.h
+++ b/examples/network/multicastreceiver/receiver.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/multicastsender/main.cpp b/examples/network/multicastsender/main.cpp
index 56e35c9540..163dfcb655 100644
--- a/examples/network/multicastsender/main.cpp
+++ b/examples/network/multicastsender/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/multicastsender/sender.cpp b/examples/network/multicastsender/sender.cpp
index 6172f07063..842f97579b 100644
--- a/examples/network/multicastsender/sender.cpp
+++ b/examples/network/multicastsender/sender.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/multicastsender/sender.h b/examples/network/multicastsender/sender.h
index 75ce4c93ea..ebcbdd3bd3 100644
--- a/examples/network/multicastsender/sender.h
+++ b/examples/network/multicastsender/sender.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/network-chat/chatdialog.cpp b/examples/network/network-chat/chatdialog.cpp
index 9ad042e05f..732f43626a 100644
--- a/examples/network/network-chat/chatdialog.cpp
+++ b/examples/network/network-chat/chatdialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/network-chat/chatdialog.h b/examples/network/network-chat/chatdialog.h
index 258206a905..2007acac2c 100644
--- a/examples/network/network-chat/chatdialog.h
+++ b/examples/network/network-chat/chatdialog.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/network-chat/client.cpp b/examples/network/network-chat/client.cpp
index d9f594e8ac..f80b3783ef 100644
--- a/examples/network/network-chat/client.cpp
+++ b/examples/network/network-chat/client.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/network-chat/client.h b/examples/network/network-chat/client.h
index 317fef36a8..9227b894a8 100644
--- a/examples/network/network-chat/client.h
+++ b/examples/network/network-chat/client.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/network-chat/connection.cpp b/examples/network/network-chat/connection.cpp
index 9171d1fc5f..e02186fb85 100644
--- a/examples/network/network-chat/connection.cpp
+++ b/examples/network/network-chat/connection.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/network-chat/connection.h b/examples/network/network-chat/connection.h
index 5db5cc59e8..126ad53674 100644
--- a/examples/network/network-chat/connection.h
+++ b/examples/network/network-chat/connection.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/network-chat/main.cpp b/examples/network/network-chat/main.cpp
index 94a4dacae8..05afc004da 100644
--- a/examples/network/network-chat/main.cpp
+++ b/examples/network/network-chat/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/network-chat/peermanager.cpp b/examples/network/network-chat/peermanager.cpp
index a0374e7e7e..d774ce4158 100644
--- a/examples/network/network-chat/peermanager.cpp
+++ b/examples/network/network-chat/peermanager.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/network-chat/peermanager.h b/examples/network/network-chat/peermanager.h
index a061bbbb53..b100d19652 100644
--- a/examples/network/network-chat/peermanager.h
+++ b/examples/network/network-chat/peermanager.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/network-chat/server.cpp b/examples/network/network-chat/server.cpp
index 4a3a28298a..f27cfa3894 100644
--- a/examples/network/network-chat/server.cpp
+++ b/examples/network/network-chat/server.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -49,7 +49,7 @@ Server::Server(QObject *parent)
listen(QHostAddress::Any);
}
-void Server::incomingConnection(int socketDescriptor)
+void Server::incomingConnection(qintptr socketDescriptor)
{
Connection *connection = new Connection(this);
connection->setSocketDescriptor(socketDescriptor);
diff --git a/examples/network/network-chat/server.h b/examples/network/network-chat/server.h
index 0d88c873da..8222bd3c50 100644
--- a/examples/network/network-chat/server.h
+++ b/examples/network/network-chat/server.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -56,7 +56,7 @@ signals:
void newConnection(Connection *connection);
protected:
- void incomingConnection(int socketDescriptor);
+ void incomingConnection(qintptr socketDescriptor);
};
#endif
diff --git a/examples/network/network.pro b/examples/network/network.pro
index f12a6a1d47..0496cbb242 100644
--- a/examples/network/network.pro
+++ b/examples/network/network.pro
@@ -10,7 +10,6 @@ SUBDIRS = \
broadcastsender \
fortuneclient \
fortuneserver \
- qftp \
http \
loopback \
threadedfortuneserver \
diff --git a/examples/network/qftp/ftp.qrc b/examples/network/qftp/ftp.qrc
deleted file mode 100644
index b598ab8829..0000000000
--- a/examples/network/qftp/ftp.qrc
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>images/cdtoparent.png</file>
- <file>images/dir.png</file>
- <file>images/file.png</file>
-</qresource>
-</RCC>
diff --git a/examples/network/qftp/ftpwindow.cpp b/examples/network/qftp/ftpwindow.cpp
deleted file mode 100644
index ba568d6ec0..0000000000
--- a/examples/network/qftp/ftpwindow.cpp
+++ /dev/null
@@ -1,406 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtWidgets>
-#include <QtNetwork>
-
-#include "ftpwindow.h"
-
-FtpWindow::FtpWindow(QWidget *parent)
- : QDialog(parent), ftp(0), networkSession(0)
-{
- ftpServerLabel = new QLabel(tr("Ftp &server:"));
- ftpServerLineEdit = new QLineEdit("ftp.qt.nokia.com");
- ftpServerLabel->setBuddy(ftpServerLineEdit);
-
- statusLabel = new QLabel(tr("Please enter the name of an FTP server."));
-
- fileList = new QTreeWidget;
- fileList->setEnabled(false);
- fileList->setRootIsDecorated(false);
- fileList->setHeaderLabels(QStringList() << tr("Name") << tr("Size") << tr("Owner") << tr("Group") << tr("Time"));
- fileList->header()->setStretchLastSection(false);
-
- connectButton = new QPushButton(tr("Connect"));
- connectButton->setDefault(true);
-
- cdToParentButton = new QPushButton;
- cdToParentButton->setIcon(QPixmap(":/images/cdtoparent.png"));
- cdToParentButton->setEnabled(false);
-
- downloadButton = new QPushButton(tr("Download"));
- downloadButton->setEnabled(false);
-
- quitButton = new QPushButton(tr("Quit"));
-
- buttonBox = new QDialogButtonBox;
- buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole);
- buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
-
- progressDialog = new QProgressDialog(this);
-
- connect(fileList, SIGNAL(itemActivated(QTreeWidgetItem*,int)),
- this, SLOT(processItem(QTreeWidgetItem*,int)));
- connect(fileList, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
- this, SLOT(enableDownloadButton()));
- connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload()));
- connect(connectButton, SIGNAL(clicked()), this, SLOT(connectOrDisconnect()));
- connect(cdToParentButton, SIGNAL(clicked()), this, SLOT(cdToParent()));
- connect(downloadButton, SIGNAL(clicked()), this, SLOT(downloadFile()));
- connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
-
- QHBoxLayout *topLayout = new QHBoxLayout;
- topLayout->addWidget(ftpServerLabel);
- topLayout->addWidget(ftpServerLineEdit);
- topLayout->addWidget(cdToParentButton);
- topLayout->addWidget(connectButton);
-
- QVBoxLayout *mainLayout = new QVBoxLayout;
- mainLayout->addLayout(topLayout);
- mainLayout->addWidget(fileList);
- mainLayout->addWidget(statusLabel);
- mainLayout->addWidget(buttonBox);
- setLayout(mainLayout);
-
- setWindowTitle(tr("FTP"));
-}
-
-QSize FtpWindow::sizeHint() const
-{
- return QSize(500, 300);
-}
-
-//![0]
-void FtpWindow::connectOrDisconnect()
-{
- if (ftp) {
- ftp->abort();
- ftp->deleteLater();
- ftp = 0;
-//![0]
- fileList->setEnabled(false);
- cdToParentButton->setEnabled(false);
- downloadButton->setEnabled(false);
- connectButton->setEnabled(true);
- connectButton->setText(tr("Connect"));
-#ifndef QT_NO_CURSOR
- setCursor(Qt::ArrowCursor);
-#endif
- statusLabel->setText(tr("Please enter the name of an FTP server."));
- return;
- }
-
-#ifndef QT_NO_CURSOR
- setCursor(Qt::WaitCursor);
-#endif
-
- if (!networkSession || !networkSession->isOpen()) {
- if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
- if (!networkSession) {
- // Get saved network configuration
- QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
- settings.beginGroup(QLatin1String("QtNetwork"));
- const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
- settings.endGroup();
-
- // If the saved network configuration is not currently discovered use the system default
- QNetworkConfiguration config = manager.configurationFromIdentifier(id);
- if ((config.state() & QNetworkConfiguration::Discovered) !=
- QNetworkConfiguration::Discovered) {
- config = manager.defaultConfiguration();
- }
-
- networkSession = new QNetworkSession(config, this);
- connect(networkSession, SIGNAL(opened()), this, SLOT(connectToFtp()));
- connect(networkSession, SIGNAL(error(QNetworkSession::SessionError)), this, SLOT(enableConnectButton()));
- }
- connectButton->setEnabled(false);
- statusLabel->setText(tr("Opening network session."));
- networkSession->open();
- return;
- }
- }
- connectToFtp();
-}
-
-void FtpWindow::connectToFtp()
-{
-//![1]
- ftp = new QFtp(this);
- connect(ftp, SIGNAL(commandFinished(int,bool)),
- this, SLOT(ftpCommandFinished(int,bool)));
- connect(ftp, SIGNAL(listInfo(QUrlInfo)),
- this, SLOT(addToList(QUrlInfo)));
- connect(ftp, SIGNAL(dataTransferProgress(qint64,qint64)),
- this, SLOT(updateDataTransferProgress(qint64,qint64)));
-
- fileList->clear();
- currentPath.clear();
- isDirectory.clear();
-//![1]
-
-//![2]
- QUrl url(ftpServerLineEdit->text());
- if (!url.isValid() || url.scheme().toLower() != QLatin1String("ftp")) {
- ftp->connectToHost(ftpServerLineEdit->text(), 21);
- ftp->login();
- } else {
- ftp->connectToHost(url.host(), url.port(21));
-
- if (!url.userName().isEmpty())
- ftp->login(QUrl::fromPercentEncoding(url.userName().toLatin1()), url.password());
- else
- ftp->login();
- if (!url.path().isEmpty())
- ftp->cd(url.path());
- }
-//![2]
-
- fileList->setEnabled(true);
- connectButton->setEnabled(false);
- connectButton->setText(tr("Disconnect"));
- statusLabel->setText(tr("Connecting to FTP server %1...")
- .arg(ftpServerLineEdit->text()));
-}
-
-//![3]
-void FtpWindow::downloadFile()
-{
- QString fileName = fileList->currentItem()->text(0);
-//![3]
-//
- if (QFile::exists(fileName)) {
- QMessageBox::information(this, tr("FTP"),
- tr("There already exists a file called %1 in "
- "the current directory.")
- .arg(fileName));
- return;
- }
-
-//![4]
- file = new QFile(fileName);
- if (!file->open(QIODevice::WriteOnly)) {
- QMessageBox::information(this, tr("FTP"),
- tr("Unable to save the file %1: %2.")
- .arg(fileName).arg(file->errorString()));
- delete file;
- return;
- }
-
- ftp->get(fileList->currentItem()->text(0), file);
-
- progressDialog->setLabelText(tr("Downloading %1...").arg(fileName));
- downloadButton->setEnabled(false);
- progressDialog->exec();
-}
-//![4]
-
-//![5]
-void FtpWindow::cancelDownload()
-{
- ftp->abort();
-
- if (file->exists()) {
- file->close();
- file->remove();
- }
- delete file;
-}
-//![5]
-
-//![6]
-void FtpWindow::ftpCommandFinished(int, bool error)
-{
-#ifndef QT_NO_CURSOR
- setCursor(Qt::ArrowCursor);
-#endif
-
- if (ftp->currentCommand() == QFtp::ConnectToHost) {
- if (error) {
- QMessageBox::information(this, tr("FTP"),
- tr("Unable to connect to the FTP server "
- "at %1. Please check that the host "
- "name is correct.")
- .arg(ftpServerLineEdit->text()));
- connectOrDisconnect();
- return;
- }
- statusLabel->setText(tr("Logged onto %1.")
- .arg(ftpServerLineEdit->text()));
- fileList->setFocus();
- downloadButton->setDefault(true);
- connectButton->setEnabled(true);
- return;
- }
-//![6]
-
-//![7]
- if (ftp->currentCommand() == QFtp::Login)
- ftp->list();
-//![7]
-
-//![8]
- if (ftp->currentCommand() == QFtp::Get) {
- if (error) {
- statusLabel->setText(tr("Canceled download of %1.")
- .arg(file->fileName()));
- file->close();
- file->remove();
- } else {
- statusLabel->setText(tr("Downloaded %1 to current directory.")
- .arg(file->fileName()));
- file->close();
- }
- delete file;
- enableDownloadButton();
- progressDialog->hide();
-//![8]
-//![9]
- } else if (ftp->currentCommand() == QFtp::List) {
- if (isDirectory.isEmpty()) {
- fileList->addTopLevelItem(new QTreeWidgetItem(QStringList() << tr("<empty>")));
- fileList->setEnabled(false);
- }
- }
-//![9]
-}
-
-//![10]
-void FtpWindow::addToList(const QUrlInfo &urlInfo)
-{
- QTreeWidgetItem *item = new QTreeWidgetItem;
- item->setText(0, urlInfo.name());
- item->setText(1, QString::number(urlInfo.size()));
- item->setText(2, urlInfo.owner());
- item->setText(3, urlInfo.group());
- item->setText(4, urlInfo.lastModified().toString("MMM dd yyyy"));
-
- QPixmap pixmap(urlInfo.isDir() ? ":/images/dir.png" : ":/images/file.png");
- item->setIcon(0, pixmap);
-
- isDirectory[urlInfo.name()] = urlInfo.isDir();
- fileList->addTopLevelItem(item);
- if (!fileList->currentItem()) {
- fileList->setCurrentItem(fileList->topLevelItem(0));
- fileList->setEnabled(true);
- }
-}
-//![10]
-
-//![11]
-void FtpWindow::processItem(QTreeWidgetItem *item, int /*column*/)
-{
- QString name = item->text(0);
- if (isDirectory.value(name)) {
- fileList->clear();
- isDirectory.clear();
- currentPath += '/';
- currentPath += name;
- ftp->cd(name);
- ftp->list();
- cdToParentButton->setEnabled(true);
-#ifndef QT_NO_CURSOR
- setCursor(Qt::WaitCursor);
-#endif
- return;
- }
-}
-//![11]
-
-//![12]
-void FtpWindow::cdToParent()
-{
-#ifndef QT_NO_CURSOR
- setCursor(Qt::WaitCursor);
-#endif
- fileList->clear();
- isDirectory.clear();
- currentPath = currentPath.left(currentPath.lastIndexOf('/'));
- if (currentPath.isEmpty()) {
- cdToParentButton->setEnabled(false);
- ftp->cd("/");
- } else {
- ftp->cd(currentPath);
- }
- ftp->list();
-}
-//![12]
-
-//![13]
-void FtpWindow::updateDataTransferProgress(qint64 readBytes,
- qint64 totalBytes)
-{
- progressDialog->setMaximum(totalBytes);
- progressDialog->setValue(readBytes);
-}
-//![13]
-
-//![14]
-void FtpWindow::enableDownloadButton()
-{
- QTreeWidgetItem *current = fileList->currentItem();
- if (current) {
- QString currentFile = current->text(0);
- downloadButton->setEnabled(!isDirectory.value(currentFile));
- } else {
- downloadButton->setEnabled(false);
- }
-}
-//![14]
-
-void FtpWindow::enableConnectButton()
-{
- // Save the used configuration
- QNetworkConfiguration config = networkSession->configuration();
- QString id;
- if (config.type() == QNetworkConfiguration::UserChoice)
- id = networkSession->sessionProperty(QLatin1String("UserChoiceConfiguration")).toString();
- else
- id = config.identifier();
-
- QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
- settings.beginGroup(QLatin1String("QtNetwork"));
- settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
- settings.endGroup();
-
- connectButton->setEnabled(true);
- statusLabel->setText(tr("Please enter the name of an FTP server."));
-}
-
diff --git a/examples/network/qftp/ftpwindow.h b/examples/network/qftp/ftpwindow.h
deleted file mode 100644
index f060bfc0ce..0000000000
--- a/examples/network/qftp/ftpwindow.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef FTPWINDOW_H
-#define FTPWINDOW_H
-
-#include <QDialog>
-#include <QHash>
-#include <QNetworkConfigurationManager>
-
-QT_BEGIN_NAMESPACE
-class QDialogButtonBox;
-class QFile;
-class QFtp;
-class QLabel;
-class QLineEdit;
-class QTreeWidget;
-class QTreeWidgetItem;
-class QProgressDialog;
-class QPushButton;
-class QUrlInfo;
-class QNetworkSession;
-QT_END_NAMESPACE
-
-class FtpWindow : public QDialog
-{
- Q_OBJECT
-
-public:
- FtpWindow(QWidget *parent = 0);
- QSize sizeHint() const;
-
-//![0]
-private slots:
- void connectOrDisconnect();
- void downloadFile();
- void cancelDownload();
- void connectToFtp();
-
- void ftpCommandFinished(int commandId, bool error);
- void addToList(const QUrlInfo &urlInfo);
- void processItem(QTreeWidgetItem *item, int column);
- void cdToParent();
- void updateDataTransferProgress(qint64 readBytes,
- qint64 totalBytes);
- void enableDownloadButton();
- void enableConnectButton();
-//![0]
-
-private:
- QLabel *ftpServerLabel;
- QLineEdit *ftpServerLineEdit;
- QLabel *statusLabel;
- QTreeWidget *fileList;
- QPushButton *cdToParentButton;
- QPushButton *connectButton;
- QPushButton *downloadButton;
- QPushButton *quitButton;
- QDialogButtonBox *buttonBox;
- QProgressDialog *progressDialog;
-
-//![1]
- QHash<QString, bool> isDirectory;
- QString currentPath;
- QFtp *ftp;
- QFile *file;
-
- QNetworkSession *networkSession;
- QNetworkConfigurationManager manager;
-//![1]
-};
-
-#endif
diff --git a/examples/network/qftp/images/cdtoparent.png b/examples/network/qftp/images/cdtoparent.png
deleted file mode 100644
index 24b6180829..0000000000
--- a/examples/network/qftp/images/cdtoparent.png
+++ /dev/null
Binary files differ
diff --git a/examples/network/qftp/images/dir.png b/examples/network/qftp/images/dir.png
deleted file mode 100644
index 0ce5ae75fc..0000000000
--- a/examples/network/qftp/images/dir.png
+++ /dev/null
Binary files differ
diff --git a/examples/network/qftp/images/file.png b/examples/network/qftp/images/file.png
deleted file mode 100644
index be6c53089a..0000000000
--- a/examples/network/qftp/images/file.png
+++ /dev/null
Binary files differ
diff --git a/examples/network/qftp/main.cpp b/examples/network/qftp/main.cpp
deleted file mode 100644
index 15689b5a55..0000000000
--- a/examples/network/qftp/main.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include "ftpwindow.h"
-
-
-int main(int argc, char *argv[])
-{
- Q_INIT_RESOURCE(ftp);
- QApplication app(argc, argv);
- FtpWindow ftpWin;
- ftpWin.show();
- return ftpWin.exec();
-}
diff --git a/examples/network/qftp/qftp.desktop b/examples/network/qftp/qftp.desktop
deleted file mode 100644
index 6149fe96df..0000000000
--- a/examples/network/qftp/qftp.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Name=FTP
-Exec=/opt/usr/bin/qftp
-Icon=qftp
-X-Window-Icon=
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
diff --git a/examples/network/qftp/qftp.pro b/examples/network/qftp/qftp.pro
deleted file mode 100644
index c554b37a03..0000000000
--- a/examples/network/qftp/qftp.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-QT += widgets
-
-HEADERS = ftpwindow.h
-SOURCES = ftpwindow.cpp \
- main.cpp
-RESOURCES += ftp.qrc
-QT += network
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/qftp
-sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro images
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/qftp
-INSTALLS += target sources
diff --git a/examples/network/securesocketclient/certificateinfo.cpp b/examples/network/securesocketclient/certificateinfo.cpp
index 9c9ffdeb4c..a3976dac16 100644
--- a/examples/network/securesocketclient/certificateinfo.cpp
+++ b/examples/network/securesocketclient/certificateinfo.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/securesocketclient/certificateinfo.h b/examples/network/securesocketclient/certificateinfo.h
index cc5cc34e8a..3c54e2c229 100644
--- a/examples/network/securesocketclient/certificateinfo.h
+++ b/examples/network/securesocketclient/certificateinfo.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/securesocketclient/main.cpp b/examples/network/securesocketclient/main.cpp
index c15534b523..349752d0ce 100644
--- a/examples/network/securesocketclient/main.cpp
+++ b/examples/network/securesocketclient/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/securesocketclient/sslclient.cpp b/examples/network/securesocketclient/sslclient.cpp
index 8d862c4c56..8527337e1b 100644
--- a/examples/network/securesocketclient/sslclient.cpp
+++ b/examples/network/securesocketclient/sslclient.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/securesocketclient/sslclient.h b/examples/network/securesocketclient/sslclient.h
index 4e0bc1891f..5c1317f131 100644
--- a/examples/network/securesocketclient/sslclient.h
+++ b/examples/network/securesocketclient/sslclient.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/threadedfortuneserver/dialog.cpp b/examples/network/threadedfortuneserver/dialog.cpp
index 2340a6bc5a..94a0c657e3 100644
--- a/examples/network/threadedfortuneserver/dialog.cpp
+++ b/examples/network/threadedfortuneserver/dialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/threadedfortuneserver/dialog.h b/examples/network/threadedfortuneserver/dialog.h
index 19a6fc2f47..1fdc4b21a0 100644
--- a/examples/network/threadedfortuneserver/dialog.h
+++ b/examples/network/threadedfortuneserver/dialog.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/threadedfortuneserver/fortuneserver.cpp b/examples/network/threadedfortuneserver/fortuneserver.cpp
index 7179ba51e8..9363497f76 100644
--- a/examples/network/threadedfortuneserver/fortuneserver.cpp
+++ b/examples/network/threadedfortuneserver/fortuneserver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -58,7 +58,7 @@ FortuneServer::FortuneServer(QObject *parent)
//! [0]
//! [1]
-void FortuneServer::incomingConnection(int socketDescriptor)
+void FortuneServer::incomingConnection(qintptr socketDescriptor)
{
QString fortune = fortunes.at(qrand() % fortunes.size());
FortuneThread *thread = new FortuneThread(socketDescriptor, fortune, this);
diff --git a/examples/network/threadedfortuneserver/fortuneserver.h b/examples/network/threadedfortuneserver/fortuneserver.h
index 785a72e27e..8d1a6ed151 100644
--- a/examples/network/threadedfortuneserver/fortuneserver.h
+++ b/examples/network/threadedfortuneserver/fortuneserver.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -53,7 +53,7 @@ public:
FortuneServer(QObject *parent = 0);
protected:
- void incomingConnection(int socketDescriptor);
+ void incomingConnection(qintptr socketDescriptor);
private:
QStringList fortunes;
diff --git a/examples/network/threadedfortuneserver/fortunethread.cpp b/examples/network/threadedfortuneserver/fortunethread.cpp
index e9878e06d7..18c8f1f25a 100644
--- a/examples/network/threadedfortuneserver/fortunethread.cpp
+++ b/examples/network/threadedfortuneserver/fortunethread.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/threadedfortuneserver/fortunethread.h b/examples/network/threadedfortuneserver/fortunethread.h
index 1d6f5608d8..b3b8a20ae4 100644
--- a/examples/network/threadedfortuneserver/fortunethread.h
+++ b/examples/network/threadedfortuneserver/fortunethread.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/threadedfortuneserver/main.cpp b/examples/network/threadedfortuneserver/main.cpp
index 0bf75aa18c..1174b7e827 100644
--- a/examples/network/threadedfortuneserver/main.cpp
+++ b/examples/network/threadedfortuneserver/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/addtorrentdialog.cpp b/examples/network/torrent/addtorrentdialog.cpp
index c78535a309..5e473df15e 100644
--- a/examples/network/torrent/addtorrentdialog.cpp
+++ b/examples/network/torrent/addtorrentdialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/addtorrentdialog.h b/examples/network/torrent/addtorrentdialog.h
index 09aa48c354..649296bdb2 100644
--- a/examples/network/torrent/addtorrentdialog.h
+++ b/examples/network/torrent/addtorrentdialog.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/bencodeparser.cpp b/examples/network/torrent/bencodeparser.cpp
index edb04c6d6b..cccaede179 100644
--- a/examples/network/torrent/bencodeparser.cpp
+++ b/examples/network/torrent/bencodeparser.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/bencodeparser.h b/examples/network/torrent/bencodeparser.h
index de8b8ffd93..6e137a62e3 100644
--- a/examples/network/torrent/bencodeparser.h
+++ b/examples/network/torrent/bencodeparser.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/connectionmanager.cpp b/examples/network/torrent/connectionmanager.cpp
index 889933ea83..7c55c1f6a2 100644
--- a/examples/network/torrent/connectionmanager.cpp
+++ b/examples/network/torrent/connectionmanager.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/connectionmanager.h b/examples/network/torrent/connectionmanager.h
index ef38507e45..90ce2841ec 100644
--- a/examples/network/torrent/connectionmanager.h
+++ b/examples/network/torrent/connectionmanager.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/filemanager.cpp b/examples/network/torrent/filemanager.cpp
index b4dfb25bca..bcb53f2685 100644
--- a/examples/network/torrent/filemanager.cpp
+++ b/examples/network/torrent/filemanager.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/filemanager.h b/examples/network/torrent/filemanager.h
index cf1a0f706b..cd59b57f9d 100644
--- a/examples/network/torrent/filemanager.h
+++ b/examples/network/torrent/filemanager.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/main.cpp b/examples/network/torrent/main.cpp
index 1023ae85a7..eaa637699b 100644
--- a/examples/network/torrent/main.cpp
+++ b/examples/network/torrent/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/mainwindow.cpp b/examples/network/torrent/mainwindow.cpp
index 3d264eb272..56a56ee164 100644
--- a/examples/network/torrent/mainwindow.cpp
+++ b/examples/network/torrent/mainwindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/mainwindow.h b/examples/network/torrent/mainwindow.h
index 0d42c91ce4..12d9a4fea0 100644
--- a/examples/network/torrent/mainwindow.h
+++ b/examples/network/torrent/mainwindow.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/metainfo.cpp b/examples/network/torrent/metainfo.cpp
index ba55ebace6..15efe7c30f 100644
--- a/examples/network/torrent/metainfo.cpp
+++ b/examples/network/torrent/metainfo.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/metainfo.h b/examples/network/torrent/metainfo.h
index afa824d74b..39c8e17e08 100644
--- a/examples/network/torrent/metainfo.h
+++ b/examples/network/torrent/metainfo.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/peerwireclient.cpp b/examples/network/torrent/peerwireclient.cpp
index 0d9580eeff..fa51343db6 100644
--- a/examples/network/torrent/peerwireclient.cpp
+++ b/examples/network/torrent/peerwireclient.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/peerwireclient.h b/examples/network/torrent/peerwireclient.h
index b8f8cb56e5..96d5c49770 100644
--- a/examples/network/torrent/peerwireclient.h
+++ b/examples/network/torrent/peerwireclient.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/ratecontroller.cpp b/examples/network/torrent/ratecontroller.cpp
index 47cf177ccb..af497a4437 100644
--- a/examples/network/torrent/ratecontroller.cpp
+++ b/examples/network/torrent/ratecontroller.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/ratecontroller.h b/examples/network/torrent/ratecontroller.h
index 4949abb641..20b7df4664 100644
--- a/examples/network/torrent/ratecontroller.h
+++ b/examples/network/torrent/ratecontroller.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/torrentclient.cpp b/examples/network/torrent/torrentclient.cpp
index 3df1bb886f..46f44a853b 100644
--- a/examples/network/torrent/torrentclient.cpp
+++ b/examples/network/torrent/torrentclient.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/torrentclient.h b/examples/network/torrent/torrentclient.h
index 7978e8e1f4..75bef55924 100644
--- a/examples/network/torrent/torrentclient.h
+++ b/examples/network/torrent/torrentclient.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/examples/network/torrent/torrentserver.cpp b/examples/network/torrent/torrentserver.cpp
index 7a9ff67972..ecc7ba098c 100644
--- a/examples/network/torrent/torrentserver.cpp
+++ b/examples/network/torrent/torrentserver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -61,7 +61,7 @@ void TorrentServer::removeClient(TorrentClient *client)
clients.removeAll(client);
}
-void TorrentServer::incomingConnection(int socketDescriptor)
+void TorrentServer::incomingConnection(qintptr socketDescriptor)
{
PeerWireClient *client =
new PeerWireClient(ConnectionManager::instance()->clientId(), this);
diff --git a/examples/network/torrent/torrentserver.h b/examples/network/torrent/torrentserver.h
index 2622384cfd..fd939ae641 100644
--- a/examples/network/torrent/torrentserver.h
+++ b/examples/network/torrent/torrentserver.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -58,7 +58,7 @@ public:
void removeClient(TorrentClient *client);
protected:
- void incomingConnection(int socketDescriptor);
+ void incomingConnection(qintptr socketDescriptor);
private slots:
void removeClient();
diff --git a/examples/network/torrent/trackerclient.cpp b/examples/network/torrent/trackerclient.cpp
index 0b9a5815c9..43c60ac9bd 100644
--- a/examples/network/torrent/trackerclient.cpp
+++ b/examples/network/torrent/trackerclient.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -45,6 +45,7 @@
#include "trackerclient.h"
#include <QtCore>
+#include <QNetworkRequest>
TrackerClient::TrackerClient(TorrentClient *downloader, QObject *parent)
: QObject(parent), torrentDownloader(downloader)
@@ -56,7 +57,7 @@ TrackerClient::TrackerClient(TorrentClient *downloader, QObject *parent)
lastTrackerRequest = false;
firstSeeding = true;
- connect(&http, SIGNAL(done(bool)), this, SLOT(httpRequestDone(bool)));
+ connect(&http, SIGNAL(finished(QNetworkReply*)), this, SLOT(httpRequestDone(QNetworkReply*)));
}
void TrackerClient::start(const MetaInfo &info)
@@ -82,15 +83,13 @@ void TrackerClient::startSeeding()
void TrackerClient::stop()
{
lastTrackerRequest = true;
- http.abort();
fetchPeerList();
}
void TrackerClient::timerEvent(QTimerEvent *event)
{
if (event->timerId() == requestIntervalTimer) {
- if (http.state() == QHttp::Unconnected)
- fetchPeerList();
+ fetchPeerList();
} else {
QObject::timerEvent(event);
}
@@ -148,32 +147,35 @@ void TrackerClient::fetchPeerList()
if (!trackerId.isEmpty())
query += "&trackerid=" + trackerId;
- http.setHost(url.host(), url.port() == -1 ? 80 : url.port());
- if (!url.userName().isEmpty())
- http.setUser(url.userName(), url.password());
- http.get(query);
+ QNetworkRequest req(url);
+ if (!url.userName().isEmpty()) {
+ uname = url.userName();
+ pwd = url.password();
+ connect(&http, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(provideAuthentication(QNetworkReply*,QAuthenticator*)));
+ }
+ http.get(req);
}
-void TrackerClient::httpRequestDone(bool error)
+void TrackerClient::httpRequestDone(QNetworkReply *reply)
{
+ reply->deleteLater();
if (lastTrackerRequest) {
emit stopped();
return;
}
- if (error) {
- emit connectionError(http.error());
+ if (reply->error() != QNetworkReply::NoError) {
+ emit connectionError(reply->error());
return;
}
- QByteArray response = http.readAll();
- http.abort();
+ QByteArray response = reply->readAll();
+ reply->abort();
BencodeParser parser;
if (!parser.parse(response)) {
qWarning("Error parsing bencode response from tracker: %s",
qPrintable(parser.errorString()));
- http.abort();
return;
}
@@ -234,3 +236,10 @@ void TrackerClient::httpRequestDone(bool error)
emit peerListUpdated(peers);
}
}
+
+void TrackerClient::provideAuthentication(QNetworkReply *reply, QAuthenticator *auth)
+{
+ Q_UNUSED(reply);
+ auth->setUser(uname);
+ auth->setPassword(pwd);
+}
diff --git a/examples/network/torrent/trackerclient.h b/examples/network/torrent/trackerclient.h
index de63a8f87f..723b3aa4b7 100644
--- a/examples/network/torrent/trackerclient.h
+++ b/examples/network/torrent/trackerclient.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -45,7 +45,9 @@
#include <QList>
#include <QObject>
#include <QHostAddress>
-#include <QHttp>
+#include <QNetworkAccessManager>
+#include <QNetworkReply>
+#include <QAuthenticator>
#include "metainfo.h"
#include "torrentclient.h"
@@ -64,7 +66,7 @@ public:
void startSeeding();
signals:
- void connectionError(QHttp::Error error);
+ void connectionError(QNetworkReply::NetworkError error);
void failure(const QString &reason);
void warning(const QString &message);
@@ -80,20 +82,23 @@ protected:
private slots:
void fetchPeerList();
- void httpRequestDone(bool error);
+ void httpRequestDone(QNetworkReply *reply);
+ void provideAuthentication(QNetworkReply *reply, QAuthenticator *auth);
private:
TorrentClient *torrentDownloader;
int requestInterval;
int requestIntervalTimer;
- QHttp http;
+ QNetworkAccessManager http;
MetaInfo metaInfo;
QByteArray trackerId;
QList<TorrentPeer> peers;
qint64 uploadedBytes;
qint64 downloadedBytes;
qint64 length;
+ QString uname;
+ QString pwd;
bool firstTrackerRequest;
bool lastTrackerRequest;