Mercurial > hg > svcore
changeset 581:2e0c987a12bd
* Pull out the widgetry part of FileFinder into widgets/InteractiveFileFinder
(essentially this is just to avoid a dependency from data/fileio to widgets/
which is problematic for non-gui programs)
author | Chris Cannam |
---|---|
date | Fri, 27 Mar 2009 16:25:52 +0000 |
parents | ebb6ac65bccc |
children | 442e2ff876aa |
files | data/data.pro rdf/RDFImporter.cpp |
diffstat | 2 files changed, 14 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/data/data.pro Fri Mar 27 13:10:01 2009 +0000 +++ b/data/data.pro Fri Mar 27 16:25:52 2009 +0000 @@ -38,6 +38,7 @@ fileio/CSVFormat.h \ fileio/DataFileReader.h \ fileio/DataFileReaderFactory.h \ + fileio/FileFinder.h \ fileio/FileReadThread.h \ fileio/FileSource.h \ fileio/MatchFileReader.h \ @@ -97,6 +98,7 @@ fileio/CSVFileWriter.cpp \ fileio/CSVFormat.cpp \ fileio/DataFileReaderFactory.cpp \ + fileio/FileFinder.cpp \ fileio/FileReadThread.cpp \ fileio/FileSource.cpp \ fileio/MatchFileReader.cpp \
--- a/rdf/RDFImporter.cpp Fri Mar 27 13:10:01 2009 +0000 +++ b/rdf/RDFImporter.cpp Fri Mar 27 16:25:52 2009 +0000 @@ -36,10 +36,7 @@ #include "data/fileio/FileSource.h" #include "data/fileio/CachedFile.h" - -#ifndef NO_SV_GUI -#include "widgets/FileFinder.h" -#endif +#include "data/fileio/FileFinder.h" using std::cerr; using std::endl; @@ -212,16 +209,18 @@ #else if (!fs->isAvailable()) { FileFinder *ff = FileFinder::getInstance(); - QString path = ff->find(FileFinder::AudioFile, - fs->getLocation(), - m_uristring); - if (path != "") { - delete fs; - fs = new FileSource(path, reporter); - if (!fs->isAvailable()) { + if (ff) { + QString path = ff->find(FileFinder::AudioFile, + fs->getLocation(), + m_uristring); + if (path != "") { delete fs; - m_errorString = QString("Signal source \"%1\" is not available").arg(source); - continue; + fs = new FileSource(path, reporter); + if (!fs->isAvailable()) { + delete fs; + m_errorString = QString("Signal source \"%1\" is not available").arg(source); + continue; + } } } }