diff rdf/PluginRDFDescription.cpp @ 468:70b333085952

* complete switching the code to use CachedFile -- now to tidy & fix the remaining flaws...
author Chris Cannam
date Mon, 27 Oct 2008 20:29:55 +0000
parents 93806ad9481e
children 0dc158c1a6c9
line wrap: on
line diff
--- a/rdf/PluginRDFDescription.cpp	Mon Oct 27 18:15:20 2008 +0000
+++ b/rdf/PluginRDFDescription.cpp	Mon Oct 27 20:29:55 2008 +0000
@@ -19,6 +19,7 @@
 #include "SimpleSPARQLQuery.h"
 
 #include "data/fileio/FileSource.h"
+#include "data/fileio/CachedFile.h"
 
 #include "base/Profiler.h"
 
@@ -29,7 +30,7 @@
 using std::endl;
 
 PluginRDFDescription::PluginRDFDescription(QString pluginId) :
-    m_source(0),
+//!!!    m_source(0),
     m_pluginId(pluginId),
     m_haveDescription(false)
 {
@@ -50,7 +51,7 @@
 
 PluginRDFDescription::~PluginRDFDescription()
 {
-    delete m_source;
+//!!!    delete m_source;
 }
 
 bool
@@ -168,6 +169,13 @@
         
         //!!! persistent with expiry
 
+        CachedFile cf(url);
+        if (!cf.isOK()) {
+            return false;
+        }
+
+        local = QUrl::fromLocalFile(cf.getLocalFilename()).toString();
+/*!!!
         m_source = new FileSource(url, 0, FileSource::PersistentCache);
 
         if (!m_source->isAvailable()) {
@@ -177,6 +185,7 @@
         }
         m_source->waitForData();
         local = QUrl::fromLocalFile(m_source->getLocalFilename()).toString();
+*/
     }
     
     if (!indexMetadata(local, label)) success = false;