QHttp 类里面 void QHttp::requestFinished ( int id, bool error ) [signal]
This signal is emitted when processing the request identified by id has finished. error is true if an error occurred during the processing; otherwise error is false.
如果处理出错,那么error回返回。我查看了error的值NoError, HostNotFound, ConnectionRefused, UnexpectedClose, ..., UnknownError。
QHTTP类里面没有判断下载的文件超过磁盘的大小的这种情况吗?
我在程序里面这样做的,先取得totalbytes,然后在requestFinished 之后,判断下载的文件的大小,如果小于totalbytes,那么出错。
PS:我实验的QT example中的http例子,没有判断这样情况。如果大于磁盘容量,还是照样下载。但是文件大小只是能容纳的容量。
谢谢!
[ 此贴被XChinux在2006-09-22 00:06重新编辑 ]