Doc: Modularize QtNetwork documentation.

This change moves the snippets and imagesto the modularized directories.

Change-Id: If14912692a7f72d7de345eaf88d9ec9752310fca
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
This commit is contained in:
Casper van Donderen 2012-05-07 11:10:29 +02:00 committed by Marius Storm-Olsen
parent 9fde9ab167
commit 7eca53b51a
41 changed files with 52 additions and 52 deletions

View File

@ -1361,7 +1361,7 @@ int QFtpPrivate::addCommand(QFtpCommand *cmd)
e.g. if you want to connect and login to a FTP server. This is
simply achieved:
\snippet doc/src/snippets/code/src_network_access_qftp.cpp 0
\snippet code/src_network_access_qftp.cpp 0
In this case two FTP commands have been scheduled. When the last
scheduled command has finished, a done() signal is emitted with
@ -1379,12 +1379,12 @@ int QFtpPrivate::addCommand(QFtpCommand *cmd)
Example: If you want to download the INSTALL file from the Qt
FTP server, you would write this:
\snippet doc/src/snippets/code/src_network_access_qftp.cpp 1
\snippet code/src_network_access_qftp.cpp 1
For this example the following sequence of signals is emitted
(with small variations, depending on network traffic, etc.):
\snippet doc/src/snippets/code/src_network_access_qftp.cpp 2
\snippet code/src_network_access_qftp.cpp 2
The dataTransferProgress() signal in the above example is useful
if you want to show a \link QProgressBar progress bar \endlink to
@ -1397,7 +1397,7 @@ int QFtpPrivate::addCommand(QFtpCommand *cmd)
If the login fails for the above example, the signals would look
like this:
\snippet doc/src/snippets/code/src_network_access_qftp.cpp 3
\snippet code/src_network_access_qftp.cpp 3
You can then get details about the error with the error() and
errorString() functions.

View File

@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
and a data block, which are separated by each other by two
consecutive new lines. An example for one part would be:
\snippet doc/src/snippets/code/src_network_access_qhttppart.cpp 0
\snippet code/src_network_access_qhttppart.cpp 0
For setting headers, use setHeader() and setRawHeader(), which behave
exactly like QNetworkRequest::setHeader() and QNetworkRequest::setRawHeader().
@ -77,12 +77,12 @@ QT_BEGIN_NAMESPACE
To construct a QHttpPart with a small body, consider the following snippet
(this produces the data shown in the example above):
\snippet doc/src/snippets/code/src_network_access_qhttppart.cpp 1
\snippet code/src_network_access_qhttppart.cpp 1
To construct a QHttpPart reading from a device (e.g. a file), the following
can be applied:
\snippet doc/src/snippets/code/src_network_access_qhttppart.cpp 2
\snippet code/src_network_access_qhttppart.cpp 2
Be aware that QHttpPart does not take ownership of the device when set, so
it is the developer's responsibility to destroy it when it is not needed anymore.
@ -226,7 +226,7 @@ void QHttpPart::setBodyDevice(QIODevice *device)
As an example, consider the following code snippet, which constructs a multipart
message containing a text part followed by an image part:
\snippet doc/src/snippets/code/src_network_access_qhttpmultipart.cpp 0
\snippet code/src_network_access_qhttpmultipart.cpp 0
\sa QHttpPart, QNetworkAccessManager::post()
*/

View File

