diff data/fileio/CachedFile.cpp @ 520:e340b2fb9471

* Make FileSource able to indicate its preferred content type (e.g. application/rdf+xml in preference to text/html for rdf content) * Temp directory on Windows -- make $HOME expand to homedrive+homepath instead of user profile location (which may be networked)
author Chris Cannam
date Thu, 11 Dec 2008 15:18:10 +0000
parents a82645e788fc
children b4a8d8221eaf
line wrap: on
line diff
--- a/data/fileio/CachedFile.cpp	Thu Dec 11 12:37:16 2008 +0000
+++ b/data/fileio/CachedFile.cpp	Thu Dec 11 15:18:10 2008 +0000
@@ -68,8 +68,11 @@
     return fi.filePath();
 }
 
-CachedFile::CachedFile(QString origin, ProgressReporter *reporter) :
+CachedFile::CachedFile(QString origin,
+                       ProgressReporter *reporter,
+                       QString preferredContentType) :
     m_origin(origin),
+    m_preferredContentType(preferredContentType),
     m_reporter(reporter),
     m_ok(false)
 {
@@ -80,8 +83,11 @@
     check();
 }
 
-CachedFile::CachedFile(QUrl url, ProgressReporter *reporter) :
+CachedFile::CachedFile(QUrl url,
+                       ProgressReporter *reporter,
+    QString preferredContentType) :
     m_origin(url.toString()),
+    m_preferredContentType(preferredContentType),
     m_reporter(reporter),
     m_ok(false)
 {
@@ -182,7 +188,7 @@
     //!!! using Qt classes, but a plain delete then copy is probably
     //!!! good enough)
 
-    FileSource fs(m_origin, m_reporter);
+    FileSource fs(m_origin, m_reporter, m_preferredContentType);
 
     if (!fs.isOK() || !fs.isAvailable()) {
         std::cerr << "CachedFile::retrieve: ERROR: FileSource reported unavailable or failure" << std::endl;