Mercurial > hg > svcore
comparison data/fileio/FileSource.cpp @ 527:3c5570e3d9c5
* Fix crash in SimpleSPARQLQuery
* Fix failure to add images from local files
author | Chris Cannam |
---|---|
date | Thu, 15 Jan 2009 18:20:40 +0000 |
parents | 3f68eab92857 |
children | 57857a57a03a |
comparison
equal
deleted
inserted
replaced
526:8878efd21dbc | 527:3c5570e3d9c5 |
---|---|
28 #include <QHttpResponseHeader> | 28 #include <QHttpResponseHeader> |
29 | 29 |
30 #include <iostream> | 30 #include <iostream> |
31 #include <cstdlib> | 31 #include <cstdlib> |
32 | 32 |
33 //#define DEBUG_FILE_SOURCE 1 | 33 #define DEBUG_FILE_SOURCE 1 |
34 | 34 |
35 int | 35 int |
36 FileSource::m_count = 0; | 36 FileSource::m_count = 0; |
37 | 37 |
38 QMutex | 38 QMutex |
193 } | 193 } |
194 | 194 |
195 m_done = true; | 195 m_done = true; |
196 | 196 |
197 #ifdef DEBUG_FILE_SOURCE | 197 #ifdef DEBUG_FILE_SOURCE |
198 std::cerr << "FileSource::FileSource(" << m_url.toString().toStdString() << ") [copy ctor]: note: local filename is \"" << m_localFilename.toStdString() << "\"" << std::endl; | |
199 #endif | |
200 | |
201 #ifdef DEBUG_FILE_SOURCE | |
198 std::cerr << "FileSource::FileSource(copy ctor) exiting" << std::endl; | 202 std::cerr << "FileSource::FileSource(copy ctor) exiting" << std::endl; |
199 #endif | 203 #endif |
200 } | 204 } |
201 | 205 |
202 FileSource::~FileSource() | 206 FileSource::~FileSource() |
232 #endif | 236 #endif |
233 m_ok = true; | 237 m_ok = true; |
234 m_lastStatus = 200; | 238 m_lastStatus = 200; |
235 | 239 |
236 if (!QFileInfo(m_localFilename).exists()) { | 240 if (!QFileInfo(m_localFilename).exists()) { |
241 #ifdef DEBUG_FILE_SOURCE | |
242 std::cerr << "FileSource::init: Local file of this name does not exist, trying URL as a literal filename" << std::endl; | |
243 #endif | |
237 if (literal) { | 244 if (literal) { |
238 m_lastStatus = 404; | 245 m_lastStatus = 404; |
239 } else { | 246 } else { |
240 // Again, QUrl may have been mistreating us -- | 247 // Again, QUrl may have been mistreating us -- |
241 // e.g. dropping a part that looks like query data | 248 // e.g. dropping a part that looks like query data |