@ -178,7 +178,7 @@ static void ensureInitialized()
returned in response to the corresponding request.
A simple download off the network could be accomplished with:
\snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 0
\snippet code/src_network_access_qnetworkaccessmanager.cpp 0
QNetworkAccessManager has an asynchronous API.
When the \tt replyFinished slot above is called, the parameter it
@ -197,7 +197,7 @@ static void ensureInitialized()
A more involved example, assuming the manager is already existent,
can be:
\snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 1
\snippet code/src_network_access_qnetworkaccessmanager.cpp 1
\section1 Network and Roaming support
@ -283,11 +283,11 @@ static void ensureInitialized()
By default the value of this property reflects the physical state of the device. Applications
may override it to disable all network requests via this network access manager by calling
\snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 4
\snippet code/src_network_access_qnetworkaccessmanager.cpp 4
Network requests can be reenabled again by calling
\snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 5
\snippet code/src_network_access_qnetworkaccessmanager.cpp 5
\note Calling setNetworkAccessible() does not change the network state.
*/
@ -805,12 +805,12 @@ QNetworkReply *QNetworkAccessManager::deleteResource(const QNetworkRequest &requ
To restore the default network configuration set the network configuration to the value
returned from QNetworkConfigurationManager::defaultConfiguration().
\snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 2
\snippet code/src_network_access_qnetworkaccessmanager.cpp 2
If an invalid network configuration is set, a network session will not be created. In this
case network requests will be processed regardless, but may fail. For example:
\snippet doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp 3
\snippet code/src_network_access_qnetworkaccessmanager.cpp 3
\sa configuration(), QNetworkSession
*/

View File

@ -88,17 +88,17 @@ QT_BEGIN_NAMESPACE
A network disk cache can be enabled by:
\snippet doc/src/snippets/code/src_network_access_qnetworkdiskcache.cpp 0
\snippet code/src_network_access_qnetworkdiskcache.cpp 0
When sending requests, to control the preference of when to use the cache
and when to use the network, consider the following:
\snippet doc/src/snippets/code/src_network_access_qnetworkdiskcache.cpp 1
\snippet code/src_network_access_qnetworkdiskcache.cpp 1
To check whether the response came from the cache or from the network, the
following can be applied:
\snippet doc/src/snippets/code/src_network_access_qnetworkdiskcache.cpp 2
\snippet code/src_network_access_qnetworkdiskcache.cpp 2
*/
/*!

View File

@ -616,7 +616,7 @@ void QNetworkReply::setSslConfiguration(const QSslConfiguration &config)
If, for instance, you want to issue a request to a server that uses
a self-signed certificate, consider the following snippet:
\snippet doc/src/snippets/code/src_network_access_qnetworkreply.cpp 0
\snippet code/src_network_access_qnetworkreply.cpp 0
Multiple calls to this function will replace the list of errors that
were passed in previous calls.

View File

@ -487,7 +487,7 @@ QList<QByteArray> QNetworkRequest::rawHeaderList() const
the corresponding "cooked" header will be set as well.
For example:
\snippet doc/src/snippets/code/src_network_access_qnetworkrequest.cpp 0
\snippet code/src_network_access_qnetworkrequest.cpp 0
will also set the known header LastModifiedHeader to be the
QDateTime object of the parsed date.

View File

@ -321,7 +321,7 @@ QNetworkConfiguration QNetworkConfigurationManager::configurationFromIdentifier(
This is equivalent to the following code snippet:
\snippet doc/src/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp 0
\snippet code/src_network_bearer_qnetworkconfigmanager.cpp 0
\sa onlineStateChanged()
*/

View File

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@ -171,11 +171,11 @@ static void qt_qdnsservicerecord_sort(QList<QDnsServiceRecord> &records)
For example, you can determine which servers an XMPP chat client should
connect to for a given domain with:
\snippet doc/src/snippets/code/src_network_kernel_qdnslookup.cpp 0
\snippet code/src_network_kernel_qdnslookup.cpp 0
Once the request finishes you can handle the results with:
\snippet doc/src/snippets/code/src_network_kernel_qdnslookup.cpp 1
\snippet code/src_network_kernel_qdnslookup.cpp 1
\note If you simply want to find the IP address(es) associated with a host
name, or the host name associated with an IP address you should use

View File

@ -644,7 +644,7 @@ QAbstractSocket::NetworkLayerProtocol QHostAddress::protocol() const
Returns the IPv6 address as a Q_IPV6ADDR structure. The structure
consists of 16 unsigned characters.
\snippet doc/src/snippets/code/src_network_kernel_qhostaddress.cpp 0
\snippet code/src_network_kernel_qhostaddress.cpp 0
This value is valid if the protocol() is
\l{QAbstractSocket::}{IPv6Protocol}.

View File

@ -83,7 +83,7 @@ Q_GLOBAL_STATIC(QHostInfoLookupManager, theHostInfoLookupManager)
Example:
\snippet doc/src/snippets/code/src_network_kernel_qhostinfo.cpp 0
\snippet code/src_network_kernel_qhostinfo.cpp 0
The slot is invoked when the results are ready. The results are
@ -97,7 +97,7 @@ Q_GLOBAL_STATIC(QHostInfoLookupManager, theHostInfoLookupManager)
If you want a blocking lookup, use the QHostInfo::fromName() function:
\snippet doc/src/snippets/code/src_network_kernel_qhostinfo.cpp 1
\snippet code/src_network_kernel_qhostinfo.cpp 1
QHostInfo supports Internationalized Domain Names (IDNs) through the
IDNA and Punycode standards.
@ -126,12 +126,12 @@ static QBasicAtomicInt theIdCounter = Q_BASIC_ATOMIC_INITIALIZER(1);
The lookup is performed by a single function call, for example:
\snippet doc/src/snippets/code/src_network_kernel_qhostinfo.cpp 2
\snippet code/src_network_kernel_qhostinfo.cpp 2
The implementation of the slot prints basic information about the
addresses returned by the lookup, or reports an error if it failed:
\snippet doc/src/snippets/code/src_network_kernel_qhostinfo.cpp 3
\snippet code/src_network_kernel_qhostinfo.cpp 3
If you pass a literal IP address to \a name instead of a host name,
QHostInfo will search for the domain name for the IP (i.e., QHostInfo will
@ -139,7 +139,7 @@ static QBasicAtomicInt theIdCounter = Q_BASIC_ATOMIC_INITIALIZER(1);
contain both the resolved domain name and IP addresses for the host
name. Example:
\snippet doc/src/snippets/code/src_network_kernel_qhostinfo.cpp 4
\snippet code/src_network_kernel_qhostinfo.cpp 4
\note There is no guarantee on the order the signals will be emitted
if you start multiple requests with lookupHost().
@ -311,7 +311,7 @@ QHostInfo::~QHostInfo()
Example:
\snippet doc/src/snippets/code/src_network_kernel_qhostinfo.cpp 5
\snippet code/src_network_kernel_qhostinfo.cpp 5
\sa hostName(), error()
*/

View File

@ -59,14 +59,14 @@
network-enabled applications that you have written should
automatically support network proxy using the following code.
\snippet doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp 0
\snippet code/src_network_kernel_qnetworkproxy.cpp 0
An alternative to setting an application wide proxy is to specify
the proxy for individual sockets using QAbstractSocket::setProxy()
and QTcpServer::setProxy(). In this way, it is possible to disable
the use of a proxy for specific sockets using the following code:
\snippet doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp 1
\snippet code/src_network_kernel_qnetworkproxy.cpp 1
Network proxy is not used if the address used in \l
{QAbstractSocket::connectToHost()}{connectToHost()}, \l
@ -800,7 +800,7 @@ QList<QByteArray> QNetworkProxy::rawHeaderList() const
the corresponding "cooked" header will be set as well.
For example:
\snippet doc/src/snippets/code/src_network_access_qnetworkrequest.cpp 0
\snippet code/src_network_access_qnetworkrequest.cpp 0
will also set the known header LastModifiedHeader to be the
QDateTime object of the parsed date.

View File

@ -142,7 +142,7 @@
We show an example:
\snippet doc/src/snippets/network/tcpwait.cpp 0
\snippet network/tcpwait.cpp 0
If \l{QIODevice::}{waitForReadyRead()} returns false, the
connection has been closed or an error has occurred.
@ -1937,7 +1937,7 @@ static int qt_timeout_value(int msecs, int elapsed)
The following example waits up to one second for a connection
to be established:
\snippet doc/src/snippets/code/src_network_socket_qabstractsocket.cpp 0
\snippet code/src_network_socket_qabstractsocket.cpp 0
If msecs is -1, this function will not time out.
@ -2182,7 +2182,7 @@ bool QAbstractSocket::waitForBytesWritten(int msecs)
The following example waits up to one second for a connection
to be closed:
\snippet doc/src/snippets/code/src_network_socket_qabstractsocket.cpp 1
\snippet code/src_network_socket_qabstractsocket.cpp 1
If msecs is -1, this function will not time out.
@ -2285,7 +2285,7 @@ bool QAbstractSocket::isSequential() const
This function is most commonly used when reading data from the
socket in a loop. For example:
\snippet doc/src/snippets/code/src_network_socket_qabstractsocket.cpp 2
\snippet code/src_network_socket_qabstractsocket.cpp 2
\sa bytesAvailable(), readyRead()
*/
@ -2873,7 +2873,7 @@ void QAbstractSocket::setSocketError(SocketError socketError)
To disable the use of a proxy for this socket, use the
QNetworkProxy::NoProxy proxy type:
\snippet doc/src/snippets/code/src_network_socket_qabstractsocket.cpp 3
\snippet code/src_network_socket_qabstractsocket.cpp 3
The default value for the proxy is QNetworkProxy::DefaultProxy,
which means the socket will use the application settings: if a

View File

@ -255,7 +255,7 @@ QT_BEGIN_NAMESPACE
The following example waits up to one second for a connection
to be established:
\snippet doc/src/snippets/code/src_network_socket_qlocalsocket_unix.cpp 0
\snippet code/src_network_socket_qlocalsocket_unix.cpp 0
If \a msecs is -1, this function will not time out.
@ -274,7 +274,7 @@ QT_BEGIN_NAMESPACE
The following example waits up to one second for a connection
to be closed:
\snippet doc/src/snippets/code/src_network_socket_qlocalsocket_unix.cpp 1
\snippet code/src_network_socket_qlocalsocket_unix.cpp 1
If \a msecs is -1, this function will not time out.

View File

@ -494,7 +494,7 @@ qintptr QNativeSocketEngine::socketDescriptor() const
waitForWrite().
Example:
\snippet doc/src/snippets/code/src_network_socket_qnativesocketengine.cpp 0
\snippet code/src_network_socket_qnativesocketengine.cpp 0
Otherwise, error() should be called to determine the cause of the
error.
@ -590,7 +590,7 @@ bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port)
the blocking function waitForRead().
Example:
\snippet doc/src/snippets/code/src_network_socket_qnativesocketengine.cpp 1
\snippet code/src_network_socket_qnativesocketengine.cpp 1
\sa bind(), accept()
*/

View File

@ -654,7 +654,7 @@ QString QTcpServer::errorString() const
To disable the use of a proxy for this socket, use the
QNetworkProxy::NoProxy proxy type:
\snippet doc/src/snippets/code/src_network_socket_qtcpserver.cpp 0
\snippet code/src_network_socket_qtcpserver.cpp 0
\sa proxy(), QNetworkProxy
*/

View File

@ -75,7 +75,7 @@
Example:
\snippet doc/src/snippets/code/src_network_socket_qudpsocket.cpp 0
\snippet code/src_network_socket_qudpsocket.cpp 0
QUdpSocket also supports UDP multicast. Use joinMulticastGroup() and
leaveMulticastGroup() to control group membership, and

View File

@ -834,7 +834,7 @@ QByteArray QSslCertificate::toText() const
Example:
\snippet doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp 0
\snippet code/src_network_ssl_qsslcertificate.cpp 0
\sa fromData()
*/

View File

@ -102,7 +102,7 @@ const QSsl::SslOptions QSslConfigurationPrivate::defaultSslOptions = QSsl::SslOp
achieve that. The following example illustrates how to change the
protocol to TLSv1_0 in a QSslSocket object:
\snippet doc/src/snippets/code/src_network_ssl_qsslconfiguration.cpp 0
\snippet code/src_network_ssl_qsslconfiguration.cpp 0
\sa QSsl::SslProtocol, QSslCertificate, QSslCipher, QSslKey
QSslSocket, QNetworkAccessManager,

View File

@ -71,7 +71,7 @@
This method starts an immediate SSL handshake once the connection
has been established.
\snippet doc/src/snippets/code/src_network_ssl_qsslsocket.cpp 0
\snippet code/src_network_ssl_qsslsocket.cpp 0
As with a plain QTcpSocket, QSslSocket enters the HostLookupState,
ConnectingState, and finally the ConnectedState, if the connection
@ -94,7 +94,7 @@
the existing one passed in. It then initiates the SSL handshake
by calling startServerEncryption().
\snippet doc/src/snippets/code/src_network_ssl_qsslsocket.cpp 1
\snippet code/src_network_ssl_qsslsocket.cpp 1
If an error occurs, QSslSocket emits the sslErrors() signal. In this
case, if no action is taken to ignore the error(s), the connection
@ -122,7 +122,7 @@
waitForEncrypted(), which will block the calling thread until an
encrypted connection has been established.
\snippet doc/src/snippets/code/src_network_ssl_qsslsocket.cpp 2
\snippet code/src_network_ssl_qsslsocket.cpp 2
QSslSocket provides an extensive, easy-to-use API for handling
cryptographic ciphers, private keys, and local, peer, and
@ -397,7 +397,7 @@ void QSslSocket::resume()
If the SSL handshake is successful, QSslSocket emits encrypted().
\snippet doc/src/snippets/code/src_network_ssl_qsslsocket.cpp 3
\snippet code/src_network_ssl_qsslsocket.cpp 3
\b{Note:} The example above shows that text can be written to
the socket immediately after requesting the encrypted connection,
@ -1149,7 +1149,7 @@ void QSslSocket::setCiphers(const QList<QSslCipher> &ciphers)
is a colon-separated list of cipher suite names. The ciphers are listed in
order of preference, starting with the most preferred cipher. For example:
\snippet doc/src/snippets/code/src_network_ssl_qsslsocket.cpp 4
\snippet code/src_network_ssl_qsslsocket.cpp 4
Each cipher name in \a ciphers must be the name of a cipher in the
list returned by supportedCiphers(). Restricting the cipher suite
@ -1438,7 +1438,7 @@ bool QSslSocket::waitForConnected(int msecs)
The following example waits up to one second for the socket to be
encrypted:
\snippet doc/src/snippets/code/src_network_ssl_qsslsocket.cpp 5
\snippet code/src_network_ssl_qsslsocket.cpp 5
If msecs is -1, this function will not time out.
@ -1736,7 +1736,7 @@ void QSslSocket::ignoreSslErrors()
If, for instance, you want to connect to a server that uses
a self-signed certificate, consider the following snippet:
\snippet doc/src/snippets/code/src_network_ssl_qsslsocket.cpp 6
\snippet code/src_network_ssl_qsslsocket.cpp 6
Multiple calls to this function will replace the list of errors that
were passed in previous calls.