comparison data/fileio/FileSource.h @ 981:c6f2b93a7d52

Respond tidily to user cancellation during download, instead of going on to attempt to load the nonexistent file as a non-audio format
author Chris Cannam
date Tue, 09 Sep 2014 16:52:24 +0100
parents 12aff5a181bc
children 3a48b22fed48
comparison
equal deleted inserted replaced
979:c598b1d880f2 981:c6f2b93a7d52
99 * retrieved (if it is remote). 99 * retrieved (if it is remote).
100 */ 100 */
101 void waitForData(); 101 void waitForData();
102 102
103 /** 103 /**
104 * Return true if the FileSource object is valid and no error 104 * Return true if the FileSource object is valid and neither error
105 * occurred in looking up the file or remote URL. Non-existence 105 * nor cancellation occurred while retrieving the file or remote
106 * of the file or URL is not an error -- call isAvailable() to 106 * URL. Non-existence of the file or URL is not an error -- call
107 * test for that. 107 * isAvailable() to test for that.
108 */ 108 */
109 bool isOK() const; 109 bool isOK() const;
110 110
111 /** 111 /**
112 * Return true if the file or remote URL exists. This may block 112 * Return true if the file or remote URL exists. This may block
118 /** 118 /**
119 * Return true if the entire file has been retrieved and is 119 * Return true if the entire file has been retrieved and is
120 * available. 120 * available.
121 */ 121 */
122 bool isDone() const; 122 bool isDone() const;
123
124 /**
125 * Return true if the operation was cancelled by the user through
126 * the ProgressReporter interface. Note that the cancelled()
127 * signal will have been emitted, and isOK() will also return
128 * false in this case.
129 */
130 bool wasCancelled() const;
123 131
124 /** 132 /**
125 * Return true if this FileSource is referring to a QRC resource. 133 * Return true if this FileSource is referring to a QRC resource.
126 */ 134 */
127 bool isResource() const; 135 bool isResource() const;
225 QString m_localFilename; 233 QString m_localFilename;
226 QString m_errorString; 234 QString m_errorString;
227 QString m_contentType; 235 QString m_contentType;
228 QString m_preferredContentType; 236 QString m_preferredContentType;
229 bool m_ok; 237 bool m_ok;
238 bool m_cancelled;
230 int m_lastStatus; 239 int m_lastStatus;
231 bool m_resource; 240 bool m_resource;
232 bool m_remote; 241 bool m_remote;
233 bool m_done; 242 bool m_done;
234 bool m_leaveLocalFile; 243 bool m_leaveLocalFile;