Mercurial > hg > svcore
comparison rdf/PluginRDFDescription.cpp @ 471:0dc158c1a6c9
* tidy up uses of CachedFile
| author | Chris Cannam |
|---|---|
| date | Tue, 28 Oct 2008 11:38:43 +0000 |
| parents | 70b333085952 |
| children | 3ffce691c9bf |
comparison
equal
deleted
inserted
replaced
| 470:dddd4ab77068 | 471:0dc158c1a6c9 |
|---|---|
| 28 #include <iostream> | 28 #include <iostream> |
| 29 using std::cerr; | 29 using std::cerr; |
| 30 using std::endl; | 30 using std::endl; |
| 31 | 31 |
| 32 PluginRDFDescription::PluginRDFDescription(QString pluginId) : | 32 PluginRDFDescription::PluginRDFDescription(QString pluginId) : |
| 33 //!!! m_source(0), | |
| 34 m_pluginId(pluginId), | 33 m_pluginId(pluginId), |
| 35 m_haveDescription(false) | 34 m_haveDescription(false) |
| 36 { | 35 { |
| 37 PluginRDFIndexer *indexer = PluginRDFIndexer::getInstance(); | 36 PluginRDFIndexer *indexer = PluginRDFIndexer::getInstance(); |
| 38 QString url = indexer->getDescriptionURLForPluginId(pluginId); | 37 QString url = indexer->getDescriptionURLForPluginId(pluginId); |
| 49 } | 48 } |
| 50 } | 49 } |
| 51 | 50 |
| 52 PluginRDFDescription::~PluginRDFDescription() | 51 PluginRDFDescription::~PluginRDFDescription() |
| 53 { | 52 { |
| 54 //!!! delete m_source; | |
| 55 } | 53 } |
| 56 | 54 |
| 57 bool | 55 bool |
| 58 PluginRDFDescription::haveDescription() const | 56 PluginRDFDescription::haveDescription() const |
| 59 { | 57 { |
| 165 QString local = url; | 163 QString local = url; |
| 166 | 164 |
| 167 if (FileSource::isRemote(url) && | 165 if (FileSource::isRemote(url) && |
| 168 FileSource::canHandleScheme(url)) { | 166 FileSource::canHandleScheme(url)) { |
| 169 | 167 |
| 170 //!!! persistent with expiry | |
| 171 | |
| 172 CachedFile cf(url); | 168 CachedFile cf(url); |
| 173 if (!cf.isOK()) { | 169 if (!cf.isOK()) { |
| 174 return false; | 170 return false; |
| 175 } | 171 } |
| 176 | 172 |
| 177 local = QUrl::fromLocalFile(cf.getLocalFilename()).toString(); | 173 local = QUrl::fromLocalFile(cf.getLocalFilename()).toString(); |
| 178 /*!!! | |
| 179 m_source = new FileSource(url, 0, FileSource::PersistentCache); | |
| 180 | |
| 181 if (!m_source->isAvailable()) { | |
| 182 delete m_source; | |
| 183 m_source = 0; | |
| 184 return false; | |
| 185 } | |
| 186 m_source->waitForData(); | |
| 187 local = QUrl::fromLocalFile(m_source->getLocalFilename()).toString(); | |
| 188 */ | |
| 189 } | 174 } |
| 190 | 175 |
| 191 if (!indexMetadata(local, label)) success = false; | 176 if (!indexMetadata(local, label)) success = false; |
| 192 if (!indexOutputs(local, label)) success = false; | 177 if (!indexOutputs(local, label)) success = false; |
| 193 | 178 |
