Mercurial > hg > svcore
diff data/fileio/RemoteFile.h @ 210:a06afefe45ee
* Cancel when downloading file
* Handle status codes (404 etc)
* Add RemoteFile::isAvailable
* Start on FileFinder for looking up files referred to in distant sessions
author | Chris Cannam |
---|---|
date | Wed, 10 Jan 2007 17:26:39 +0000 |
parents | 8a3d68910b37 |
children | e2bbb58e6df6 |
line wrap: on
line diff
--- a/data/fileio/RemoteFile.h Wed Jan 10 12:27:55 2007 +0000 +++ b/data/fileio/RemoteFile.h Wed Jan 10 17:26:39 2007 +0000 @@ -19,11 +19,13 @@ #include <QUrl> #include <QMutex> #include <QString> +#include <QTimer> class QFtp; class QHttp; class QFile; class QProgressDialog; +class QHttpResponseHeader; class RemoteFile : public QObject { @@ -33,10 +35,13 @@ RemoteFile(QUrl url); virtual ~RemoteFile(); + bool isAvailable(); + void wait(); bool isOK() const; bool isDone() const; + QString getLocalFilename() const; QString getErrorString() const; @@ -48,8 +53,11 @@ protected slots: void dataReadProgress(int done, int total); + void responseHeaderReceived(const QHttpResponseHeader &resp); void dataTransferProgress(qint64 done, qint64 total); void done(bool error); + void showProgressDialog(); + void cancelled(); protected: QFtp *m_ftp; @@ -58,8 +66,10 @@ QString m_localFilename; QString m_errorString; bool m_ok; + int m_lastStatus; bool m_done; QProgressDialog *m_progressDialog; + QTimer m_progressShowTimer; QString createLocalFile(QUrl url);