Changeset 561 for trunk/doc/src/examples/ftp.qdoc
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/doc/src/examples/ftp.qdoc
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the documentation of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 41 41 42 42 /*! 43 \example network/ ftp43 \example network/qftp 44 44 \title FTP Example 45 45 … … 79 79 of current commands, and information about files on the server. 80 80 81 \snippet examples/network/ ftp/ftpwindow.h 081 \snippet examples/network/qftp/ftpwindow.h 0 82 82 83 83 We will look at each slot when we examine the \c FtpWindow … … 85 85 private variables: 86 86 87 \snippet examples/network/ ftp/ftpwindow.h 187 \snippet examples/network/qftp/ftpwindow.h 1 88 88 89 89 The \c isDirectory hash keeps a history of all entries explored on … … 91 91 directory or a file. We use the QFile object to download files 92 92 from the FTP server. 93 93 94 94 \section1 FtpWindow Class Implementation 95 95 96 96 We skip the \c FtpWindow constructor as it only contains code for 97 97 setting up the GUI, which is explained in other examples. 98 98 99 99 We move on to the slots, starting with \c connectOrDisconnect(). 100 100 101 \snippet examples/network/ ftp/ftpwindow.cpp 0101 \snippet examples/network/qftp/ftpwindow.cpp 0 102 102 103 103 If \c ftp is already pointing to a QFtp object, we QFtp::Close its … … 107 107 108 108 \dots 109 \snippet examples/network/ ftp/ftpwindow.cpp 1109 \snippet examples/network/qftp/ftpwindow.cpp 1 110 110 111 111 If we get here, \c connectOrDisconnect() was called to establish a … … 119 119 progress reports. 120 120 121 \snippet examples/network/ ftp/ftpwindow.cpp 2121 \snippet examples/network/qftp/ftpwindow.cpp 2 122 122 123 123 The \gui {Ftp Server} line edit contains the IP address or … … 135 135 We move on to the \c downloadFile() slot: 136 136 137 \snippet examples/network/ ftp/ftpwindow.cpp 3137 \snippet examples/network/qftp/ftpwindow.cpp 3 138 138 \dots 139 \snippet examples/network/ ftp/ftpwindow.cpp 4140 139 \snippet examples/network/qftp/ftpwindow.cpp 4 140 141 141 We first fetch the name of the file, which we find in the selected 142 142 item of \c fileList. We then start the download by using … … 144 144 and a signal when the download is completed. 145 145 146 \snippet examples/network/ ftp/ftpwindow.cpp 5146 \snippet examples/network/qftp/ftpwindow.cpp 5 147 147 148 148 QFtp supports canceling the download of files. 149 149 150 \snippet examples/network/ ftp/ftpwindow.cpp 6150 \snippet examples/network/qftp/ftpwindow.cpp 6 151 151 152 152 The \c ftpCommandFinished() slot is called when QFtp has … … 154 154 command, QFtp will set \c error to one of the values in 155 155 the QFtp::Error enum; otherwise, \c error is zero. 156 157 \snippet examples/network/ ftp/ftpwindow.cpp 7156 157 \snippet examples/network/qftp/ftpwindow.cpp 7 158 158 159 159 After login, the QFtp::list() function will list the top-level … … 162 162 directory. 163 163 164 \snippet examples/network/ ftp/ftpwindow.cpp 8164 \snippet examples/network/qftp/ftpwindow.cpp 8 165 165 166 166 When a \l{QFtp::}{Get} command is finished, a file has finished 167 167 downloading (or an error occurred during the download). 168 169 \snippet examples/network/ ftp/ftpwindow.cpp 9168 169 \snippet examples/network/qftp/ftpwindow.cpp 9 170 170 171 171 After a \l{QFtp::}{List} command is performed, we have to check if … … 173 173 would not have been called). 174 174 175 Let's continue with the the\c addToList() slot:176 177 \snippet examples/network/ ftp/ftpwindow.cpp 10175 Let's continue with the \c addToList() slot: 176 177 \snippet examples/network/qftp/ftpwindow.cpp 10 178 178 179 179 When a new file has been resolved during a QFtp::List command, … … 183 183 current item. 184 184 185 \snippet examples/network/ ftp/ftpwindow.cpp 11185 \snippet examples/network/qftp/ftpwindow.cpp 11 186 186 187 187 The \c processItem() slot is called when an item is double clicked … … 189 189 want to load the contents of that directory with QFtp::list(). 190 190 191 \snippet examples/network/ ftp/ftpwindow.cpp 12192 193 \c cdToParent() is invoked when the theuser requests to go to the191 \snippet examples/network/qftp/ftpwindow.cpp 12 192 193 \c cdToParent() is invoked when the user requests to go to the 194 194 parent directory of the one displayed in the file list. After 195 195 changing the directory, we QFtp::List its contents. 196 196 197 \snippet examples/network/ ftp/ftpwindow.cpp 13197 \snippet examples/network/qftp/ftpwindow.cpp 13 198 198 199 199 The \c updateDataTransferProgress() slot is called regularly by … … 202 202 user. 203 203 204 \snippet examples/network/ ftp/ftpwindow.cpp 14204 \snippet examples/network/qftp/ftpwindow.cpp 14 205 205 206 206 The \c enableDownloadButton() is called whenever the current item
Note:
See TracChangeset
for help on using the changeset viewer.